From acac3e610c69a2dbbb159c5733cba3c0bd1dc59b Mon Sep 17 00:00:00 2001 From: Miha Kralj Date: Fri, 28 Nov 2025 13:35:16 -0800 Subject: [PATCH] updates from mac --- .config/dotnet-tools.json | 24 +- .deepsource.toml | 32 +- .github/TradingPlatform.BusinessLayer.xml | 13170 +- .github/chatmodes/Beast mode.chatmode.md | 102 +- .github/codeql/codeql-config.yml | 42 +- .github/copilot-instructions.md.backup | 444 +- .github/workflows/Publish.yml | 684 +- .sonarlint/._QuanTAlib.json | Bin 0 -> 4096 bytes .sonarlint/QuanTAlib.json | 3 +- .vscode/extensions.json | 14 +- .vscode/settings.json | 381 +- .vscode/tasks.json | 4 +- Directory.Build.props | 120 +- GitVersion.yml | 52 +- README.md | 187 + ilspy/TradingPlatform.BusinessLayer.cs | 228178 ++++++++--------- lib/._QuanTAlib.Tests.csproj | Bin 0 -> 4096 bytes lib/Directory.Build.props | 26 +- lib/QuanTAlib.Tests.csproj | 88 +- lib/averages/ema/Ema.Quantower.cs | 116 +- lib/averages/ema/Ema.Tests.cs | 456 +- lib/averages/ema/Ema.Validation.Tests.cs | 396 +- lib/averages/ema/Ema.cs | 326 +- lib/averages/ema/Ema.md | 272 +- lib/averages/ema/EmaVector.Tests.cs | 276 +- lib/averages/ema/EmaVector.cs | 554 +- lib/core/simd/SimdExtensions.Tests.cs | 498 +- lib/core/simd/SimdExtensions.cs | 560 +- lib/core/simd/SimdExtensions.md | 86 +- lib/core/tbar/TBar.Notebook.dib | 148 +- lib/core/tbar/TBar.Tests.cs | 152 +- lib/core/tbar/TBar.md | 136 +- lib/core/tbar/tbar.cs | 166 +- lib/core/tbarseries/TBarSeries.Notebook.dib | 164 +- lib/core/tbarseries/TBarSeries.Tests.cs | 116 +- lib/core/tbarseries/TBarSeries.md | 140 +- lib/core/tbarseries/tbarseries.cs | 294 +- lib/core/tseries/TSeries.Tests.cs | 98 +- lib/core/tseries/TSeries.md | 112 +- lib/core/tseries/tseries.cs | 292 +- lib/core/tvalue/TValue.Tests.cs | 102 +- lib/core/tvalue/TValue.md | 74 +- lib/core/tvalue/tvalue.cs | 114 +- lib/feeds/IFeed.cs | 70 +- lib/feeds/IFeed.md | 90 +- lib/feeds/csv/CsvFeed.Tests.cs | 508 +- lib/feeds/csv/CsvFeed.cs | 392 +- lib/feeds/csv/CsvFeed.md | 136 +- lib/feeds/csv/daily_IBM.csv | 202 +- lib/feeds/gbm/GBM.md | 134 +- lib/feeds/gbm/Gbm.Tests.cs | 566 +- lib/feeds/gbm/gbm.cs | 422 +- lib/quantalib.csproj | 102 +- quantower/Averages.csproj | 64 +- quantower/IndicatorExtensions.cs | 474 +- 55 files changed, 126278 insertions(+), 126081 deletions(-) create mode 100644 .sonarlint/._QuanTAlib.json create mode 100644 README.md create mode 100644 lib/._QuanTAlib.Tests.csproj diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 37f0d820..c5b13197 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -1,12 +1,12 @@ -{ - "version": 1, - "isRoot": true, - "tools": { - "gitversion.tool": { - "version": "5.12.0", - "commands": [ - "dotnet-gitversion" - ] - } - } -} +{ + "version": 1, + "isRoot": true, + "tools": { + "gitversion.tool": { + "version": "5.12.0", + "commands": [ + "dotnet-gitversion" + ] + } + } +} diff --git a/.deepsource.toml b/.deepsource.toml index 6b3a5714..4f96f656 100644 --- a/.deepsource.toml +++ b/.deepsource.toml @@ -1,17 +1,17 @@ -version = 1 - -[[analyzers]] -name = "csharp" -enabled = true - -[[analyzers]] -name = "test-coverage" -enabled = true - -[[analyzers]] -name = "secrets" -enabled = true - -[[transformers]] -name = "dotnet-format" +version = 1 + +[[analyzers]] +name = "csharp" +enabled = true + +[[analyzers]] +name = "test-coverage" +enabled = true + +[[analyzers]] +name = "secrets" +enabled = true + +[[transformers]] +name = "dotnet-format" enabled = true \ No newline at end of file diff --git a/.github/TradingPlatform.BusinessLayer.xml b/.github/TradingPlatform.BusinessLayer.xml index 60fa288b..12fd45c7 100644 --- a/.github/TradingPlatform.BusinessLayer.xml +++ b/.github/TradingPlatform.BusinessLayer.xml @@ -1,6585 +1,6585 @@ - - - - TradingPlatform.BusinessLayer - - - - - Access to the chart panel - - - - - Chart panel unique ID - - - - - Collection of chart windows - - - - - Current X scale value - width of the bar in pixels - - - - - Provides time zone of current chart. - - - - - Provides account of current chart. - - - - - Provides custom sessions of current chart. - - - - - Current tick size of the chart - - - - - Main window of the chart - - - - - Current right offset value - - - - - Collection of chart drawingsCollection - - - - - Force chart refreshing - - - - - The MouseDown event occurs when the mouse button is pressed down - - - - - The MouseUp event occurs when the mouse button is released - - - - - The MouseClick event occurs when the mouse button is clicked - - - - - The MouseMove event occurs when the mouse moving over the chart - - - - - The MouseDown event occurs when the user scrolling mouse wheel - - - - - The MouseDown event occurs when the mouse enter the chart - - - - - The MouseDown event occurs when the mouse leave the chart - - - - - The SettingsChanged event occurs when any settings were changed - - - - - The AccountChanged event occurs when the account was changed - - - - - Access to the chart drawingsCollection collection - - - - - Add chart drawing to the collection - - - - - - Remove specified chart drawing from collection - - - - - - Get chart drawing by ID - - - - - - - Get all chart drawingsCollection assigned to specified symbol - - - - - - The Added events occured, when new chart drawing was added to collection - - - - - The Moved events occured, when chart drawing was moved - - - - - The Removed events occured, when chart drawing was removed from the collection - - - - - The SelectionChanged events occured, when selected chart drawing was changed - - - - - Access to the particular window from chart panel - - - - - Client rectangle of the chart window - - - - - Determines, whether this window is the main window of the chart - - - - - Chart window number - - - - - Special object, allows you to convert values from x/y scale to Time/Price and back - - - - - - - - - - Converter between x/y and Time/Price scales - - - - - Get the DateTime value that is corresponding to specified x coordinate - - - - - - - Get the Price value that is corresponding to specified y coordinate - - - - - - - Get the X coordinate that is corresponding to specified DateTime value - - - - - - - Get the Y coordinate that is corresponding to specified price value - - - - - - - Get the bar index that is corresponding to specified DateTime value - - - - - - - Access to the chart drawing - - - - - Determines, the way how chart drawing was created: manually or programmatically - - - - - Determines, the availability of drawing - only current chart or all charts with same symbol - - - - - The unique ID of the chart drawing - - - - - Determines, whether chart drawing draws above or below the main chart - - - - - Determines, state of the chart drawing: Locked or Unlocked - - - - - Get time and price of the particular point of the chart drawing - - - - - Set time and price value for particular point of the chart drawing - - - - - Gets s list - - - - - Gets symbol types list - - - - - Gets s list - - - - - Gets s list - - - - - Gets Exchanges list - - - - - Gets Orders list - - - - - Gets Order Types list - - - - - Gets Positions list - - - - - Gets Closed Positions list - - - - - Gets Corporate Actions list - - - - - Gets Report Types list - - - - - Gets s list - - - - - Vendor connection respond bundle - - - - - The connection status - - - - - The respond message - - - - - Ping state dictum - - - - - Ping signals connected - - - - - Ping signals disconnected - - - - - The asset formatting description. - - - - - Initializes a new instance of the class. - - The asset id. - The value. - If true, add currency name. - - - - Mediates a history meta data with available data types and intervals on vendor side - - - - - Asset id bearer - - - - - Asset name bearer - - - - - Asset description - - - - - Asset id bearer - - - - - Performs a binding with broker or data provider - - - - - Specifies any operation before breaking a connection with broker or data provider - - - - - Called when platform finished retreiving all required informations from vendor during connecting - - - - - Ping processing before its visualization in the terminal - - - - - Retrieves an information about available accounts. Yon need to specify at least one account - - - - - Confirms allowed nonfixed list by vendor - - - - - Retrieves a collection of available exchange markets from vendor - - - - - Retrieves information about available assets. - - - - - Retrieves information about available symbols. - - - - - Gets an available symbols types from vendor - - - - - Derives a non fixed symbol from vendor - - - - - Derives a non-fixed list of symbols from vendor - - - - - Retrieves allowed/supported order types - - - - - Retrieves an information about opened orders at the time of connection. - - - - - Retrieves an information about positions at the time of connection - - - - - Gets trades history from server for requested time range - - - - - Subscribing to quote data: Level1/Level2/Trade - - - - - Unsubscribing from quote data: Level1/Level2/Trade - - - - - Gets a list of supported historical intervals and data types by vendor - - - - - Prepare and sending order placing request to broker - - - - - Sending order modification request to broker - - - - - Sending order cancellation request to broker - - - - - Sending position closing request to broker - - - - - Gets information about available reports from vendor - - - - - Called when platform need to generate particular report - - - - - Ping respond bundle - - - - - Ping time - - - - - Time spent for single request - - - - - Ping state - - - - - Performs a binding with broker or data provider - - - - - Specifies any operation before breaking a connection with broker or data provider - - - - - Called when platform finished retreiving all required informations from vendor during connecting - - - - - Ping processing before its visualization in the terminal - - - - - Retrieves an information about available accounts. Yon need to specify at least one account - - - - - Retrieves a collection of available exchange markets from vendor - - - - - Retrieves information about available assets. - - - - - Retrieves information about available symbols. - - - - - Gets an available symbols types from vendor - - - - - Derives a non fixed symbol from vendor - - - - - Derives a non-fixed list of symbols from vendor - - - - - Retrieves an information about opened orders at the time of connection. - - - - - Retrieves an information about positions at the time of connection - - - - - Retrieves an information about closed positions at the time of connection - - - - - Subscribing to quote data: Level1/Level2/Trade - - - - - Unsubscribing from quote data: Level1/Level2/Trade - - - - - Gets a list of supported historical intervals and data types by vendor - - - - - Prepare and sending order placing request to broker - - - - - Sending order modification request to broker - - - - - Sending order cancellation request to broker - - - - - Sending position closing request to broker - - - - - Gets information about available reports from vendor - - - - - Called when platform need to generate particular report - - - - - Retrieves allowed/supported order types - - - - - Confirms allowed non fixed list by vendor - - - - - Gets a settings list from a vendor selection of the setup window - - - - - The ID of the order group. This group created when trades done by the MAM account. - - - - - Total quantity of the order - - - - - Gets OrderType - - - - - Gets order price value - - - - - Gets order trigger price value - - - - - Gets order trailing offset value - - - - - Gets orders current status - - - - - Gets orders last update time - - - - - Gets Position Id. - - - - - Gets StopLoss holder for given order - - - - - Gets TakeProfit holder for given order - - - - - Orders Type Id. It is used for the orders type comparing. - - - - - Gets order TIF(Time-In-Force) type - - - - - Gets orders expiration time - - - - - Remaining quantity of the order - - - - - Filled quantity of the order - - - - - Gets open order original status - - - - - Will be triggered on each invocation - - - - - - - - - - - - - - - Get VWAP value - - - - - - - - - - - - - - - - - - - - - - - - - Снапшот для эмулятора - - - - - Текущая версия для сериализации. Если что-то меняем и нужно делать поддержку старого формата - можно использовать версию. - - - - - Version 1.1: изменилась схема работы с коннектами: стали доступны кастомные коннекты - - - - - Defines 'Volume Analysis' calculation result item - - - - - Contains all user's account information - - - - - Gets account unique code. - - - - - Obtaining account name. - - - - - Gets base currency of account. Account CCY is always equal to the server CCY in AlgoStudio - - - - - Gets current balance of the account. - - - - - Gets additional account information - - - - - Will be triggered on each account information updating - - - - - Gets Account name - - - - - - Creates a business object info with an Account data which can be used for the restoring/serialization process. - - - - - - The account operation. - - - - - Gets the name. - - - - - Gets the button text. - - - - - Gets the settings. - - - - - - - The settings. - - - - Builds the confirmation. - - The settings. - A string. - - - - - - The settings. - - - - Compare to. - - The obj. - An int. - - - - The additional info collection. - - - - - Gets the count. - - - - - Gets the items. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The items. - - - - Try get item. - - The api key. - The item. - A bool. - - - - Gets the enumerator. - - ]]> - - - - Tos the string. - - A string. - - - - The comparing type. - - - - - The additional info item formating type. - - - - - The additional info item. - - - - - ключ для апи, обязательно для заполнения и должен быть уникальным - - - - - Gets or Sets the group info. - - - - - Gets or Sets the sort index. - - - - - Gets or Sets the name key. - - - - - Gets or Sets the tool tip key. - - - - - Gets or Sets the data type. - - - - - Gets or Sets the value. - - - - - Gets or Sets a value indicating whether hidden. - - - - - Gets or Sets the formating type. - - - - - используется в связке с AccountAdditionalInfoItemFormatingType.CustomAsset для форматирования в заданном ассете - - - - - Gets or Sets a value indicating whether visible. - - - - - Gets or Sets a value indicating whether is link. - - - - - Gets or Sets the editing info. - - - - - Gets or Sets the formatting description. - - - - - Initializes a new instance of the class. - - - - - - - The item. - - - - - - An object. - - - - To the XML element. - - A XElement. - - - - From the XML element. - - The element. - The deserialization info. - - - - To the string. - - A string. - - - - Defines asset entity - - - - - Asset id bearer - - - - - Asset name bearer - - - - - Asset description - - - - - Defines a number precision of the change value - - - - - Gets precision value - - - - - Gets asset ISO 4217 code - - - - - Creates an Asset instance - - given connection Id - - - - Formats price into precision normalized string - - - - - - - Formats price into concatenated string which contains the precision normalized value and Asset's name - - - - - - - Gets Asset name - - - - - - Uses comparison by Assets names - - - - - - - Unique ID during active session. Don't use for serialization - - - - - Договориль использовать множественное число для типа инструмента - - - - - Завели для индийской интеграции - - - - - Represents information about corporate action. - - - - - Get the date and time when trade was executed - - - - - Will be triggered on corporate action updating - - - - - Base class for all Custom symbols: Synthetics, Custom Formulas, etc. - - - - - alexb: нам достаточно подставлять правильный HistoricalData - он сделает всю работу - - - - - Расчёт Bid/Ask/BidSize/AskSize для синтетика - - - - - Расчёт Last/LastSize для синтетика - - - - - Расчёт Level2 для синтетика - - - - - Расчёт DayBar для синтетика - - - - - Расчёт бара для синтетика - - - - - Increment current position - - - - - Will be triggered on each invocation - - - - - Applies an position modificaion or position changing by accepting a message. - - - - - - Contains all information which belong to the given exchange - - - - - Gets Exchange Id - - - - - Gets Exchange name - - - - - Used for the Exchanges comparing - - - - - Compares Exchnges in order by next - SortIndex, Exchange name, Connection Id, Exchange Id. - - - - - - - Provides possibility to group and sort symbols for each connection - - - - - Gets group Id - - - - - Gets group name - - - - - Gets sort index for comparing process - - - - - Represents trading information about pending order - - - - - The ID of the order group. This group created when trades done by the MAM account. - - - - - Gets Position Id. - - - - - Total quantity of the order - - - - - Filled quantity of the order - - - - - Remaining quantity of the order - - - - - Orders Type Id. It is used for the orders type comparing. - - - - - Gets OrderType - - - - - Gets order price value - - - - - Gets order trigger price value - - - - - Gets order trailing offset value - - - - - Gets orders current status - - - - - Gets open order original status - - - - - Gets order TIF(Time-In-Force) type - - - - - Gets orders expiration time - - - - - Gets orders last update time - - - - - Gets StopLoss holder for given order - - - - - Gets TakeProfit holder for given order - - - - - Will be triggered on each invocation - - - - - Creates Order instance - - - - - - Applies an order modificaion or order changing by accepting a message. - - - - - - Cancels pending order - - - - - - Represents an wrapper - - - - - Represents trading information about related position - - - - - Will be triggered on each and invocation - - - - - Gets position quantity value - - - - - Gets position open order price - - - - - Gets position openning time - - - - - Gets Profit/loss (without swaps or commissions) all calculated based on the current broker's price. For open position it shows the profit/loss you would make if you close the position at the current price. If position closed, this parameter show profit/loss what trader have after closing this position. - - - - - Gets Profit/loss calculated based on the current broker's price. For open position it shows the profit/loss you would make if you close the position at the current price. If position closed, this parameter show profit/loss what trader have after closing this position. - - - - - Gets fee amount for the position. - - - - - Gets PnL swaps - - - - - The market price obtainable from your broker. - - - - - Closes position if quantity is not specified else - uses partial closing operation. - - - - - - - Gets StopLoss order which belongs to the position - - - - - Gets TakeProfit order which belongs to the position - - - - - Returns ticks amount between open and current price. - - - - - Represents a report grid which can hold system reports based on s and s content. - - - - - Columns collection - - - - - Rows collection - - - - - Initializes report grid - - - - - Adds coloring column to the report - - - - - Adds default(non-colored) column to the report - - - - - Exposes report cell decoration - - - - - Cell label - - - - - Cell value - - - - - Exposes report column decoration - - - - - Header of the column - - - - - Column value type - - - - - Exposes report row decoration - - - - - A collection of cells - - - - - Initializes cells in the row - - - - - Adds cells to the row by label and value - - - - - Adds cells to the row by value only - - - - - Defines report request parameters from which can be used in - - - - - Gets report Id - - - - - Gets report Name - - - - - report settings - - - - - Represents a permisions checking tool which use next priority order , , and - - - - - Represent access to symbol information and properties. - - - - - Gets symbol Id - - - - - Gets symbol name - - - - - Gets symbol description - - - - - Gets symbol type - - - - - Gets symbol base Asset - - - - - Gets symbol counter Asset - - - - - Gets Exchange of current symbol - - - - - Gets Exchange id of current symbol - - - - - Returns delay with which quote come in platform. - - - - - Gets symbol additional info - - - - - The highest trade allowed - - - - - The lowest trade allowed - - - - - Gets symbol NettingType - - - - - Gets SymbolGroup - - - - - Gets current SymbolQuotingType - - - - - Amount of base asset for one lot. - - - - - Stores list of symbol ticksizes - - - - - Cached value of TickSize (if 1 level) - - - - - Step of the lot changes - - - - - Step of the notional value changes - - - - - Gets derivative expiration date - - - - - Gets derivative last trading date - - - - - Gets derivative maturity date - - - - - Gets derivative strike price - - - - - Gets derivative option style - - - - - Gets derivative option type - - - - - Gets derivative option serie - - - - - Gets derivative underlier name - - - - - Gets derivative underlier symbol - - - - - Gets derivative underlier symbol id - - - - - Gets Ask price - - - - - Gets Ask size - - - - - Gets Bid price - - - - - Gets Bid size - - - - - Gets quote time - - - - - Gets last price - - - - - Gets last size - - - - - Gets last time - - - - - Gets mark price - - - - - Gets mark size - - - - - Gets open price - - - - - Gets previous close price - - - - - Gets high price - - - - - Gets low price - - - - - Gets volume value - - - - - Gets quote asset volume value - - - - - Gets PrevSettlement value - - - - - Gets ticks amount - - - - - Gets trades amount - - - - - Gets Level2 data - - - - - Gets spread value between Bid and Ask - - - - - Gets percentage value - - - - - Gets change value between Bid/Last and Close price - - - - - Gets percentage value - - - - - Default history type - - - - - List of all available history types - - - - - Gets SymbolVolumeType - - - - - List of all available history types - - - - - Will be triggered when new Level1 quote is comming - - - - - Will be triggered when new Level2 quote is comming - - - - - Will be triggered when new trade quote is comming - - - - - Will be triggered when new correctional quote is comming from the vendor. - - - - - Will be triggered when symbol updated. - - - - - Gets real time calculation setting - - - - - Gets real time calculation setting - - - - - Gets real time calculation setting - - - - - Gets real time calculation setting - - - - - Gets historical data according to period and other parameters - - - - - - - - - Gets historical data according to period and other parameters - - - - - - - - - - Gets historical data according to aggregation and other parameters - - - - - - - - - - Gets historical data according to given history request - - - - - - - Gets historical ticks data according to given parameters - - - - - - - - - Returns rounded to price - - - - - Calculates new price which equal to given price shifted by a number of given ticks - - - - - - - - Calculates ticks between two prices - - - - - - - - Gets cached symbol tick size or retrives it from the list - - - - - - - Gets symbol tick cost retrived from the list by price - - - - - - - Returns VariableTick if it can be retrived from list by price or null - - - - - - - Gets cached tick size if it available, else tries to obtain with Last, Bid, Ask, first element of list otherwise - - - - - - Formats price value to the appropriative string with a counting on tick precision. - - - - - - - Formats price value to the appropriative string with a counting on max tick precision. - - - - - - - Returns string with formatted ticks value - - - - - - - - Comparing by value - - - - - Gets symbol orders types list which are allowed. - - - - - - - Process order placing with given request parameters - - - - - - - An symbol has possibility to obtain the default account - - - - - Represents information about trade. - - - - - Gets the unique identifier of the order initiating the trade. - - - - - Gets a unique identifier of the position, which is related to this trade. - - - - - Get the price where trade was executed - - - - - Get the trade quantity - - - - - Get the date and time when trade was executed - - - - - Get the trade Gross P&L - - - - - Get the trade Net P&L - - - - - Get the fee value that was charged for this trade - - - - - Get the trade order type - - - - - Will be triggered on trade updating - - - - - The symbols list manager. - - - - - Gets the count. - - - - - Gets or Sets the settings. - - - - - Represent access to level2 data. - - - - - Gets Level2 Asks list - - - - - Gets Level2 Bids list - - - - - Gets current Level2 data - - Parameters of DepthOfMarket - - - - - Gets current Level2 data - - Parameters of request for Leve2Item collection - - - - - Leve2 data. Contains Bids and Ask collections - - - - - Represent parameters of DepthOfMarket - - - - - Represent parameters of request for Leve2Item collection - - - - - Aggregation method - - - - - Required amount of level2 - - - - - Use custom tick size - - - - - Calculate cumulative size - - - - - Aggregation method - - - - - Represent access to level2 item. - - - - - Cumulative size - - - - - Imbalance Percent - - - - - Price - - - - - Size - - - - - Time - - - - - MMID - - - - - проверка на вхождение - - - - - Represents information about connection and provides an access to the current trading information(Symbols, Orders, Position, Accounts etc.). - - - - - Provides access to all business objects which are belong to this connection - - - - - Gets connection Id - - - - - Gets connection Name - - - - - Gets connection's vendor name - - - - - Contains list of connection settings. Will be reused on each population time. - - - - - Gets connection's state (Connected/Connecting/Fail etc.) - - - - - Defines connection type - - - - - Will be triggered when changed. - - - - - Will be triggered when changed. - - - - - Represents connection ping time - - - - - Messages count that one is waited to process - - - - - Gets a matched available metadata info with the vendor's side - - - - - Establishes a connection to a specified vendor - - - - - - Closes a connection. - - - - - Только для использования в ConnectionCache - - - - - alexb: "Умный" поиск - разрешаем указывать слова в любом порядке - - - - - Generates a report with given requested parameters - - specifies Report's type - - - - - Gets connection's s list - - - - - Gets connection's symbol types list which are allowed in this connection - - - - - Gets connection's s list - - - - - Gets connection's s list - - - - - Gets all Exchanges which are allowed in this connection - - - - - Gets all Orders which are belong to this connection - - - - - Gets all Order Types which are available on this connection - - - - - Gets all Positions which are belong to this connection - - - - - Gets all Closed Positions which are belong to this connection - - - - - Gets all Corporate actions which are belong to this connection - - - - - Gets all Report Types which are available on this connection - - - - - Gets all Account operations which are available on this connection - - - - - Gets all Tradins signals which are available on this connection - - - - - Server connection status - - - - - Specifies connection using type. - - - - - Specifies how connection was created: by default or by user - - - - - Represents all needed parameters for the connection constructing process. - - - - - Gets a user friendly name of the connection - - - - - Gets connection group - - - - - Gets vendor's name - - - - - Gets connection Id - - - - - Favorites one will be displayed in Control center toolbar - - - - - Gets ConnectionState - - - - - Gets vendor's settings - - - - - Specifies how connection was created: by default or by user - - - - - realization - - - - - Creates connection info instance - - - - - - Creates connection info instance. - - - - - - - - - дефолтовый период пигования - - - - - Таймер, по которому проходит пинг - - - - - Запускаем таймер - - - - - Останавливаем таймер - - - - - Коннекты, которые нужно подключить - - - - - Сколько ждем до следующей попытки - - - - - The main entry point in the API. Core keeps access to all business logic entities and their properties: - connections, accounts, symbols, positions, orders, etc. Some of them can be reached through using managers or directly via specified collections. - You can always access the Core object via static Core.Instance property. - - - - - Gets a singleton instance of . API entry point - - - - - Gets an access to all created connections and manages them - - - - - Gets an access to the system logging mechanism - - - - - Obtains licence rules for the current user - - - - - Gets an access to all available trading data vendors and creates them - - - - - Gets an access to the all available aggregation types - - - - - Access to Volume Analysis calculations - - - - - Gets an access to the all available indicators and creates them - - - - - Gets an access to the all available trading strategies and manages them - - - - - Gets a permissions checking mechanism - - - - - Gets a time based conversion and synchronization mechanism - - - - - Gets SMTP mail service for sending emails - - - - - Represents current trading status - - - - - Will be triggered when changed - - - - - Gets all available s from open connections - - - - - Gets all available s from open connections - - - - - Gets all available s from open connections - - - - - Gets all available s from open connections - - - - - Gets all available s from open connections - - - - - Gets all available s from open connections - - - - - Gets all available s from open connections - - - - - Gets all available s from open connections - - - - - Gets all available s from open connections - - - - - Gets all available s from open connections - - - - - Gets all available s from open connections. Otherwise returns empty list - > - - - - Gets all available s from open connections. Otherwise returns empty list - > - - - - Starts a initialization process which initializes given Managers, and Utils. And provides a subscribing on events. - - - - - Disposes all previously initialized modules and unsubscribe from events - - - - - Will be triggered when new added to the core - - - - - Gets an instance of exist Account or creates a new one with given info parameter - - - - - - - Will be triggered when new added to the core - - - - - Returns all s from open connections which satisfy given request parameters, otherwise returns empty list - - - - - - - Retrieves any by given request parameters. Otherwise returns null - - - Must be specified if open connections total is more than one. Will search only in Synthetic symbols list if id is equal to - - - - - - Gets an instance of exist symbol or creates a new one with given info parameter - - - - - - - Will be triggered when new placed - - - - - Will be triggered when canceled - - - - - Gets instance by given Id string. Otherwise returns null - - - Must be specified if open connections total is more than one - - - - - Gets instance by given Id string. Otherwise returns null - - - Must be specified if open connections total is more than one - - - - - Will be triggered when new opened - - - - - Will be triggered when closed - - - - - Gets instance by given Id string. Otherwise returns null - - - Must be specified if open connections total is more than one - - - - - Gets Profit'n'Loss with given request parameters from open connection. Otherwise returns null - - - - - - - Will be triggered when new added - - - - - Will be triggered when removed - - - - - Will be triggered when new occured - - - - - Gets collection of by given parameters - - - - - - - - Gets collection of by given parameters and callback - - - - - - - - - Will be triggered when new occured - - - - - Will be triggered when new added - - - - - Gets collection of by given parameters - - - - - - - - Places with given request parameters - - - - - - - Places multiple s with given request parameters - - - - - - - - Modifies by given request parameters - - - - - - - Closes with given request parameters - - - - - - - Cancels with given request parameters - - - - - - - Returns with given request parameters from open connection - - - - - - - Will be triggered when new received - - - - - Sends custom request if connection with given Id is open - - - - - - - Subscribe on custom messages - - custom message handler - custom messages Id - - - - Unsubscribe from custom messages - - custom message handler - custom messages Id - - - - Gets all previously configured s - - - - - Gets an access to s and manages them - - - - - Adds if given parameters are valid - - - - - - - Replaces exist list by new list in if given parameters are valid - - - - - - - Removes with a given name - - - - - - Replaces list name by new given name in if given parameters are valid - - - - - - - Represent all available Historical Symbols - - - - - Will be triggered when custom symbol added - - - - - Will be triggered when custom symbol removed - - - - - Will be triggered when custom symbol updated - - - - - Represent all available Synthetic items - - - - - Adds given Synthetic to the list if it does not contain - - - - - - Removes given Synthetic from the list if it exists - - - - - - Will be triggered when created/chenged/removed - - - - - Override to change string representation of aggregation - - - - - Represent access to historical data information and indicators control. - - - - - Gets HistoricalData symbol - - - - - Gets HistoricalData aggregation - - - - - Gets HistoricalData left time boundary - - - - - Gets HistoricalData right time boundary - - - - - Gets HistoricalData items amount - - - - - Retrieves HistoricalData item by indexing offset and direction to find. - - - - - - - - Will be triggered when new historical item created - - - - - Will be triggered when current historical item changed or updated - - - - - Gets access to built-in indicators - - - - - Reloads entire HistoricalData - - - - - Gets index by time with counting on search direction - - - - - Gets array of attached indicators - - - - - Creates indicator by it's name and if it successfully created adds it to the HistoricalData - - - - - - - - Adds indicator to the HistoricalData - - - - - - Removes indicator from the HistoricalData - - - - - - Will be triggered when volume analysis of current historical item changed or updated - - - - - Period that can be used as a basis for history aggregations - - - - - Represents historical data bar item - - - - - Gets bar's right time border - - - - - Defines bar's ticks count - - - - - Defines Open price - - - - - Defines High price - - - - - Defines Low price - - - - - Defines Close price - - - - - Gets Median (High+Low)/2 price - - - - - Gets Typical (High+Low+Close)/3 price - - - - - Gets Weighted (High+Low+Close+Close)/4 price - - - - - Defines ticks amount - - - - - Defines volume value - - - - - Gets price by indexing - - - - - - - Creates HistoryItemBar instance with default OHLC price = - - - - - Comparing by , OHLC, - - - - - - - Creates HistoryItemLast instance - - - - - Represents historical data trade item - - - - - Defines price value - - - - - Defines volume value - - - - - Defines trade operation side as aggressor flag - - - - - Gets price by indexing - - - - - - - Creates HistoryItemLast instance - - - - - Comparing by , OHLC, - - - - - - - Creates HistoryItemLast instance - - - - - Gets price by indexing - - - - - - - Creates HistoryItemLast instance - - - - - Represents historical data tick item - - - - - Defines Bid price - - - - - Defines Bid size - - - - - Defines Ask price - - - - - Defines Ask size - - - - - Gets price by indexing - - - - - - - Creates HistoryItemBar instance with default Ask/AskSize/Bid/BidSize = - - - - - Comparing by , OHLC, , , , - - - - - - - Resolves a history request parameters per symbol - - - - - Represents mechanism for supporting predefined and custom periods - - - - - Gets period multiplier - - - - - Gets base period type - - - - - Gets ticks value as an result of base period multiplicated by - - - - - Creates Period instance with greater than 0 - - - - - - - True if their base paeriods and are respectively equal. - - - - - - - - True if any of their base paeriods and are respectively not equal. - - - - - - - - True if their ticks values are satisfying initial condition - - - - - - - - True if their ticks values are satisfying initial condition - - - - - - - - True if their ticks values are satisfying initial condition - - - - - - - - True if their ticks values are satisfying initial condition - - - - - - - - True if their base paeriods and are respectively equal. - - - - - - - Formats given value to a specific user friendly string - - - - - - - Returns value in ticks according to base period type - - - - - - - Returns shorted string according to base period type - - - - - - - Converts time gap into dates range - - - - - - - Compares by - - - - - - - Serialize into object - - - - - - Deserialize from - - - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Predefined period - - - - - Represent access to DayBar quote, which contains summary information about instrument prices. - - - - - High price - - - - - Open price - - - - - Low price - - - - - Previous Close price - - - - - Ticks value - - - - - Volume value - - - - - Volume value - - - - - Previous settlement price - - - - - Bid price - - - - - Bid size - - - - - Ask price - - - - - Ask size - - - - - Last price - - - - - Last size - - - - - Trades value - - - - - Change value - - - - - Change value in percentage - - - - - - - - - - Represent access to DOM2 quote, which contains Bids and Asks. - - - - - Collection of Asks quotes - - - - - Collection of Bids quotes - - - - - Represent access to trade information. - - - - - Price at which trade occured - - - - - Size of the trade - - - - - Information about operation side of the trade - - - - - Shows the direction of price movement, comparing to previous value. - - - - - Represent access to Level2 quote. - - - - - Price type of Level2 quote: Bid or Ask - - - - - Price of Level2 quote - - - - - Size of Level2 quote - - - - - Unique ID of Level2 quote - - - - - Shows, whether Level2 quote is using only for removing from depth - - - - - Broker identifier that send level2 quote - - - - - specifies the implied quantity associated with the price for the quote. Subtracting this amount from the Size yields the outright quantity for the price level. A value of zero indicates that the implied size is not available/defined or that it is actually zero. - - - - - Time of the quote - - - - - Represent access to quote information. - - - - - Bid price - - - - - Bid size - - - - - Ask price - - - - - Ask size - - - - - Shows the direction of bid price movement, comparing to previous value. - - - - - Shows the direction of ask price movement, comparing to previous value. - - - - - Constants for licence keys - - - - - User licences info store - - - - - Current state of connection to licence server - - - - - Current connected user info - - - - - All active licences that user have - - - - - Check that user have licence - - - - - The loopback http listener without kestrel. - - - - - Initializes a new instance of the class. - - The port. - - - - Dispose - - - - - Wait for callback asynchronously. - - The token. - ]]> - - - - Specifies the reason of price data updating. - - - - - Indicates the processing of new historical bar. - - - - - Indicates the coming of new real-time tick. - - - - - Indicates a start of new real-time bar. - - - - - Specifies the type of events when indicator should recalculate itself. - - - - - Specifies the style of indicator line. - - - - - Moving average mode - - - - - Simple Moving Average - - - - - Exponential Moving Average - - - - - Smoothed Moving Average - - - - - Linearly Weighted Moving Average - - - - - - - - - - Displays HV schedule and percentile value. - - - - - Displays the percentile schedule only. - - - - - Returns an instance of the Exponential Moving Average (EMA) indicator. - EMA provides a weighted price calculation for the last N periods. - - Period of Exponential Moving Average - Sources prices for MA - Calculation type - - - - Gets the Linearly Weighted Moving Average - Linear Weighted Moving Average makes the most recent bar more important unlike SMA. - - Moving average period - Type of the price - - - - - Gets the SMA(Simple Moving Average) indicator. - The 'SMA' indicator provides an average price for the last N periods. - - Period of simple moving average. - Sources prices for MA. - - - - - Returns an instance of the Smoothed Moving Average (SMMA) indicator. - SMMA indicator provides a smoothed average price for the last N periods. - - Moving average period - Type of the price - Calculation type - - - - - Gets the PPMA(Pivot Point Moving Average) indicator. - The 'PPMA' indicator uses the pivot point calculation as the input a simple moving average. - - Period of PPMA indicator - - - - - - Gets the MAS3 (3MASignal) indicator. - The 'MAS3' indicator offers buy and sell signals according to intersections of three moving averages. - - Short moving average period. - Middle moving average period. - Long moving average period. - The count of bars. The trend will be determined on this interval. - - - - - - Gets the specific MA indicator, according to selected 'MaMode'. - - Period of moving average. - Type of price. - MA mode. - Calculation type - - - - - - Gets the BB(Bollinger Bands) indicator. - The 'BB' indicator provides a relative definition of high and low based on standard deviation and a simple moving average. - - Period of MA for envelopes. - Value of confidence interval. - Sources prices for MA. - Type of moving average. - Calculation type - - - - - Gets the Commodity Channel Index. - Measures the position of price in relation to its moving average. - - Period for CCI MA - Sources prices for CCI - MA mode for CCI - Calculation type - - - - - Returns an instance of the Modified Moving Average (MMA) indicator. - MMA comprises a sloping factor to help it overtake with the growing or declining value of the trading price of the currency. - - Period of Modified Moving Average - Sources prices for MA - - - - - Gets the Regression indicator - The Linear Regression Indicator plots the ending value of a Linear Regression Line for a specified number of bars; showing, statistically, where the price is expected to be. - - Moving average period - Type of the price - - - - - Gets the Channel (Price Channel) indicator. - The 'Channel' indicator is based on measurement of min and max prices for the definite number of periods. - - Period of price channel - - - - - - Gets the AFIRMA indicator - Autoregressive finite impulse response moving average. A digital filter accurately shows the price movement as powered with least square method to minimise time lag - - Moving average period - Type of the price - Afirma mode - with least squares method overlapping if true - - - - - Gets the RSI indicator. - Relative Strength Index (RSI) is a momentum oscillator that measures the speed and change of price movements. - - RSI Period - Price Type - RSI Mode (Simple or Exponential) - MA Mode for smooth data - MA period for smooth data - Calculation type - - - - - Returns an instance of the McGinley Dynamic indicator. - McGinley Dynamic avoids of most whipsaws and it rapidly moves up or down according to a quickly changing market. It needs no adjusting because it is dynamic and it adjusts itself. - - Period of exponential moving average - Dynamic tracking factor - Source price type - Calculation type - - - - - Gets the MAE (Moving Average Envelope) indicator. - The 'MAE' indicator demonstrates a range of the prices discrepancy from a Moving Average. - - Period of MA for envelopes. - Sources prices for MA. - Type of moving average. - Upband deviation in %. - Downband deviation in %. - Calculation type - - - - - Returns an instance of the Parabolic Time/Price System (SAR) indicator. - SAR indicator helps to define the direction of the prevailing trend and the moment to close positions opened during the reversal. - - Step of parabolic SAR system - Maximum value for the acceleration factor - - - - - - Gets the AO (Awesome Oscillator) indicator. - The 'AO' indicator determines market momentum. - - - - - - Gets the CMO (Chande Momentum Oscillator) indicator. - The CMO calculates the dividing of difference between the sum of all recent gains and the sum of all recent losses by the sum of all price movement over the period. - - Period of MA for envelopes. - Sources prices for MA. - - - - - - Returns an instance of the ZigZag indicator. - ZigZag is a trend following indicator that is used to predict when a given symbol's momentum is reversing. - - Percent Deviation - - - - - - Gets the Aroon indicator. - Reveals the beginning of a new trend and determines how strong it is - - Aroons period - - - - - - Returns an instance of the Standart Deviation (SD) indicator. - The SD shows the difference of the volatility value from the average one. - - Period of indicator - Sources prices for MA - Type of Moving Average - Calculation type - - - - - Gets the MACD (Moving Average Convergence/Divergence) indicator. - The MACD is a trend-following momentum indicator that shows the relationship between two moving averages of prices. - - Period of fast EMA. - Period of slow EMA. - Period of signal EMA. - Calculation type - - - - - Returns an instance of the Kairi Relative Index (KRI) indicator. - KRI calculates deviation of the current price from its simple moving average as a percent of the moving average. - - - - - - - - Returns an instance of the Bollinger Bands Flat (BBF) indicator. - The BBF provides the same data as BB, but drawn in separate field and easier to recognize whether price is in or out of the band. - - Period - Deviation - Sources prices for MA - Type of Moving Average - Calculation type - - - - - Gets the ROC (Rate of Change) indicator. - The ROC shows the speed at which price is changing. - - Period of momentum. - - - - - - Gets the Momentum indicator. - Momentum compares where the current price is in relation to where the price was in the past. - - Period for Momentum - Sources prices for Momentum - - - - - - Gets the %R Larry Williams. - Uses Stochastic to determine overbought and oversold levels. - - Period for Momentum - - - - - - Returns an instance of the Price Oscillator (PO) indicator. - PO calculates the variation between price moving averages. - - Period of MA1 - Period of MA2 - Sources prices for MA - Type of Moving Average - Calculation type - - - - - Gets the OsMA (Moving Average of Oscillator) indicator. - The OsMA reflects the difference between an oscillator (MACD) and its moving average (signal line). - - Period of fast EMA. - Period of slow EMA. - Period of signal EMA. - Calculation type - - - - - Gets On Balance Volume. - On Balance Volume (OBV) measures buying and selling pressure as a cumulative indicator that adds volume on up days and subtracts volume on down days. - - Sources prices for OBV - - - - - - Returns an instance of the Positive Volume Index (PVI) indicator. - The PVI value changes on the periods in which value of volume has increased in comparison with the previous period. - - - - - - - - Returns an instance of the Volume indicator. - Volume allows to confirm the strength of a trend or to suggest about it's weakness. - - - - - - - Gets the MFI(Money Flow Index) indicator. - The MFI(Money Flow Index) is an oscillator that uses both price and volume to measure buying and selling pressure. - - Period of MFI. - - - - - - Returns an instance of the Acceleration/Deceleration Oscillator (AC). - AC measures the acceleration and deceleration of the current momentum. - - - - - - - Gets the Average True Range (ATR) indicator. - The ATR measures of market volatility. - - - Period of Moving Average. - Type of Moving Average - Calculation type - - - - - Returns an instance of the Kaufman Adaptive Moving Average (KAMA) indicator. - KAMA is an exponential style average with a smoothing that varies according to recent data. - - Period - Fast factor - Slow factor - Sources prices for MA - - - - - - Returns an instance of the Qstick indicator. - The Qstick is a moving average that shows the difference between the prices at which an issue opens and closes. - - - - Calculation type - - - - - Get the Swing Index (SI) indicator. - The SI is used to confirm trend line breakouts on price charts. - - The divider. - - - - - - Get the True Strength Index (TSI) indicator. - - The TSI is a variation of the Relative Strength Indicator which uses a doubly-smoothed - EMA of price momentum to eliminate choppy price changes and spot trend changes. - - - First MA period. - Second MA period. - Calculation type - - - - - Returns an instance of the Average Directional Index (ADX) indicator. - The ADX determines the strength of a prevailing trend. - - Period - Type of Moving Average - Calculation type - - - - - Returns an instance of the Keltner Channel indicator. - Keltner Channels are volatility-based envelopes set above and below an exponential moving average. - - Period of MA for Keltner's Channel - Coefficient of channel's width - Sources prices for MA - Type of Moving Average - Calculation type - - - - - Returns an instance of the Percentage Price Oscillator (PPO). - Percentage Price Oscillator is a momentum indicator. Signal line is EMA of PPO. Formula: (FastEMA-SlowEMA)/SlowEMA. - - Fast EMA Period - Slow EMA Period - Signal EMA Period - Calculation type - - - - - Gets the Stochastic Slow. - Shows the location of the current close relative to the high/low range over a set number of periods (Slow). - - Period - Smoothing - Double smoothing - Moving type - Calculation type - - - - - Gets the Stochastic x Relative Strength Index. - StochRSI is an oscillator that measures the level of RSI relative to its range. - - Period - Smoothing - Double smoothing - - - - - - Gets the Ichimoku. - Enables to quickly discern and filter 'at a glance' the low-probability trading setups from those of higher probability. - - Tenkan Period - Kijun Period - Senkou Span B - - - - - - Gets the Directional Movement Index(DMI) indicator. - The DMI іdentifies whether there is a definable trend in the market. - - Period of Moving Average. - Type of Moving Average. - Calculation type - - - - - Gets the Alligator. - Three moving averages with different colors, periods and calculation methods. - - Type of Jaw Moving Average. - SourcePrice of Jaw Moving Average. - Period of Jaw Moving Average. - Shift of Jaw Moving Average. - Period of Moving Average. - Type of Moving Average. - Period of Moving Average. - Type of Moving Average. - Period of Moving Average. - Type of Moving Average. - Period of Moving Average. - Type of Moving Average. - - - - - - Base class for all indicators. - - - - - Short name of indicator - - - - - Access to current Symbol of indicator - - - - - Amount of items in internal buffers - - - - - Represent access to current used historical data. - - - - - Represent access indicator series - - - - - - - - - - Specified, whether indicator should use main or additional window on the chart - - - - - Specified, whether indicator should draw on chart background by default. - - - - - Specified, whether indicator should participate into price auto scale system. - - - - - Precision amount for formatting price (the count of digits after decimal point); By default = -1, which means to use precision from indicator's symbol - - - - - Indicator's settings - - - - - Represent access to the chart, that created indicator - - - - - Recalculate indicator - - - - - - - - - - - Sets the value of indicator into internal buffer - - Value - Index of indicator line - Offset value - - - - Gets the value of indicator from internal buffer - - Offset value - Index of indicator line - Offset start point - - - - - Set line break point. - - Offset value - Index of indicator line - Offset start point - - - - Remove line break point. - - Offset value - Index of indicator line - Offset start point - - - - Check if the point is a break point. - - Offset value - Index of indicator line - Offset start point - - - - Gets the price from historical data - - - - - - - - Get Bid price - - Offset value - - - - - Get Ask price - - Offset value - - - - - Get Last price - - Offset value - - - - - Get Open price - - Offset value - - - - - Get High price - - Offset value - - - - - Get Low price - - Offset value - - - - - Get Close price - - Offset value - - - - - Get Median price - - Offset value - - - - - Get Typical price - - Offset value - - - - - Get Weighted price - - Offset value - - - - - Get Volume - - Offset value - - - - - Get Volume in quoting asset - - Offset value - - - - - Get Ticks - - Offset value - - - - - Get Open interest - - Offset value - - - - - Get Funding rate - - Offset value - - - - - Get Time - - Offset value - - - - - Formatting price, using precision from assigned symbol or Digits value if specified - - Price value - - - - - Marks cloud begin between two line series with specific color - - First line series index - Second line series index - Cloud color - Offset - - - - Marks cloud end between two line series with specific color - - First line series index - Second line series index - Cloud color - Offset - - - - Using IndicatorLineMarker class you can mark by color or icon any point of your indicator's line. - - - - - Color of the marker - - - - - Icon that will be drawn above the indicator line - - - - - Icon that will be drawn beyond the indicator line - - - - - Constructor for IndicatorLineMarker - - - - - - - - Constructor for IndicatorLineMarker - - - - - Different type of icons for Indicator marker - - - - - Sets the bar number (from the data beginning) from which the drawing of the given indicator line must start; - - - - - Time shift of indicator's line - - - - - Redraws parts of indicator's line within the interval set by offset - - - - - Removes redrawn parts of indicator's line within the interval set by offset - - - - - - - - - - Fully clears markers from line - - - - - Use this attribute to mark input parameters of your script. You will see them in the settings screen on adding - - - - - Displayed name of input parameter - - - - - Sort index for input paramter - - - - - Minimal value for numeric input parameters - - - - - Maximal value for numeric input parameters - - - - - Increment value for numeric input parameters - - - - - Decimal palces for numeric input parameters - - - - - List of predefined values - - - - - Event occurred when write a new log - - - - - Get logs from the strategy for specified date range - - - - - - - - Write log message - - - - - - - The base class for strategies - - - - - Unique ID of the strategy - - - - - The current state of the strategy - - - - - Event occured when strategy write a new log - - - - - Event occured if any of strategy settings was changed - - - - - Run strategy - - - - - Stop strategy - - - - - Remove the strategy - - - - - Get current metrics from the strategy - - - - - - Get logs from the strategy for specified date range - - - - - - - - Write log message - - - - - - - Specifies constants that define which mouse button was pressed. - - - - - No mouse button was pressed. - - - - - The left mouse button was pressed. - - - - - The right mouse button was pressed. - - - - - The middle mouse button was pressed. - - - - - The first XButton was pressed. - - - - - The second XButton was pressed. - - - - - Gets or sets a value indicating whether the event was handled. - true to bypass the control's default handling; otherwise, false to also pass the event along to the default control handler. - - - - - Defines quote parameters for subscribtion - - - - - Symbol Id - - - - - Quote type - - - - - SubscribeQuotesParameters constructor - - - - - Id of the order - - - - - Gets or Sets the groups. - - - - - SettingItem cast type - - - - - SettingItem state - - - - - Specifies the DatePicker time format. - - - - - Date only - - - - - Date and time - - - - - Time only - - - - - Time with seconds - - - - - - - - - - Typecasts setting as TabControl item - - - - - Typecasts setting as GroupBox item - - - - - Typecasts setting as AccountLookup item - - - - - Typecasts setting as Button item - - - - - Typecasts setting as CheckBox item - - - - - Typecasts setting as CheckBox item - - - - - Typecasts setting as Color item - - - - - Typecasts setting as DateTimePicker item - - - - - Typecasts setting as NumericUpDown item - - - - - Typecasts setting as NumericUpDown item - - - - - Typecasts setting as AccountLookup item - - - - - Typecasts setting as Password item - - - - - Typecasts setting as Period item - - - - - Typecasts setting as ComboBox item - - - - - Typecasts setting as TextBox item - - - - - Typecasts setting as SymbolLookup item - - - - - Typecasts setting as TextBox item - - - - - Cancel all pending s - - the name of the initiator of the call (optional) - - - - Cancel all pending s by - - - the name of the initiator of the call (optional) - - - - Cancel all pending s by - - - the name of the initiator of the call (optional) - - - - Cancel all pending s by and - - - - the name of the initiator of the call (optional) - - - - Cancel all pending s by and - - - - the name of the initiator of the call (optional) - - - - Cancel all pending s by , and - - - - - the name of the initiator of the call (optional) - - - - Cancel all pending s by - - - the name of the initiator of the call (optional) - - - - Cancel all pending s by and - - - - the name of the initiator of the call (optional) - - - - Cancel all pending s by , and - - - - - the name of the initiator of the call (optional) - - - - Cancel all pending s by - - - the name of the initiator of the call (optional) - - - - Cancel all pending s by and - - - - the name of the initiator of the call (optional) - - - - Cancel all pending s by , and - - - - - the name of the initiator of the call (optional) - - - - Cancel all pending s by - - - the name of the initiator of the call (optional) - - - - Close all s - - the name of the initiator of the call (optional) - List of - - - - Close all s by - - - the name of the initiator of the call (optional) - List of - - - - Close all s by - - - the name of the initiator of the call (optional) - List of - - - - Close all s by and - - - - the name of the initiator of the call (optional) - List of - - - - Close all s by - - - the name of the initiator of the call (optional) - List of - - - - Close all s by and - - - - the name of the initiator of the call (optional) - List of - - - - Close all positive s - - the name of the initiator of the call (optional) - List of - - - - Close all positive s by - - - the name of the initiator of the call (optional) - List of - - - - Close all negative s - - the name of the initiator of the call (optional) - List of - - - - Close all negative s by - - - the name of the initiator of the call (optional) - List of - - - - Reverse all s - - the name of the initiator of the call (optional) - List of - - - - Reverse all s by - - - the name of the initiator of the call (optional) - List of - - - - Reverse all s by - - - the name of the initiator of the call (optional) - List of - - - - Reverse by and - - - - the name of the initiator of the call (optional) - - - - - Cancel all s and close all s - - the name of the initiator of the call (optional) - - - - Cancel all s and close all s by - - - the name of the initiator of the call (optional) - - - - Cancel all s and close all s by and - - - - the name of the initiator of the call (optional) - - - - Modify SL to breakeven price - - - the name of the initiator of the call (optional) - - - - Modify SL to breakeven price with certain additional offset - - - offset in ticks - the name of the initiator of the call (optional) - - - - Modify SL to breakeven price - - - list of s that will be used for order placing - the name of the initiator of the call (optional) - - - - Adjust SL/TP for given - - - - the name of the initiator of the call (optional) - - - - Adjust stop loss for given - - - list of s - initial stop loss parameters (optional) - - the name of the initiator of the call (optional) - - - - - Adjust take profit for given - - - list of s - initial take profit parameters (optional) - - the name of the initiator of the call (optional) - - - - - The allowed result. - - - - - Gets the status. - - - - - Gets the reason. - - - - - Get the allowed result. - - An AllowedResult. - - - - Gets the not allowed result. - - The reason. - An AllowedResult. - - - - The action wrapper. - - - - - Gets or Sets the items. - - - - - Initializes a new instance of the class. - - - - - Froms the X element. - - The element. - The deserialization info. - - - - Tos the X element. - - A XElement. - - - - The aggressor flag calculator. - - - - - Initializes a new instance of the class. - - - - - Collect bid ask. - - The symbol. - The time ticks. - The bid. - The ask. - - - - Calculate aggressor flag. - - The symbol. - The time ticks. - The last. - An AggressorFlag. - - - - - - - - - Calculate aggressor flag. - - The previous bid. - The previous ask. - The last. - An AggressorFlag. - - - - The alert. - - - - - Gets or Sets the text. - - - - - Gets or Sets the symbol name. - - - - - Gets or Sets the connection name. - - - - - Gets or Sets the action on confirm. - - - - - Gets or Sets the name. - - - - - The alert data. - - - - - The name. - - - - - Gets or Sets the columns. - - - - - Gets or Sets the groups. - - - - - Gets or Sets the actions. - - - - - Gets or Sets a value indicating whether enabled. - - - - - Gets or Sets the table dictionary. - - - - - Gets or Sets a value indicating whether coloring is alert. - - - - - Gets or Sets a value indicating whether filter alert. - - - - - Gets or Sets a value indicating whether search alert. - - - - - Gets or Sets a value indicating whether to remove. - - - - - Gets or Sets the ID. - - - - - Gets or Sets the command sender. - - - - - Gets or Sets a value indicating whether need confirm trading. - - - - - Initializes a new instance of the class. - - - - - To the XML element. - - A XElement. - - - - From the XML element. - - The element. - The deserialization info. - - - - The arbitrage symbol. - - - - - Gets or Sets the index. - - - - - Gets the unique ID. - - - - - Gets the symbol id. - - - - - Gets or Sets a value indicating whether is selected. - - - - - Gets or Sets the symbol. - - - - - Gets or Sets the account. - - - - - Gets or Sets the commission. - - - - - Initializes a new instance of the class. - - - - - Compare to. - - The other. - An int. - - - - Froms the X element. - - The element. - The deserialization info. - - - - Tos the X element. - - A XElement. - - - - The action buffered processor. - - - - - The action buffered processor with priority. - - - - - Initializes a new instance of the class. - - The threads count. - - - - The buffered processor. - - - - - - Gets the state. - - - - - Gets the queue depth. - - - - - - - - - - - - - - - - - The subject. - - - - Wait all messages process. - - The external token. - - - - The buffered processor state. - - - - - - - - - - Агрегація, що буде використовуватись як дефолтна для "TimeFrameScreen". - Повинна відповідати агрегації чарта. - - - - - https://stackoverflow.com/questions/3060381/datetime-addmonths-adding-only-month-not-days - - Проблема: - (29 Feb).AddMonth(1) = 29 March - - - - - Defines advanced trading operation respond bundle - - - - - Respond operation state - - - - - Respond message - - - - - Respond value (optional) - - - - - Details of sub-operations - - - - - Get all available custom resources - - - - - Get custom resource stream by name - - - - - Check whether specified items was hidden by branding specification - - - - - - The assembly loader. - - - - - Load types. - - The folder name. - The target type. - The assembly name filter. - The search option. - If true, load in memory. - If true, allow loading references. - ]]> - - - - Quote type for subscribtion dictum - - - - - Level 1 quote - - - - - Level 2 quote - - - - - Last - - - - - Mark price - - - - - Trading operation state - - - - - Complex trading operation state - - - - - The aggressor flag calculator extensions. - - - - - Collect bid ask. - - The calculator. - The quote. - - - - Calculate aggressor flag. - - The calculator. - The last. - An AggressorFlag. - - - - Gets the price from historical data - - - - - - - - Get Bid price - - Offset value - - - - - Get Ask price - - Offset value - - - - - Get Last price - - Offset value - - - - - Get Open price - - Offset value - - - - - Get High price - - Offset value - - - - - Get Low price - - Offset value - - - - - Get Close price - - Offset value - - - - - Get Median price - - Offset value - - - - - Get Typical price - - Offset value - - - - - Get Weighted price - - Offset value - - - - - Get Volume - - Offset value - - - - - Get Volume in quoting asset - - Offset value - - - - - Get Ticks - - Offset value - - - - - Get Open interest - - Offset value - - - - - Get Funding rate - - Offset value - - - - - Get Time - - Offset value - - - - - Combines intersecting intervals - - - - - Get all settings or particular settings by provided hierarchy path - - - - - Write info log message - - - - - Write trading log message - - - - - Write error log message - - - - - Variable lifetime - - - - - The variable will be removed on exit - - - - - The variable will be written to file - - - - - Global variable entry - - - - - Variable name - - - - - using System; - using System.Text; - using PTLRuntime.NETScript; - - namespace GlobalVariablesManager - { - public class GlobalVariablesManager : NETIndicator - { - List<GlobalVariable> global_List=new List<GlobalVariable>(); - - public override void Init() - { - if(GlobalVariablesManager.Count()>0) - { - global_List=GlobalVariablesManager.GetGlobalVariablesList(); - foreach (var el in global_List) - { - Print(el.Name); - Print(el.Value); - } - } - } - } - } - - - - - - - Variable value - - - - - using System; - using System.Text; - using PTLRuntime.NETScript; - - namespace GlobalVariablesManager - { - public class GlobalVariablesManager : NETIndicator - { - List<GlobalVariable> global_List=new List<GlobalVariable>(); - public override void Init() - { - if(GlobalVariablesManager.Count()>0) - { - global_List=GlobalVariablesManager.GetGlobalVariablesList(); - foreach (var el in global_List) - { - Print(el.Name); - Print(el.Value); - } - } - } - } - } - - - - - - - Initializes new variable - - - - - using System; - using System.Text; - using PTLRuntime.NETScript; - - namespace GlobalVariablesManager - { - public class GlobalVariablesManager : NETIndicator - { - List<GlobalVariable> global_List=new List<GlobalVariable>(); - public override void Init() - { - if(GlobalVariablesManager.Count()>0) - { - global_List=GlobalVariablesManager.GetGlobalVariablesList(); - foreach (var el in global_List) - { - //Simplified way to retrieve global variable value - el.GlobalVariable("new_global_variable_period", period) - - //However, to obtain certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. - } - } - } - } - } - - - - Variable name - Variable value - - - - Sets variable value to a global storage - - - - - using System; - using System.Text; - using PTLRuntime.NETScript; - - namespace GlobalVariablesManager - { - public class GlobalVariablesManager : NETIndicator - { - GlobalVariablesManager(){ - base.ProjectName = "GlobalVariablesManager"; - base.Password=GetHashedPassword(ProjectName); - } - - [InputParameter("Period", 0, 1, 9999)] - public int period = 5; - - public override void OnQuote() - { - //Simplified way to store a global variable - - GlobalVariablesManager.SetValue("global_variable_period", period, VariableLifetime.SaveSession); - - //However, to indicate any variable belongs to certain indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. - - GlobalVariablesManager.SetValue("global_variable_period" +Symbols.Current.Name+period+Password, period, VariableLifetime.SaveSession); - } - } - } - - - - Variable name - New value - Variable lifetime - - - - Removes specified variable from global storage - - - - - using System; - using System.Text; - using PTLRuntime.NETScript; - - namespace GlobalVariablesManager - { - public class GlobalVariablesManager : NETIndicator - { - public override void Init() - { - //Simplified way to remove a global variable - - GlobalVariablesManager.Remove("global_variable_period"); - - //However, to remove certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. - } - } - } - - - - Variable name - - - - Returns variables' count in global storage - - - - - using System; - using System.Text; - using PTLRuntime.NETScript; - - namespace GlobalVariablesManager - { - public class GlobalVariablesManager : NETIndicator - { - public override void Init() - { - if(GlobalVariablesManager.Count()>0) - { - Print("Your session obtains "+GlobalVariablesManager.Count()+" global variables"); - } - } - } - } - - - - - - - - Removes all variables from global storage - - - - - using System; - using System.Text; - using PTLRuntime.NETScript; - - namespace GlobalVariablesManager - { - public class GlobalVariablesManager : NETIndicator - { - public override void Init() - { - GlobalVariablesManager.RemoveAll(); - - if(GlobalVariablesManager.Count()==0) - { - Print("Your session does not have any global variables"); - } - } - } - } - - - - - - - Check if variable with specified name exists in global storage - - - - - using System; - using System.Text; - using PTLRuntime.NETScript; - - namespace GlobalVariablesManager - { - public class GlobalVariablesManager : NETIndicator - { - public override void Init() - { - //Simplified way to check an existance of a global variable - - if(GlobalVariablesManager.Exists("global_variable_period")) - Print("Your session has this global variable"); - else - GlobalVariablesManager.SetValue("global_variable_period"); - - //However, to obtain certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. - } - } - } - - - - Variable name - - - - - Returns variable value by name - - - - - using System; - using System.Text; - using PTLRuntime.NETScript; - - namespace GlobalVariablesManager - { - public class GlobalVariablesManager : NETIndicator - { - public override void Init() - { - //Simplified way to retrieve global variable value - - if(GlobalVariablesManager.Exists("global_variable_period")) - //Always perform a type casting before assigning any variable from global storage - period = (int)GlobalVariablesManager.GetValue("global_variable_period"); - - //However, to obtain certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. - } - } - } - - - - Variable name - Variable value - - - - Performs a variable assigning from a global storage if such name exists in a scope - - - - - using System; - using System.Text; - using PTLRuntime.NETScript; - - namespace GlobalVariablesManager - { - public class GlobalVariablesManager : NETIndicator - { - public override void Init() - { - int new_period; - - //Simplified way to retrieve global variable value - - if(GlobalVariablesManager.TryGetValue("global_variable_period")) - Print("New variable is assigned from globals: " + new_period); - if(new_period==period) - Print("Matching, no need to re-assign globals: "); - else - GlobalVariablesManager.SetValue("global_variable_period", period, VariableLifetime.SaveSession); - - //However, to obtain certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. - } - } - } - - - - Variable name - Variable value - True if variable exists - - - - Saves all serializable variables to disk - - - - - using System; - using System.Text; - using PTLRuntime.NETScript; - - namespace GlobalVariablesManager - { - public class GlobalVariablesManager : NETIndicator - { - Connection myConnection = Connection.CurrentConnection; - public override void OnQuote() - { - if(myConnection.Status==Disconnected) - GlobalVariablesManager.Flush(); - } - } - } - - - - - - - Returns all global variables as list - - - - - using System; - using System.Text; - using PTLRuntime.NETScript; - - namespace GlobalVariablesManager - { - public class GlobalVariablesManager : NETIndicator - { - List <GlobalVariable>global_List=new List<GlobalVariable>(); - public override void Init() - { - if(GlobalVariablesManager.Count()>0) - global_List=GlobalVariablesManager.GetGlobalVariablesList(); - - foreach (var el in global_List) - { - Print(el.Name); - } - } - } - } - - - - Collection of global variables - - - - Object is non-serializable - - - - - Object too big - - - - - The application logger event. - - - - - Current logging level - - - - - Sets logs with custom messag, logging level, connection name - - - - - Sets logs with exception and custom message (optional), logging level, connection name - - - - - Sets logs with objects inherited from ILoggable interface,logging level, connection name - - - - - Sets a log level in case of deep debug - - - - - Remove a log level if one has not needed already - - - - - Все параметры, которые могут использоваться при отправке email - - - - - Отправит сообщение по E-mail - - - - - - - - - - Чисто, як маркер для парсера xgettext.exe - - - - - - - Check, whether current translation equal to hidden - - - - - - - - - - - - - - - - - - - - - - - Allows to save Symbols into named lists - - - - - from: - http://www.codeguru.com/csharp/csharp/cs_date_time/timeroutines/article.php/c4207/C-SNTP-Client.htm - +++ добавлен диспозе, подправлен ToString(), убран лишний метод. - +++ ReceiveTimeoutбSendTimeout - - NTPClient is a C# class designed to connect to time servers on the Internet. - The implementation of the protocol is based on the RFC 2030. - - Public class members: - - LeapIndicator - Warns of an impending leap second to be inserted/deleted in the last - minute of the current day. (See the _LeapIndicator enum) - - VersionNumber - Version number of the protocol (3 or 4). - - Mode - Returns mode. (See the _Mode enum) - - Stratum - Stratum of the clock. (See the _Stratum enum) - - PollInterval - Maximum interval between successive messages. - - Precision - Precision of the clock. - - RootDelay - Round trip time to the primary reference source. - - RootDispersion - Nominal error relative to the primary reference source. - - ReferenceTimestamp - The time at which the clock was last set or corrected. - - OriginateTimestamp - The time at which the request departed the client for the server. - - ReceiveTimestamp - The time at which the request arrived at the server. - - Transmit Timestamp - The time at which the reply departed the server for client. - - RoundTripDelay - The time between the departure of request and arrival of reply. - - LocalClockOffset - The offset of the local clock relative to the primary reference - source. - - Initialize - Sets up data structure and prepares for connection. - - Connect - Connects to the time server and populates the data structure. - - IsResponseValid - Returns true if received data is valid and if comes from - a NTP-compliant time server. - - ToString - Returns a string representation of the object. - - ----------------------------------------------------------------------------- - Structure of the standard NTP header (as described in RFC 2030) - 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - |LI | VN |Mode | Stratum | Poll | Precision | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Root Delay | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Root Dispersion | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Reference Identifier | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | | - | Reference Timestamp (64) | - | | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | | - | Originate Timestamp (64) | - | | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | | - | Receive Timestamp (64) | - | | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | | - | Transmit Timestamp (64) | - | | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Key Identifier (optional) (32) | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | | - | | - | Message Digest (optional) (128) | - | | - | | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - ----------------------------------------------------------------------------- - - NTP Timestamp Format (as described in RFC 2030) - 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Seconds | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Seconds Fraction (0-padded) | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - - - - - Connect to the time server - - - - - Defines a trading operation respond bundle - - - - - Respond operation state - - - - - Respond message - - - - - Respond order id - - - - - Provides VA calculation parameters - - - - - Provides VA calculation request per - - - - - Summary calculated Volume info - - - - - Volume info for each price - - - - - Fire in case of price level was added or existing was updated - - - - - Represent item with Volume Analysis calculation results - - - - - Volume Analysis calculations - - - - - Calculate volume profile for requested time range - - - - - Calculate volume profile for each bar in History Data - - - - - Calculate volume profile for requested time range - - - - - Calculate volume profile for each bar in History Data - - - - - - - - - - - - - - + + + + TradingPlatform.BusinessLayer + + + + + Access to the chart panel + + + + + Chart panel unique ID + + + + + Collection of chart windows + + + + + Current X scale value - width of the bar in pixels + + + + + Provides time zone of current chart. + + + + + Provides account of current chart. + + + + + Provides custom sessions of current chart. + + + + + Current tick size of the chart + + + + + Main window of the chart + + + + + Current right offset value + + + + + Collection of chart drawingsCollection + + + + + Force chart refreshing + + + + + The MouseDown event occurs when the mouse button is pressed down + + + + + The MouseUp event occurs when the mouse button is released + + + + + The MouseClick event occurs when the mouse button is clicked + + + + + The MouseMove event occurs when the mouse moving over the chart + + + + + The MouseDown event occurs when the user scrolling mouse wheel + + + + + The MouseDown event occurs when the mouse enter the chart + + + + + The MouseDown event occurs when the mouse leave the chart + + + + + The SettingsChanged event occurs when any settings were changed + + + + + The AccountChanged event occurs when the account was changed + + + + + Access to the chart drawingsCollection collection + + + + + Add chart drawing to the collection + + + + + + Remove specified chart drawing from collection + + + + + + Get chart drawing by ID + + + + + + + Get all chart drawingsCollection assigned to specified symbol + + + + + + The Added events occured, when new chart drawing was added to collection + + + + + The Moved events occured, when chart drawing was moved + + + + + The Removed events occured, when chart drawing was removed from the collection + + + + + The SelectionChanged events occured, when selected chart drawing was changed + + + + + Access to the particular window from chart panel + + + + + Client rectangle of the chart window + + + + + Determines, whether this window is the main window of the chart + + + + + Chart window number + + + + + Special object, allows you to convert values from x/y scale to Time/Price and back + + + + + + + + + + Converter between x/y and Time/Price scales + + + + + Get the DateTime value that is corresponding to specified x coordinate + + + + + + + Get the Price value that is corresponding to specified y coordinate + + + + + + + Get the X coordinate that is corresponding to specified DateTime value + + + + + + + Get the Y coordinate that is corresponding to specified price value + + + + + + + Get the bar index that is corresponding to specified DateTime value + + + + + + + Access to the chart drawing + + + + + Determines, the way how chart drawing was created: manually or programmatically + + + + + Determines, the availability of drawing - only current chart or all charts with same symbol + + + + + The unique ID of the chart drawing + + + + + Determines, whether chart drawing draws above or below the main chart + + + + + Determines, state of the chart drawing: Locked or Unlocked + + + + + Get time and price of the particular point of the chart drawing + + + + + Set time and price value for particular point of the chart drawing + + + + + Gets s list + + + + + Gets symbol types list + + + + + Gets s list + + + + + Gets s list + + + + + Gets Exchanges list + + + + + Gets Orders list + + + + + Gets Order Types list + + + + + Gets Positions list + + + + + Gets Closed Positions list + + + + + Gets Corporate Actions list + + + + + Gets Report Types list + + + + + Gets s list + + + + + Vendor connection respond bundle + + + + + The connection status + + + + + The respond message + + + + + Ping state dictum + + + + + Ping signals connected + + + + + Ping signals disconnected + + + + + The asset formatting description. + + + + + Initializes a new instance of the class. + + The asset id. + The value. + If true, add currency name. + + + + Mediates a history meta data with available data types and intervals on vendor side + + + + + Asset id bearer + + + + + Asset name bearer + + + + + Asset description + + + + + Asset id bearer + + + + + Performs a binding with broker or data provider + + + + + Specifies any operation before breaking a connection with broker or data provider + + + + + Called when platform finished retreiving all required informations from vendor during connecting + + + + + Ping processing before its visualization in the terminal + + + + + Retrieves an information about available accounts. Yon need to specify at least one account + + + + + Confirms allowed nonfixed list by vendor + + + + + Retrieves a collection of available exchange markets from vendor + + + + + Retrieves information about available assets. + + + + + Retrieves information about available symbols. + + + + + Gets an available symbols types from vendor + + + + + Derives a non fixed symbol from vendor + + + + + Derives a non-fixed list of symbols from vendor + + + + + Retrieves allowed/supported order types + + + + + Retrieves an information about opened orders at the time of connection. + + + + + Retrieves an information about positions at the time of connection + + + + + Gets trades history from server for requested time range + + + + + Subscribing to quote data: Level1/Level2/Trade + + + + + Unsubscribing from quote data: Level1/Level2/Trade + + + + + Gets a list of supported historical intervals and data types by vendor + + + + + Prepare and sending order placing request to broker + + + + + Sending order modification request to broker + + + + + Sending order cancellation request to broker + + + + + Sending position closing request to broker + + + + + Gets information about available reports from vendor + + + + + Called when platform need to generate particular report + + + + + Ping respond bundle + + + + + Ping time + + + + + Time spent for single request + + + + + Ping state + + + + + Performs a binding with broker or data provider + + + + + Specifies any operation before breaking a connection with broker or data provider + + + + + Called when platform finished retreiving all required informations from vendor during connecting + + + + + Ping processing before its visualization in the terminal + + + + + Retrieves an information about available accounts. Yon need to specify at least one account + + + + + Retrieves a collection of available exchange markets from vendor + + + + + Retrieves information about available assets. + + + + + Retrieves information about available symbols. + + + + + Gets an available symbols types from vendor + + + + + Derives a non fixed symbol from vendor + + + + + Derives a non-fixed list of symbols from vendor + + + + + Retrieves an information about opened orders at the time of connection. + + + + + Retrieves an information about positions at the time of connection + + + + + Retrieves an information about closed positions at the time of connection + + + + + Subscribing to quote data: Level1/Level2/Trade + + + + + Unsubscribing from quote data: Level1/Level2/Trade + + + + + Gets a list of supported historical intervals and data types by vendor + + + + + Prepare and sending order placing request to broker + + + + + Sending order modification request to broker + + + + + Sending order cancellation request to broker + + + + + Sending position closing request to broker + + + + + Gets information about available reports from vendor + + + + + Called when platform need to generate particular report + + + + + Retrieves allowed/supported order types + + + + + Confirms allowed non fixed list by vendor + + + + + Gets a settings list from a vendor selection of the setup window + + + + + The ID of the order group. This group created when trades done by the MAM account. + + + + + Total quantity of the order + + + + + Gets OrderType + + + + + Gets order price value + + + + + Gets order trigger price value + + + + + Gets order trailing offset value + + + + + Gets orders current status + + + + + Gets orders last update time + + + + + Gets Position Id. + + + + + Gets StopLoss holder for given order + + + + + Gets TakeProfit holder for given order + + + + + Orders Type Id. It is used for the orders type comparing. + + + + + Gets order TIF(Time-In-Force) type + + + + + Gets orders expiration time + + + + + Remaining quantity of the order + + + + + Filled quantity of the order + + + + + Gets open order original status + + + + + Will be triggered on each invocation + + + + + + + + + + + + + + + Get VWAP value + + + + + + + + + + + + + + + + + + + + + + + + + Снапшот для эмулятора + + + + + Текущая версия для сериализации. Если что-то меняем и нужно делать поддержку старого формата + можно использовать версию. + + + + + Version 1.1: изменилась схема работы с коннектами: стали доступны кастомные коннекты + + + + + Defines 'Volume Analysis' calculation result item + + + + + Contains all user's account information + + + + + Gets account unique code. + + + + + Obtaining account name. + + + + + Gets base currency of account. Account CCY is always equal to the server CCY in AlgoStudio + + + + + Gets current balance of the account. + + + + + Gets additional account information + + + + + Will be triggered on each account information updating + + + + + Gets Account name + + + + + + Creates a business object info with an Account data which can be used for the restoring/serialization process. + + + + + + The account operation. + + + + + Gets the name. + + + + + Gets the button text. + + + + + Gets the settings. + + + + + + + The settings. + + + + Builds the confirmation. + + The settings. + A string. + + + + + + The settings. + + + + Compare to. + + The obj. + An int. + + + + The additional info collection. + + + + + Gets the count. + + + + + Gets the items. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The items. + + + + Try get item. + + The api key. + The item. + A bool. + + + + Gets the enumerator. + + ]]> + + + + Tos the string. + + A string. + + + + The comparing type. + + + + + The additional info item formating type. + + + + + The additional info item. + + + + + ключ для апи, обязательно для заполнения и должен быть уникальным + + + + + Gets or Sets the group info. + + + + + Gets or Sets the sort index. + + + + + Gets or Sets the name key. + + + + + Gets or Sets the tool tip key. + + + + + Gets or Sets the data type. + + + + + Gets or Sets the value. + + + + + Gets or Sets a value indicating whether hidden. + + + + + Gets or Sets the formating type. + + + + + используется в связке с AccountAdditionalInfoItemFormatingType.CustomAsset для форматирования в заданном ассете + + + + + Gets or Sets a value indicating whether visible. + + + + + Gets or Sets a value indicating whether is link. + + + + + Gets or Sets the editing info. + + + + + Gets or Sets the formatting description. + + + + + Initializes a new instance of the class. + + + + + + + The item. + + + + + + An object. + + + + To the XML element. + + A XElement. + + + + From the XML element. + + The element. + The deserialization info. + + + + To the string. + + A string. + + + + Defines asset entity + + + + + Asset id bearer + + + + + Asset name bearer + + + + + Asset description + + + + + Defines a number precision of the change value + + + + + Gets precision value + + + + + Gets asset ISO 4217 code + + + + + Creates an Asset instance + + given connection Id + + + + Formats price into precision normalized string + + + + + + + Formats price into concatenated string which contains the precision normalized value and Asset's name + + + + + + + Gets Asset name + + + + + + Uses comparison by Assets names + + + + + + + Unique ID during active session. Don't use for serialization + + + + + Договориль использовать множественное число для типа инструмента + + + + + Завели для индийской интеграции + + + + + Represents information about corporate action. + + + + + Get the date and time when trade was executed + + + + + Will be triggered on corporate action updating + + + + + Base class for all Custom symbols: Synthetics, Custom Formulas, etc. + + + + + alexb: нам достаточно подставлять правильный HistoricalData - он сделает всю работу + + + + + Расчёт Bid/Ask/BidSize/AskSize для синтетика + + + + + Расчёт Last/LastSize для синтетика + + + + + Расчёт Level2 для синтетика + + + + + Расчёт DayBar для синтетика + + + + + Расчёт бара для синтетика + + + + + Increment current position + + + + + Will be triggered on each invocation + + + + + Applies an position modificaion or position changing by accepting a message. + + + + + + Contains all information which belong to the given exchange + + + + + Gets Exchange Id + + + + + Gets Exchange name + + + + + Used for the Exchanges comparing + + + + + Compares Exchnges in order by next - SortIndex, Exchange name, Connection Id, Exchange Id. + + + + + + + Provides possibility to group and sort symbols for each connection + + + + + Gets group Id + + + + + Gets group name + + + + + Gets sort index for comparing process + + + + + Represents trading information about pending order + + + + + The ID of the order group. This group created when trades done by the MAM account. + + + + + Gets Position Id. + + + + + Total quantity of the order + + + + + Filled quantity of the order + + + + + Remaining quantity of the order + + + + + Orders Type Id. It is used for the orders type comparing. + + + + + Gets OrderType + + + + + Gets order price value + + + + + Gets order trigger price value + + + + + Gets order trailing offset value + + + + + Gets orders current status + + + + + Gets open order original status + + + + + Gets order TIF(Time-In-Force) type + + + + + Gets orders expiration time + + + + + Gets orders last update time + + + + + Gets StopLoss holder for given order + + + + + Gets TakeProfit holder for given order + + + + + Will be triggered on each invocation + + + + + Creates Order instance + + + + + + Applies an order modificaion or order changing by accepting a message. + + + + + + Cancels pending order + + + + + + Represents an wrapper + + + + + Represents trading information about related position + + + + + Will be triggered on each and invocation + + + + + Gets position quantity value + + + + + Gets position open order price + + + + + Gets position openning time + + + + + Gets Profit/loss (without swaps or commissions) all calculated based on the current broker's price. For open position it shows the profit/loss you would make if you close the position at the current price. If position closed, this parameter show profit/loss what trader have after closing this position. + + + + + Gets Profit/loss calculated based on the current broker's price. For open position it shows the profit/loss you would make if you close the position at the current price. If position closed, this parameter show profit/loss what trader have after closing this position. + + + + + Gets fee amount for the position. + + + + + Gets PnL swaps + + + + + The market price obtainable from your broker. + + + + + Closes position if quantity is not specified else - uses partial closing operation. + + + + + + + Gets StopLoss order which belongs to the position + + + + + Gets TakeProfit order which belongs to the position + + + + + Returns ticks amount between open and current price. + + + + + Represents a report grid which can hold system reports based on s and s content. + + + + + Columns collection + + + + + Rows collection + + + + + Initializes report grid + + + + + Adds coloring column to the report + + + + + Adds default(non-colored) column to the report + + + + + Exposes report cell decoration + + + + + Cell label + + + + + Cell value + + + + + Exposes report column decoration + + + + + Header of the column + + + + + Column value type + + + + + Exposes report row decoration + + + + + A collection of cells + + + + + Initializes cells in the row + + + + + Adds cells to the row by label and value + + + + + Adds cells to the row by value only + + + + + Defines report request parameters from which can be used in + + + + + Gets report Id + + + + + Gets report Name + + + + + report settings + + + + + Represents a permisions checking tool which use next priority order , , and + + + + + Represent access to symbol information and properties. + + + + + Gets symbol Id + + + + + Gets symbol name + + + + + Gets symbol description + + + + + Gets symbol type + + + + + Gets symbol base Asset + + + + + Gets symbol counter Asset + + + + + Gets Exchange of current symbol + + + + + Gets Exchange id of current symbol + + + + + Returns delay with which quote come in platform. + + + + + Gets symbol additional info + + + + + The highest trade allowed + + + + + The lowest trade allowed + + + + + Gets symbol NettingType + + + + + Gets SymbolGroup + + + + + Gets current SymbolQuotingType + + + + + Amount of base asset for one lot. + + + + + Stores list of symbol ticksizes + + + + + Cached value of TickSize (if 1 level) + + + + + Step of the lot changes + + + + + Step of the notional value changes + + + + + Gets derivative expiration date + + + + + Gets derivative last trading date + + + + + Gets derivative maturity date + + + + + Gets derivative strike price + + + + + Gets derivative option style + + + + + Gets derivative option type + + + + + Gets derivative option serie + + + + + Gets derivative underlier name + + + + + Gets derivative underlier symbol + + + + + Gets derivative underlier symbol id + + + + + Gets Ask price + + + + + Gets Ask size + + + + + Gets Bid price + + + + + Gets Bid size + + + + + Gets quote time + + + + + Gets last price + + + + + Gets last size + + + + + Gets last time + + + + + Gets mark price + + + + + Gets mark size + + + + + Gets open price + + + + + Gets previous close price + + + + + Gets high price + + + + + Gets low price + + + + + Gets volume value + + + + + Gets quote asset volume value + + + + + Gets PrevSettlement value + + + + + Gets ticks amount + + + + + Gets trades amount + + + + + Gets Level2 data + + + + + Gets spread value between Bid and Ask + + + + + Gets percentage value + + + + + Gets change value between Bid/Last and Close price + + + + + Gets percentage value + + + + + Default history type + + + + + List of all available history types + + + + + Gets SymbolVolumeType + + + + + List of all available history types + + + + + Will be triggered when new Level1 quote is comming + + + + + Will be triggered when new Level2 quote is comming + + + + + Will be triggered when new trade quote is comming + + + + + Will be triggered when new correctional quote is comming from the vendor. + + + + + Will be triggered when symbol updated. + + + + + Gets real time calculation setting + + + + + Gets real time calculation setting + + + + + Gets real time calculation setting + + + + + Gets real time calculation setting + + + + + Gets historical data according to period and other parameters + + + + + + + + + Gets historical data according to period and other parameters + + + + + + + + + + Gets historical data according to aggregation and other parameters + + + + + + + + + + Gets historical data according to given history request + + + + + + + Gets historical ticks data according to given parameters + + + + + + + + + Returns rounded to price + + + + + Calculates new price which equal to given price shifted by a number of given ticks + + + + + + + + Calculates ticks between two prices + + + + + + + + Gets cached symbol tick size or retrives it from the list + + + + + + + Gets symbol tick cost retrived from the list by price + + + + + + + Returns VariableTick if it can be retrived from list by price or null + + + + + + + Gets cached tick size if it available, else tries to obtain with Last, Bid, Ask, first element of list otherwise - + + + + + Formats price value to the appropriative string with a counting on tick precision. + + + + + + + Formats price value to the appropriative string with a counting on max tick precision. + + + + + + + Returns string with formatted ticks value + + + + + + + + Comparing by value + + + + + Gets symbol orders types list which are allowed. + + + + + + + Process order placing with given request parameters + + + + + + + An symbol has possibility to obtain the default account + + + + + Represents information about trade. + + + + + Gets the unique identifier of the order initiating the trade. + + + + + Gets a unique identifier of the position, which is related to this trade. + + + + + Get the price where trade was executed + + + + + Get the trade quantity + + + + + Get the date and time when trade was executed + + + + + Get the trade Gross P&L + + + + + Get the trade Net P&L + + + + + Get the fee value that was charged for this trade + + + + + Get the trade order type + + + + + Will be triggered on trade updating + + + + + The symbols list manager. + + + + + Gets the count. + + + + + Gets or Sets the settings. + + + + + Represent access to level2 data. + + + + + Gets Level2 Asks list + + + + + Gets Level2 Bids list + + + + + Gets current Level2 data + + Parameters of DepthOfMarket + + + + + Gets current Level2 data + + Parameters of request for Leve2Item collection + + + + + Leve2 data. Contains Bids and Ask collections + + + + + Represent parameters of DepthOfMarket + + + + + Represent parameters of request for Leve2Item collection + + + + + Aggregation method + + + + + Required amount of level2 + + + + + Use custom tick size + + + + + Calculate cumulative size + + + + + Aggregation method + + + + + Represent access to level2 item. + + + + + Cumulative size + + + + + Imbalance Percent + + + + + Price + + + + + Size + + + + + Time + + + + + MMID + + + + + проверка на вхождение + + + + + Represents information about connection and provides an access to the current trading information(Symbols, Orders, Position, Accounts etc.). + + + + + Provides access to all business objects which are belong to this connection + + + + + Gets connection Id + + + + + Gets connection Name + + + + + Gets connection's vendor name + + + + + Contains list of connection settings. Will be reused on each population time. + + + + + Gets connection's state (Connected/Connecting/Fail etc.) + + + + + Defines connection type + + + + + Will be triggered when changed. + + + + + Will be triggered when changed. + + + + + Represents connection ping time + + + + + Messages count that one is waited to process + + + + + Gets a matched available metadata info with the vendor's side + + + + + Establishes a connection to a specified vendor + + + + + + Closes a connection. + + + + + Только для использования в ConnectionCache + + + + + alexb: "Умный" поиск - разрешаем указывать слова в любом порядке + + + + + Generates a report with given requested parameters + + specifies Report's type + + + + + Gets connection's s list + + + + + Gets connection's symbol types list which are allowed in this connection + + + + + Gets connection's s list + + + + + Gets connection's s list + + + + + Gets all Exchanges which are allowed in this connection + + + + + Gets all Orders which are belong to this connection + + + + + Gets all Order Types which are available on this connection + + + + + Gets all Positions which are belong to this connection + + + + + Gets all Closed Positions which are belong to this connection + + + + + Gets all Corporate actions which are belong to this connection + + + + + Gets all Report Types which are available on this connection + + + + + Gets all Account operations which are available on this connection + + + + + Gets all Tradins signals which are available on this connection + + + + + Server connection status + + + + + Specifies connection using type. + + + + + Specifies how connection was created: by default or by user + + + + + Represents all needed parameters for the connection constructing process. + + + + + Gets a user friendly name of the connection + + + + + Gets connection group + + + + + Gets vendor's name + + + + + Gets connection Id + + + + + Favorites one will be displayed in Control center toolbar + + + + + Gets ConnectionState + + + + + Gets vendor's settings + + + + + Specifies how connection was created: by default or by user + + + + + realization + + + + + Creates connection info instance + + + + + + Creates connection info instance. + + + + + + + + + дефолтовый период пигования + + + + + Таймер, по которому проходит пинг + + + + + Запускаем таймер + + + + + Останавливаем таймер + + + + + Коннекты, которые нужно подключить + + + + + Сколько ждем до следующей попытки + + + + + The main entry point in the API. Core keeps access to all business logic entities and their properties: + connections, accounts, symbols, positions, orders, etc. Some of them can be reached through using managers or directly via specified collections. + You can always access the Core object via static Core.Instance property. + + + + + Gets a singleton instance of . API entry point + + + + + Gets an access to all created connections and manages them + + + + + Gets an access to the system logging mechanism + + + + + Obtains licence rules for the current user + + + + + Gets an access to all available trading data vendors and creates them + + + + + Gets an access to the all available aggregation types + + + + + Access to Volume Analysis calculations + + + + + Gets an access to the all available indicators and creates them + + + + + Gets an access to the all available trading strategies and manages them + + + + + Gets a permissions checking mechanism + + + + + Gets a time based conversion and synchronization mechanism + + + + + Gets SMTP mail service for sending emails + + + + + Represents current trading status + + + + + Will be triggered when changed + + + + + Gets all available s from open connections + + + + + Gets all available s from open connections + + + + + Gets all available s from open connections + + + + + Gets all available s from open connections + + + + + Gets all available s from open connections + + + + + Gets all available s from open connections + + + + + Gets all available s from open connections + + + + + Gets all available s from open connections + + + + + Gets all available s from open connections + + + + + Gets all available s from open connections + + + + + Gets all available s from open connections. Otherwise returns empty list + > + + + + Gets all available s from open connections. Otherwise returns empty list + > + + + + Starts a initialization process which initializes given Managers, and Utils. And provides a subscribing on events. + + + + + Disposes all previously initialized modules and unsubscribe from events + + + + + Will be triggered when new added to the core + + + + + Gets an instance of exist Account or creates a new one with given info parameter + + + + + + + Will be triggered when new added to the core + + + + + Returns all s from open connections which satisfy given request parameters, otherwise returns empty list + + + + + + + Retrieves any by given request parameters. Otherwise returns null + + + Must be specified if open connections total is more than one. Will search only in Synthetic symbols list if id is equal to + + + + + + Gets an instance of exist symbol or creates a new one with given info parameter + + + + + + + Will be triggered when new placed + + + + + Will be triggered when canceled + + + + + Gets instance by given Id string. Otherwise returns null + + + Must be specified if open connections total is more than one + + + + + Gets instance by given Id string. Otherwise returns null + + + Must be specified if open connections total is more than one + + + + + Will be triggered when new opened + + + + + Will be triggered when closed + + + + + Gets instance by given Id string. Otherwise returns null + + + Must be specified if open connections total is more than one + + + + + Gets Profit'n'Loss with given request parameters from open connection. Otherwise returns null + + + + + + + Will be triggered when new added + + + + + Will be triggered when removed + + + + + Will be triggered when new occured + + + + + Gets collection of by given parameters + + + + + + + + Gets collection of by given parameters and callback + + + + + + + + + Will be triggered when new occured + + + + + Will be triggered when new added + + + + + Gets collection of by given parameters + + + + + + + + Places with given request parameters + + + + + + + Places multiple s with given request parameters + + + + + + + + Modifies by given request parameters + + + + + + + Closes with given request parameters + + + + + + + Cancels with given request parameters + + + + + + + Returns with given request parameters from open connection + + + + + + + Will be triggered when new received + + + + + Sends custom request if connection with given Id is open + + + + + + + Subscribe on custom messages + + custom message handler + custom messages Id + + + + Unsubscribe from custom messages + + custom message handler + custom messages Id + + + + Gets all previously configured s + + + + + Gets an access to s and manages them + + + + + Adds if given parameters are valid + + + + + + + Replaces exist list by new list in if given parameters are valid + + + + + + + Removes with a given name + + + + + + Replaces list name by new given name in if given parameters are valid + + + + + + + Represent all available Historical Symbols + + + + + Will be triggered when custom symbol added + + + + + Will be triggered when custom symbol removed + + + + + Will be triggered when custom symbol updated + + + + + Represent all available Synthetic items + + + + + Adds given Synthetic to the list if it does not contain + + + + + + Removes given Synthetic from the list if it exists + + + + + + Will be triggered when created/chenged/removed + + + + + Override to change string representation of aggregation + + + + + Represent access to historical data information and indicators control. + + + + + Gets HistoricalData symbol + + + + + Gets HistoricalData aggregation + + + + + Gets HistoricalData left time boundary + + + + + Gets HistoricalData right time boundary + + + + + Gets HistoricalData items amount + + + + + Retrieves HistoricalData item by indexing offset and direction to find. + + + + + + + + Will be triggered when new historical item created + + + + + Will be triggered when current historical item changed or updated + + + + + Gets access to built-in indicators + + + + + Reloads entire HistoricalData + + + + + Gets index by time with counting on search direction + + + + + Gets array of attached indicators + + + + + Creates indicator by it's name and if it successfully created adds it to the HistoricalData + + + + + + + + Adds indicator to the HistoricalData + + + + + + Removes indicator from the HistoricalData + + + + + + Will be triggered when volume analysis of current historical item changed or updated + + + + + Period that can be used as a basis for history aggregations + + + + + Represents historical data bar item + + + + + Gets bar's right time border + + + + + Defines bar's ticks count + + + + + Defines Open price + + + + + Defines High price + + + + + Defines Low price + + + + + Defines Close price + + + + + Gets Median (High+Low)/2 price + + + + + Gets Typical (High+Low+Close)/3 price + + + + + Gets Weighted (High+Low+Close+Close)/4 price + + + + + Defines ticks amount + + + + + Defines volume value + + + + + Gets price by indexing + + + + + + + Creates HistoryItemBar instance with default OHLC price = + + + + + Comparing by , OHLC, + + + + + + + Creates HistoryItemLast instance + + + + + Represents historical data trade item + + + + + Defines price value + + + + + Defines volume value + + + + + Defines trade operation side as aggressor flag + + + + + Gets price by indexing + + + + + + + Creates HistoryItemLast instance + + + + + Comparing by , OHLC, + + + + + + + Creates HistoryItemLast instance + + + + + Gets price by indexing + + + + + + + Creates HistoryItemLast instance + + + + + Represents historical data tick item + + + + + Defines Bid price + + + + + Defines Bid size + + + + + Defines Ask price + + + + + Defines Ask size + + + + + Gets price by indexing + + + + + + + Creates HistoryItemBar instance with default Ask/AskSize/Bid/BidSize = + + + + + Comparing by , OHLC, , , , + + + + + + + Resolves a history request parameters per symbol + + + + + Represents mechanism for supporting predefined and custom periods + + + + + Gets period multiplier + + + + + Gets base period type + + + + + Gets ticks value as an result of base period multiplicated by + + + + + Creates Period instance with greater than 0 + + + + + + + True if their base paeriods and are respectively equal. + + + + + + + + True if any of their base paeriods and are respectively not equal. + + + + + + + + True if their ticks values are satisfying initial condition + + + + + + + + True if their ticks values are satisfying initial condition + + + + + + + + True if their ticks values are satisfying initial condition + + + + + + + + True if their ticks values are satisfying initial condition + + + + + + + + True if their base paeriods and are respectively equal. + + + + + + + Formats given value to a specific user friendly string + + + + + + + Returns value in ticks according to base period type + + + + + + + Returns shorted string according to base period type + + + + + + + Converts time gap into dates range + + + + + + + Compares by + + + + + + + Serialize into object + + + + + + Deserialize from + + + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Predefined period + + + + + Represent access to DayBar quote, which contains summary information about instrument prices. + + + + + High price + + + + + Open price + + + + + Low price + + + + + Previous Close price + + + + + Ticks value + + + + + Volume value + + + + + Volume value + + + + + Previous settlement price + + + + + Bid price + + + + + Bid size + + + + + Ask price + + + + + Ask size + + + + + Last price + + + + + Last size + + + + + Trades value + + + + + Change value + + + + + Change value in percentage + + + + + + + + + + Represent access to DOM2 quote, which contains Bids and Asks. + + + + + Collection of Asks quotes + + + + + Collection of Bids quotes + + + + + Represent access to trade information. + + + + + Price at which trade occured + + + + + Size of the trade + + + + + Information about operation side of the trade + + + + + Shows the direction of price movement, comparing to previous value. + + + + + Represent access to Level2 quote. + + + + + Price type of Level2 quote: Bid or Ask + + + + + Price of Level2 quote + + + + + Size of Level2 quote + + + + + Unique ID of Level2 quote + + + + + Shows, whether Level2 quote is using only for removing from depth + + + + + Broker identifier that send level2 quote + + + + + specifies the implied quantity associated with the price for the quote. Subtracting this amount from the Size yields the outright quantity for the price level. A value of zero indicates that the implied size is not available/defined or that it is actually zero. + + + + + Time of the quote + + + + + Represent access to quote information. + + + + + Bid price + + + + + Bid size + + + + + Ask price + + + + + Ask size + + + + + Shows the direction of bid price movement, comparing to previous value. + + + + + Shows the direction of ask price movement, comparing to previous value. + + + + + Constants for licence keys + + + + + User licences info store + + + + + Current state of connection to licence server + + + + + Current connected user info + + + + + All active licences that user have + + + + + Check that user have licence + + + + + The loopback http listener without kestrel. + + + + + Initializes a new instance of the class. + + The port. + + + + Dispose + + + + + Wait for callback asynchronously. + + The token. + ]]> + + + + Specifies the reason of price data updating. + + + + + Indicates the processing of new historical bar. + + + + + Indicates the coming of new real-time tick. + + + + + Indicates a start of new real-time bar. + + + + + Specifies the type of events when indicator should recalculate itself. + + + + + Specifies the style of indicator line. + + + + + Moving average mode + + + + + Simple Moving Average + + + + + Exponential Moving Average + + + + + Smoothed Moving Average + + + + + Linearly Weighted Moving Average + + + + + + + + + + Displays HV schedule and percentile value. + + + + + Displays the percentile schedule only. + + + + + Returns an instance of the Exponential Moving Average (EMA) indicator. + EMA provides a weighted price calculation for the last N periods. + + Period of Exponential Moving Average + Sources prices for MA + Calculation type + + + + Gets the Linearly Weighted Moving Average + Linear Weighted Moving Average makes the most recent bar more important unlike SMA. + + Moving average period + Type of the price + + + + + Gets the SMA(Simple Moving Average) indicator. + The 'SMA' indicator provides an average price for the last N periods. + + Period of simple moving average. + Sources prices for MA. + + + + + Returns an instance of the Smoothed Moving Average (SMMA) indicator. + SMMA indicator provides a smoothed average price for the last N periods. + + Moving average period + Type of the price + Calculation type + + + + + Gets the PPMA(Pivot Point Moving Average) indicator. + The 'PPMA' indicator uses the pivot point calculation as the input a simple moving average. + + Period of PPMA indicator + + + + + + Gets the MAS3 (3MASignal) indicator. + The 'MAS3' indicator offers buy and sell signals according to intersections of three moving averages. + + Short moving average period. + Middle moving average period. + Long moving average period. + The count of bars. The trend will be determined on this interval. + + + + + + Gets the specific MA indicator, according to selected 'MaMode'. + + Period of moving average. + Type of price. + MA mode. + Calculation type + + + + + + Gets the BB(Bollinger Bands) indicator. + The 'BB' indicator provides a relative definition of high and low based on standard deviation and a simple moving average. + + Period of MA for envelopes. + Value of confidence interval. + Sources prices for MA. + Type of moving average. + Calculation type + + + + + Gets the Commodity Channel Index. + Measures the position of price in relation to its moving average. + + Period for CCI MA + Sources prices for CCI + MA mode for CCI + Calculation type + + + + + Returns an instance of the Modified Moving Average (MMA) indicator. + MMA comprises a sloping factor to help it overtake with the growing or declining value of the trading price of the currency. + + Period of Modified Moving Average + Sources prices for MA + + + + + Gets the Regression indicator + The Linear Regression Indicator plots the ending value of a Linear Regression Line for a specified number of bars; showing, statistically, where the price is expected to be. + + Moving average period + Type of the price + + + + + Gets the Channel (Price Channel) indicator. + The 'Channel' indicator is based on measurement of min and max prices for the definite number of periods. + + Period of price channel + + + + + + Gets the AFIRMA indicator + Autoregressive finite impulse response moving average. A digital filter accurately shows the price movement as powered with least square method to minimise time lag + + Moving average period + Type of the price + Afirma mode + with least squares method overlapping if true + + + + + Gets the RSI indicator. + Relative Strength Index (RSI) is a momentum oscillator that measures the speed and change of price movements. + + RSI Period + Price Type + RSI Mode (Simple or Exponential) + MA Mode for smooth data + MA period for smooth data + Calculation type + + + + + Returns an instance of the McGinley Dynamic indicator. + McGinley Dynamic avoids of most whipsaws and it rapidly moves up or down according to a quickly changing market. It needs no adjusting because it is dynamic and it adjusts itself. + + Period of exponential moving average + Dynamic tracking factor + Source price type + Calculation type + + + + + Gets the MAE (Moving Average Envelope) indicator. + The 'MAE' indicator demonstrates a range of the prices discrepancy from a Moving Average. + + Period of MA for envelopes. + Sources prices for MA. + Type of moving average. + Upband deviation in %. + Downband deviation in %. + Calculation type + + + + + Returns an instance of the Parabolic Time/Price System (SAR) indicator. + SAR indicator helps to define the direction of the prevailing trend and the moment to close positions opened during the reversal. + + Step of parabolic SAR system + Maximum value for the acceleration factor + + + + + + Gets the AO (Awesome Oscillator) indicator. + The 'AO' indicator determines market momentum. + + + + + + Gets the CMO (Chande Momentum Oscillator) indicator. + The CMO calculates the dividing of difference between the sum of all recent gains and the sum of all recent losses by the sum of all price movement over the period. + + Period of MA for envelopes. + Sources prices for MA. + + + + + + Returns an instance of the ZigZag indicator. + ZigZag is a trend following indicator that is used to predict when a given symbol's momentum is reversing. + + Percent Deviation + + + + + + Gets the Aroon indicator. + Reveals the beginning of a new trend and determines how strong it is + + Aroons period + + + + + + Returns an instance of the Standart Deviation (SD) indicator. + The SD shows the difference of the volatility value from the average one. + + Period of indicator + Sources prices for MA + Type of Moving Average + Calculation type + + + + + Gets the MACD (Moving Average Convergence/Divergence) indicator. + The MACD is a trend-following momentum indicator that shows the relationship between two moving averages of prices. + + Period of fast EMA. + Period of slow EMA. + Period of signal EMA. + Calculation type + + + + + Returns an instance of the Kairi Relative Index (KRI) indicator. + KRI calculates deviation of the current price from its simple moving average as a percent of the moving average. + + + + + + + + Returns an instance of the Bollinger Bands Flat (BBF) indicator. + The BBF provides the same data as BB, but drawn in separate field and easier to recognize whether price is in or out of the band. + + Period + Deviation + Sources prices for MA + Type of Moving Average + Calculation type + + + + + Gets the ROC (Rate of Change) indicator. + The ROC shows the speed at which price is changing. + + Period of momentum. + + + + + + Gets the Momentum indicator. + Momentum compares where the current price is in relation to where the price was in the past. + + Period for Momentum + Sources prices for Momentum + + + + + + Gets the %R Larry Williams. + Uses Stochastic to determine overbought and oversold levels. + + Period for Momentum + + + + + + Returns an instance of the Price Oscillator (PO) indicator. + PO calculates the variation between price moving averages. + + Period of MA1 + Period of MA2 + Sources prices for MA + Type of Moving Average + Calculation type + + + + + Gets the OsMA (Moving Average of Oscillator) indicator. + The OsMA reflects the difference between an oscillator (MACD) and its moving average (signal line). + + Period of fast EMA. + Period of slow EMA. + Period of signal EMA. + Calculation type + + + + + Gets On Balance Volume. + On Balance Volume (OBV) measures buying and selling pressure as a cumulative indicator that adds volume on up days and subtracts volume on down days. + + Sources prices for OBV + + + + + + Returns an instance of the Positive Volume Index (PVI) indicator. + The PVI value changes on the periods in which value of volume has increased in comparison with the previous period. + + + + + + + + Returns an instance of the Volume indicator. + Volume allows to confirm the strength of a trend or to suggest about it's weakness. + + + + + + + Gets the MFI(Money Flow Index) indicator. + The MFI(Money Flow Index) is an oscillator that uses both price and volume to measure buying and selling pressure. + + Period of MFI. + + + + + + Returns an instance of the Acceleration/Deceleration Oscillator (AC). + AC measures the acceleration and deceleration of the current momentum. + + + + + + + Gets the Average True Range (ATR) indicator. + The ATR measures of market volatility. + + + Period of Moving Average. + Type of Moving Average + Calculation type + + + + + Returns an instance of the Kaufman Adaptive Moving Average (KAMA) indicator. + KAMA is an exponential style average with a smoothing that varies according to recent data. + + Period + Fast factor + Slow factor + Sources prices for MA + + + + + + Returns an instance of the Qstick indicator. + The Qstick is a moving average that shows the difference between the prices at which an issue opens and closes. + + + + Calculation type + + + + + Get the Swing Index (SI) indicator. + The SI is used to confirm trend line breakouts on price charts. + + The divider. + + + + + + Get the True Strength Index (TSI) indicator. + + The TSI is a variation of the Relative Strength Indicator which uses a doubly-smoothed + EMA of price momentum to eliminate choppy price changes and spot trend changes. + + + First MA period. + Second MA period. + Calculation type + + + + + Returns an instance of the Average Directional Index (ADX) indicator. + The ADX determines the strength of a prevailing trend. + + Period + Type of Moving Average + Calculation type + + + + + Returns an instance of the Keltner Channel indicator. + Keltner Channels are volatility-based envelopes set above and below an exponential moving average. + + Period of MA for Keltner's Channel + Coefficient of channel's width + Sources prices for MA + Type of Moving Average + Calculation type + + + + + Returns an instance of the Percentage Price Oscillator (PPO). + Percentage Price Oscillator is a momentum indicator. Signal line is EMA of PPO. Formula: (FastEMA-SlowEMA)/SlowEMA. + + Fast EMA Period + Slow EMA Period + Signal EMA Period + Calculation type + + + + + Gets the Stochastic Slow. + Shows the location of the current close relative to the high/low range over a set number of periods (Slow). + + Period + Smoothing + Double smoothing + Moving type + Calculation type + + + + + Gets the Stochastic x Relative Strength Index. + StochRSI is an oscillator that measures the level of RSI relative to its range. + + Period + Smoothing + Double smoothing + + + + + + Gets the Ichimoku. + Enables to quickly discern and filter 'at a glance' the low-probability trading setups from those of higher probability. + + Tenkan Period + Kijun Period + Senkou Span B + + + + + + Gets the Directional Movement Index(DMI) indicator. + The DMI іdentifies whether there is a definable trend in the market. + + Period of Moving Average. + Type of Moving Average. + Calculation type + + + + + Gets the Alligator. + Three moving averages with different colors, periods and calculation methods. + + Type of Jaw Moving Average. + SourcePrice of Jaw Moving Average. + Period of Jaw Moving Average. + Shift of Jaw Moving Average. + Period of Moving Average. + Type of Moving Average. + Period of Moving Average. + Type of Moving Average. + Period of Moving Average. + Type of Moving Average. + Period of Moving Average. + Type of Moving Average. + + + + + + Base class for all indicators. + + + + + Short name of indicator + + + + + Access to current Symbol of indicator + + + + + Amount of items in internal buffers + + + + + Represent access to current used historical data. + + + + + Represent access indicator series + + + + + + + + + + Specified, whether indicator should use main or additional window on the chart + + + + + Specified, whether indicator should draw on chart background by default. + + + + + Specified, whether indicator should participate into price auto scale system. + + + + + Precision amount for formatting price (the count of digits after decimal point); By default = -1, which means to use precision from indicator's symbol + + + + + Indicator's settings + + + + + Represent access to the chart, that created indicator + + + + + Recalculate indicator + + + + + + + + + + + Sets the value of indicator into internal buffer + + Value + Index of indicator line + Offset value + + + + Gets the value of indicator from internal buffer + + Offset value + Index of indicator line + Offset start point + + + + + Set line break point. + + Offset value + Index of indicator line + Offset start point + + + + Remove line break point. + + Offset value + Index of indicator line + Offset start point + + + + Check if the point is a break point. + + Offset value + Index of indicator line + Offset start point + + + + Gets the price from historical data + + + + + + + + Get Bid price + + Offset value + + + + + Get Ask price + + Offset value + + + + + Get Last price + + Offset value + + + + + Get Open price + + Offset value + + + + + Get High price + + Offset value + + + + + Get Low price + + Offset value + + + + + Get Close price + + Offset value + + + + + Get Median price + + Offset value + + + + + Get Typical price + + Offset value + + + + + Get Weighted price + + Offset value + + + + + Get Volume + + Offset value + + + + + Get Volume in quoting asset + + Offset value + + + + + Get Ticks + + Offset value + + + + + Get Open interest + + Offset value + + + + + Get Funding rate + + Offset value + + + + + Get Time + + Offset value + + + + + Formatting price, using precision from assigned symbol or Digits value if specified + + Price value + + + + + Marks cloud begin between two line series with specific color + + First line series index + Second line series index + Cloud color + Offset + + + + Marks cloud end between two line series with specific color + + First line series index + Second line series index + Cloud color + Offset + + + + Using IndicatorLineMarker class you can mark by color or icon any point of your indicator's line. + + + + + Color of the marker + + + + + Icon that will be drawn above the indicator line + + + + + Icon that will be drawn beyond the indicator line + + + + + Constructor for IndicatorLineMarker + + + + + + + + Constructor for IndicatorLineMarker + + + + + Different type of icons for Indicator marker + + + + + Sets the bar number (from the data beginning) from which the drawing of the given indicator line must start; + + + + + Time shift of indicator's line + + + + + Redraws parts of indicator's line within the interval set by offset + + + + + Removes redrawn parts of indicator's line within the interval set by offset + + + + + + + + + + Fully clears markers from line + + + + + Use this attribute to mark input parameters of your script. You will see them in the settings screen on adding + + + + + Displayed name of input parameter + + + + + Sort index for input paramter + + + + + Minimal value for numeric input parameters + + + + + Maximal value for numeric input parameters + + + + + Increment value for numeric input parameters + + + + + Decimal palces for numeric input parameters + + + + + List of predefined values + + + + + Event occurred when write a new log + + + + + Get logs from the strategy for specified date range + + + + + + + + Write log message + + + + + + + The base class for strategies + + + + + Unique ID of the strategy + + + + + The current state of the strategy + + + + + Event occured when strategy write a new log + + + + + Event occured if any of strategy settings was changed + + + + + Run strategy + + + + + Stop strategy + + + + + Remove the strategy + + + + + Get current metrics from the strategy + + + + + + Get logs from the strategy for specified date range + + + + + + + + Write log message + + + + + + + Specifies constants that define which mouse button was pressed. + + + + + No mouse button was pressed. + + + + + The left mouse button was pressed. + + + + + The right mouse button was pressed. + + + + + The middle mouse button was pressed. + + + + + The first XButton was pressed. + + + + + The second XButton was pressed. + + + + + Gets or sets a value indicating whether the event was handled. + true to bypass the control's default handling; otherwise, false to also pass the event along to the default control handler. + + + + + Defines quote parameters for subscribtion + + + + + Symbol Id + + + + + Quote type + + + + + SubscribeQuotesParameters constructor + + + + + Id of the order + + + + + Gets or Sets the groups. + + + + + SettingItem cast type + + + + + SettingItem state + + + + + Specifies the DatePicker time format. + + + + + Date only + + + + + Date and time + + + + + Time only + + + + + Time with seconds + + + + + + + + + + Typecasts setting as TabControl item + + + + + Typecasts setting as GroupBox item + + + + + Typecasts setting as AccountLookup item + + + + + Typecasts setting as Button item + + + + + Typecasts setting as CheckBox item + + + + + Typecasts setting as CheckBox item + + + + + Typecasts setting as Color item + + + + + Typecasts setting as DateTimePicker item + + + + + Typecasts setting as NumericUpDown item + + + + + Typecasts setting as NumericUpDown item + + + + + Typecasts setting as AccountLookup item + + + + + Typecasts setting as Password item + + + + + Typecasts setting as Period item + + + + + Typecasts setting as ComboBox item + + + + + Typecasts setting as TextBox item + + + + + Typecasts setting as SymbolLookup item + + + + + Typecasts setting as TextBox item + + + + + Cancel all pending s + + the name of the initiator of the call (optional) + + + + Cancel all pending s by + + + the name of the initiator of the call (optional) + + + + Cancel all pending s by + + + the name of the initiator of the call (optional) + + + + Cancel all pending s by and + + + + the name of the initiator of the call (optional) + + + + Cancel all pending s by and + + + + the name of the initiator of the call (optional) + + + + Cancel all pending s by , and + + + + + the name of the initiator of the call (optional) + + + + Cancel all pending s by + + + the name of the initiator of the call (optional) + + + + Cancel all pending s by and + + + + the name of the initiator of the call (optional) + + + + Cancel all pending s by , and + + + + + the name of the initiator of the call (optional) + + + + Cancel all pending s by + + + the name of the initiator of the call (optional) + + + + Cancel all pending s by and + + + + the name of the initiator of the call (optional) + + + + Cancel all pending s by , and + + + + + the name of the initiator of the call (optional) + + + + Cancel all pending s by + + + the name of the initiator of the call (optional) + + + + Close all s + + the name of the initiator of the call (optional) + List of + + + + Close all s by + + + the name of the initiator of the call (optional) + List of + + + + Close all s by + + + the name of the initiator of the call (optional) + List of + + + + Close all s by and + + + + the name of the initiator of the call (optional) + List of + + + + Close all s by + + + the name of the initiator of the call (optional) + List of + + + + Close all s by and + + + + the name of the initiator of the call (optional) + List of + + + + Close all positive s + + the name of the initiator of the call (optional) + List of + + + + Close all positive s by + + + the name of the initiator of the call (optional) + List of + + + + Close all negative s + + the name of the initiator of the call (optional) + List of + + + + Close all negative s by + + + the name of the initiator of the call (optional) + List of + + + + Reverse all s + + the name of the initiator of the call (optional) + List of + + + + Reverse all s by + + + the name of the initiator of the call (optional) + List of + + + + Reverse all s by + + + the name of the initiator of the call (optional) + List of + + + + Reverse by and + + + + the name of the initiator of the call (optional) + + + + + Cancel all s and close all s + + the name of the initiator of the call (optional) + + + + Cancel all s and close all s by + + + the name of the initiator of the call (optional) + + + + Cancel all s and close all s by and + + + + the name of the initiator of the call (optional) + + + + Modify SL to breakeven price + + + the name of the initiator of the call (optional) + + + + Modify SL to breakeven price with certain additional offset + + + offset in ticks + the name of the initiator of the call (optional) + + + + Modify SL to breakeven price + + + list of s that will be used for order placing + the name of the initiator of the call (optional) + + + + Adjust SL/TP for given + + + + the name of the initiator of the call (optional) + + + + Adjust stop loss for given + + + list of s + initial stop loss parameters (optional) + + the name of the initiator of the call (optional) + + + + + Adjust take profit for given + + + list of s + initial take profit parameters (optional) + + the name of the initiator of the call (optional) + + + + + The allowed result. + + + + + Gets the status. + + + + + Gets the reason. + + + + + Get the allowed result. + + An AllowedResult. + + + + Gets the not allowed result. + + The reason. + An AllowedResult. + + + + The action wrapper. + + + + + Gets or Sets the items. + + + + + Initializes a new instance of the class. + + + + + Froms the X element. + + The element. + The deserialization info. + + + + Tos the X element. + + A XElement. + + + + The aggressor flag calculator. + + + + + Initializes a new instance of the class. + + + + + Collect bid ask. + + The symbol. + The time ticks. + The bid. + The ask. + + + + Calculate aggressor flag. + + The symbol. + The time ticks. + The last. + An AggressorFlag. + + + + + + + + + Calculate aggressor flag. + + The previous bid. + The previous ask. + The last. + An AggressorFlag. + + + + The alert. + + + + + Gets or Sets the text. + + + + + Gets or Sets the symbol name. + + + + + Gets or Sets the connection name. + + + + + Gets or Sets the action on confirm. + + + + + Gets or Sets the name. + + + + + The alert data. + + + + + The name. + + + + + Gets or Sets the columns. + + + + + Gets or Sets the groups. + + + + + Gets or Sets the actions. + + + + + Gets or Sets a value indicating whether enabled. + + + + + Gets or Sets the table dictionary. + + + + + Gets or Sets a value indicating whether coloring is alert. + + + + + Gets or Sets a value indicating whether filter alert. + + + + + Gets or Sets a value indicating whether search alert. + + + + + Gets or Sets a value indicating whether to remove. + + + + + Gets or Sets the ID. + + + + + Gets or Sets the command sender. + + + + + Gets or Sets a value indicating whether need confirm trading. + + + + + Initializes a new instance of the class. + + + + + To the XML element. + + A XElement. + + + + From the XML element. + + The element. + The deserialization info. + + + + The arbitrage symbol. + + + + + Gets or Sets the index. + + + + + Gets the unique ID. + + + + + Gets the symbol id. + + + + + Gets or Sets a value indicating whether is selected. + + + + + Gets or Sets the symbol. + + + + + Gets or Sets the account. + + + + + Gets or Sets the commission. + + + + + Initializes a new instance of the class. + + + + + Compare to. + + The other. + An int. + + + + Froms the X element. + + The element. + The deserialization info. + + + + Tos the X element. + + A XElement. + + + + The action buffered processor. + + + + + The action buffered processor with priority. + + + + + Initializes a new instance of the class. + + The threads count. + + + + The buffered processor. + + + + + + Gets the state. + + + + + Gets the queue depth. + + + + + + + + + + + + + + + + + The subject. + + + + Wait all messages process. + + The external token. + + + + The buffered processor state. + + + + + + + + + + Агрегація, що буде використовуватись як дефолтна для "TimeFrameScreen". + Повинна відповідати агрегації чарта. + + + + + https://stackoverflow.com/questions/3060381/datetime-addmonths-adding-only-month-not-days + + Проблема: + (29 Feb).AddMonth(1) = 29 March + + + + + Defines advanced trading operation respond bundle + + + + + Respond operation state + + + + + Respond message + + + + + Respond value (optional) + + + + + Details of sub-operations + + + + + Get all available custom resources + + + + + Get custom resource stream by name + + + + + Check whether specified items was hidden by branding specification + + + + + + The assembly loader. + + + + + Load types. + + The folder name. + The target type. + The assembly name filter. + The search option. + If true, load in memory. + If true, allow loading references. + ]]> + + + + Quote type for subscribtion dictum + + + + + Level 1 quote + + + + + Level 2 quote + + + + + Last + + + + + Mark price + + + + + Trading operation state + + + + + Complex trading operation state + + + + + The aggressor flag calculator extensions. + + + + + Collect bid ask. + + The calculator. + The quote. + + + + Calculate aggressor flag. + + The calculator. + The last. + An AggressorFlag. + + + + Gets the price from historical data + + + + + + + + Get Bid price + + Offset value + + + + + Get Ask price + + Offset value + + + + + Get Last price + + Offset value + + + + + Get Open price + + Offset value + + + + + Get High price + + Offset value + + + + + Get Low price + + Offset value + + + + + Get Close price + + Offset value + + + + + Get Median price + + Offset value + + + + + Get Typical price + + Offset value + + + + + Get Weighted price + + Offset value + + + + + Get Volume + + Offset value + + + + + Get Volume in quoting asset + + Offset value + + + + + Get Ticks + + Offset value + + + + + Get Open interest + + Offset value + + + + + Get Funding rate + + Offset value + + + + + Get Time + + Offset value + + + + + Combines intersecting intervals + + + + + Get all settings or particular settings by provided hierarchy path + + + + + Write info log message + + + + + Write trading log message + + + + + Write error log message + + + + + Variable lifetime + + + + + The variable will be removed on exit + + + + + The variable will be written to file + + + + + Global variable entry + + + + + Variable name + + + + + using System; + using System.Text; + using PTLRuntime.NETScript; + + namespace GlobalVariablesManager + { + public class GlobalVariablesManager : NETIndicator + { + List<GlobalVariable> global_List=new List<GlobalVariable>(); + + public override void Init() + { + if(GlobalVariablesManager.Count()>0) + { + global_List=GlobalVariablesManager.GetGlobalVariablesList(); + foreach (var el in global_List) + { + Print(el.Name); + Print(el.Value); + } + } + } + } + } + + + + + + + Variable value + + + + + using System; + using System.Text; + using PTLRuntime.NETScript; + + namespace GlobalVariablesManager + { + public class GlobalVariablesManager : NETIndicator + { + List<GlobalVariable> global_List=new List<GlobalVariable>(); + public override void Init() + { + if(GlobalVariablesManager.Count()>0) + { + global_List=GlobalVariablesManager.GetGlobalVariablesList(); + foreach (var el in global_List) + { + Print(el.Name); + Print(el.Value); + } + } + } + } + } + + + + + + + Initializes new variable + + + + + using System; + using System.Text; + using PTLRuntime.NETScript; + + namespace GlobalVariablesManager + { + public class GlobalVariablesManager : NETIndicator + { + List<GlobalVariable> global_List=new List<GlobalVariable>(); + public override void Init() + { + if(GlobalVariablesManager.Count()>0) + { + global_List=GlobalVariablesManager.GetGlobalVariablesList(); + foreach (var el in global_List) + { + //Simplified way to retrieve global variable value + el.GlobalVariable("new_global_variable_period", period) + + //However, to obtain certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. + } + } + } + } + } + + + + Variable name + Variable value + + + + Sets variable value to a global storage + + + + + using System; + using System.Text; + using PTLRuntime.NETScript; + + namespace GlobalVariablesManager + { + public class GlobalVariablesManager : NETIndicator + { + GlobalVariablesManager(){ + base.ProjectName = "GlobalVariablesManager"; + base.Password=GetHashedPassword(ProjectName); + } + + [InputParameter("Period", 0, 1, 9999)] + public int period = 5; + + public override void OnQuote() + { + //Simplified way to store a global variable + + GlobalVariablesManager.SetValue("global_variable_period", period, VariableLifetime.SaveSession); + + //However, to indicate any variable belongs to certain indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. + + GlobalVariablesManager.SetValue("global_variable_period" +Symbols.Current.Name+period+Password, period, VariableLifetime.SaveSession); + } + } + } + + + + Variable name + New value + Variable lifetime + + + + Removes specified variable from global storage + + + + + using System; + using System.Text; + using PTLRuntime.NETScript; + + namespace GlobalVariablesManager + { + public class GlobalVariablesManager : NETIndicator + { + public override void Init() + { + //Simplified way to remove a global variable + + GlobalVariablesManager.Remove("global_variable_period"); + + //However, to remove certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. + } + } + } + + + + Variable name + + + + Returns variables' count in global storage + + + + + using System; + using System.Text; + using PTLRuntime.NETScript; + + namespace GlobalVariablesManager + { + public class GlobalVariablesManager : NETIndicator + { + public override void Init() + { + if(GlobalVariablesManager.Count()>0) + { + Print("Your session obtains "+GlobalVariablesManager.Count()+" global variables"); + } + } + } + } + + + + + + + + Removes all variables from global storage + + + + + using System; + using System.Text; + using PTLRuntime.NETScript; + + namespace GlobalVariablesManager + { + public class GlobalVariablesManager : NETIndicator + { + public override void Init() + { + GlobalVariablesManager.RemoveAll(); + + if(GlobalVariablesManager.Count()==0) + { + Print("Your session does not have any global variables"); + } + } + } + } + + + + + + + Check if variable with specified name exists in global storage + + + + + using System; + using System.Text; + using PTLRuntime.NETScript; + + namespace GlobalVariablesManager + { + public class GlobalVariablesManager : NETIndicator + { + public override void Init() + { + //Simplified way to check an existance of a global variable + + if(GlobalVariablesManager.Exists("global_variable_period")) + Print("Your session has this global variable"); + else + GlobalVariablesManager.SetValue("global_variable_period"); + + //However, to obtain certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. + } + } + } + + + + Variable name + + + + + Returns variable value by name + + + + + using System; + using System.Text; + using PTLRuntime.NETScript; + + namespace GlobalVariablesManager + { + public class GlobalVariablesManager : NETIndicator + { + public override void Init() + { + //Simplified way to retrieve global variable value + + if(GlobalVariablesManager.Exists("global_variable_period")) + //Always perform a type casting before assigning any variable from global storage + period = (int)GlobalVariablesManager.GetValue("global_variable_period"); + + //However, to obtain certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. + } + } + } + + + + Variable name + Variable value + + + + Performs a variable assigning from a global storage if such name exists in a scope + + + + + using System; + using System.Text; + using PTLRuntime.NETScript; + + namespace GlobalVariablesManager + { + public class GlobalVariablesManager : NETIndicator + { + public override void Init() + { + int new_period; + + //Simplified way to retrieve global variable value + + if(GlobalVariablesManager.TryGetValue("global_variable_period")) + Print("New variable is assigned from globals: " + new_period); + if(new_period==period) + Print("Matching, no need to re-assign globals: "); + else + GlobalVariablesManager.SetValue("global_variable_period", period, VariableLifetime.SaveSession); + + //However, to obtain certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. + } + } + } + + + + Variable name + Variable value + True if variable exists + + + + Saves all serializable variables to disk + + + + + using System; + using System.Text; + using PTLRuntime.NETScript; + + namespace GlobalVariablesManager + { + public class GlobalVariablesManager : NETIndicator + { + Connection myConnection = Connection.CurrentConnection; + public override void OnQuote() + { + if(myConnection.Status==Disconnected) + GlobalVariablesManager.Flush(); + } + } + } + + + + + + + Returns all global variables as list + + + + + using System; + using System.Text; + using PTLRuntime.NETScript; + + namespace GlobalVariablesManager + { + public class GlobalVariablesManager : NETIndicator + { + List <GlobalVariable>global_List=new List<GlobalVariable>(); + public override void Init() + { + if(GlobalVariablesManager.Count()>0) + global_List=GlobalVariablesManager.GetGlobalVariablesList(); + + foreach (var el in global_List) + { + Print(el.Name); + } + } + } + } + + + + Collection of global variables + + + + Object is non-serializable + + + + + Object too big + + + + + The application logger event. + + + + + Current logging level + + + + + Sets logs with custom messag, logging level, connection name + + + + + Sets logs with exception and custom message (optional), logging level, connection name + + + + + Sets logs with objects inherited from ILoggable interface,logging level, connection name + + + + + Sets a log level in case of deep debug + + + + + Remove a log level if one has not needed already + + + + + Все параметры, которые могут использоваться при отправке email + + + + + Отправит сообщение по E-mail + + + + + + + + + + Чисто, як маркер для парсера xgettext.exe + + + + + + + Check, whether current translation equal to hidden + + + + + + + + + + + + + + + + + + + + + + + Allows to save Symbols into named lists + + + + + from: + http://www.codeguru.com/csharp/csharp/cs_date_time/timeroutines/article.php/c4207/C-SNTP-Client.htm + +++ добавлен диспозе, подправлен ToString(), убран лишний метод. + +++ ReceiveTimeoutбSendTimeout + + NTPClient is a C# class designed to connect to time servers on the Internet. + The implementation of the protocol is based on the RFC 2030. + + Public class members: + + LeapIndicator - Warns of an impending leap second to be inserted/deleted in the last + minute of the current day. (See the _LeapIndicator enum) + + VersionNumber - Version number of the protocol (3 or 4). + + Mode - Returns mode. (See the _Mode enum) + + Stratum - Stratum of the clock. (See the _Stratum enum) + + PollInterval - Maximum interval between successive messages. + + Precision - Precision of the clock. + + RootDelay - Round trip time to the primary reference source. + + RootDispersion - Nominal error relative to the primary reference source. + + ReferenceTimestamp - The time at which the clock was last set or corrected. + + OriginateTimestamp - The time at which the request departed the client for the server. + + ReceiveTimestamp - The time at which the request arrived at the server. + + Transmit Timestamp - The time at which the reply departed the server for client. + + RoundTripDelay - The time between the departure of request and arrival of reply. + + LocalClockOffset - The offset of the local clock relative to the primary reference + source. + + Initialize - Sets up data structure and prepares for connection. + + Connect - Connects to the time server and populates the data structure. + + IsResponseValid - Returns true if received data is valid and if comes from + a NTP-compliant time server. + + ToString - Returns a string representation of the object. + + ----------------------------------------------------------------------------- + Structure of the standard NTP header (as described in RFC 2030) + 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |LI | VN |Mode | Stratum | Poll | Precision | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Root Delay | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Root Dispersion | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Reference Identifier | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | | + | Reference Timestamp (64) | + | | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | | + | Originate Timestamp (64) | + | | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | | + | Receive Timestamp (64) | + | | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | | + | Transmit Timestamp (64) | + | | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Key Identifier (optional) (32) | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | | + | | + | Message Digest (optional) (128) | + | | + | | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + ----------------------------------------------------------------------------- + + NTP Timestamp Format (as described in RFC 2030) + 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Seconds | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Seconds Fraction (0-padded) | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + + + + + Connect to the time server + + + + + Defines a trading operation respond bundle + + + + + Respond operation state + + + + + Respond message + + + + + Respond order id + + + + + Provides VA calculation parameters + + + + + Provides VA calculation request per + + + + + Summary calculated Volume info + + + + + Volume info for each price + + + + + Fire in case of price level was added or existing was updated + + + + + Represent item with Volume Analysis calculation results + + + + + Volume Analysis calculations + + + + + Calculate volume profile for requested time range + + + + + Calculate volume profile for each bar in History Data + + + + + Calculate volume profile for requested time range + + + + + Calculate volume profile for each bar in History Data + + + + + + + + + + + + + + diff --git a/.github/chatmodes/Beast mode.chatmode.md b/.github/chatmodes/Beast mode.chatmode.md index e1798c38..56b6c776 100644 --- a/.github/chatmodes/Beast mode.chatmode.md +++ b/.github/chatmodes/Beast mode.chatmode.md @@ -1,51 +1,51 @@ -*Act:** meticulous auto-agent; finish fully—no early stop. -Cycle: State→Do→Verify→Iterate→Validate. -Style: concise, exact, verifiable. - -### 🧰 Tool Roles -| Tool | Purpose | -|------|----------| -| **seq-think-mcp** | plan & decompose tasks | -| **tavily-mcp** | fresh info, web/news search | -| **ref-tools-mcp** | lib/framework specs | -| **wolfram-mcp** | math/logic/symbolic verify | -| **git-mcp** | code/docs search, lint, commit rules | -| **qdrant-mcp** | long-term memory (no secrets) | - -Fallback: search→tavily→ref→git | plan→seq | calc→wolfram | persist→qdrant. - -### ⚙️ Workflow -1️⃣ **Recall/Discover:** qdrant for mem, tavily/ref/wolfram for current info. -2️⃣ **Analyze:** define expected, edges, deps, pitfalls; plan via seq-think. -3️⃣ **Investigate:** git search→read context→root cause; log in qdrant. -4️⃣ **Research:** tavily search→extract; ref-tools for stds; git for docs; recurse; save refs. -5️⃣ **Plan:** seq-think build TODO (emoji status); store in qdrant. -6️⃣ **Implement:** small testable edits; read ≤2k lines; make `.env` if missing. -7️⃣ **Debug:** logs/probes; fix root; reverify each step. -8️⃣ **Test:** run per change; add edges; repeat till pass. -9️⃣ **Validate:** confirm intent; hidden tests; math check via wolfram. -🔟 **Memorize:** store verified facts `{text,meta:{src,proj,date,tags}}` → qdrant; tag old deprecated. - -### 💬 Comm -Speak clear, brief, pro-casual. -Use bullets/code; no filler. -Write direct to files; show only if asked. - -### 🪶 Git Policy -No auto-commit—only on user cmd. -Before commit: -1) verify scope/tests ✔ -2) check rules via git + qdrant ✔ -3) `git add` → `git commit -m ""` -Msg: subj ≤50ch, imperative; body ≤72ch what/why; footer refs/trailers. -Checklist: concise ✔ why ✔ refs ✔ style ✔ tests ✔ - -### ⚠️ Error Handling -If unclear → reverify (tavily/ref). -Math gap → wolfram. -Missing ctx → qdrant. -Multi-path → seq-think fork. - -### ✅ Goal -Deliver complete, tested, verified soln; persist in qdrant. -Loop: Plan→Exec→Verify→Persist→Confirm. +*Act:** meticulous auto-agent; finish fully—no early stop. +Cycle: State→Do→Verify→Iterate→Validate. +Style: concise, exact, verifiable. + +### 🧰 Tool Roles +| Tool | Purpose | +|------|----------| +| **seq-think-mcp** | plan & decompose tasks | +| **tavily-mcp** | fresh info, web/news search | +| **ref-tools-mcp** | lib/framework specs | +| **wolfram-mcp** | math/logic/symbolic verify | +| **git-mcp** | code/docs search, lint, commit rules | +| **qdrant-mcp** | long-term memory (no secrets) | + +Fallback: search→tavily→ref→git | plan→seq | calc→wolfram | persist→qdrant. + +### ⚙️ Workflow +1️⃣ **Recall/Discover:** qdrant for mem, tavily/ref/wolfram for current info. +2️⃣ **Analyze:** define expected, edges, deps, pitfalls; plan via seq-think. +3️⃣ **Investigate:** git search→read context→root cause; log in qdrant. +4️⃣ **Research:** tavily search→extract; ref-tools for stds; git for docs; recurse; save refs. +5️⃣ **Plan:** seq-think build TODO (emoji status); store in qdrant. +6️⃣ **Implement:** small testable edits; read ≤2k lines; make `.env` if missing. +7️⃣ **Debug:** logs/probes; fix root; reverify each step. +8️⃣ **Test:** run per change; add edges; repeat till pass. +9️⃣ **Validate:** confirm intent; hidden tests; math check via wolfram. +🔟 **Memorize:** store verified facts `{text,meta:{src,proj,date,tags}}` → qdrant; tag old deprecated. + +### 💬 Comm +Speak clear, brief, pro-casual. +Use bullets/code; no filler. +Write direct to files; show only if asked. + +### 🪶 Git Policy +No auto-commit—only on user cmd. +Before commit: +1) verify scope/tests ✔ +2) check rules via git + qdrant ✔ +3) `git add` → `git commit -m ""` +Msg: subj ≤50ch, imperative; body ≤72ch what/why; footer refs/trailers. +Checklist: concise ✔ why ✔ refs ✔ style ✔ tests ✔ + +### ⚠️ Error Handling +If unclear → reverify (tavily/ref). +Math gap → wolfram. +Missing ctx → qdrant. +Multi-path → seq-think fork. + +### ✅ Goal +Deliver complete, tested, verified soln; persist in qdrant. +Loop: Plan→Exec→Verify→Persist→Confirm. diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml index e69f298e..c06bcf13 100644 --- a/.github/codeql/codeql-config.yml +++ b/.github/codeql/codeql-config.yml @@ -1,22 +1,22 @@ -name: "CodeQL Config" - -queries: - - uses: security-and-quality - - uses: security-extended - -paths-ignore: - - '**/test/**' - - '**/tests/**' - - '**/*.test.cs' - - '**/obj/**' - - '**/bin/**' - - '**/docs/**' - -query-filters: - - exclude: - problem.severity: - - warning - - recommendation - -paths: +name: "CodeQL Config" + +queries: + - uses: security-and-quality + - uses: security-extended + +paths-ignore: + - '**/test/**' + - '**/tests/**' + - '**/*.test.cs' + - '**/obj/**' + - '**/bin/**' + - '**/docs/**' + +query-filters: + - exclude: + problem.severity: + - warning + - recommendation + +paths: - src \ No newline at end of file diff --git a/.github/copilot-instructions.md.backup b/.github/copilot-instructions.md.backup index 8b320b78..e9345c0b 100644 --- a/.github/copilot-instructions.md.backup +++ b/.github/copilot-instructions.md.backup @@ -1,222 +1,222 @@ -# QuanTAlib AI Coding Agent Instructions - -## Project Overview -QuanTAlib is a high-performance C# library for quantitative technical analysis, targeting .NET 8.0 with real-time streaming data processing. The library provides 50+ technical indicators optimized for sub-millisecond calculations using circular buffers, SIMD operations, and event-driven architecture. - -## Critical Architecture Patterns - -### Core Data Flow -All indicators inherit from `AbstractBase` (in `lib/core/abstractBase.cs`) which implements `ITValue`: -```csharp -// Standard indicator lifecycle: -Input → Calc() → ManageState(isNew) → Calculation() → Process() → Pub event -``` - -**Key insight**: The `isNew` parameter distinguishes between new bars and updates to the last bar. Indicators must support both modes - this is tested extensively in `Tests/test_updates_*.cs`. - -### Circular Buffer Pattern -`CircularBuffer` (in `lib/core/circularbuffer.cs`) is the foundation for memory-efficient fixed-capacity storage: -- Never grows beyond initial capacity -- O(1) add/access operations -- SIMD-optimized aggregations (Sum, Min, Max, Average) -- **Critical**: Always use `Add(item, isNew)` - the `isNew` flag controls whether to append or update - -### State Management in Indicators -Every indicator must implement: -```csharp -protected override void ManageState(bool isNew) -{ - if (isNew) { - _index++; - _p_prevValue = _prevValue; // Backup state - } else { - _prevValue = _p_prevValue; // Restore state - } -} -``` -This allows bar updates without corrupting historical calculations. - -## Development Workflow - -### MCP-Orchestrated Process -**Research Gate**: Before implementing non-trivial indicators, use Context7 to retrieve authoritative formulas/references. Embed citation tags in PR descriptions. - -**Decomposition**: Use Sequential-Thinking for complex multi-stage work (SIMD refactors, multi-timeframe logic). - -**Task Tracking**: Taskmaster holds the canonical task graph. Feature branches follow pattern: `feature/{taskId}-{slug}`. - -**Quality Gates**: -1. Formula citation required for non-trivial indicators (Context7 tag) -2. Benchmark data required for performance-related changes -3. Taskmaster task IDs must be referenced in PRs -4. Update `memory-bank/progress.md` after merge when threshold met - -### Build & Test Commands -```powershell -# Build solution -dotnet build QuanTAlib.sln - -# Run all tests -dotnet test --no-build - -# Run with coverage -dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov - -# Build using tasks.json -# Use Run Task: "build" or "test" -``` - -### Adding a New Indicator -1. **Research**: Get formula/specification (Context7 if needed) -2. **Location**: Place in appropriate `lib/` subdirectory (averages, oscillators, momentum, volatility, volume, statistics) -3. **Template structure**: -```csharp -using System.Runtime.CompilerServices; -namespace QuanTAlib; - -[SkipLocalsInit] -public sealed class MyIndicator : AbstractBase -{ - private CircularBuffer _buffer; - private double _prevValue, _p_prevValue; // State + backup - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public MyIndicator(int period) - { - ArgumentOutOfRangeException.ThrowIfLessThan(period, 1); - _buffer = new(period); - WarmupPeriod = period; // Set when indicator stabilizes - Name = $"MyIndicator({period})"; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected override void ManageState(bool isNew) - { - if (isNew) { - _index++; - _p_prevValue = _prevValue; - } else { - _prevValue = _p_prevValue; - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] - protected override double Calculation() - { - ManageState(Input.IsNew); - _buffer.Add(Input.Value, Input.IsNew); - // Implement calculation logic - return result; - } -} -``` - -4. **Testing**: Create update test in `Tests/test_updates_*.cs`: -```csharp -[Fact] -public void MyIndicator_Update() -{ - var indicator = new MyIndicator(period: 14); - TestTValueUpdate(indicator, indicator.Calc); -} -``` - -### Quantower Integration -For platform indicators in `quantower/`, create wrapper classes inheriting from Quantower's `Indicator`: -- Use private `lib/` indicator instances -- Map `OnUpdate()` to indicator's `Calc()` method -- Extract output fields (e.g., `ma`, `jmaUp`, `jmaLo`) from indicator state - -## Code Style Requirements - -### Performance First -- Use `[MethodImpl(MethodImplOptions.AggressiveInlining)]` for hot paths -- Use `[MethodImpl(MethodImplOptions.AggressiveOptimization)]` for calculation methods -- Apply `[SkipLocalsInit]` to indicator classes -- Prefer SIMD operations in `CircularBuffer` for aggregations -- Minimize allocations in `Calculation()` methods - -### C# Conventions -- **No inline comments** within methods - code should be self-documenting -- Use XML doc comments for public APIs only -- PascalCase for public members, _camelCase for private fields -- Compact code - minimal whitespace between logical blocks -- Latest C# features: `ArgumentOutOfRangeException.ThrowIfLessThan`, pattern matching, etc. - -### Project Settings -- `LangVersion: preview` - use cutting-edge C# features -- `AllowUnsafeBlocks: true` - SIMD and unsafe operations permitted -- `Nullable: enable` - strict nullability checking -- Target: `net8.0` - -## Key Files & Directories - -### Core Library Structure -``` -lib/ -├── core/ # AbstractBase, CircularBuffer, TSeries, TBar, TValue -├── averages/ # Moving averages (SMA, EMA, DEMA, TEMA, JMA, etc.) -├── oscillators/ # RSI, Stochastic, Williams %R, CCI, Fisher -├── momentum/ # MACD, ADX, ROC, Vortex -├── volatility/ # ATR, Bollinger Bands, volatility measures -├── volume/ # Volume-based indicators -└── statistics/ # Statistical measures, correlations -``` - -### Critical Reference Files -- `lib/core/abstractBase.cs` - Base class for all indicators -- `lib/core/circularbuffer.cs` - Memory-efficient storage with SIMD -- `Directory.Build.props` - Solution-wide MSBuild properties -- `memory-bank/systemPatterns.md` - Architecture patterns -- `memory-bank/activeContext.md` - Current work focus and MCP policies -- `memory-bank/progress.md` - Completed features and roadmap - -### Testing Reference -- `Tests/test_updates_*.cs` - Update behavior validation (IsNew handling) -- `Tests/test_quantower.cs` - Quantower integration validation -- `Tests/test_talib.cs`, `test_Trady.cs` - Cross-validation against reference libraries - -## Common Patterns - -### Multi-Stage Smoothing -Many indicators (DEMA, TEMA, MACD) use cascaded smoothing: -```csharp -private readonly Ema _ema1; -private readonly Ema _ema2; - -_ema1.Calc(Input.Value, Input.IsNew); -_ema2.Calc(_ema1.Value, Input.IsNew); -``` - -### Bar-Based vs Value-Based -- **Value-based**: Accept `TValue`, process single values (most indicators) -- **Bar-based**: Accept `TBar` (OHLCV), process bar data (ATR, Stochastic, volume indicators) - -Override appropriate `Calc()` method: -```csharp -public override TValue Calc(TBar barInput) { /* ... */ } -``` - -### WarmupPeriod Calculation -Set `WarmupPeriod` to indicate when the indicator reaches 95% accuracy: -```csharp -WarmupPeriod = (int)Math.Ceiling(Math.Log(0.05) / Math.Log(1 - alpha)); -``` - -## Validation Strategy -1. **Update tests**: Verify `isNew=false` behavior converges to `isNew=true` with same final value -2. **Reference comparison**: Validate against TALib, Trady, or Skender implementations -3. **Edge cases**: Test with insufficient data (< period), NaN/Infinity, extreme values -4. **Performance**: Benchmark calculation time - target < 0.5ms per update - -## Documentation Requirements -- XML docs on public classes/methods describing purpose, formula, and sources -- Mathematical formulas in doc comments with source citations -- No internal comments - let code structure communicate intent -- Update `memory-bank/progress.md` after significant feature completion - -## GitVersion & Releases -- Semantic versioning via GitVersion.yml -- Version properties auto-injected: `$(GitVersion_MajorMinorPatch)` -- Commit messages influence version bumps (conventional commits) -- Build creates NuGet package with embedded version metadata +# QuanTAlib AI Coding Agent Instructions + +## Project Overview +QuanTAlib is a high-performance C# library for quantitative technical analysis, targeting .NET 8.0 with real-time streaming data processing. The library provides 50+ technical indicators optimized for sub-millisecond calculations using circular buffers, SIMD operations, and event-driven architecture. + +## Critical Architecture Patterns + +### Core Data Flow +All indicators inherit from `AbstractBase` (in `lib/core/abstractBase.cs`) which implements `ITValue`: +```csharp +// Standard indicator lifecycle: +Input → Calc() → ManageState(isNew) → Calculation() → Process() → Pub event +``` + +**Key insight**: The `isNew` parameter distinguishes between new bars and updates to the last bar. Indicators must support both modes - this is tested extensively in `Tests/test_updates_*.cs`. + +### Circular Buffer Pattern +`CircularBuffer` (in `lib/core/circularbuffer.cs`) is the foundation for memory-efficient fixed-capacity storage: +- Never grows beyond initial capacity +- O(1) add/access operations +- SIMD-optimized aggregations (Sum, Min, Max, Average) +- **Critical**: Always use `Add(item, isNew)` - the `isNew` flag controls whether to append or update + +### State Management in Indicators +Every indicator must implement: +```csharp +protected override void ManageState(bool isNew) +{ + if (isNew) { + _index++; + _p_prevValue = _prevValue; // Backup state + } else { + _prevValue = _p_prevValue; // Restore state + } +} +``` +This allows bar updates without corrupting historical calculations. + +## Development Workflow + +### MCP-Orchestrated Process +**Research Gate**: Before implementing non-trivial indicators, use Context7 to retrieve authoritative formulas/references. Embed citation tags in PR descriptions. + +**Decomposition**: Use Sequential-Thinking for complex multi-stage work (SIMD refactors, multi-timeframe logic). + +**Task Tracking**: Taskmaster holds the canonical task graph. Feature branches follow pattern: `feature/{taskId}-{slug}`. + +**Quality Gates**: +1. Formula citation required for non-trivial indicators (Context7 tag) +2. Benchmark data required for performance-related changes +3. Taskmaster task IDs must be referenced in PRs +4. Update `memory-bank/progress.md` after merge when threshold met + +### Build & Test Commands +```powershell +# Build solution +dotnet build QuanTAlib.sln + +# Run all tests +dotnet test --no-build + +# Run with coverage +dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov + +# Build using tasks.json +# Use Run Task: "build" or "test" +``` + +### Adding a New Indicator +1. **Research**: Get formula/specification (Context7 if needed) +2. **Location**: Place in appropriate `lib/` subdirectory (averages, oscillators, momentum, volatility, volume, statistics) +3. **Template structure**: +```csharp +using System.Runtime.CompilerServices; +namespace QuanTAlib; + +[SkipLocalsInit] +public sealed class MyIndicator : AbstractBase +{ + private CircularBuffer _buffer; + private double _prevValue, _p_prevValue; // State + backup + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public MyIndicator(int period) + { + ArgumentOutOfRangeException.ThrowIfLessThan(period, 1); + _buffer = new(period); + WarmupPeriod = period; // Set when indicator stabilizes + Name = $"MyIndicator({period})"; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override void ManageState(bool isNew) + { + if (isNew) { + _index++; + _p_prevValue = _prevValue; + } else { + _prevValue = _p_prevValue; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] + protected override double Calculation() + { + ManageState(Input.IsNew); + _buffer.Add(Input.Value, Input.IsNew); + // Implement calculation logic + return result; + } +} +``` + +4. **Testing**: Create update test in `Tests/test_updates_*.cs`: +```csharp +[Fact] +public void MyIndicator_Update() +{ + var indicator = new MyIndicator(period: 14); + TestTValueUpdate(indicator, indicator.Calc); +} +``` + +### Quantower Integration +For platform indicators in `quantower/`, create wrapper classes inheriting from Quantower's `Indicator`: +- Use private `lib/` indicator instances +- Map `OnUpdate()` to indicator's `Calc()` method +- Extract output fields (e.g., `ma`, `jmaUp`, `jmaLo`) from indicator state + +## Code Style Requirements + +### Performance First +- Use `[MethodImpl(MethodImplOptions.AggressiveInlining)]` for hot paths +- Use `[MethodImpl(MethodImplOptions.AggressiveOptimization)]` for calculation methods +- Apply `[SkipLocalsInit]` to indicator classes +- Prefer SIMD operations in `CircularBuffer` for aggregations +- Minimize allocations in `Calculation()` methods + +### C# Conventions +- **No inline comments** within methods - code should be self-documenting +- Use XML doc comments for public APIs only +- PascalCase for public members, _camelCase for private fields +- Compact code - minimal whitespace between logical blocks +- Latest C# features: `ArgumentOutOfRangeException.ThrowIfLessThan`, pattern matching, etc. + +### Project Settings +- `LangVersion: preview` - use cutting-edge C# features +- `AllowUnsafeBlocks: true` - SIMD and unsafe operations permitted +- `Nullable: enable` - strict nullability checking +- Target: `net8.0` + +## Key Files & Directories + +### Core Library Structure +``` +lib/ +├── core/ # AbstractBase, CircularBuffer, TSeries, TBar, TValue +├── averages/ # Moving averages (SMA, EMA, DEMA, TEMA, JMA, etc.) +├── oscillators/ # RSI, Stochastic, Williams %R, CCI, Fisher +├── momentum/ # MACD, ADX, ROC, Vortex +├── volatility/ # ATR, Bollinger Bands, volatility measures +├── volume/ # Volume-based indicators +└── statistics/ # Statistical measures, correlations +``` + +### Critical Reference Files +- `lib/core/abstractBase.cs` - Base class for all indicators +- `lib/core/circularbuffer.cs` - Memory-efficient storage with SIMD +- `Directory.Build.props` - Solution-wide MSBuild properties +- `memory-bank/systemPatterns.md` - Architecture patterns +- `memory-bank/activeContext.md` - Current work focus and MCP policies +- `memory-bank/progress.md` - Completed features and roadmap + +### Testing Reference +- `Tests/test_updates_*.cs` - Update behavior validation (IsNew handling) +- `Tests/test_quantower.cs` - Quantower integration validation +- `Tests/test_talib.cs`, `test_Trady.cs` - Cross-validation against reference libraries + +## Common Patterns + +### Multi-Stage Smoothing +Many indicators (DEMA, TEMA, MACD) use cascaded smoothing: +```csharp +private readonly Ema _ema1; +private readonly Ema _ema2; + +_ema1.Calc(Input.Value, Input.IsNew); +_ema2.Calc(_ema1.Value, Input.IsNew); +``` + +### Bar-Based vs Value-Based +- **Value-based**: Accept `TValue`, process single values (most indicators) +- **Bar-based**: Accept `TBar` (OHLCV), process bar data (ATR, Stochastic, volume indicators) + +Override appropriate `Calc()` method: +```csharp +public override TValue Calc(TBar barInput) { /* ... */ } +``` + +### WarmupPeriod Calculation +Set `WarmupPeriod` to indicate when the indicator reaches 95% accuracy: +```csharp +WarmupPeriod = (int)Math.Ceiling(Math.Log(0.05) / Math.Log(1 - alpha)); +``` + +## Validation Strategy +1. **Update tests**: Verify `isNew=false` behavior converges to `isNew=true` with same final value +2. **Reference comparison**: Validate against TALib, Trady, or Skender implementations +3. **Edge cases**: Test with insufficient data (< period), NaN/Infinity, extreme values +4. **Performance**: Benchmark calculation time - target < 0.5ms per update + +## Documentation Requirements +- XML docs on public classes/methods describing purpose, formula, and sources +- Mathematical formulas in doc comments with source citations +- No internal comments - let code structure communicate intent +- Update `memory-bank/progress.md` after significant feature completion + +## GitVersion & Releases +- Semantic versioning via GitVersion.yml +- Version properties auto-injected: `$(GitVersion_MajorMinorPatch)` +- Commit messages influence version bumps (conventional commits) +- Build creates NuGet package with embedded version metadata diff --git a/.github/workflows/Publish.yml b/.github/workflows/Publish.yml index 417a6093..d5a43f98 100644 --- a/.github/workflows/Publish.yml +++ b/.github/workflows/Publish.yml @@ -1,342 +1,342 @@ -name: Publish Workflow - -on: - push: - paths-ignore: - - '**.md' - - 'docs/**' - - '.gitignore' - - 'LICENSE' - pull_request: - paths-ignore: - - '**.md' - - 'docs/**' - - '.gitignore' - - 'LICENSE' - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - contents: write - pull-requests: read # Allows SonarCloud to decorate PRs with analysis results - security-events: write # Required for CodeQL analysis and uploading SARIF results - -env: - DOTNET_VERSION: '8.x' - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - DOTNET_CLI_TELEMETRY_OPTOUT: true - -jobs: - Code_Coverage: - timeout-minutes: 30 - runs-on: windows-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v4 - with: - dotnet-version: ${{ env.DOTNET_VERSION }} - - - name: Cache NuGet packages - uses: actions/cache@v4 - with: - path: ~/.nuget/packages - key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} - restore-keys: ${{ runner.os }}-nuget- - - - name: Cache dotnet tools - uses: actions/cache@v4 - with: - path: ~/.dotnet/tools - key: ${{ runner.os }}-dotnet-tools-${{ hashFiles('**/*.csproj') }} - - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: 17 - distribution: 'zulu' - - - name: Cache SonarCloud scanner - id: cache-sonar-scanner - uses: actions/cache@v4 - with: - path: .\.sonar\scanner - key: ${{ runner.os }}-sonar-scanner - restore-keys: ${{ runner.os }}-sonar-scanner - - - name: Install dotnet tools - run: | - dotnet tool install JetBrains.dotCover.GlobalTool --global - dotnet tool install dotnet-sonarscanner --global - dotnet tool install dotnet-coverage --global - dotnet tool install --global coverlet.console - dotnet tool install --global dotnet-reportgenerator-globaltool - dotnet restore - - - name: Begin SonarCloud Analysis - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - shell: powershell - run: | - dotnet sonarscanner begin /k:"mihakralj_QuanTAlib" /o:"mihakralj-quantalib" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" ` - /d:sonar.solution.file="QuanTAlib.sln" ` - /d:sonar.cs.opencover.reportsPaths="**/*cover*.xml" ` - /d:sonar.cs.dotcover.reportsPaths="**/dotcover.xml" ` - /d:sonar.coverage.exclusions="**Tests.cs,**/*.md,**/*.html,**/*.css,**/docs/**/*,**/archive/**/*,**/notebooks/**/*,**/obj/**/*,**/bin/**/*" ` - /d:sonar.exclusions="**/TestResults/**/*,**/bin/**/*,**/obj/**/*,**/*.html,**/coverage/**/*,**/CoverageReport/**/*,**/*.md,**/*.css,**/docs/**/*,**/archive/**/*,**/notebooks/**/*" ` - /d:sonar.test.exclusions="**Tests.cs,**/obj/**/*,**/bin/**/*" ` - /d:sonar.cpd.exclusions="**Tests.cs" ` - /d:sonar.scanner.scanAll="false" ` - /d:sonar.cs.roslyn.ignoreIssues="false" ` - /d:sonar.issue.ignore.multicriteria="e1" ` - /d:sonar.issue.ignore.multicriteria.e1.ruleKey="csharpsquid:S1944,csharpsquid:S2053,csharpsquid:S2222,csharpsquid:S2259,csharpsquid:S2583,csharpsquid:S2589,csharpsquid:S3329,csharpsquid:S3655,csharpsquid:S3900,csharpsquid:S3949,csharpsquid:S3966,csharpsquid:S4158,csharpsquid:S4347,csharpsquid:S5773,csharpsquid:S6781" ` - /d:sonar.issue.ignore.multicriteria.e1.resourceKey="**/*.cs" ` - /d:sonar.verbose="true" - - - name: Build Projects - id: build - continue-on-error: true - run: | - dotnet build --no-restore --configuration Debug - dotnet build ./lib/quantalib.csproj --configuration Release --nologo - dotnet build ./quantower/Averages/_Averages.csproj --configuration Release --nologo - dotnet build ./quantower/Statistics/_Statistics.csproj --configuration Release --nologo - dotnet build ./quantower/Volatility/_Volatility.csproj --configuration Release --nologo - dotnet build ./SyntheticVendor/SyntheticVendor.csproj --configuration Release --nologo - if ($LASTEXITCODE -ne 0) { Write-Error "Build failed" } - - - name: Check Build Status - if: steps.build.outcome == 'failure' - run: exit 1 - - - name: Run Tests with Coverage - id: tests - continue-on-error: true - run: | - dotnet test --no-build --configuration Debug /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - dotnet-coverage collect "dotnet test" -f xml -o "coverage.xml" - dotnet dotcover test Tests/Tests.csproj --dcReportType=HTML --dcoutput=./dotcover.html - dotnet dotcover test Tests/Tests.csproj --dcReportType=DetailedXML --dcoutput=./dotcover.xml --verbosity=Detailed - dotnet test -p:CollectCoverage=true --collect:"XPlat Code Coverage" --results-directory "./" - - - name: Generate Coverage Report - run: | - reportgenerator -reports:*cover*.xml -targetdir:./coverage-report - - - name: Upload Coverage Reports - if: always() - uses: actions/upload-artifact@v4 - with: - name: coverage-reports - path: | - **/TestResults - **/coverage-report - **/*cover*.xml - **/dotcover.* - - - name: End SonarCloud Analysis - if: always() - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - shell: powershell - run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" - - - name: Upload Coverage to Codacy - uses: codacy/codacy-coverage-reporter-action@v1 - with: - project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} - coverage-reports: '*cover*.xml' - - - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v4 - with: - files: 'cover*' - verbose: true - - CodeQL: - timeout-minutes: 30 - runs-on: ubuntu-latest - permissions: - security-events: write - actions: read - contents: read - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v4 - with: - dotnet-version: ${{ env.DOTNET_VERSION }} - - - name: Cache NuGet packages - uses: actions/cache@v4 - with: - path: ~/.nuget/packages - key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} - restore-keys: ${{ runner.os }}-nuget- - - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: 'csharp' - queries: security-and-quality - config-file: ./.github/codeql/codeql-config.yml - tools: linked - - - name: Restore dependencies - run: dotnet restore - - - name: Build - run: dotnet build --no-restore --configuration Debug - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - output: results - upload: true - - - name: Run Snyk to check for vulnerabilities - uses: snyk/actions/dotnet@master - continue-on-error: true - env: - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} - LD_PRELOAD: '' # Clear the LD_PRELOAD to avoid CodeQL conflicts - with: - args: | - --file=./lib/quantalib.csproj - --severity-threshold=low - --detection-depth=4 - --package-manager=nuget - - - name: Run Snyk on Solution - uses: snyk/actions/dotnet@master - if: always() - continue-on-error: true - env: - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} - LD_PRELOAD: '' - with: - args: | - --file=QuanTAlib.sln - --all-projects - --detection-depth=4 - - - name: Run Snyk IaC - uses: snyk/actions/iac@master - continue-on-error: true - env: - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} - LD_PRELOAD: '' - with: - args: | - --severity-threshold=low - - build_publish: - timeout-minutes: 20 - needs: [Code_Coverage, CodeQL] - if: | - success() && - (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev')) || - github.event_name == 'workflow_dispatch' - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v4 - with: - dotnet-version: ${{ env.DOTNET_VERSION }} - - - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0 - with: - versionSpec: '6.x' - includePrerelease: true - - - name: Determine Version - id: gitversion - uses: gittools/actions/gitversion/execute@v0 - with: - useConfigFile: true - updateAssemblyInfo: false - - - name: Cache NuGet packages - uses: actions/cache@v4 - with: - path: ~/.nuget/packages - key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} - restore-keys: ${{ runner.os }}-nuget- - - - name: Build projects - run: | - dotnet restore - dotnet build ./lib/quantalib.csproj --configuration Release --nologo - dotnet build ./quantower/Averages/_Averages.csproj --configuration Release --nologo - dotnet build ./quantower/Statistics/_Statistics.csproj --configuration Release --nologo - dotnet build ./quantower/Volatility/_Volatility.csproj --configuration Release --nologo - dotnet build ./SyntheticVendor/SyntheticVendor.csproj --configuration Release --nologo - - - name: Create or Update Development Release - if: github.ref == 'refs/heads/dev' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh release delete development --yes || true - gh release create development \ - --title "Development Build" \ - --notes "Latest development build from commit ${{ github.sha }}" \ - --prerelease \ - --target ${{ github.sha }} \ - lib/bin/Release/QuanTAlib.dll \ - quantower/Averages/bin/Release/Averages.dll \ - quantower/Statistics/bin/Release/Statistics.dll \ - quantower/Volatility/bin/Release/Volatility.dll \ - SyntheticVendor/bin/Release/SyntheticVendor.dll - - - name: Push prerelease package to myget.org - if: github.ref == 'refs/heads/dev' - continue-on-error: true - id: myget-push - run: | - dotnet nuget push 'lib/bin/Release/QuanTAlib.*.nupkg' \ - --source https://www.myget.org/F/quantalib/api/v3/index.json \ - --force-english-output \ - --api-key ${{ secrets.MYGET_DEPLOY_KEY_QUANTALIB }} - - - name: Create GitHub Release - if: github.ref == 'refs/heads/main' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh release create v${{ steps.gitversion.outputs.MajorMinorPatch }} \ - --title "Release from commit ${{ steps.gitversion.outputs.MajorMinorPatch }}" \ - --notes "Release notes for this version." \ - quantower/Averages/bin/Release/Averages.dll \ - quantower/Statistics/bin/Release/Statistics.dll \ - quantower/Volatility/bin/Release/Volatility.dll \ - SyntheticVendor/bin/Release/SyntheticVendor.dll - - - name: Push release package to nuget.org - if: ${{ github.ref == 'refs/heads/main' }} - run: | - dotnet nuget push 'lib/bin/Release/QuanTAlib.*.nupkg' \ - --source https://api.nuget.org/v3/index.json \ - --skip-duplicate \ - --api-key ${{ secrets.NUGET_DEPLOY_KEY_QUANTLIB }} +name: Publish Workflow + +on: + push: + paths-ignore: + - '**.md' + - 'docs/**' + - '.gitignore' + - 'LICENSE' + pull_request: + paths-ignore: + - '**.md' + - 'docs/**' + - '.gitignore' + - 'LICENSE' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: write + pull-requests: read # Allows SonarCloud to decorate PRs with analysis results + security-events: write # Required for CodeQL analysis and uploading SARIF results + +env: + DOTNET_VERSION: '8.x' + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + DOTNET_CLI_TELEMETRY_OPTOUT: true + +jobs: + Code_Coverage: + timeout-minutes: 30 + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Cache NuGet packages + uses: actions/cache@v4 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} + restore-keys: ${{ runner.os }}-nuget- + + - name: Cache dotnet tools + uses: actions/cache@v4 + with: + path: ~/.dotnet/tools + key: ${{ runner.os }}-dotnet-tools-${{ hashFiles('**/*.csproj') }} + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: 'zulu' + + - name: Cache SonarCloud scanner + id: cache-sonar-scanner + uses: actions/cache@v4 + with: + path: .\.sonar\scanner + key: ${{ runner.os }}-sonar-scanner + restore-keys: ${{ runner.os }}-sonar-scanner + + - name: Install dotnet tools + run: | + dotnet tool install JetBrains.dotCover.GlobalTool --global + dotnet tool install dotnet-sonarscanner --global + dotnet tool install dotnet-coverage --global + dotnet tool install --global coverlet.console + dotnet tool install --global dotnet-reportgenerator-globaltool + dotnet restore + + - name: Begin SonarCloud Analysis + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + shell: powershell + run: | + dotnet sonarscanner begin /k:"mihakralj_QuanTAlib" /o:"mihakralj-quantalib" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" ` + /d:sonar.solution.file="QuanTAlib.sln" ` + /d:sonar.cs.opencover.reportsPaths="**/*cover*.xml" ` + /d:sonar.cs.dotcover.reportsPaths="**/dotcover.xml" ` + /d:sonar.coverage.exclusions="**Tests.cs,**/*.md,**/*.html,**/*.css,**/docs/**/*,**/archive/**/*,**/notebooks/**/*,**/obj/**/*,**/bin/**/*" ` + /d:sonar.exclusions="**/TestResults/**/*,**/bin/**/*,**/obj/**/*,**/*.html,**/coverage/**/*,**/CoverageReport/**/*,**/*.md,**/*.css,**/docs/**/*,**/archive/**/*,**/notebooks/**/*" ` + /d:sonar.test.exclusions="**Tests.cs,**/obj/**/*,**/bin/**/*" ` + /d:sonar.cpd.exclusions="**Tests.cs" ` + /d:sonar.scanner.scanAll="false" ` + /d:sonar.cs.roslyn.ignoreIssues="false" ` + /d:sonar.issue.ignore.multicriteria="e1" ` + /d:sonar.issue.ignore.multicriteria.e1.ruleKey="csharpsquid:S1944,csharpsquid:S2053,csharpsquid:S2222,csharpsquid:S2259,csharpsquid:S2583,csharpsquid:S2589,csharpsquid:S3329,csharpsquid:S3655,csharpsquid:S3900,csharpsquid:S3949,csharpsquid:S3966,csharpsquid:S4158,csharpsquid:S4347,csharpsquid:S5773,csharpsquid:S6781" ` + /d:sonar.issue.ignore.multicriteria.e1.resourceKey="**/*.cs" ` + /d:sonar.verbose="true" + + - name: Build Projects + id: build + continue-on-error: true + run: | + dotnet build --no-restore --configuration Debug + dotnet build ./lib/quantalib.csproj --configuration Release --nologo + dotnet build ./quantower/Averages/_Averages.csproj --configuration Release --nologo + dotnet build ./quantower/Statistics/_Statistics.csproj --configuration Release --nologo + dotnet build ./quantower/Volatility/_Volatility.csproj --configuration Release --nologo + dotnet build ./SyntheticVendor/SyntheticVendor.csproj --configuration Release --nologo + if ($LASTEXITCODE -ne 0) { Write-Error "Build failed" } + + - name: Check Build Status + if: steps.build.outcome == 'failure' + run: exit 1 + + - name: Run Tests with Coverage + id: tests + continue-on-error: true + run: | + dotnet test --no-build --configuration Debug /p:CollectCoverage=true /p:CoverletOutputFormat=opencover + dotnet-coverage collect "dotnet test" -f xml -o "coverage.xml" + dotnet dotcover test Tests/Tests.csproj --dcReportType=HTML --dcoutput=./dotcover.html + dotnet dotcover test Tests/Tests.csproj --dcReportType=DetailedXML --dcoutput=./dotcover.xml --verbosity=Detailed + dotnet test -p:CollectCoverage=true --collect:"XPlat Code Coverage" --results-directory "./" + + - name: Generate Coverage Report + run: | + reportgenerator -reports:*cover*.xml -targetdir:./coverage-report + + - name: Upload Coverage Reports + if: always() + uses: actions/upload-artifact@v4 + with: + name: coverage-reports + path: | + **/TestResults + **/coverage-report + **/*cover*.xml + **/dotcover.* + + - name: End SonarCloud Analysis + if: always() + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + shell: powershell + run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" + + - name: Upload Coverage to Codacy + uses: codacy/codacy-coverage-reporter-action@v1 + with: + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + coverage-reports: '*cover*.xml' + + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v4 + with: + files: 'cover*' + verbose: true + + CodeQL: + timeout-minutes: 30 + runs-on: ubuntu-latest + permissions: + security-events: write + actions: read + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Cache NuGet packages + uses: actions/cache@v4 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} + restore-keys: ${{ runner.os }}-nuget- + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: 'csharp' + queries: security-and-quality + config-file: ./.github/codeql/codeql-config.yml + tools: linked + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --no-restore --configuration Debug + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + output: results + upload: true + + - name: Run Snyk to check for vulnerabilities + uses: snyk/actions/dotnet@master + continue-on-error: true + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + LD_PRELOAD: '' # Clear the LD_PRELOAD to avoid CodeQL conflicts + with: + args: | + --file=./lib/quantalib.csproj + --severity-threshold=low + --detection-depth=4 + --package-manager=nuget + + - name: Run Snyk on Solution + uses: snyk/actions/dotnet@master + if: always() + continue-on-error: true + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + LD_PRELOAD: '' + with: + args: | + --file=QuanTAlib.sln + --all-projects + --detection-depth=4 + + - name: Run Snyk IaC + uses: snyk/actions/iac@master + continue-on-error: true + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + LD_PRELOAD: '' + with: + args: | + --severity-threshold=low + + build_publish: + timeout-minutes: 20 + needs: [Code_Coverage, CodeQL] + if: | + success() && + (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev')) || + github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v0 + with: + versionSpec: '6.x' + includePrerelease: true + + - name: Determine Version + id: gitversion + uses: gittools/actions/gitversion/execute@v0 + with: + useConfigFile: true + updateAssemblyInfo: false + + - name: Cache NuGet packages + uses: actions/cache@v4 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} + restore-keys: ${{ runner.os }}-nuget- + + - name: Build projects + run: | + dotnet restore + dotnet build ./lib/quantalib.csproj --configuration Release --nologo + dotnet build ./quantower/Averages/_Averages.csproj --configuration Release --nologo + dotnet build ./quantower/Statistics/_Statistics.csproj --configuration Release --nologo + dotnet build ./quantower/Volatility/_Volatility.csproj --configuration Release --nologo + dotnet build ./SyntheticVendor/SyntheticVendor.csproj --configuration Release --nologo + + - name: Create or Update Development Release + if: github.ref == 'refs/heads/dev' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release delete development --yes || true + gh release create development \ + --title "Development Build" \ + --notes "Latest development build from commit ${{ github.sha }}" \ + --prerelease \ + --target ${{ github.sha }} \ + lib/bin/Release/QuanTAlib.dll \ + quantower/Averages/bin/Release/Averages.dll \ + quantower/Statistics/bin/Release/Statistics.dll \ + quantower/Volatility/bin/Release/Volatility.dll \ + SyntheticVendor/bin/Release/SyntheticVendor.dll + + - name: Push prerelease package to myget.org + if: github.ref == 'refs/heads/dev' + continue-on-error: true + id: myget-push + run: | + dotnet nuget push 'lib/bin/Release/QuanTAlib.*.nupkg' \ + --source https://www.myget.org/F/quantalib/api/v3/index.json \ + --force-english-output \ + --api-key ${{ secrets.MYGET_DEPLOY_KEY_QUANTALIB }} + + - name: Create GitHub Release + if: github.ref == 'refs/heads/main' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release create v${{ steps.gitversion.outputs.MajorMinorPatch }} \ + --title "Release from commit ${{ steps.gitversion.outputs.MajorMinorPatch }}" \ + --notes "Release notes for this version." \ + quantower/Averages/bin/Release/Averages.dll \ + quantower/Statistics/bin/Release/Statistics.dll \ + quantower/Volatility/bin/Release/Volatility.dll \ + SyntheticVendor/bin/Release/SyntheticVendor.dll + + - name: Push release package to nuget.org + if: ${{ github.ref == 'refs/heads/main' }} + run: | + dotnet nuget push 'lib/bin/Release/QuanTAlib.*.nupkg' \ + --source https://api.nuget.org/v3/index.json \ + --skip-duplicate \ + --api-key ${{ secrets.NUGET_DEPLOY_KEY_QUANTLIB }} diff --git a/.sonarlint/._QuanTAlib.json b/.sonarlint/._QuanTAlib.json new file mode 100644 index 0000000000000000000000000000000000000000..62309917fc092b44ce531bf39b41b79bdc6fa1b5 GIT binary patch literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vf+zv$ zV3+~K+-O=D5#plB`MG+D1qC^&dId%KWvO|IdC92^j7$t)7L;F~E-P${rgfA%8Umvs zFd71*Aut*OqaiRF0;3@?8UmvsFd71*Aut*O*h2u+*#u!QkPFGkELJE=EzU13N={Ws y%P-1S$jmEA%`3^w&r8h7sZ_{GO)F7I%1O-22KI%ax`s4`>VLRbWEkZB{|5lH?I - - preview - $(NoWarn);NU1903;NU5104;NETSDK1057 - enable - enable - true - en-US - false - true - AnyCPU - True - bin\$(Configuration)\ - False - full - true - true - true - snupkg - AnyCPU - true - - - - true - link - true - true - true - portable - true - true - true - true - true - false - false - false - false - true - false - true - - - - - S1944,S2053,S2222,S2259,S2583,S2589,S3329,S3655,S3900,S3949,S3966,S4158,S4347,S5773,S6781 - - - - - - - - - Z:\Quantower - $([System.IO.Directory]::GetDirectories("$(QuantowerRoot)\TradingPlatform", "v1*")[0]) - - - + + + preview + $(NoWarn);NU1903;NU5104;NETSDK1057 + enable + enable + true + en-US + false + true + AnyCPU + True + bin\$(Configuration)\ + False + full + true + true + true + snupkg + AnyCPU + true + + + + true + link + true + true + true + portable + true + true + true + true + true + false + false + false + false + true + false + true + + + + + S1944,S2053,S2222,S2259,S2583,S2589,S3329,S3655,S3900,S3949,S3966,S4158,S4347,S5773,S6781 + + + + + + + + + Z:\Quantower + $([System.IO.Directory]::GetDirectories("$(QuantowerRoot)\TradingPlatform", "v1*")[0]) + + + diff --git a/GitVersion.yml b/GitVersion.yml index 2f3c6554..2ea209fe 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,26 +1,26 @@ -assembly-versioning-scheme: MajorMinorPatch -assembly-file-versioning-scheme: MajorMinorPatch -major-version-bump-message: '\+semver:\s?(breaking|major)' -minor-version-bump-message: '\+semver:\s?(feature|minor)' -patch-version-bump-message: '\+semver:\s?(fix|patch)' -no-bump-message: '\+semver:\s?(none|skip)' -tag-prefix: '[vV]' -branches: - main: - regex: ^main$ - mode: ContinuousDeployment - increment: Patch - track-merge-target: false - is-release-branch: true - pre-release-weight: 0 - develop: - regex: ^dev(elop)?(ment)?$ - mode: ContinuousDelivery - increment: Patch - track-merge-target: true - is-release-branch: false - source-branches: ['main'] - pre-release-weight: 30000 -ignore: - sha: [] -merge-message-formats: {} +assembly-versioning-scheme: MajorMinorPatch +assembly-file-versioning-scheme: MajorMinorPatch +major-version-bump-message: '\+semver:\s?(breaking|major)' +minor-version-bump-message: '\+semver:\s?(feature|minor)' +patch-version-bump-message: '\+semver:\s?(fix|patch)' +no-bump-message: '\+semver:\s?(none|skip)' +tag-prefix: '[vV]' +branches: + main: + regex: ^main$ + mode: ContinuousDeployment + increment: Patch + track-merge-target: false + is-release-branch: true + pre-release-weight: 0 + develop: + regex: ^dev(elop)?(ment)?$ + mode: ContinuousDelivery + increment: Patch + track-merge-target: true + is-release-branch: false + source-branches: ['main'] + pre-release-weight: 30000 +ignore: + sha: [] +merge-message-formats: {} diff --git a/README.md b/README.md new file mode 100644 index 00000000..2cc2eb0d --- /dev/null +++ b/README.md @@ -0,0 +1,187 @@ +[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=mihakralj_QuanTAlib&metric=ncloc)](https://sonarcloud.io/summary/overall?id=mihakralj_QuanTAlib) +[![Codacy grade](https://img.shields.io/codacy/grade/b1f9109222234c87bce45f1fd4c63aee?style=flat-square)](https://app.codacy.com/gh/mihakralj/QuanTAlib/dashboard) +[![codecov](https://codecov.io/gh/mihakralj/QuanTAlib/branch/main/graph/badge.svg?style=flat-square&token=YNMJRGKMTJ?style=flat-square)](https://codecov.io/gh/mihakralj/QuanTAlib) +[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=mihakralj_QuanTAlib&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=mihakralj_QuanTAlib) +[![CodeFactor](https://www.codefactor.io/repository/github/mihakralj/quantalib/badge/main)](https://www.codefactor.io/repository/github/mihakralj/quantalib/overview/main) + +[![Nuget](https://img.shields.io/nuget/v/QuanTAlib?style=flat-square)](https://www.nuget.org/packages/QuanTAlib/) +![GitHub last commit](https://img.shields.io/github/last-commit/mihakralj/QuanTAlib) +[![Nuget](https://img.shields.io/nuget/dt/QuanTAlib?style=flat-square)](https://www.nuget.org/packages/QuanTAlib/) +[![GitHub watchers](https://img.shields.io/github/watchers/mihakralj/QuanTAlib?style=flat-square)](https://github.com/mihakralj/QuanTAlib/watchers) +[![.NET](https://img.shields.io/badge/.NET-8.0%20|%209.0%20|%2010.0-blue?style=flat-square)](https://dotnet.microsoft.com/en-us/download/dotnet) + +# QuanTAlib - Quantitative Technical Analysis Library + +**Quan**titative **TA** **lib**rary (QuanTAlib) is a high-performance C# library for quantitative technical analysis, designed for [Quantower](https://www.quantower.com/) and other C#-based trading platforms. + +## Key Features + +- **Real-time streaming** - Indicators calculate results from incoming data without re-processing history +- **Update/correction support** - Last value can be recalculated multiple times before advancing to next bar +- **Valid from first bar** - Mathematically correct results from the first value with `IsHot` warmup indicator +- **SIMD-optimized** - Hardware-accelerated vector operations (AVX/SSE) for batch processing +- **Zero-allocation hot paths** - Minimal GC pressure for high-frequency scenarios + +## Architecture + +QuanTAlib uses a **Structure of Arrays (SoA)** memory layout optimized for numerical computing: + +``` +┌─────────────────────────────────────────────────────────────┐ +│ Core Data Types │ +├─────────────────────────────────────────────────────────────┤ +│ TValue (16 bytes) │ Time-value pair (long + double) │ +│ TBar (48 bytes) │ OHLCV bar (long + 5 doubles) │ +│ TSeries │ Time series with SoA layout │ +│ TBarSeries │ OHLCV series with SoA layout │ +└─────────────────────────────────────────────────────────────┘ + +┌─────────────────────────────────────────────────────────────┐ +│ Data Feeds │ +├─────────────────────────────────────────────────────────────┤ +│ IFeed │ Unified feed interface │ +│ GBM │ Geometric Brownian Motion sim │ +│ CsvFeed │ CSV file reader │ +└─────────────────────────────────────────────────────────────┘ + +``` + +### Performance Design + +The SoA layout stores timestamps and values in separate contiguous arrays: + +```csharp +// TSeries internal structure +protected readonly List _t; // Timestamps (contiguous) +protected readonly List _v; // Values (contiguous) + +// Direct SIMD access via Span +ReadOnlySpan values = series.Values; +double avg = values.AverageSIMD(); // Hardware-accelerated +``` + +This enables: +- **Cache locality** - Sequential memory access patterns +- **SIMD vectorization** - Process 4-8 values per CPU instruction +- **Zero-copy access** - `CollectionsMarshal.AsSpan()` exposes internal arrays + +## Quick Start + +### Installation + +```bash +dotnet add package QuanTAlib +``` + +### Basic Usage + +```csharp +using QuanTAlib; + +// Create EMA indicator +var ema = new Ema(period: 10); + +// Streaming mode - process one value at a time +TValue result = ema.Update(new TValue(DateTime.Now, price), isNew: true); + +// Update current bar (e.g., price tick within same minute) +result = ema.Update(new TValue(DateTime.Now, newPrice), isNew: false); + +// Batch mode - process entire series +var series = new TSeries(); +series.Add(prices); // Add historical data +TSeries emaResults = Ema.Calculate(series, period: 10); +``` + +### Multi-Period Analysis with SIMD + +```csharp +// Calculate multiple EMAs in parallel using SIMD +int[] periods = { 9, 12, 26 }; +var emaVector = new EmaVector(periods); + +// Single update calculates all periods +TValue[] results = emaVector.Update(new TValue(time, price)); +Console.WriteLine($"EMA(9)={results[0]}, EMA(12)={results[1]}, EMA(26)={results[2]}"); +``` + +### Using Data Feeds + +```csharp +// Geometric Brownian Motion simulator +var gbm = new GBM(startPrice: 100, mu: 0.05, sigma: 0.2); +TBarSeries bars = gbm.Fetch(count: 1000, DateTime.UtcNow.Ticks, TimeSpan.FromMinutes(1)); + +// CSV file reader +var csv = new CsvFeed("data/daily_IBM.csv"); +TBar bar = csv.Next(isNew: true); +``` + +## Installation to Quantower + +Copy DLL files to Quantower installation: + +``` +\Settings\Scripts\Indicators\QuanTAlib\Averages\Averages.dll +``` + +Where `` is the directory containing `Start.lnk`. + +## Project Structure + +``` +QuanTAlib/ +├── lib/ +│ ├── core/ +│ │ ├── tvalue/ # TValue struct +│ │ ├── tseries/ # TSeries class +│ │ ├── tbar/ # TBar struct +│ │ ├── tbarseries/ # TBarSeries class +│ │ └── simd/ # SIMD extensions +│ ├── averages/ +│ │ └── ema/ # EMA indicator + tests + docs +│ └── feeds/ +│ ├── csv/ # CSV file feed +│ └── gbm/ # GBM simulator +└── quantower/ # Quantower integration +``` + +Each indicator follows a consistent file pattern: +- `Indicator.cs` - Core implementation +- `Indicator.Tests.cs` - Unit tests +- `Indicator.Validation.Tests.cs` - Cross-validation with other libraries +- `Indicator.md` - Documentation +- `Indicator.Notebook.dib` - Interactive notebook +- `Indicator.Quantower.cs` - Quantower wrapper + +## Validation + +QuanTAlib validates results against established TA libraries: + +- [TA-LIB](https://www.ta-lib.org/function.html) - Industry standard C library +- [Skender Stock Indicators](https://dotnet.stockindicators.dev/) - Popular .NET library +- [Tulip Indicators](https://tulipindicators.org/) - High-performance C library + +## Requirements + +- .NET 8.0, 9.0, or 10.0 +- Hardware with AVX/SSE support recommended for optimal SIMD performance + +## License + +Apache License 2.0 - See [LICENSE](LICENSE) for details. + +## Contributing + +Contributions welcome! Each indicator should include: +1. Core implementation with streaming support +2. Unit tests covering edge cases +3. Validation tests against reference libraries +4. Documentation with mathematical formulas +5. Quantower wrapper (optional) + +## Links + +- [GitHub Repository](https://github.com/mihakralj/QuanTAlib) +- [NuGet Package](https://www.nuget.org/packages/QuanTAlib/) +- [Quantower Platform](https://www.quantower.com/) diff --git a/ilspy/TradingPlatform.BusinessLayer.cs b/ilspy/TradingPlatform.BusinessLayer.cs index cd7bbb5d..9e7d536f 100644 --- a/ilspy/TradingPlatform.BusinessLayer.cs +++ b/ilspy/TradingPlatform.BusinessLayer.cs @@ -1,114089 +1,114089 @@ -using System; -using System.Collections; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics; -using System.Diagnostics.Metrics; -using System.Drawing; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Net.Http.Json; -using System.Net.Mail; -using System.Net.NetworkInformation; -using System.Net.Security; -using System.Net.Sockets; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters.Binary; -using System.Runtime.Versioning; -using System.Security.Claims; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Text.Json; -using System.Text.Json.Serialization; -using System.Text.RegularExpressions; -using System.Threading; -using System.Threading.Tasks; -using System.Web; -using System.Windows.Input; -using System.Xml; -using System.Xml.Linq; -using System.Xml.XPath; -using {C306A0DD-1657-4827-8B17-3122184442EB}; -using AuthenticodeExaminer; -using CancelAllOpenOrdersRequests; -using CommandLine; -using FluentFTP; -using IdentityModel.Client; -using IdentityModel.OidcClient; -using IdentityModel.OidcClient.Browser; -using IdentityModel.OidcClient.Results; -using NGettext; -using NGettext.Loaders; -using Platform.Utils; -using ProtoBuf; -using TradingPlatform.BusinessLayer; -using TradingPlatform.BusinessLayer.Abstractions.Misc; -using TradingPlatform.BusinessLayer.Chart; -using TradingPlatform.BusinessLayer.DataBinding; -using TradingPlatform.BusinessLayer.DataBinding.Exceptions; -using TradingPlatform.BusinessLayer.DataBinding.Mvvm; -using TradingPlatform.BusinessLayer.GlobalVariables; -using TradingPlatform.BusinessLayer.History.Aggregations; -using TradingPlatform.BusinessLayer.History.Storage; -using TradingPlatform.BusinessLayer.Integration; -using TradingPlatform.BusinessLayer.Integration.Limitation; -using TradingPlatform.BusinessLayer.Licence; -using TradingPlatform.BusinessLayer.LocalOrders; -using TradingPlatform.BusinessLayer.Media.Messengers; -using TradingPlatform.BusinessLayer.Modules; -using TradingPlatform.BusinessLayer.Modules.PlaceOrderStrategies; -using TradingPlatform.BusinessLayer.Native; -using TradingPlatform.BusinessLayer.PowerTrades; -using TradingPlatform.BusinessLayer.Serialization; -using TradingPlatform.BusinessLayer.Settings.Condition; -using TradingPlatform.BusinessLayer.Settings.OTP; -using TradingPlatform.BusinessLayer.TimeSync; -using TradingPlatform.BusinessLayer.Utils; -using TradingPlatform.BusinessLayer.Utils.Comparers; -using TradingPlatform.BusinessLayer.Utils.EqualityComparers; -using TradingPlatform.BusinessLayer.Utils.Extensions; -using TradingPlatform.BusinessLayer.Utils.Limitation; -using TradingPlatform.BusinessLayer.Utils.Sounds; -using TradingPlatform.BusinessLayer.Utils.Storage; -using TradingPlatform.BusinessLayer.Utils.TaskSchedulers; -using TradingPlatform.BusinessLayer.Utils.TradingProtection; -using TradingPlatform.BusinessLayer.Utils.UserTradesLocalStorage; -using TradingPlatform.BusinessLayer.VolumeAnalysis.Storage; -using ?; - -[assembly: CompilationRelaxations(8)] -[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] -[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] -[assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")] -[assembly: InternalsVisibleTo("TradingPlatform.BusinessLayer.Tests")] -[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] -[assembly: AssemblyCompany("QUANTOWER")] -[assembly: AssemblyConfiguration("Release")] -[assembly: AssemblyCopyright("Copyright cQUANTOWER 2017")] -[assembly: AssemblyFileVersion("1.144.12.0")] -[assembly: AssemblyInformationalVersion("1.144.12+955059d4fca78a19dda63cf80aa2b7a03c9f0221")] -[assembly: AssemblyProduct("Quantower")] -[assembly: AssemblyTitle("TradingPlatform.BusinessLayer")] -[assembly: AssemblyVersion("1.144.12.0")] -[module: RefSafetyRules(11)] -namespace ? -{ - internal static class ? - { - public static string ?(this Assembly P_0) - { - return P_0.?()?.Product; - } - - public static string ?(this Assembly P_0) - { - object obj = P_0.?()?.Version; - if (obj == null) - { - AssemblyFileVersionAttribute assemblyFileVersionAttribute = P_0.?(); - if (assemblyFileVersionAttribute == null) - { - return null; - } - obj = assemblyFileVersionAttribute.Version; - } - return (string)obj; - } - - public static ? ?(this Assembly P_0) where ? : Attribute - { - return P_0.GetCustomAttributes(typeof(?), inherit: false).FirstOrDefault() as ?; - } - } - internal static class ? - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static void ?(Assembly P_0, Assembly P_1) - { - if (P_0.?() != P_1.?()) - { - Environment.Exit(0); - } - if (P_0.?() != P_1.?()) - { - Environment.Exit(0); - } - } - } - internal static class ? - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - internal bool ?(AuthenticodeSignature P_0) - { - return P_0.SigningCertificate.Thumbprint.ToUpper() == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - - internal bool ?(AuthenticodeSignature P_0) - { - return P_0.SigningCertificate.Thumbprint.ToUpper() == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static void ?(string P_0) - { - if (!?(P_0)) - { - Environment.Exit(0); - } - } - - internal static bool ?(string P_0) - { - try - { - FileInspector fileInspector = new FileInspector(P_0); - SignatureCheckResult signatureCheckResult = fileInspector.Validate(); - IEnumerable signatures = fileInspector.GetSignatures(); - if (Path.GetFileName(P_0) == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) - { - if (signatureCheckResult != SignatureCheckResult.Valid) - { - return false; - } - if (!signatures.Any((AuthenticodeSignature authenticodeSignature) => authenticodeSignature.SigningCertificate.Thumbprint.ToUpper() == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - return false; - } - } - else - { - if (signatureCheckResult != SignatureCheckResult.Valid && signatureCheckResult != SignatureCheckResult.UntrustedRoot) - { - return false; - } - if (!signatures.Any((AuthenticodeSignature authenticodeSignature) => authenticodeSignature.SigningCertificate.Thumbprint.ToUpper() == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - return false; - } - } - return true; - } - catch (Exception) - { - return false; - } - } - } -} -namespace Platform.Utils -{ - public static class Encryptor - { - [CompilerGenerated] - private static string ?; - - public static string UnicDeviceId - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = text; - } - } - - internal static string ?(string P_0) - { - if (string.IsNullOrEmpty(P_0)) - { - return P_0; - } - string result = string.Empty; - try - { - using Aes aes = Aes.Create(); - byte[] bytes = Encoding.UTF8.GetBytes(UnicDeviceId); - int count = Math.Min(aes.IV.Length, bytes.Length); - byte[] array = new byte[aes.IV.Length]; - Buffer.BlockCopy(bytes, 0, array, 0, count); - using ICryptoTransform transform = aes.CreateEncryptor(array, aes.IV); - using MemoryStream memoryStream = new MemoryStream(); - using (CryptoStream stream = new CryptoStream(memoryStream, transform, CryptoStreamMode.Write)) - { - using StreamWriter streamWriter = new StreamWriter(stream); - streamWriter.Write(P_0); - } - byte[] iV = aes.IV; - byte[] array2 = memoryStream.ToArray(); - byte[] array3 = new byte[iV.Length + array2.Length]; - Buffer.BlockCopy(iV, 0, array3, 0, iV.Length); - Buffer.BlockCopy(array2, 0, array3, iV.Length, array2.Length); - result = Convert.ToBase64String(array3); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - return result; - } - - internal static string ?(string P_0) - { - if (string.IsNullOrEmpty(P_0)) - { - return P_0; - } - string result = null; - try - { - byte[] array = Convert.FromBase64String(P_0); - using Aes aes = Aes.Create(); - byte[] array2 = new byte[aes.IV.Length]; - byte[] array3 = new byte[array.Length - array2.Length]; - Buffer.BlockCopy(array, 0, array2, 0, array2.Length); - Buffer.BlockCopy(array, array2.Length, array3, 0, array.Length - array2.Length); - byte[] bytes = Encoding.UTF8.GetBytes(UnicDeviceId); - int count = Math.Min(aes.IV.Length, bytes.Length); - byte[] array4 = new byte[aes.IV.Length]; - Buffer.BlockCopy(bytes, 0, array4, 0, count); - using ICryptoTransform transform = aes.CreateDecryptor(array4, array2); - using MemoryStream stream = new MemoryStream(array3); - using CryptoStream stream2 = new CryptoStream(stream, transform, CryptoStreamMode.Read); - using StreamReader streamReader = new StreamReader(stream2); - result = streamReader.ReadToEnd(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - return result; - } - } -} -namespace CancelAllOpenOrdersRequests -{ - public class CancelAllOpenOrdersOnSymbolRequest : RequestParameters, ISubTradingOperation - { - [CompilerGenerated] - private readonly SymbolComplexIdentifier ??; - - [CompilerGenerated] - private readonly string[] ??; - - [CompilerGenerated] - private readonly GroupTradingOperation ??; - - public override RequestType Type => RequestType.Custom; - - public SymbolComplexIdentifier SymbolComplexIdentifier - { - [CompilerGenerated] - get - { - return ??; - } - } - - public string[] OrderIdArray - { - [CompilerGenerated] - get - { - return ??; - } - } - - public GroupTradingOperation ParentOperation - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public CancelAllOpenOrdersOnSymbolRequest(SymbolComplexIdentifier symbolComplexIdentifier, params string[] orderIdArray) - { - ?? = symbolComplexIdentifier; - ?? = orderIdArray; - } - } - public class CancelAllOpenOrdersOnAccountRequest : RequestParameters, ISubTradingOperation - { - [CompilerGenerated] - private readonly string ??; - - [CompilerGenerated] - private readonly GroupTradingOperation ??; - - public override RequestType Type => RequestType.Custom; - - public string AccountId - { - [CompilerGenerated] - get - { - return ??; - } - } - - public GroupTradingOperation ParentOperation - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public CancelAllOpenOrdersOnAccountRequest(string accountId) - { - ?? = accountId; - } - } - public class CancelAllOpenOrdersOnSymbolAndAccountRequest : RequestParameters, ISubTradingOperation - { - [CompilerGenerated] - private readonly SymbolComplexIdentifier ??; - - [CompilerGenerated] - private readonly string ??; - - [CompilerGenerated] - private readonly GroupTradingOperation ??; - - public override RequestType Type => RequestType.Custom; - - public SymbolComplexIdentifier SymbolComplexIdentifier - { - [CompilerGenerated] - get - { - return ??; - } - } - - public string AccountId - { - [CompilerGenerated] - get - { - return ??; - } - } - - public GroupTradingOperation ParentOperation - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public CancelAllOpenOrdersOnSymbolAndAccountRequest(SymbolComplexIdentifier symbolComplexIdentifier, string accountId) - { - ?? = symbolComplexIdentifier; - ?? = accountId; - } - } - public static class CancelRules - { - public const string ALLOW_CANCEL_ALL_OPEN_ORDERS_ON_SYMBOL = "Allow CancelAllOpenOrdersOnSymbol"; - - public const string ALLOW_CANCEL_ALL_OPEN_ORDERS_ON_ACCOUNT = "Allow CancelAllOpenOrdersOnAccount"; - - public const string ALLOW_CANCEL_ALL_OPEN_ORDERS_ON_SYMBOL_AND_ACCOUNT = "Allow CancelAllOpenOrdersOnSymbolAndAccount"; - } -} -namespace TradingPlatform.BusinessLayer -{ - public interface IConnectionBindedObject - { - string ConnectionId { get; } - } - public interface IConnectionStateDependent - { - ConnectionDependency GetConnectionStateDependency(); - - void OnConnectionStateChanged(Connection connection, ConnectionStateChangedEventArgs e); - } - public interface IHistoryItem : ICloneable - { - DateTime TimeLeft { get; } - - long TicksLeft { get; set; } - - long TicksRight { get; set; } - - double this[PriceType priceType] { get; } - - VolumeAnalysisData VolumeAnalysisData { get; set; } - - void SetData(string key, object value); - - bool TryGetData(string key, out TData data); - } - public interface IHistoryProcessor : IDisposable - { - SubscribeQuoteType? GetSubscribeQuoteType { get; } - - event HistoryEventHandler NewHistoryItem; - - event HistoryEventHandler HistoryItemUpdated; - - void Initialize(HistoryRequestParameters historyRequestParameters); - - IList AggregateHistory(HistoryHolder historyHolder); - - void ProcessQuote(MessageQuote messageQuote); - - void CorrectHistoryRequestBorders(HistoryRequestParameters historyRequestParameters); - - string GetTimeToNextBar(); - } - public interface IBusinessObjectsProvider - { - /// - /// Gets s list - /// - Symbol[] Symbols { get; } - - /// - /// Gets symbol types list - /// - SymbolType[] SymbolTypes { get; } - - /// - /// Gets s list - /// - Account[] Accounts { get; } - - /// - /// Gets s list - /// - Asset[] Assets { get; } - - /// - /// Gets Exchanges list - /// - Exchange[] Exchanges { get; } - - /// - /// Gets Orders list - /// - Order[] Orders { get; } - - /// - /// Gets Order Types list - /// - OrderType[] OrderTypes { get; } - - /// - /// Gets Positions list - /// - Position[] Positions { get; } - - /// - /// Gets Closed Positions list - /// - ClosedPosition[] ClosedPositions { get; } - - /// - /// Gets Corporate Actions list - /// - CorporateAction[] CorporateActions { get; } - - /// - /// Gets Report Types list - /// - ReportType[] ReportTypes { get; } - - DeliveredAsset[] DeliveredAssets { get; } - - AccountOperation[] AccountOperations { get; } - - /// - /// Gets s list - /// - TradingSignal[] TradingSignals { get; } - } - public interface ICurrentAccount - { - Account CurrentAccount { get; set; } - } - public interface ICurrentSymbol - { - Symbol CurrentSymbol { get; set; } - } - public interface ICustomizable - { - IList Settings { get; set; } - } - public interface ISetAsDefault - { - IList DefaultSetting { get; } - - void SetAsDefault(); - } - public interface ISaveAsTemplate : ISetAsDefault - { - IChartObjectTemplate[] AvailableTemplates { get; } - - void SaveAsTemplate(); - - void ApplyTemplate(IChartObjectTemplate template); - - void RenameTemplate(IChartObjectTemplate template); - - void RemoveTemplate(IChartObjectTemplate template); - } - public interface ICustomizableVisualGroups - { - void ProcessSettingsVisualGroups(IList settings); - } - public interface IHistoryTypeIndicator - { - HistoryType HistoryType { get; } - } -} -namespace ? -{ - internal interface ? - { - void ?(Indicator P_0); - } -} -namespace TradingPlatform.BusinessLayer -{ - public interface IIndicatorsCollection - { - void AddIndicator(Indicator indicator); - - void RemoveIndicator(Indicator indicator); - } - public interface IRangeWatchlistIndicator : IWatchlistIndicator - { - TimeSpan MinHistoryRange { get; } - } - public interface ISessionObserverIndicator - { - ISessionsContainer SessionContainer { get; } - } - public interface IVolumeAnalysisIndicator - { - bool IsRequirePriceLevelsCalculation { get; } - - void VolumeAnalysisData_Loaded(); - } - public interface IWatchlistIndicator - { - int MinHistoryDepths { get; } - } - public interface IOrder : ITradingObject, IUniqueID - { - /// - /// The ID of the order group. This group created when trades done by the MAM account. - /// - string GroupId { get; } - - /// - /// Total quantity of the order - /// - double TotalQuantity { get; } - - /// - /// Gets OrderType - /// - OrderType OrderType { get; } - - /// - /// Gets order price value - /// - double Price { get; } - - /// - /// Gets order trigger price value - /// - double TriggerPrice { get; } - - /// - /// Gets order trailing offset value - /// - double TrailOffset { get; } - - /// - /// Gets orders current status - /// - OrderStatus Status { get; } - - /// - /// Gets orders last update time - /// - DateTime LastUpdateTime { get; } - - /// - /// Gets Position Id. - /// - string PositionId { get; } - - /// - /// Gets StopLoss holder for given order - /// - SlTpHolder StopLoss { get; } - - /// - /// Gets TakeProfit holder for given order - /// - SlTpHolder TakeProfit { get; } - - SlTpHolder[] StopLossItems { get; } - - SlTpHolder[] TakeProfitItems { get; } - - string ConnectionId { get; } - - /// - /// Orders Type Id. It is used for the orders type comparing. - /// - string OrderTypeId { get; } - - /// - /// Gets order TIF(Time-In-Force) type - /// - TimeInForce TimeInForce { get; } - - /// - /// Gets orders expiration time - /// - DateTime ExpirationTime { get; } - - BusinessObjectState State { get; } - - /// - /// Remaining quantity of the order - /// - double RemainingQuantity { get; } - - /// - /// Filled quantity of the order - /// - double FilledQuantity { get; } - - /// - /// Gets open order original status - /// - string OriginalStatus { get; } - - double AverageFillPrice { get; } - - /// - /// Will be triggered on each invocation - /// - event Action Updated; - } - public interface ITradingObject - { - string Id { get; } - - Account Account { get; } - - Symbol Symbol { get; } - - Side Side { get; } - - string Comment { get; } - - AdditionalInfoCollection AdditionalInfo { get; } - } - public interface IUniqueID - { - string UniqueId { get; } - } - public interface IBuyerSellerData - { - string Seller { get; } - - string Buyer { get; } - } - public interface IVolumeTickData - { - VolumeTickDataType VolumeTickDataType { get; } - - long Time { get; } - - double Price { get; } - - double Volume { get; } - - TickDirection TickDirection { get; } - - AggressorFlag AggressorFlag { get; } - } - public enum VolumeTickDataType - { - Ticks, - Lasts - } - public sealed class DefaultSessionsContainer : ISessionsContainer, IMessageBuilder - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal SessionsSet ?(CustomSession P_0) - { - return new SessionsSet - { - Days = P_0.Days, - CertainDates = new DateTime[0], - Sessions = new Session[1] - { - new Session(P_0.Name, P_0.OpenTime, P_0.CloseTime) - } - }; - } - } - - private static DefaultSessionsContainer ??; - - private readonly CustomSession[] ??; - - public static DefaultSessionsContainer Instance - { - get - { - lock (typeof(DefaultSessionsContainer)) - { - if (?? == null) - { - ?? = new DefaultSessionsContainer(); - } - } - return ??; - } - } - - public ISession[] ActiveSessions => ??; - - public TimeZoneInfo TimeZone => null; - - private DefaultSessionsContainer() - { - ?? = new CustomSession[1] - { - new CustomSession - { - Name = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - OpenOffset = TimeSpan.Zero, - CloseOffset = TimeSpan.FromTicks(863999999999L), - Days = Enum.GetValues(typeof(DayOfWeek)).Cast().ToArray(), - Type = SessionType.Main - } - }; - } - - public ISession[] GetSessionsForDate(DateTime dateTime) - { - return ??; - } - - public MessageSessionsContainer BuildMessage() - { - return new MessageSessionsContainer - { - Id = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - Name = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - Description = string.Empty, - Holidays = new HolidayInfo[0], - SessionsSets = ???.Select((CustomSession P_0) => new SessionsSet - { - Days = P_0.Days, - CertainDates = new DateTime[0], - Sessions = new Session[1] - { - new Session(P_0.Name, P_0.OpenTime, P_0.CloseTime) - } - }).ToArray() - }; - } - } - public interface ISession - { - string Name { get; } - - SessionType Type { get; } - - TimeSpan OpenTime { get; } - - TimeSpan CloseTime { get; } - - bool IsPrimary { get; } - } - public interface ISessionsContainer - { - ISession[] ActiveSessions { get; } - - TimeZoneInfo TimeZone { get; } - - ISession[] GetSessionsForDate(DateTime dateTime); - } - public enum SessionType - { - [Description("Main")] - Main, - [Description("Pre-market")] - PreMarket, - [Description("Post-market")] - PostMarket - } - [Published] - public interface IVolumeAnalysisCalculationProgress : IDisposable - { - VolumeAnalysisCalculationState State { get; } - - int ProgressPercent { get; } - - int ProgressBarIndex { get; } - - bool IsAborted { get; } - - VolumeAnalysisCalculationParameters CalculationParameters { get; } - - event EventHandler StateChanged; - - event EventHandler ProgressChanged; - - void AbortLoading(); - - void Wait(CancellationToken token = default(CancellationToken)); - } - [Published] - public interface IVolumeAnalysisCalculationTask : IDisposable - { - VolumeAnalysisData Result { get; } - - IVolumeAnalysisCalculationProgress Progress { get; } - } - /// - /// Defines 'Volume Analysis' calculation result item - /// - public interface IVolumeAnalysisItem - { - double GetValue(VolumeAnalysisField field); - } - /// - /// Contains all user's account information - /// - [Published] - public class Account : BusinessObject, ?, IMessageBuilder, IComparable, IComparable, IEquatable - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private Asset ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private NettingType ??; - - [CompilerGenerated] - private AdditionalInfoCollection ??; - - private readonly ? ??; - - [CompilerGenerated] - private Action ??; - - /// - /// Gets account unique code. - /// - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Obtaining account name. - /// - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Gets base currency of account. Account CCY is always equal to the server CCY in AlgoStudio - /// - public Asset AccountCurrency - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = asset; - } - } - - /// - /// Gets current balance of the account. - /// - public double Balance - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public NettingType NettingType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets additional account information - /// - [NotPublished] - public AdditionalInfoCollection AdditionalInfo - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = additionalInfoCollection; - } - } - - int ?.PriorityIndex => 10; - - ? ?.Rules => ??; - - /// - /// Will be triggered on each account information updating - /// - public event Action Updated - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - [NotPublished] - protected internal Account(string connectionId) - : base(connectionId) - { - ?? = new ?(); - Core.Instance.RulesManager.Defaults.ForEach(delegate(Rule P_0) - { - ??.?(P_0.Name, P_0); - }); - } - - [NotPublished] - protected internal Account(BusinessObjectInfo accountInfo) - : base(accountInfo.ConnectionId) - { - Id = accountInfo.Id; - Name = accountInfo.Name; - State = BusinessObjectState.Fake; - } - - internal void ?(MessageAccount P_0) - { - Id = P_0.AccountId; - Name = P_0.AccountName; - if (P_0.AssetId != null && ConnectionCache != null && ConnectionCache.??.TryGetValue(P_0.AssetId, out var value)) - { - AccountCurrency = value; - } - Balance = P_0.Balance; - NettingType = P_0.NettingType; - if (P_0.AccountAdditionalInfo != null) - { - if (AdditionalInfo == null) - { - AdditionalInfoCollection additionalInfoCollection = (AdditionalInfo = new AdditionalInfoCollection()); - } - foreach (AdditionalInfoItem item in P_0.AccountAdditionalInfo) - { - AdditionalInfo.?(item); - } - } - ???.Invoke(this); - } - - private MessageAccount ?() - { - return new MessageAccount - { - AccountId = Id, - AccountName = Name, - AssetId = AccountCurrency.Id, - Balance = Balance, - AccountAdditionalInfo = AdditionalInfo?.Items.ToList() - }; - } - - MessageAccount IMessageBuilder.BuildMessage() - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(); - } - - /// - /// Gets Account name - /// - /// - [NotPublished] - public override string ToString() - { - return Name; - } - - /// - /// Creates a business object info with an Account data which can be used for the restoring/serialization process. - /// - /// - [NotPublished] - public override BusinessObjectInfo CreateInfo() - { - return new ? - { - ConnectionId = base.ConnectionId, - Id = Id, - Name = Name, - IsCrypto = false - }; - } - - public int CompareTo(object obj) - { - return CompareTo(obj as Account); - } - - public int CompareTo(Account other) - { - if (this == other) - { - return 0; - } - if (other == null) - { - return 1; - } - return string.Compare(Id, other.Id, StringComparison.Ordinal); - } - - public bool Equals(Account other) - { - if (other == null) - { - return false; - } - if (this == other) - { - return true; - } - if (Id == other.Id) - { - return base.ConnectionId == other.ConnectionId; - } - return false; - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - if (this == obj) - { - return true; - } - if (obj.GetType() != GetType()) - { - return false; - } - return Equals((Account)obj); - } - - public override int GetHashCode() - { - return HashCode.Combine(Id, base.ConnectionId); - } - - [CompilerGenerated] - private void ?(Rule P_0) - { - ??.?(P_0.Name, P_0); - } - } - /// - /// The account operation. - /// - public class AccountOperation : BusinessObject, IComparable - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private IList ??; - - private AccountOperationUpdateHandler ??; - - private AccountOperationConfirmationHandler ??; - - private AccountOperationExecuteHandler ??; - - /// - /// Gets the name. - /// - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Gets the button text. - /// - public string ButtonText - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Gets the settings. - /// - public IList Settings - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = list; - } - } - - internal AccountOperation(string P_0) - : base(P_0) - { - } - - /// - /// - /// - /// The settings. - public void Update(IList settings) - { - ???.Invoke(settings); - } - - /// - /// Builds the confirmation. - /// - /// The settings. - /// A string. - public string BuildConfirmation(IList settings) - { - return ???.Invoke(settings); - } - - /// - /// - /// - /// The settings. - public void Execute(IList settings) - { - ???.Invoke(settings); - } - - internal void ?(MessageAccountOperation P_0) - { - Name = P_0.Name; - ButtonText = P_0.ButtonText; - Settings = P_0.Settings.DeepCopy().ToList(); - ?? = P_0.UpdateHandler; - ?? = P_0.BuildConfirmationHandler; - ?? = P_0.ExecuteHandler; - } - - /// - /// Compare to. - /// - /// The obj. - /// An int. - public int CompareTo(object obj) - { - if (!(obj is AccountOperation accountOperation)) - { - return 0; - } - return string.Compare(Name, accountOperation.Name, StringComparison.Ordinal); - } - } - public delegate string AccountOperationConfirmationHandler(IList settings); - public delegate void AccountOperationExecuteHandler(IList settings); - public delegate void AccountOperationUpdateHandler(IList settings); - /// - /// The additional info collection. - /// - public class AdditionalInfoCollection : IEnumerable, IEnumerable, IEquatable - { - private readonly Dictionary ?; - - private readonly object ?; - - private static readonly ListEqualityComparer ?; - - /// - /// Gets the count. - /// - public int Count => ?.Count; - - public AdditionalInfoItem this[string key] - { - get - { - if (TryGetItem(key, out var item)) - { - return item; - } - throw new KeyNotFoundException(); - } - } - - /// - /// Gets the items. - /// - public IEnumerable Items - { - get - { - lock (?) - { - foreach (KeyValuePair item in ?) - { - yield return item.Value.Clone() as AdditionalInfoItem; - } - } - } - } - - static AdditionalInfoCollection() - { - ? = new ListEqualityComparer(EqualityComparer.Default); - } - - /// - /// Initializes a new instance of the class. - /// - public AdditionalInfoCollection() - { - ? = new Dictionary(); - ? = new object(); - } - - /// - /// Initializes a new instance of the class. - /// - /// The items. - public AdditionalInfoCollection(params AdditionalInfoItem[] items) - : this() - { - foreach (AdditionalInfoItem additionalInfoItem in items) - { - ?(additionalInfoItem); - } - } - - /// - /// Try get item. - /// - /// The api key. - /// The item. - /// A bool. - public bool TryGetItem(string apiKey, out AdditionalInfoItem item) - { - item = null; - lock (?) - { - if (?.TryGetValue(apiKey, out var value)) - { - item = value.Clone() as AdditionalInfoItem; - return true; - } - } - return false; - } - - internal void ?(AdditionalInfoItem P_0) - { - lock (?) - { - if (!?.TryGetValue(P_0.Id, out var value)) - { - value = new AdditionalInfoItem(); - ?.Add(P_0.Id, value); - } - value.Update(P_0); - } - } - - internal void ?(IEnumerable P_0) - { - lock (?) - { - foreach (SettingItem item in P_0) - { - if (?.TryGetValue(item.Name, out var value)) - { - value.Value = item.Value; - } - } - } - } - - /// - /// Gets the enumerator. - /// - /// ]]> - public IEnumerator GetEnumerator() - { - return Items.GetEnumerator(); - } - - private IEnumerator ?() - { - return GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(); - } - - /// - /// Tos the string. - /// - /// A string. - public override string ToString() - { - StringBuilder stringBuilder = new StringBuilder(); - using (IEnumerator enumerator = GetEnumerator()) - { - while (enumerator.MoveNext()) - { - AdditionalInfoItem current = enumerator.Current; - if (current.Hidden || !current.Visible) - { - continue; - } - string value = ((current.FormattingDescription == null) ? current.Value.ToString() : current.FormattingDescription.GetFormattedData()); - if (string.IsNullOrEmpty(current.NameKey) && string.IsNullOrEmpty(value)) - { - continue; - } - if (string.IsNullOrEmpty(current.NameKey)) - { - StringBuilder stringBuilder2 = stringBuilder; - StringBuilder stringBuilder3 = stringBuilder2; - StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(2, 1, stringBuilder2); - handler.AppendFormatted(value); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder3.Append(ref handler); - continue; - } - object value2 = current.Value; - if (value2 is bool) - { - if ((bool)value2) - { - StringBuilder stringBuilder2 = stringBuilder; - StringBuilder stringBuilder4 = stringBuilder2; - StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(2, 1, stringBuilder2); - handler.AppendFormatted(current.NameKey); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder4.Append(ref handler); - } - } - else - { - StringBuilder stringBuilder2 = stringBuilder; - StringBuilder stringBuilder5 = stringBuilder2; - StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(5, 2, stringBuilder2); - handler.AppendFormatted(current.NameKey); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - handler.AppendFormatted(value); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder5.Append(ref handler); - } - } - } - return stringBuilder.ToString().TrimEnd(' ', ';'); - } - - public bool Equals(AdditionalInfoCollection other) - { - List x = Items.ToList(); - List y = other.Items.ToList(); - return ?.Equals(x, y); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - if (this == obj) - { - return true; - } - if (obj.GetType() != GetType()) - { - return false; - } - return Equals((AdditionalInfoCollection)obj); - } - - public override int GetHashCode() - { - return ?.GetHashCode(Items.ToList()); - } - } - /// - /// The comparing type. - /// - [DataContract(Name = "ComparingType", Namespace = "TradingPlatform")] - public enum ComparingType - { - [EnumMember] - String, - [EnumMember] - Int, - [EnumMember] - Double, - [EnumMember] - Long, - [EnumMember] - DateTime, - [EnumMember] - Boolean - } - /// - /// The additional info item formating type. - /// - public enum AdditionalInfoItemFormatingType - { - None, - AssetBalance, - CustomAsset, - Percent - } - /// - /// The additional info item. - /// - [ProtoContract] - public class AdditionalInfoItem : ICloneable, IXElementSerialization, IEquatable - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private ComparingType ??; - - [CompilerGenerated] - private object ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private AdditionalInfoItemFormatingType ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private EditingInfo ??; - - [CompilerGenerated] - private IFormattingDescription ??; - - /// - /// ???? ??? ???, ??????????? ??? ?????????? ? ?????? ???? ?????????? - /// - [ProtoMember(1)] - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the group info. - /// - [ProtoMember(2)] - public string GroupInfo - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the sort index. - /// - [ProtoMember(3)] - public int SortIndex - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the name key. - /// - [ProtoMember(4)] - public string NameKey - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the tool tip key. - /// - [ProtoMember(5)] - public string ToolTipKey - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the data type. - /// - [ProtoMember(6)] - public ComparingType DataType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the value. - /// - [ProtoIgnore] - public object Value - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets a value indicating whether hidden. - /// - [ProtoMember(7)] - public bool Hidden - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the formating type. - /// - [ProtoMember(8)] - public AdditionalInfoItemFormatingType FormatingType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// ???????????? ? ?????? ? AccountAdditionalInfoItemFormatingType.CustomAsset ??? ?????????????? ? ???????? ?????? - /// - [ProtoMember(9)] - public string CustomAssetID - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets a value indicating whether visible. - /// - [ProtoMember(10)] - public bool Visible - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets a value indicating whether is link. - /// - [ProtoMember(11)] - public bool IsLink - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(12, IsRequired = false)] - private string ProtoDynamicPropertySurrogateString - { - get - { - if (DataType != ComparingType.String) - { - return null; - } - return (string)Value; - } - set - { - if (DataType == ComparingType.String && text != null) - { - Value = text; - } - } - } - - [ProtoMember(13, IsRequired = false)] - private int? ProtoDynamicPropertySurrogateInt - { - get - { - if (DataType != ComparingType.Int) - { - return null; - } - return (int)Value; - } - set - { - if (DataType == ComparingType.Int && num.HasValue) - { - Value = num; - } - } - } - - [ProtoMember(14, IsRequired = false)] - private double? ProtoDynamicPropertySurrogateDouble - { - get - { - if (DataType != ComparingType.Double) - { - return null; - } - return (double)Value; - } - set - { - if (DataType == ComparingType.Double && num.HasValue) - { - Value = num; - } - } - } - - [ProtoMember(15, IsRequired = false)] - private long? ProtoDynamicPropertySurrogateLong - { - get - { - if (DataType != ComparingType.Long) - { - return null; - } - return (long)Value; - } - set - { - if (DataType == ComparingType.Long && num.HasValue) - { - Value = num; - } - } - } - - [ProtoMember(16, IsRequired = false)] - private DateTime? ProtoDynamicPropertySurrogateDateTime - { - get - { - if (DataType != ComparingType.DateTime) - { - return null; - } - return (DateTime)Value; - } - set - { - if (DataType == ComparingType.DateTime && dateTime.HasValue) - { - Value = dateTime; - } - } - } - - [ProtoMember(17, IsRequired = false)] - private bool? ProtoDynamicPropertySurrogateBoolean - { - get - { - if (DataType != ComparingType.Boolean) - { - return null; - } - return (bool)Value; - } - set - { - if (DataType == ComparingType.Boolean && flag.HasValue) - { - Value = flag; - } - } - } - - /// - /// Gets or Sets the editing info. - /// - public EditingInfo EditingInfo - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the formatting description. - /// - public IFormattingDescription FormattingDescription - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Initializes a new instance of the class. - /// - public AdditionalInfoItem() - { - Visible = true; - } - - /// - /// - /// - /// The item. - public virtual void Update(AdditionalInfoItem item) - { - GroupInfo = item.GroupInfo; - SortIndex = item.SortIndex; - NameKey = item.NameKey; - ToolTipKey = item.ToolTipKey; - DataType = item.DataType; - Value = item.Value; - Hidden = item.Hidden; - Visible = item.Visible; - IsLink = item.IsLink; - Id = item.Id; - FormatingType = item.FormatingType; - CustomAssetID = item.CustomAssetID; - EditingInfo = ((item.EditingInfo == null) ? null : new EditingInfo(item.EditingInfo)); - FormattingDescription = item.FormattingDescription; - } - - /// - /// - /// - /// An object. - public object Clone() - { - AdditionalInfoItem additionalInfoItem = new AdditionalInfoItem(); - additionalInfoItem.Update(this); - return additionalInfoItem; - } - - /// - /// To the XML element. - /// - /// A XElement. - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GroupInfo)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SortIndex)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), NameKey)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ToolTipKey)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)DataType)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Value)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), Hidden)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)FormatingType)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CustomAssetID)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Visible)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsLink)); - return xElement; - } - - /// - /// From the XML element. - /// - /// The element. - /// The deserialization info. - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - Id = xElement.Value; - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - GroupInfo = xElement2.Value; - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - SortIndex = xElement3.ToInt(); - } - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - NameKey = xElement4.Value; - } - XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement5 != null) - { - ToolTipKey = xElement5.Value; - } - XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement6 != null) - { - DataType = (ComparingType)xElement6.ToInt(); - } - XElement xElement7 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement7 != null) - { - Value = DataType switch - { - ComparingType.Int => xElement7.ToInt(), - ComparingType.Double => xElement7.ToDouble(), - ComparingType.Long => xElement7.ToLong(), - ComparingType.DateTime => xElement7.ToDateTime(), - ComparingType.Boolean => xElement7.ToBool(), - _ => xElement7.Value, - }; - } - XElement xElement8 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - if (xElement8 != null) - { - Hidden = xElement8.ToBool(); - } - XElement xElement9 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement9 != null) - { - FormatingType = (AdditionalInfoItemFormatingType)xElement9.ToInt(); - } - XElement xElement10 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement10 != null) - { - CustomAssetID = xElement10.Value; - } - XElement xElement11 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement11 != null) - { - Visible = xElement11.ToBool(); - } - XElement xElement12 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement12 != null) - { - IsLink = xElement12.ToBool(); - } - } - - /// - /// To the string. - /// - /// A string. - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(38, 4); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Id); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(GroupInfo); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Visible); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Hidden); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public bool Equals(AdditionalInfoItem other) - { - if (other == null) - { - return false; - } - if (this == other) - { - return true; - } - if (NameKey == other.NameKey) - { - return object.Equals(Value, other.Value); - } - return false; - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - if (this == obj) - { - return true; - } - if (obj.GetType() != GetType()) - { - return false; - } - return Equals((AdditionalInfoItem)obj); - } - - public override int GetHashCode() - { - return HashCode.Combine(NameKey, Value); - } - } - public class EditingInfo - { - [CompilerGenerated] - private SettingItem ?; - - [CompilerGenerated] - private Action ?; - - public SettingItem SettingItem - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - public Action ValueChanged - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - public EditingInfo() - { - } - - public EditingInfo(EditingInfo origin) - { - SettingItem = origin.SettingItem.GetCopy(); - ValueChanged = origin.ValueChanged; - } - } - /// - /// Defines asset entity - /// - [Published] - public class Asset : BusinessObject, IComparable, IMessageBuilder - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - private double ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private string ??; - - /// - /// Asset id bearer - /// - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Asset name bearer - /// - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Asset description - /// - public string Description - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Defines a number precision of the change value - /// - public double MinimumChange - { - get - { - return ??; - } - set - { - if (?? != value) - { - ?? = value; - Precision = CoreMath.GetValuePrecision((decimal)??); - } - } - } - - /// - /// Gets precision value - /// - public int Precision - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets asset ISO 4217 code - /// - public string IsoCode - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Creates an Asset instance - /// - /// given connection Id - [NotPublished] - public Asset(string connectionId) - : base(connectionId) - { - } - - /// - /// Formats price into precision normalized string - /// - /// - /// - public string FormatPrice(double price) - { - if (!double.IsNaN(price)) - { - return price.Format(Precision); - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); - } - - /// - /// Formats price into concatenated string which contains the precision normalized value and Asset's name - /// - /// - /// - public string FormatPriceWithCurrency(double price) - { - if (!double.IsNaN(price)) - { - return price.Format(Precision) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Name; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); - } - - public string FormatWithCurrency(double value) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(1, 2); - defaultInterpolatedStringHandler.AppendFormatted(value); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - internal void ?(MessageAsset P_0) - { - Id = P_0.Id; - Name = P_0.Name; - Description = P_0.Description; - MinimumChange = P_0.MinimumChange; - IsoCode = P_0.IsoCode; - } - - private MessageAsset ?() - { - return new MessageAsset - { - Id = Id, - Name = Name, - Description = Description, - MinimumChange = MinimumChange, - IsoCode = IsoCode - }; - } - - MessageAsset IMessageBuilder.BuildMessage() - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(); - } - - /// - /// Gets Asset name - /// - /// - [NotPublished] - public override string ToString() - { - return Name; - } - - /// - /// Uses comparison by Assets names - /// - /// - /// - [NotPublished] - public int CompareTo(object obj) - { - if (!(obj is Asset asset)) - { - return 1; - } - return Name.CompareTo(asset.Name); - } - } - [DataContract] - [KnownType(typeof(Account))] - [KnownType(typeof(PnLItem))] - public abstract class BusinessObject : IConnectionBindedObject, IUniqueID - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private BusinessObjectState ??; - - private Connection ??; - - [CompilerGenerated] - private string ??; - - private static long ??; - - public string ConnectionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - public virtual BusinessObjectState State - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected internal set - { - ?? = value; - } - } - - public virtual Connection Connection => ?? ?? (?? = Core.Instance.Connections[ConnectionId]); - - internal virtual ? ConnectionCache => Connection?.??; - - /// - /// Unique ID during active session. Don't use for serialization - /// - public string UniqueId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - internal BusinessObject() - { - } - - internal BusinessObject(string P_0) - { - UniqueId = Interlocked.Increment(ref ??).ToString(); - ConnectionId = P_0; - State = BusinessObjectState.Normal; - } - - [NotPublished] - public virtual BusinessObjectInfo CreateInfo() - { - return new BusinessObjectInfo - { - ConnectionId = ConnectionId - }; - } - } - [DataContract(Name = "AccountStatus", Namespace = "TradingPlatform")] - public enum AccountStatus - { - [EnumMember] - Active, - [EnumMember] - Closed, - [EnumMember] - Halted - } - /// - /// ?????????? ???????????? ????????????? ????? ??? ???? ??????????? - /// - [DataContract(Name = "InstrumentType", Namespace = "TradingPlatform")] - public enum SymbolType - { - [EnumMember] - Unknown, - [EnumMember] - Forex, - [EnumMember] - Equities, - [EnumMember] - CFD, - [EnumMember] - Indexes, - [EnumMember] - Futures, - [EnumMember] - Options, - [EnumMember] - ETF, - [EnumMember] - Crypto, - [EnumMember] - Synthetic, - [EnumMember] - Spot, - [EnumMember] - Forward, - [EnumMember] - FixedIncome, - [EnumMember] - Warrants, - /// - /// ?????? ??? ????????? ?????????? - /// - [EnumMember] - Debentures, - [EnumMember] - Bond, - [EnumMember] - Swap - } - [DataContract(Name = "InstrumentQuotingType", Namespace = "TradingPlatform")] - public enum SymbolQuotingType - { - [EnumMember] - LotSize, - [EnumMember] - TickSizeTickCost, - [EnumMember] - Undefined - } - [DataContract(Name = "OptionCodingStyle", Namespace = "TradingPlatform")] - public enum OptionCodingStyle - { - [EnumMember] - Unspecified, - [EnumMember] - European, - [EnumMember] - American - } - public enum OrderStatus - { - [Description("Unspecified")] - Unspecified, - [Description("Opened")] - Opened, - [Description("Partially Filled")] - PartiallyFilled, - [Description("Filled")] - Filled, - [Description("Cancelled")] - Cancelled, - [Description("Refused")] - Refused, - [Description("Inactive")] - Inactive - } - public enum TimeInForce - { - [Description("Default")] - Default, - [Description("Day")] - Day, - [Description("Fill Or Kill")] - FOK, - [Description("Good Till Cancel")] - GTC, - [Description("Immediate Or Cancel")] - IOC, - [Description("Good Till Date")] - GTD, - [Description("Good Till Time")] - GTT, - [Description("Fill And Kill")] - FAK, - [Description("At The Open")] - ATO, - [Description("At The Close")] - ATC - } - public enum DealTicketType - { - [Description("Info")] - Info, - [Description("Refuse")] - Refuse, - [Description("Order opened")] - OrderOpened, - [Description("Order filled")] - OrderFilled, - [Description("Order partially filled")] - OrderPartiallyFilled, - [Description("Order cancelled")] - OrderCancelled, - [Description("Trading operation request")] - TradingOperationRequest, - [Description("Trading operation success")] - TradingOperationResultSuccess, - [Description("Trading operation refuse")] - TradingOperationResultRefuse, - [Description("Trading signal")] - TradingSignal, - [Description("Terminal update")] - TerminalUpdate, - [Description("License")] - License, - [Description("Connection success")] - ConnectionSuccess, - [Description("Connection lost")] - ConnectionLost - } - public enum DealTicketState - { - Received, - Seen - } - public enum PriceMeasurement - { - Absolute, - Offset - } - [DataContract(Name = "NettingType", Namespace = "TradingPlatform")] - public enum NettingType - { - [Description("Undefined")] - [EnumMember] - Undefined, - [Description("Multiple positions")] - [EnumMember] - MultiPosition, - [Description("Multiple positions per side")] - [EnumMember] - MultiPerSide, - [Description("One position")] - [EnumMember] - OnePosition, - [Description("One position per side")] - [EnumMember] - OnePositionPerSide - } - [DataContract(Name = "InstrumentVolumeType", Namespace = "TradingPlatform")] - public enum SymbolVolumeType - { - [EnumMember] - Volume, - [EnumMember] - Ticks, - [EnumMember] - Disable - } - public enum BusinessObjectState - { - Normal, - Fake - } - [DataContract(Name = "DeltaCalculationType", Namespace = "TradingPlatform")] - public enum DeltaCalculationType - { - [Description("Aggressor flag")] - [EnumMember(Value = "Aggressor flag")] - AggressorFlag, - [Description("Tick direction")] - [EnumMember(Value = "Tick direction")] - TickDirection - } - [DataContract(Name = "AvailableDerivatives", Namespace = "TradingPlatform")] - public enum AvailableDerivatives - { - None, - Unknown, - Present - } - [DataContract(Name = "FutureContractType", Namespace = "TradingPlatform")] - public enum FutureContractType - { - [EnumMember] - Contract, - [EnumMember] - Continuous, - [EnumMember] - Spread - } - public enum GroupOrderType - { - None, - OCO - } - public enum AccountBalanceEventReason - { - New, - Update - } - public enum OptionSerieType - { - Unknown, - Daily, - Week, - Month, - BinaryContracts - } - public class ClosedPosition : Position - { - [CompilerGenerated] - private double ??; - - public double LastTradedPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - internal ClosedPosition(string P_0) - : base(P_0) - { - } - - public override TradingOperationResult Close(double closeQuantity = -1.0) - { - return TradingOperationResult.CreateError(new ClosePositionRequestParameters().RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - - internal override void ?(MessageOpenPosition P_0) - { - base.?(P_0); - if (P_0 is MessageClosedPosition messageClosedPosition) - { - LastTradedPrice = messageClosedPosition.LastTradedPrice; - } - } - } - /// - /// Represents information about corporate action. - /// - [Published] - public class CorporateAction : BusinessObject - { - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private Symbol ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private CorporateActionType ??; - - [CompilerGenerated] - private Action ??; - - /// - /// Get the date and time when trade was executed - /// - public DateTime DateTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - [DataMember(Name = "ID")] - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected set - { - ?? = value; - } - } - - [DataMember(Name = "Instrument")] - public Symbol Symbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected set - { - ?? = value; - } - } - - public string Details - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public CorporateActionType CorporateActionType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Will be triggered on corporate action updating - /// - public event Action Updated - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public CorporateAction(string connectionId) - : base(connectionId) - { - } - - internal void ?(MessageCorporateAction P_0) - { - Id = P_0.CorporateActionId; - if (!string.IsNullOrEmpty(P_0.SymbolId) && ConnectionCache != null && ConnectionCache.SymbolsCache.?(P_0.SymbolId, out var symbol)) - { - Symbol = symbol; - } - DateTime = P_0.DateTime; - Details = P_0.Details; - CorporateActionType = P_0.CorporateActionType; - ???.Invoke(); - } - } - [Published] - [DataContract(Name = "CryptoAccount", Namespace = "TradingPlatform")] - public class CryptoAccount : Account, IMessageBuilder - { - private readonly Dictionary ??; - - [CompilerGenerated] - private EventHandler ??; - - public CryptoAssetBalances[] Balances => ??.Values.ToArray(); - - public event EventHandler BalanceUpdated - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - internal CryptoAccount(string P_0) - : base(P_0) - { - ?? = new Dictionary(); - } - - internal CryptoAccount(BusinessObjectInfo P_0) - : base(P_0) - { - ?? = new Dictionary(); - } - - public bool TryGetAssetBalances(string assetId, out CryptoAssetBalances cryptoAssetBalances) - { - return ??.TryGetValue(assetId, out cryptoAssetBalances); - } - - internal void ?(MessageCryptoAssetBalances P_0) - { - AccountBalanceEventReason reason = AccountBalanceEventReason.Update; - if (!??.TryGetValue(P_0.AssetId, out var value)) - { - value = (??[P_0.AssetId] = new CryptoAssetBalances(base.ConnectionId)); - reason = AccountBalanceEventReason.New; - } - value.?(P_0); - ??.InvokeSafely(this, new CryptoAccountEventArgs(reason, value)); - } - - public override BusinessObjectInfo CreateInfo() - { - ? obj = base.CreateInfo() as ?; - obj.IsCrypto = true; - return obj; - } - - private MessageCryptoAccount ?() - { - return new MessageCryptoAccount - { - AccountId = base.Id, - AccountName = base.Name, - AssetId = base.AccountCurrency?.Id, - Balance = base.Balance, - AccountAdditionalInfo = base.AdditionalInfo?.Items.ToList() - }; - } - - MessageCryptoAccount IMessageBuilder.BuildMessage() - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(); - } - } - [Published] - [DataContract(Name = "CryptoAssetBalances", Namespace = "TradingPlatform")] - public class CryptoAssetBalances : BusinessObject, IMessageBuilder - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private Asset ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private GetAvailableBalanceHandler ??; - - private string ??; - - [DataMember(Name = "AssetId")] - public string AssetId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - public Asset Asset - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = asset; - } - } - - [DataMember(Name = "TotalBalance")] - public double TotalBalance - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = num; - } - } - - [DataMember(Name = "AvailableBalance")] - public double AvailableBalance - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = num; - } - } - - [DataMember(Name = "ReservedBalance")] - public double ReservedBalance - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = num; - } - } - - [DataMember(Name = "TotalInUSD")] - public double TotalInUSD - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = num; - } - } - - [DataMember(Name = "TotalInBTC")] - public double TotalInBTC - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = num; - } - } - - [DataMember(Name = "Debt")] - public double Debt - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = num; - } - } - - [DataMember(Name = "Equity")] - public double Equity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = num; - } - } - - [DataMember(Name = "EquityInBTC")] - public double EquityInBTC - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = num; - } - } - - public DateTime LastUpdateTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - public GetAvailableBalanceHandler AvailableBalanceHandler - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double GetAvailableBalance(OrderRequestParameters requestParameters) - { - double availableBalance = 0.0; - GetAvailableBalanceHandler availableBalanceHandler = AvailableBalanceHandler; - if (availableBalanceHandler != null && availableBalanceHandler(AssetId, requestParameters, out availableBalance)) - { - return availableBalance; - } - return AvailableBalance; - } - - internal CryptoAssetBalances(string P_0) - : base(P_0) - { - } - - internal void ?(MessageCryptoAssetBalances P_0) - { - AssetId = P_0.AssetId; - TotalBalance = P_0.TotalBalance; - AvailableBalance = P_0.AvailableBalance; - ReservedBalance = P_0.ReservedBalance; - TotalInUSD = P_0.TotalInUSD; - TotalInBTC = P_0.TotalInBTC; - Debt = P_0.Debt; - Equity = P_0.Equity; - EquityInBTC = P_0.EquityInBTC; - AvailableBalanceHandler = P_0.AvailableBalanceHandler; - ?? = P_0.AccountId; - if (!string.IsNullOrEmpty(P_0.AssetId) && ConnectionCache.??.TryGetValue(P_0.AssetId, out var value)) - { - Asset = value; - } - LastUpdateTime = Core.Instance.TimeUtils.DateTimeUtcNow; - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(18, 2); - defaultInterpolatedStringHandler.AppendFormatted(AssetId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(TotalBalance); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public MessageCryptoAssetBalances BuildMessage() - { - return new MessageCryptoAssetBalances - { - AssetId = AssetId, - TotalBalance = TotalBalance, - AvailableBalance = AvailableBalance, - ReservedBalance = ReservedBalance, - TotalInUSD = TotalInUSD, - TotalInBTC = TotalInBTC, - Debt = Debt, - Equity = Equity, - EquityInBTC = EquityInBTC, - AvailableBalanceHandler = AvailableBalanceHandler, - AccountId = ?? - }; - } - } - /// - /// Base class for all Custom symbols: Synthetics, Custom Formulas, etc. - /// - public class CustomSymbol : Symbol, IDisposable - { - public CustomSymbol(string connectionID) - : base(connectionID) - { - base.Id = Guid.NewGuid().ToString(); - } - - public virtual void Dispose() - { - } - } -} -namespace ? -{ - internal sealed class ? : HistoricalData - { - [Serializable] - [CompilerGenerated] - private new sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func> ??; - - internal IEnumerable ?(HistoryInterval P_0) - { - return P_0.History; - } - } - - private readonly HistoryStorage ??; - - public ?(HistoryRequestParameters P_0, HistoryStorage P_1) - : base(P_0) - { - ?? = P_1; - } - - private protected override IList ?(HistoryRequestParameters P_0) - { - List list = new List(); - if (?? == null) - { - return list; - } - if (!(P_0.Symbol is HistoricalSymbol historicalSymbol)) - { - return list; - } - if (P_0.FromTime > P_0.ToTime) - { - return list; - } - HistoryAggregation aggregationToDirectDownload = P_0.Aggregation.GetAggregationToDirectDownload(P_0.Symbol.HistoryMetadata); - if (aggregationToDirectDownload == null) - { - return list; - } - HistoryRequestParameters historyRequestParameters = new HistoryRequestParameters(P_0) - { - ForceReload = false, - Aggregation = aggregationToDirectDownload - }; - HistoryStorageInfo info = historicalSymbol.GetInfo(historyRequestParameters.ToDescription(), HistoryStorageInfoScope.StoredIntervals); - if (info == null || !info.StoredIntervals.Any()) - { - return list; - } - DateTime dateTime = info.StoredIntervals.First().From; - if (historyRequestParameters.FromTime < dateTime) - { - historyRequestParameters.FromTime = dateTime; - } - Interval[] array = historyRequestParameters.Interval.Split(base.Symbol.GetHistoryDownloadingStep(historyRequestParameters.Aggregation)).ToArray(); - for (int i = 0; i < array.Length; i++) - { - try - { - if (P_0.CancellationToken.IsCancellationRequested) - { - break; - } - HistoryRequestParameters copy = historyRequestParameters.Copy; - copy.FromTime = array[i].From; - copy.ToTime = array[i].To; - List historyParametersForServerRequest; - List history = ??.Load(copy, out historyParametersForServerRequest).SelectMany((HistoryInterval historyInterval) => historyInterval.History).ToList(); - float num = (float)i / (float)array.Length; - IList collection = ??.AggregateHistory(new HistoryHolder(history, copy, (int)(num * 100f))); - list.AddRange(collection); - P_0.ProgressInfo?.Report(num); - continue; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - return list; - } - } - return list; - } - } -} -namespace TradingPlatform.BusinessLayer -{ - public sealed class HistoricalSymbol : CustomSymbol, IHistoryDataReceiver, IXElementSerialization, IHistoryStorage - { - public const string HISTORICAL_SYMBOL_CONNECTION_ID = "HISTORICAL_SYMBOL_CONNECTION_ID"; - - private string ??; - - private HistoryStorage ??; - - public HistoricalSymbol() - : base(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - base.Id = null; - ?(); - base.Exchange = new Exchange(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - base.Exchange.?(new MessageExchange - { - Id = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - ExchangeName = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - SortIndex = -1 - }); - } - - public void SetLocalStoragePath(string path) - { - if (!(?? == path)) - { - ???.Dispose(); - ?? = path; - ?? = HistoryStorage.Create(??); - ?(); - } - } - - private new void ?() - { - if (string.IsNullOrEmpty(??)) - { - historyMetadata = new HistoryMetadata(); - return; - } - HashSet hashSet = new HashSet(); - HashSet hashSet2 = new HashSet(); - HashSet hashSet3 = new HashSet(); - HashSet hashSet4 = new HashSet(); - HashSet hashSet5 = new HashSet(); - foreach (HistoryDescription allAvailableHistoryDescription in ??.GetAllAvailableHistoryDescriptions()) - { - HistoryStorageInfo info = ??.GetInfo(allAvailableHistoryDescription, HistoryStorageInfoScope.StoredIntervals); - if (info.StoredIntervals == null || !info.StoredIntervals.Any()) - { - continue; - } - hashSet.Add(allAvailableHistoryDescription.Aggregation.Name); - HistoryAggregation aggregation = allAvailableHistoryDescription.Aggregation; - if (!(aggregation is HistoryAggregationTime historyAggregationTime)) - { - if (!(aggregation is HistoryAggregationTick historyAggregationTick)) - { - if (!(aggregation is HistoryAggregationTimeStatistics historyAggregationTimeStatistics)) - { - if (aggregation is HistoryAggregationVolumeProfile historyAggregationVolumeProfile) - { - hashSet3.Add(historyAggregationVolumeProfile.Period); - } - } - else - { - hashSet3.Add(historyAggregationTimeStatistics.Period); - } - } - else - { - hashSet5.Add(historyAggregationTick.HistoryType); - } - } - else - { - hashSet2.Add(historyAggregationTime.Period); - hashSet4.Add(historyAggregationTime.HistoryType); - } - } - historyMetadata = new HistoryMetadata - { - AllowedAggregations = hashSet.ToArray(), - AllowedPeriodsHistoryAggregationTime = hashSet2.ToArray(), - AllowedHistoryTypesHistoryAggregationTime = hashSet4.ToArray(), - AllowedHistoryTypesHistoryAggregationTick = hashSet5.ToArray(), - AllowedPeriodsHistoryAggregationTimeStatistics = hashSet3.ToArray(), - DownloadingStep_Tick = TimeSpan.FromDays(1.0) - }; - } - - private protected override HistoricalData ?(HistoryRequestParameters P_0) - { - return new ?(P_0, ??); - } - - public override List GetAlowedOrderTypes(OrderTypeUsage? usage) - { - return new List(); - } - - public IList Load(HistoryRequestParameters requestParameters, out List historyParametersForServerRequest) - { - historyParametersForServerRequest = new List { requestParameters }; - return ???.Load(requestParameters, out historyParametersForServerRequest); - } - - public void Save(HistoryInterval historyInterval, bool wait = false) - { - if (?? != null) - { - ??.Save(historyInterval, wait); - ?(); - } - } - - public void Delete(HistoryDescription description, Interval interval, bool wait = false) - { - if (?? != null) - { - ??.Delete(description, interval, wait); - ??.?(); - ?(); - } - } - - public HistoryStorageInfo GetInfo(HistoryDescription description, HistoryStorageInfoScope scope) - { - return ???.GetInfo(description, scope); - } - - public List GetAllAvailableHistoryDescriptions() - { - return ??.GetAllAvailableHistoryDescriptions(); - } - - public XElement ToXElement() - { - XElement xElement = new XElement(GetType().Name); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ??)); - MessageSymbol messageSymbol = ((IMessageBuilder)this).BuildMessage(); - xElement.Add(messageSymbol.ToXElement()); - if (base.Product != null) - { - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((IMessageBuilder)base.Product).BuildMessage().ToXElement())); - } - if (base.QuotingCurrency != null) - { - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((IMessageBuilder)base.QuotingCurrency).BuildMessage().ToXElement())); - } - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - SetLocalStoragePath(xElement.Value); - } - string text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - XElement xElement2 = ((!(element.Name == text)) ? element.Element(text) : element); - if (xElement2 != null) - { - MessageSymbol messageSymbol = new MessageSymbol(base.Id); - messageSymbol.FromXElement(xElement2, deserializationInfo); - ?(messageSymbol); - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - XElement xElement4 = xElement3.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - Asset asset = new Asset(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - MessageAsset messageAsset = new MessageAsset(); - messageAsset.FromXElement(xElement4, deserializationInfo); - asset.?(messageAsset); - base.Product = asset; - } - } - XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement5 != null) - { - XElement xElement6 = xElement5.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement6 != null) - { - Asset asset2 = new Asset(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - MessageAsset messageAsset2 = new MessageAsset(); - messageAsset2.FromXElement(xElement6, deserializationInfo); - asset2.?(messageAsset2); - base.QuotingCurrency = asset2; - } - } - ?(); - } - - public void SaveHistory(HistoryHolder historyHolderFromProvider) - { - try - { - Save(new HistoryInterval - { - Description = new HistoryDescription(base.Id, historyHolderFromProvider.RequestParameters.Aggregation), - Interval = historyHolderFromProvider.RequestParameters.Interval, - History = historyHolderFromProvider.History - }, wait: true); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - } - public sealed class HistoryDataSymbolProvider : IHistoryDataProvider - { - [CompilerGenerated] - private Action ??; - - private readonly Symbol ??; - - private readonly HistoryRequestParameters ??; - - private readonly Interval[] ??; - - private int ??; - - public bool AllDataAlreadyProvided => ?? >= ??.Length; - - public string ProgressValue => ((float)?? / (float)??.Length).ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - - public event Action ProgressChanged - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public HistoryDataSymbolProvider(Symbol realSymbolToImportHistory, HistoryRequestParameters historyRequestParameters) - { - ?? = realSymbolToImportHistory; - ?? = historyRequestParameters; - ?? = ??.Interval.Split(??.GetHistoryDownloadingStep(??.Aggregation)).ToArray(); - ?? = 0; - } - - public HistoryHolder GetHistory(CancellationToken cancellationToken) - { - Interval interval = ??[??]; - HistoryRequestParameters historyRequestParameters = new HistoryRequestParameters(??) - { - Interval = interval, - CancellationToken = cancellationToken - }; - if (?? == null) - { - return null; - } - HistoricalData history = ??.GetHistory(historyRequestParameters); - List list = new List(); - for (int i = 0; i < history.Count; i++) - { - list.Add(history[i, SeekOriginHistory.Begin]); - } - ??++; - ???.Invoke(ProgressValue); - return new HistoryHolder(list, historyRequestParameters); - } - } - public sealed class HistoryDataSymbolProviderRealtime : IHistoryDataProvider, IDisposable - { - private const int ?? = 10000; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private string ??; - - private DateTime ??; - - private DateTime ??; - - private readonly HistoricalData ??; - - private readonly HistoryRequestParameters ??; - - private readonly ManualResetEventSlim ??; - - public bool AllDataAlreadyProvided - { - get - { - if (!(?? >= ??.ToTime)) - { - return Core.Instance.TimeUtils.DateTimeUtcNow - ??.Symbol.QuoteDelay - TimeSpan.FromSeconds(10.0) > ??.ToTime; - } - return true; - } - } - - public string ProgressValue - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public event Action ProgressChanged - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public HistoryDataSymbolProviderRealtime(HistoryRequestParameters historyRequestParameters) - { - ?? = historyRequestParameters; - HistoryRequestParameters historyRequestParameters2 = new HistoryRequestParameters(??) - { - ToTime = default(DateTime) - }; - ?? = new ManualResetEventSlim(); - ?? = ??.Symbol.GetHistory(historyRequestParameters2); - ??.NewHistoryItem += ?; - } - - public void Dispose() - { - ??.Dispose(); - ??.NewHistoryItem -= ?; - ??.Dispose(); - } - - public HistoryHolder GetHistory(CancellationToken cancellationToken) - { - if (??.Symbol == null) - { - return null; - } - if (??.Symbol.State == BusinessObjectState.Fake) - { - return null; - } - TimeSpan timeout = ??.ToTime - Core.Instance.TimeUtils.DateTimeUtcNow + ??.Symbol.QuoteDelay + TimeSpan.FromSeconds(10.0); - ??.Wait(timeout, cancellationToken); - ??.Reset(); - if (??.Count == 0) - { - return null; - } - List list = new List(); - HistoryRequestParameters historyRequestParameters = new HistoryRequestParameters(??); - int i; - for (i = 0; i < 10000 && i < ??.Count; i++) - { - IHistoryItem historyItem = ??[i, SeekOriginHistory.Begin]; - ?? = historyItem.TimeLeft; - if (historyItem.TimeLeft >= ??.ToTime) - { - break; - } - if (historyItem.TimeLeft >= ??.FromTime) - { - list.Add(historyItem); - } - } - if (!list.Any()) - { - return null; - } - historyRequestParameters.FromTime = list.First().TimeLeft; - historyRequestParameters.ToTime = new DateTime(list.Last().TicksRight + 1, DateTimeKind.Utc); - ??.CutItems(i); - return new HistoryHolder(list, historyRequestParameters); - } - - private void ?(object P_0, HistoryEventArgs P_1) - { - ?? = P_1.HistoryItem.TimeLeft; - if (?? < ??.FromTime) - { - if (??.Count > 10000) - { - ??.CutItems(10000); - } - ProgressValue = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - ???.Invoke(ProgressValue); - return; - } - if (??.Count >= 10000) - { - ??.Set(); - return; - } - if (?? >= ??.ToTime) - { - ??.Set(); - return; - } - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(25, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(??.Count((IHistoryItem historyItem) => historyItem.TicksLeft > ??.FromTime.Ticks)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(10000); - ProgressValue = defaultInterpolatedStringHandler.ToStringAndClear(); - ???.Invoke(ProgressValue); - } - - [CompilerGenerated] - private bool ?(IHistoryItem P_0) - { - return P_0.TicksLeft > ??.FromTime.Ticks; - } - } - public interface IHistoryDataProvider - { - bool AllDataAlreadyProvided { get; } - - string ProgressValue { get; } - - event Action ProgressChanged; - - HistoryHolder GetHistory(CancellationToken changeToken); - } - public interface IHistoryDataReceiver - { - void SaveHistory(HistoryHolder historyFromProvider); - } - public sealed class ImportHistoryTask : IHistoryProcessingTask, IDisposable - { - [CompilerGenerated] - private sealed class ? - { - public CancellationToken ??; - - public ImportHistoryTask ??; - - internal void ?() - { - while (!??.??.AllDataAlreadyProvided) - { - try - { - if (??.IsCancellationRequested) - { - break; - } - HistoryHolder history = ??.??.GetHistory(??); - if (??.IsCancellationRequested || history == null) - { - break; - } - if (history.History.Any()) - { - ??.??.SaveHistory(history); - ??.?? += history.History.Count; - ??.???.Invoke(??.ProgressValue); - } - continue; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - ??.Stop(); - return; - } - } - ??.TaskState = HistoryTaskStateEnum.Completed; - ??.??.ProgressChanged -= ??.?; - (??.?? as IDisposable)?.Dispose(); - } - } - - [CompilerGenerated] - private Action ??; - - private HistoryTaskStateEnum ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private Action ??; - - private int ??; - - private string ??; - - private readonly IHistoryDataProvider ??; - - private readonly IHistoryDataReceiver ??; - - private CancellationTokenSource ??; - - public HistoryTaskStateEnum TaskState - { - get - { - return ??; - } - private set - { - if (?? != HistoryTaskStateEnum.Completed) - { - ?? = historyTaskStateEnum; - switch (??) - { - case HistoryTaskStateEnum.Active: - ?(); - break; - case HistoryTaskStateEnum.Stopped: - ??.Cancel(); - break; - case HistoryTaskStateEnum.Completed: - ?? = string.Empty; - break; - } - ???.Invoke(??); - } - } - } - - public string Description - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string ProgressValue - { - get - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(13, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(??); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - string text = defaultInterpolatedStringHandler.ToStringAndClear(); - if (string.IsNullOrEmpty(??)) - { - return text; - } - return text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ??; - } - } - - public event Action TaskStateChanged - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public event Action ProgressChanged - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public ImportHistoryTask(IHistoryDataProvider historyDataProvider, IHistoryDataReceiver historyDataReceiver) - { - ?? = historyDataProvider; - ?? = historyDataReceiver; - } - - public void Dispose() - { - if (?? != null) - { - ??.Cancel(); - ??.Dispose(); - ?? = null; - } - } - - public void Start() - { - TaskState = HistoryTaskStateEnum.Active; - } - - public void Stop() - { - TaskState = HistoryTaskStateEnum.Stopped; - } - - private void ?() - { - ?? = new CancellationTokenSource(); - CancellationToken ?? = ??.Token; - ??.ProgressChanged += ?; - ?? = 0; - ???.Invoke(ProgressValue); - Task.Factory.StartNew(delegate - { - while (!??.AllDataAlreadyProvided) - { - try - { - if (!??.IsCancellationRequested) - { - HistoryHolder history = ??.GetHistory(??); - if (!??.IsCancellationRequested && history != null) - { - if (history.History.Any()) - { - ??.SaveHistory(history); - ?? += history.History.Count; - ???.Invoke(ProgressValue); - } - continue; - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - Stop(); - return; - } - break; - } - TaskState = HistoryTaskStateEnum.Completed; - ??.ProgressChanged -= ?; - (?? as IDisposable)?.Dispose(); - }, ??); - } - - private void ?(string P_0) - { - ?? = P_0; - ???.Invoke(ProgressValue); - } - } - public interface IHistoryProcessingTask - { - HistoryTaskStateEnum TaskState { get; } - - string ProgressValue { get; } - - string Description { get; } - - event Action TaskStateChanged; - - event Action ProgressChanged; - - void Stop(); - } - public enum HistoryTaskStateEnum - { - [Description("Stopped")] - [EnumMember] - Stopped, - [Description("Active")] - [EnumMember] - Active, - [Description("Completed")] - [EnumMember] - Completed - } - public class BasicSyntheticPriceModifier : SyntheticPriceModifier - { - public override SyntheticPriceModifierType Type => SyntheticPriceModifierType.Basic; - - public override double CalculatePrice(double coefficient, double price) - { - return coefficient * price; - } - } - public class LnSyntheticPriceModifier : SyntheticPriceModifier - { - public override SyntheticPriceModifierType Type => SyntheticPriceModifierType.Ln; - - public override double CalculatePrice(double coefficient, double price) - { - return coefficient * Math.Log(price); - } - } - public abstract class SyntheticPriceModifier - { - public abstract SyntheticPriceModifierType Type { get; } - - public abstract double CalculatePrice(double coefficient, double price); - - public static SyntheticPriceModifier Create(SyntheticPriceModifierType type) - { - return type switch - { - SyntheticPriceModifierType.Undefined => new BasicSyntheticPriceModifier(), - SyntheticPriceModifierType.Basic => new BasicSyntheticPriceModifier(), - SyntheticPriceModifierType.Ln => new LnSyntheticPriceModifier(), - _ => throw new ArgumentOutOfRangeException(), - }; - } - } - public enum SyntheticPriceModifierType - { - Undefined, - [Description("Basic")] - Basic, - [Description("Ln")] - Ln - } -} -namespace ? -{ - internal sealed class ? : HistoricalData - { - private readonly Synthetic ??; - - public ?(HistoryRequestParameters P_0) - : base(P_0) - { - ?? = (Synthetic)P_0.Symbol; - } - - private protected override IList ?(HistoryRequestParameters P_0) - { - if (??.SyntheticState != SyntheticState.Initialized) - { - return new List(); - } - HistoryAggregation aggregationToDirectDownload = P_0.Aggregation.GetAggregationToDirectDownload(P_0.Symbol.HistoryMetadata); - HistoryRequestParameters historyRequestParameters = new HistoryRequestParameters(P_0) - { - Aggregation = aggregationToDirectDownload - }; - if (??.ForceUseTicksForHistory) - { - HistoryAggregation aggregation = historyRequestParameters.Aggregation; - if (!(aggregation is HistoryAggregationTickBars historyAggregationTickBars)) - { - if (aggregation is HistoryAggregationTime historyAggregationTime) - { - HistoryRequestParameters historyRequestParameters2 = historyRequestParameters; - historyRequestParameters2.Aggregation = new HistoryAggregationTick(historyAggregationTime.HistoryType switch - { - HistoryType.Ask => HistoryType.BidAsk, - HistoryType.Bid => HistoryType.BidAsk, - _ => historyAggregationTime.HistoryType, - }); - } - } - else - { - HistoryRequestParameters historyRequestParameters2 = historyRequestParameters; - historyRequestParameters2.Aggregation = new HistoryAggregationTick(historyAggregationTickBars.HistoryType switch - { - HistoryType.Ask => HistoryType.BidAsk, - HistoryType.Bid => HistoryType.BidAsk, - _ => historyAggregationTickBars.HistoryType, - }); - } - } - List list = new List(); - double[] array = new double[??.Items.Count]; - for (int i = 0; i < ??.Items.Count; i++) - { - array[i] = ??.Items[i].Coefficient; - HistoryRequestParameters historyRequestParameters3 = new HistoryRequestParameters(historyRequestParameters) - { - Symbol = ??.Items[i].Symbol - }; - if (??.Items[i].Coefficient < 0.0) - { - HistoryAggregation aggregation = historyRequestParameters3.Aggregation; - if (!(aggregation is HistoryAggregationTickBars { HistoryType: var historyType } historyAggregationTickBars2)) - { - if (aggregation is HistoryAggregationTime { HistoryType: var historyType2 } historyAggregationTime2) - { - HistoryType historyType3 = historyType2 switch - { - HistoryType.Ask => HistoryType.Bid, - HistoryType.Bid => HistoryType.Ask, - _ => historyAggregationTime2.HistoryType, - }; - historyRequestParameters.Aggregation = new HistoryAggregationTime(historyAggregationTime2.Period, historyType3); - } - } - else - { - HistoryType historyType4 = historyType switch - { - HistoryType.Ask => HistoryType.Bid, - HistoryType.Bid => HistoryType.Ask, - _ => historyAggregationTickBars2.HistoryType, - }; - historyRequestParameters.Aggregation = new HistoryAggregationTickBars(historyAggregationTickBars2.TicksCount, historyType4); - } - } - HistoricalData historicalData = new HistoricalData(historyRequestParameters3); - historicalData.Reload(); - if (historicalData.Count == 0) - { - return new List(); - } - list.Add(new ? - { - HistoricalData = historicalData, - SyntheticItem = ??.Items[i] - }); - } - List list2 = new List(); - ? ?2 = new ?(list, P_0.CancellationToken); - do - { - IHistoryItem[] array2 = new IHistoryItem[??.Items.Count]; - for (int j = 0; j < ?2.?.Count; j++) - { - array2[j] = ?2.?[j].HistoricalData[?2.?[j].Position, SeekOriginHistory.Begin]; - } - IHistoryItem historyItem = global::?.?.?(array, array2, ??.PriceModifier); - if (!(historyItem is HistoryItemBar historyItemBar)) - { - if (!(historyItem is HistoryItemTick historyItemTick)) - { - if (!(historyItem is HistoryItemLast historyItemLast)) - { - if (historyItem is HistoryItemMark historyItemMark) - { - historyItemMark.Price = base.Symbol.RoundPriceToTickSize(historyItemMark.Price); - } - } - else - { - historyItemLast.Price = base.Symbol.RoundPriceToTickSize(historyItemLast.Price); - } - } - else - { - historyItemTick.Bid = base.Symbol.RoundPriceToTickSize(historyItemTick.Bid); - historyItemTick.Ask = base.Symbol.RoundPriceToTickSize(historyItemTick.Ask); - } - } - else - { - historyItemBar.Open = base.Symbol.RoundPriceToTickSize(historyItemBar.Open); - historyItemBar.High = base.Symbol.RoundPriceToTickSize(historyItemBar.High); - historyItemBar.Low = base.Symbol.RoundPriceToTickSize(historyItemBar.Low); - historyItemBar.Close = base.Symbol.RoundPriceToTickSize(historyItemBar.Close); - } - list2.Add(historyItem); - } - while (?2.?(P_0.CancellationToken)); - list2.ProcessTickDirection(P_0.CancellationToken); - return ??.AggregateHistory(new HistoryHolder(list2, historyRequestParameters)); - } - } -} -namespace TradingPlatform.BusinessLayer -{ - public sealed class Synthetic : CustomSymbol, ICustomizable - { - [Serializable] - [CompilerGenerated] - private new sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func, IEnumerable, IEnumerable> ??; - - public static Func> ??; - - public static Func> ??; - - public static Func> ??; - - public static Func> ??; - - public static Func ??; - - public static Action ??; - - internal string ?(SyntheticItem P_0) - { - return P_0.Symbol.ConnectionId; - } - - internal bool ?(SyntheticItem P_0) - { - return P_0.Symbol == null; - } - - internal bool ?(SyntheticItem P_0) - { - return P_0.Symbol.State == BusinessObjectState.Fake; - } - - internal SyntheticItem ?(SyntheticItem P_0) - { - return new SyntheticItem(P_0); - } - - internal bool ?(SyntheticItem P_0) - { - return P_0.Symbol.GetAlowedOrderTypes(OrderTypeUsage.Order)?.FirstOrDefault((OrderType orderType) => orderType.Behavior == OrderTypeBehavior.Market) != null; - } - - internal bool ?(OrderType P_0) - { - return P_0.Behavior == OrderTypeBehavior.Market; - } - - internal TimeInForce[] ?(SyntheticItem P_0) - { - return P_0.Symbol.GetAlowedOrderTypes(OrderTypeUsage.Order).First((OrderType orderType) => orderType.Behavior == OrderTypeBehavior.Market).AllowedTifs; - } - - internal bool ?(OrderType P_0) - { - return P_0.Behavior == OrderTypeBehavior.Market; - } - - internal IEnumerable ?(IEnumerable P_0, IEnumerable P_1) - { - return P_0.Intersect(P_1); - } - - internal IEnumerable ?(SyntheticItem P_0) - { - return P_0.Symbol.HistoryMetadata.AllowedAggregations; - } - - internal IEnumerable ?(SyntheticItem P_0) - { - return P_0.Symbol.HistoryMetadata.AllowedPeriodsHistoryAggregationTime; - } - - internal IEnumerable ?(SyntheticItem P_0) - { - return P_0.Symbol.HistoryMetadata.AllowedHistoryTypesHistoryAggregationTime; - } - - internal IEnumerable ?(SyntheticItem P_0) - { - return P_0.Symbol.HistoryMetadata.AllowedHistoryTypesHistoryAggregationTick; - } - - internal Symbol ?(SyntheticItem P_0) - { - return P_0.Symbol; - } - - internal void ?(SyntheticItem P_0) - { - P_0.Symbol = Core.Instance.GetSymbol(P_0.Symbol.CreateInfo()); - } - } - - [CompilerGenerated] - private new sealed class ? - { - public PlaceOrderRequestParameters ??; - - public Func ??; - - internal double ?(SyntheticItem P_0) - { - return (double)((??.Side == Side.Buy) ? 1 : (-1)) * P_0.TradeRatio; - } - - internal bool ?(OrderType P_0) - { - return P_0.Behavior == ??.OrderType.Behavior; - } - } - - public const string SYNTHETIC_CONNECTION_ID = "CUSTOM_SYMBOL_CONNECTION"; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private ReadOnlyCollection ??; - - [CompilerGenerated] - private SyntheticState ??; - - [CompilerGenerated] - private SyntheticPriceModifier ??; - - [CompilerGenerated] - private bool ??; - - private List ??; - - private readonly object ??; - - private readonly ConnectionStateObserver ??; - - private bool ??; - - private bool ??; - - public override Connection Connection => Items?.FirstOrDefault()?.Symbol?.Connection; - - public override BusinessObjectState State - { - get - { - if (SyntheticState != SyntheticState.Initialized) - { - return BusinessObjectState.Fake; - } - return base.State; - } - protected internal set - { - base.State = value; - } - } - - public string[] LegsConnectionsIds => Items.Select((SyntheticItem P_0) => P_0.Symbol.ConnectionId).Distinct().ToArray(); - - public SyntheticPriceModifierType PriceModifierType - { - get - { - return PriceModifier?.Type ?? SyntheticPriceModifierType.Undefined; - } - set - { - SyntheticPriceModifier priceModifier = PriceModifier; - if (priceModifier == null || priceModifier.Type != value) - { - PriceModifier = SyntheticPriceModifier.Create(value); - } - } - } - - public ReadOnlyCollection Items - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = readOnlyCollection; - } - } - - public SyntheticState SyntheticState - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = syntheticState; - } - } - - public SyntheticPriceModifier PriceModifier - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = syntheticPriceModifier; - } - } - - public bool ForceUseTicksForHistory - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IList Settings - { - get - { - List list = new List - { - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), base.Name), - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), base.Id), - new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)PriceModifierType), - new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ForceUseTicksForHistory) - }; - if (base.Group != null) - { - list.Add(new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new List - { - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), base.Group.GroupName), - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), base.Group.Id) - })); - } - for (int i = 0; i < Items.Count; i++) - { - list.Add(new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Items[i].Settings)); - } - return list; - } - set - { - if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemString settingItemString) - { - base.Name = (string)settingItemString.Value; - } - if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemString settingItemString2) - { - base.Id = (string)settingItemString2.Value; - } - PriceModifierType = (SyntheticPriceModifierType)value.GetValueOrDefault((int)PriceModifierType, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemBoolean settingItemBoolean) - { - ForceUseTicksForHistory = (bool)settingItemBoolean.Value; - } - if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value is IEnumerable list) - { - string text = list.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value?.ToString(); - string text2 = list.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value?.ToString(); - if (!string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(text2)) - { - base.Group = new SymbolGroup(base.ConnectionId); - base.Group.?(new MessageSymbolGroup - { - GroupName = text, - Id = text2 - }); - } - } - List list2 = new List(); - for (int i = 0; i < value.Count; i++) - { - if (!(value[i].Name != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - list2.Add(new SyntheticItem - { - Settings = (value[i].Value as List) - }); - } - } - Items = new ReadOnlyCollection(list2); - } - } - - public event Action Reinitialized - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public Synthetic(string name, SyntheticPriceModifierType priceModifierType) - : base(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - ?? = new object(); - ?? = new List(); - ForceUseTicksForHistory = false; - PriceModifierType = priceModifierType; - Items = new ReadOnlyCollection(Array.Empty()); - SyntheticState = SyntheticState.NotInitialized; - base.Name = name; - Core.Instance.?(?); - ?? = new ConnectionStateObserver(this, ConnectionStateObserverPriority.High, ConnectionState.Connected, ConnectionState.Disconnected, ConnectionState.ConnectionLost); - } - - public Synthetic(string name, SyntheticPriceModifierType priceModifierType, IEnumerable items) - : this(name, priceModifierType) - { - Reinitialize(items); - } - - public Synthetic(string name, Synthetic origin) - : this(name, origin.PriceModifierType, origin.Items) - { - } - - public void Rename(string newName) - { - if (string.IsNullOrEmpty(newName)) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - base.Name = newName; - ???.Invoke(this); - base.?(); - } - - public void RenameGroup(string groupName) - { - if (string.IsNullOrEmpty(groupName)) - { - base.Group = null; - } - else - { - if (base.Group == null) - { - SymbolGroup symbolGroup = (base.Group = new SymbolGroup(base.ConnectionId)); - } - base.Group.?(new MessageSymbolGroup - { - GroupName = groupName, - Id = groupName, - SortIndex = 0 - }); - } - ???.Invoke(this); - base.?(); - } - - public void Reinitialize(IEnumerable newItems) - { - if (newItems == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - try - { - lock (??) - { - SyntheticState = SyntheticState.NotInitialized; - ?(); - base.?(); - MessageSymbol messageSymbol = new MessageSymbol(base.Id) - { - Name = base.Name, - SymbolType = SymbolType.Synthetic, - QuotingType = SymbolQuotingType.Undefined, - MinLot = 1.0, - LotStep = 1.0, - LotSize = 1.0, - VolumeType = SymbolVolumeType.Disable, - NettingType = NettingType.Undefined, - AllowCalculateRealtimeChange = true, - AllowCalculateRealtimeTicks = false, - AllowCalculateRealtimeTrades = false, - AllowCalculateRealtimeVolume = false - }; - ?(messageSymbol); - if (!newItems.Any() || newItems.Any((SyntheticItem P_0) => P_0.Symbol == null) || newItems.Any((SyntheticItem P_0) => P_0.Symbol.State == BusinessObjectState.Fake)) - { - return; - } - Items = new ReadOnlyCollection(newItems.Select((SyntheticItem P_0) => new SyntheticItem(P_0)).ToArray()); - StringBuilder stringBuilder = new StringBuilder(); - double num = double.MinValue; - double num2 = double.MaxValue; - bool flag = true; - bool flag2 = true; - TimeSpan timeSpan = TimeSpan.MaxValue; - double num3 = double.MaxValue; - foreach (SyntheticItem item in Items) - { - if (stringBuilder.Length < 100) - { - StringBuilder stringBuilder2 = stringBuilder; - StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(5, 2, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(item.Symbol.FormatQuantity(item.Coefficient)); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(item.Symbol.Name); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - stringBuilder2.Append(ref handler); - } - if (item.Symbol.MinLot > num) - { - num = item.Symbol.MinLot; - } - if (item.Symbol.MaxLot < num2) - { - num2 = item.Symbol.MaxLot; - } - if (item.Symbol.HistoryType != HistoryType.Last) - { - flag = false; - } - if (item.Symbol.HistoryType != HistoryType.Mark) - { - flag2 = false; - } - if (item.Symbol.TickSize < num3) - { - num3 = item.Symbol.TickSize; - } - if (item.Symbol.QuoteDelay < timeSpan) - { - timeSpan = item.Symbol.QuoteDelay; - } - } - if (PriceModifierType == SyntheticPriceModifierType.Ln) - { - num3 = 1E-05; - } - messageSymbol.Description = stringBuilder.ToString().TrimEnd('+', ' '); - messageSymbol.QuoteDelay = timeSpan; - messageSymbol.VariableTickList = new List - { - new VariableTick(num3) - }; - messageSymbol.MaxLot = Math.Floor(num2); - messageSymbol.HistoryType = (flag ? HistoryType.Last : (flag2 ? HistoryType.Mark : HistoryType.Bid)); - ?(messageSymbol); - bool flag3 = true; - flag3 = Items.All((SyntheticItem P_0) => P_0.Symbol.GetAlowedOrderTypes(OrderTypeUsage.Order)?.FirstOrDefault((OrderType orderType) => orderType.Behavior == OrderTypeBehavior.Market) != null); - if (((?)this).Rules[3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()] is ? ?) - { - ?.?(new MessageRule - { - Value = flag3 - }); - } - if (flag3) - { - TimeInForce[] source = Items.Select((SyntheticItem P_0) => P_0.Symbol.GetAlowedOrderTypes(OrderTypeUsage.Order).First((OrderType orderType) => orderType.Behavior == OrderTypeBehavior.Market).AllowedTifs).Cast>().Aggregate((IEnumerable P_0, IEnumerable P_1) => P_0.Intersect(P_1)) - .ToArray(); - if (!source.Any()) - { - source = new TimeInForce[1]; - } - ?? = new List - { - new MarketOrderType(source.ToArray()) - }; - } - else - { - ?? = new List - { - new MarketOrderType(default(TimeInForce)) - }; - } - historyMetadata = new HistoryMetadata - { - AllowedAggregations = Items.SelectMany((SyntheticItem P_0) => P_0.Symbol.HistoryMetadata.AllowedAggregations).Distinct().ToArray(), - AllowedPeriodsHistoryAggregationTime = Items.SelectMany((SyntheticItem P_0) => P_0.Symbol.HistoryMetadata.AllowedPeriodsHistoryAggregationTime).Distinct().ToArray(), - AllowedHistoryTypesHistoryAggregationTime = Items.SelectMany((SyntheticItem P_0) => P_0.Symbol.HistoryMetadata.AllowedHistoryTypesHistoryAggregationTime).Distinct().ToArray(), - AllowedHistoryTypesHistoryAggregationTick = Items.SelectMany((SyntheticItem P_0) => P_0.Symbol.HistoryMetadata.AllowedHistoryTypesHistoryAggregationTick).Distinct().ToArray() - }; - foreach (SyntheticItem item2 in Items) - { - item2.Symbol.NewQuote += ?; - item2.Symbol.NewLast += ?; - item2.Symbol.NewMark += ?; - item2.Symbol.NewLevel2 += ?; - item2.Symbol.NewDayBar += ?; - } - ?(); - SyntheticState = SyntheticState.Initialized; - ?? = true; - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - public override void Dispose() - { - ??.Dispose(); - ?(); - SyntheticState = SyntheticState.NotInitialized; - base.Dispose(); - } - - private new void ?() - { - try - { - foreach (SyntheticItem item in Items) - { - item.Symbol.NewQuote -= ?; - item.Symbol.NewLast -= ?; - item.Symbol.NewMark -= ?; - item.Symbol.NewLevel2 -= ?; - item.Symbol.NewDayBar -= ?; - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - protected internal override void SubscribeAction(SubscribeQuoteType type) - { - } - - protected internal override void UnSubscribeAction(SubscribeQuoteType type) - { - } - - private new void ?() - { - try - { - ReadOnlyCollection items = Items; - if (items != null && items.Count == 0) - { - return; - } - int count = Items.Count; - double[] array = new double[count]; - Level2Item[][] array2 = new Level2Item[count][]; - Level2Item[][] array3 = new Level2Item[count][]; - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - for (int i = 0; i < Items.Count; i++) - { - SyntheticItem syntheticItem = Items[i]; - SessionsContainer currentSessionsInfo = syntheticItem.Symbol.CurrentSessionsInfo; - if (currentSessionsInfo != null && !currentSessionsInfo.ContainsDate(dateTimeUtcNow)) - { - return; - } - array[i] = syntheticItem.Coefficient; - DepthOfMarketAggregatedCollections depthOfMarketAggregatedCollections = syntheticItem.Symbol.DepthOfMarket.GetDepthOfMarketAggregatedCollections(); - if (syntheticItem.Coefficient > 0.0) - { - array3[i] = new Level2Item[depthOfMarketAggregatedCollections.Bids.Length]; - for (int j = 0; j < depthOfMarketAggregatedCollections.Bids.Length; j++) - { - array3[i][j] = depthOfMarketAggregatedCollections.Bids[j]; - } - } - else - { - array3[i] = new Level2Item[depthOfMarketAggregatedCollections.Asks.Length]; - for (int k = 0; k < depthOfMarketAggregatedCollections.Asks.Length; k++) - { - array3[i][k] = depthOfMarketAggregatedCollections.Asks[k]; - } - } - if (syntheticItem.Coefficient > 0.0) - { - array2[i] = new Level2Item[depthOfMarketAggregatedCollections.Asks.Length]; - for (int l = 0; l < depthOfMarketAggregatedCollections.Asks.Length; l++) - { - array2[i][l] = depthOfMarketAggregatedCollections.Asks[l]; - } - } - else - { - array2[i] = new Level2Item[depthOfMarketAggregatedCollections.Bids.Length]; - for (int m = 0; m < depthOfMarketAggregatedCollections.Bids.Length; m++) - { - array2[i][m] = depthOfMarketAggregatedCollections.Bids[m]; - } - } - } - (Level2Quote[], DateTime) tuple = global::?.?.?(array, QuotePriceType.Bid, base.Id, array3, PriceModifier); - (Level2Quote[], DateTime) tuple2 = global::?.?.?(array, QuotePriceType.Ask, base.Id, array2, PriceModifier); - DOMQuote dOMQuote = new DOMQuote(base.Id, dateTimeUtcNow); - Level2Quote[] item = tuple.Item1; - foreach (Level2Quote level2Quote in item) - { - dOMQuote.Bids.Add(new Level2Quote(level2Quote.PriceType, level2Quote.SymbolId, level2Quote.Id, RoundPriceToTickSize(level2Quote.Price), level2Quote.Size, level2Quote.Time)); - } - item = tuple2.Item1; - foreach (Level2Quote level2Quote2 in item) - { - dOMQuote.Asks.Add(new Level2Quote(level2Quote2.PriceType, level2Quote2.SymbolId, level2Quote2.Id, RoundPriceToTickSize(level2Quote2.Price), level2Quote2.Size, level2Quote2.Time)); - } - ?(dOMQuote); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - private void ?() - { - ReadOnlyCollection items = Items; - if (items == null || items.Count != 0) - { - int count = Items.Count; - double[] array = new double[count]; - double[] array2 = new double[count]; - double[] array3 = new double[count]; - double[] array4 = new double[count]; - double[] array5 = new double[count]; - DateTime[] array6 = new DateTime[count]; - for (int i = 0; i < Items.Count; i++) - { - SyntheticItem syntheticItem = Items[i]; - array[i] = syntheticItem.Coefficient; - array2[i] = syntheticItem.Symbol.Open; - array3[i] = syntheticItem.Symbol.High; - array4[i] = syntheticItem.Symbol.Low; - array5[i] = syntheticItem.Symbol.PrevClose; - array6[i] = syntheticItem.Symbol.QuoteDateTime; - } - (double, double, double, double, DateTime) tuple = global::?.?.?(array, array2, array3, array4, array5, array6, PriceModifier); - DayBar dayBar = new DayBar(base.Name, tuple.Item5) - { - Open = tuple.Item1, - High = tuple.Item2, - Low = tuple.Item3, - PreviousClose = tuple.Item4 - }; - ?(dayBar); - } - } - - private void ?() - { - ReadOnlyCollection items = Items; - if (items == null || items.Count != 0) - { - int count = Items.Count; - double[] array = new double[count]; - double[] array2 = new double[count]; - double[] array3 = new double[count]; - double[] array4 = new double[count]; - double[] array5 = new double[count]; - double[] array6 = new double[count]; - double[] array7 = new double[count]; - double[] array8 = new double[count]; - double[] array9 = new double[count]; - double[] array10 = new double[count]; - double[] array11 = new double[count]; - double[] array12 = new double[count]; - double[] array13 = new double[count]; - DateTime[] array14 = new DateTime[count]; - for (int i = 0; i < Items.Count; i++) - { - SyntheticItem syntheticItem = Items[i]; - array[i] = syntheticItem.Coefficient; - array2[i] = syntheticItem.Symbol.Ask; - array3[i] = syntheticItem.Symbol.Bid; - array4[i] = syntheticItem.Symbol.AskSize; - array5[i] = syntheticItem.Symbol.BidSize; - array6[i] = syntheticItem.Symbol.Last; - array7[i] = syntheticItem.Symbol.LastSize; - array8[i] = syntheticItem.Symbol.Mark; - array9[i] = syntheticItem.Symbol.MarkSize; - array10[i] = syntheticItem.Symbol.Open; - array11[i] = syntheticItem.Symbol.High; - array12[i] = syntheticItem.Symbol.Low; - array13[i] = syntheticItem.Symbol.PrevClose; - array14[i] = syntheticItem.Symbol.QuoteDateTime; - } - (double, double, double, double, DateTime) tuple = global::?.?.?(array, array2, array3, array4, array5, array14, PriceModifier); - (double, double, DateTime) tuple2 = global::?.?.?(array, array6, array7, array14, PriceModifier); - (double, double, DateTime) tuple3 = global::?.?.?(array, array8, array9, array14, PriceModifier); - (double, double, double, double, DateTime) tuple4 = global::?.?.?(array, array10, array11, array12, array13, array14, PriceModifier); - DayBar obj = new DayBar(base.Name, tuple.Item5) - { - Bid = tuple.Item2, - BidSize = tuple.Item4 - }; - (obj.Ask, _, obj.AskSize, _, _) = tuple; - (obj.Last, obj.LastSize, _) = tuple2; - (obj.Mark, obj.MarkSize, _) = tuple3; - (obj.Open, obj.High, obj.Low, obj.PreviousClose, _) = tuple4; - ?(obj); - } - } - - private void ?() - { - if (SyntheticState == SyntheticState.Initialized) - { - if (??) - { - ?? = false; - ?(); - } - if (??) - { - ?? = false; - ?(); - } - } - } - - private void ?(Symbol P_0, Last P_1) - { - if (SyntheticState == SyntheticState.NotInitialized) - { - return; - } - int count = Items.Count; - double[] array = new double[count]; - double[] array2 = new double[count]; - double[] array3 = new double[count]; - DateTime[] array4 = new DateTime[count]; - for (int i = 0; i < Items.Count; i++) - { - SyntheticItem syntheticItem = Items[i]; - array[i] = syntheticItem.Coefficient; - array2[i] = syntheticItem.Symbol.Last; - array3[i] = syntheticItem.Symbol.LastSize; - array4[i] = syntheticItem.Symbol.LastDateTime; - SessionsContainer currentSessionsInfo = syntheticItem.Symbol.CurrentSessionsInfo; - if (currentSessionsInfo != null && !currentSessionsInfo.ContainsDate(array4[i])) - { - return; - } - } - (double, double, DateTime) tuple = global::?.?.?(array, array2, array3, array4, PriceModifier); - if (!tuple.Item1.IsNanOrDefault()) - { - tuple.Item1 = RoundPriceToTickSize(tuple.Item1); - Last last = new Last(base.Name, tuple.Item1, tuple.Item2, tuple.Item3) - { - AggressorFlag = AggressorFlag.NotSet - }; - ?(last); - } - } - - private void ?(Symbol P_0, Mark P_1) - { - if (SyntheticState == SyntheticState.NotInitialized) - { - return; - } - int count = Items.Count; - double[] array = new double[count]; - double[] array2 = new double[count]; - double[] array3 = new double[count]; - DateTime[] array4 = new DateTime[count]; - for (int i = 0; i < Items.Count; i++) - { - SyntheticItem syntheticItem = Items[i]; - array[i] = syntheticItem.Coefficient; - array2[i] = syntheticItem.Symbol.Mark; - array3[i] = syntheticItem.Symbol.MarkSize; - array4[i] = syntheticItem.Symbol.LastDateTime; - SessionsContainer currentSessionsInfo = syntheticItem.Symbol.CurrentSessionsInfo; - if (currentSessionsInfo != null && !currentSessionsInfo.ContainsDate(array4[i])) - { - return; - } - } - (double, double, DateTime) tuple = global::?.?.?(array, array2, array3, array4, PriceModifier); - if (tuple.Item1 != 0.0) - { - tuple.Item1 = RoundPriceToTickSize(tuple.Item1); - Mark mark = new Mark(base.Name, tuple.Item3, tuple.Item1, tuple.Item2); - ?(mark); - } - } - - private void ?(Symbol P_0, Quote P_1) - { - if (SyntheticState == SyntheticState.NotInitialized) - { - return; - } - int count = Items.Count; - double[] array = new double[count]; - double[] array2 = new double[count]; - double[] array3 = new double[count]; - double[] array4 = new double[count]; - double[] array5 = new double[count]; - DateTime[] array6 = new DateTime[count]; - for (int i = 0; i < Items.Count; i++) - { - SyntheticItem syntheticItem = Items[i]; - array[i] = syntheticItem.Coefficient; - array2[i] = syntheticItem.Symbol.Ask; - array3[i] = syntheticItem.Symbol.Bid; - array4[i] = syntheticItem.Symbol.AskSize; - array5[i] = syntheticItem.Symbol.BidSize; - array6[i] = syntheticItem.Symbol.QuoteDateTime; - SessionsContainer currentSessionsInfo = syntheticItem.Symbol.CurrentSessionsInfo; - if (currentSessionsInfo != null && !currentSessionsInfo.ContainsDate(array6[i])) - { - return; - } - } - (double, double, double, double, DateTime) tuple = global::?.?.?(array, array2, array3, array4, array5, array6, PriceModifier); - if (!tuple.Item2.IsNanOrDefault() || !tuple.Item1.IsNanOrDefault()) - { - tuple.Item2 = RoundPriceToTickSize(tuple.Item2); - tuple.Item1 = RoundPriceToTickSize(tuple.Item1); - Quote quote = new Quote(base.Name, tuple.Item2, tuple.Item4, tuple.Item1, tuple.Item3, tuple.Item5); - ?(quote); - } - } - - private void ?(Symbol P_0, Level2Quote P_1, DOMQuote P_2) - { - ?? = true; - } - - private void ?(Symbol P_0, DayBar P_1) - { - ?? = true; - } - - private protected override HistoricalData ?(HistoryRequestParameters P_0) - { - return new ?(P_0); - } - - public override List GetAlowedOrderTypes(OrderTypeUsage? usage) - { - return ??; - } - - public override bool IsTradingAllowed(Account account) - { - foreach (Symbol item in Items.Select((SyntheticItem P_0) => P_0.Symbol)) - { - Account account2 = item.Connection?.BusinessObjects?.Accounts?.FirstOrDefault(); - if (account2 == null) - { - return false; - } - if (!item.IsTradingAllowed(account2)) - { - return false; - } - } - return true; - } - - internal override TradingOperationResult ?(PlaceOrderRequestParameters P_0) - { - if (P_0 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (P_0.OrderTypeId != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - return TradingOperationResult.CreateError(P_0.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - List list = Items.OrderByDescending((SyntheticItem syntheticItem2) => (double)((P_0.Side == Side.Buy) ? 1 : (-1)) * syntheticItem2.TradeRatio).ToList(); - for (int num = 0; num < list.Count; num++) - { - SyntheticItem syntheticItem = list[num]; - Symbol symbol = syntheticItem.Symbol; - PlaceOrderRequestParameters placeOrderRequestParameters = new PlaceOrderRequestParameters(P_0) - { - Symbol = symbol, - Account = ((LegsConnectionsIds.Length > 1) ? symbol.Connection.BusinessObjects.Accounts[0] : P_0.Account) - }; - OrderType orderType = syntheticItem.Symbol.GetAlowedOrderTypes(OrderTypeUsage.Order).FirstOrDefault((OrderType orderType2) => orderType2.Behavior == P_0.OrderType.Behavior); - if (orderType == null) - { - return TradingOperationResult.CreateError(P_0.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - placeOrderRequestParameters.OrderTypeId = orderType.Id; - placeOrderRequestParameters.Quantity = (double)Math.Abs((decimal)placeOrderRequestParameters.Quantity * (decimal)syntheticItem.TradeRatio); - if ((P_0.Side == Side.Buy && syntheticItem.TradeRatio > 0.0) || (P_0.Side == Side.Sell && syntheticItem.TradeRatio < 0.0)) - { - placeOrderRequestParameters.Side = Side.Buy; - } - else - { - placeOrderRequestParameters.Side = Side.Sell; - } - if (!string.IsNullOrEmpty(syntheticItem.TradeComment)) - { - placeOrderRequestParameters.Comment = syntheticItem.TradeComment; - } - TradingOperationResult tradingOperationResult = syntheticItem.Symbol.?(placeOrderRequestParameters); - if (tradingOperationResult.Status == TradingOperationResultStatus.Failure) - { - return tradingOperationResult; - } - } - return TradingOperationResult.CreateSuccess(P_0.RequestId); - } - - public override Account GetDefaultAccount(Account currentValue = null) - { - if (LegsConnectionsIds.Length != 1) - { - return null; - } - if (currentValue?.ConnectionId == Items[0].Symbol.ConnectionId) - { - return currentValue; - } - return Core.Instance.Connections[Items[0].Symbol.ConnectionId]?.BusinessObjects?.Accounts?.FirstOrDefault(); - } - - public override string FormatQuantity(double quantity, bool inLots = true, bool abbreviate = false) - { - int valuePrecision = CoreMath.GetValuePrecision((decimal)quantity); - return quantity.Format(valuePrecision, abbreviate); - } - - public override ConnectionDependency GetConnectionStateDependency() - { - return new ConnectionDependency - { - Behavior = ConnectionDependencyBehavior.PartialDependency, - DependentConnectionsIds = LegsConnectionsIds - }; - } - - public override void OnConnectionStateChanged(Connection connection, ConnectionStateChangedEventArgs e) - { - List list = Items.ToList(); - list.ForEach(delegate(SyntheticItem P_0) - { - P_0.Symbol = Core.Instance.GetSymbol(P_0.Symbol.CreateInfo()); - }); - Reinitialize(list); - } - } - public enum SyntheticState - { - NotInitialized, - Initialized - } -} -namespace ? -{ - internal static class ? - { - internal class ? - { - private readonly List ??; - - private int ??; - - private double ??; - - private bool HasNextLevel => ?? < ??.Count - 1; - - public double PriceOnCurrentLevel - { - get - { - if (?? >= ??.Count) - { - return 0.0; - } - return ??[??].Price; - } - } - - public double SizeOnCurrentLevel - { - get - { - if (?? >= ??.Count) - { - return 0.0; - } - return ??[??].Size - ??; - } - } - - public ?(Level2Item[] P_0) - { - ?? = new List(P_0); - } - - public bool ?(double P_0) - { - double num = P_0; - do - { - if (SizeOnCurrentLevel > num) - { - ?? += num; - num = 0.0; - continue; - } - num -= SizeOnCurrentLevel; - if (HasNextLevel) - { - ??++; - ?? = 0.0; - continue; - } - return false; - } - while (num > 0.0); - return true; - } - } - - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal double ?(? P_0) - { - return P_0.SizeOnCurrentLevel; - } - } - - public static (double ask, double bid, double askSize, double BidSize, DateTime QuoteDateTime) ?(double[] P_0, double[] P_1, double[] P_2, double[] P_3, double[] P_4, DateTime[] P_5, SyntheticPriceModifier P_6) - { - if (P_0 == null || P_0.Length == 0) - { - return (ask: double.NaN, bid: double.NaN, askSize: double.NaN, BidSize: double.NaN, QuoteDateTime: DateTime.MinValue); - } - double num = 0.0; - double num2 = 0.0; - double num3 = P_3[0]; - double num4 = P_4[0]; - DateTime dateTime = P_5[0]; - for (int i = 0; i < P_0.Length; i++) - { - if (P_1[i].IsNanOrDefault() && P_2[i].IsNanOrDefault()) - { - return (ask: double.NaN, bid: double.NaN, askSize: double.NaN, BidSize: double.NaN, QuoteDateTime: DateTime.MinValue); - } - num += P_6.CalculatePrice(P_0[i], (P_0[i] > 0.0) ? P_1[i] : P_2[i]); - num2 += P_6.CalculatePrice(P_0[i], (P_0[i] > 0.0) ? P_2[i] : P_1[i]); - if (P_0[i] > 0.0) - { - if (P_3[i] < num3) - { - num3 = P_3[i]; - } - if (P_4[i] < num4) - { - num4 = P_4[i]; - } - } - else - { - if (P_3[i] < num4) - { - num4 = P_3[i]; - } - if (P_4[i] < num3) - { - num3 = P_4[i]; - } - } - if (P_5[i] > dateTime) - { - dateTime = P_5[i]; - } - } - return (ask: num, bid: num2, askSize: num3, BidSize: num4, QuoteDateTime: dateTime); - } - - public static (double last, double lastSize, DateTime LastDateTime) ?(double[] P_0, double[] P_1, double[] P_2, DateTime[] P_3, SyntheticPriceModifier P_4) - { - if (P_0 == null || P_0.Length == 0) - { - return (last: double.NaN, lastSize: double.NaN, LastDateTime: DateTime.MinValue); - } - double num = 0.0; - double num2 = P_2[0]; - DateTime dateTime = P_3[0]; - for (int i = 0; i < P_0.Length; i++) - { - if (P_1[i].IsNanOrDefault()) - { - return (last: double.NaN, lastSize: double.NaN, LastDateTime: DateTime.MinValue); - } - num += P_4.CalculatePrice(P_0[i], P_1[i]); - if (P_2[i] < num2) - { - num2 = P_2[i]; - } - if (P_3[i] > dateTime) - { - dateTime = P_3[i]; - } - } - return (last: num, lastSize: num2, LastDateTime: dateTime); - } - - public static (double mark, double markSize, DateTime markDateTime) ?(double[] P_0, double[] P_1, double[] P_2, DateTime[] P_3, SyntheticPriceModifier P_4) - { - if (P_0 == null || P_0.Length == 0) - { - return (mark: double.NaN, markSize: double.NaN, markDateTime: DateTime.MinValue); - } - double num = 0.0; - double num2 = P_2[0]; - DateTime dateTime = P_3[0]; - for (int i = 0; i < P_0.Length; i++) - { - if (P_1[i].IsNanOrDefault()) - { - return (mark: double.NaN, markSize: double.NaN, markDateTime: DateTime.MinValue); - } - num += P_4.CalculatePrice(P_0[i], P_1[i]); - if (P_2[i] < num2) - { - num2 = P_2[i]; - } - if (P_3[i] > dateTime) - { - dateTime = P_3[i]; - } - } - return (mark: num, markSize: num2, markDateTime: dateTime); - } - - public static (Level2Quote[] quotes, DateTime Time) ?(double[] P_0, QuotePriceType P_1, string P_2, Level2Item[][] P_3, SyntheticPriceModifier P_4) - { - try - { - if (P_3 == null) - { - return (quotes: null, Time: DateTime.MinValue); - } - ?[] array = new ?[P_0.Length]; - for (int i = 0; i < array.Length; i++) - { - array[i] = new ?(P_3[i]); - } - List list = new List(); - bool flag = false; - do - { - double num = 0.0; - for (int j = 0; j < P_0.Length; j++) - { - num += P_4.CalculatePrice(P_0[j], array[j].PriceOnCurrentLevel); - } - double num2 = array.Min((? ?2) => ?2.SizeOnCurrentLevel); - list.Add(new Level2Quote(P_1, P_2, P_1.ToString() + list.Count, num, num2, Core.Instance.TimeUtils.DateTimeUtcNow)); - ?[] array2 = array; - for (int num3 = 0; num3 < array2.Length; num3++) - { - if (!array2[num3].?(num2)) - { - flag = true; - break; - } - } - } - while (!flag); - return (quotes: list.ToArray(), Time: DateTime.MinValue); - } - catch - { - return (quotes: null, Time: DateTime.MinValue); - } - } - - public static (double open, double high, double low, double close, DateTime QuoteDateTime) ?(double[] P_0, double[] P_1, double[] P_2, double[] P_3, double[] P_4, DateTime[] P_5, SyntheticPriceModifier P_6) - { - if (P_0 == null || P_0.Length == 0) - { - return (open: 0.0, high: 0.0, low: 0.0, close: 0.0, QuoteDateTime: DateTime.MinValue); - } - double num = 0.0; - double num2 = 0.0; - double num3 = 0.0; - double num4 = 0.0; - DateTime dateTime = P_5[0]; - for (int i = 0; i < P_0.Length; i++) - { - num += P_6.CalculatePrice(P_0[i], P_1[i]); - num2 += P_6.CalculatePrice(P_0[i], P_2[i]); - num3 += P_6.CalculatePrice(P_0[i], P_3[i]); - num4 += P_6.CalculatePrice(P_0[i], P_4[i]); - if (P_5[i] > dateTime) - { - dateTime = P_5[i]; - } - } - return (open: num, high: num2, low: num3, close: num4, QuoteDateTime: dateTime); - } - - public static IHistoryItem ?(double[] P_0, IHistoryItem[] P_1, SyntheticPriceModifier P_2) - { - if (P_1 == null) - { - return null; - } - if (P_1.Length == 0) - { - return null; - } - IHistoryItem historyItem = P_1[0]; - if (!(historyItem is HistoryItemBar)) - { - if (!(historyItem is HistoryItemTick)) - { - if (historyItem is HistoryItemLast) - { - double num = 0.0; - double volume = 0.0; - long num2 = long.MinValue; - for (int i = 0; i < P_0.Length; i++) - { - HistoryItemLast historyItemLast = (HistoryItemLast)P_1[i]; - num += P_2.CalculatePrice(P_0[i], historyItemLast.Price); - if (historyItemLast.TicksLeft > num2) - { - num2 = historyItemLast.TicksLeft; - } - } - return new HistoryItemLast - { - Price = num, - Volume = volume, - TicksLeft = num2 - }; - } - return null; - } - double num3 = 0.0; - double num4 = 0.0; - double bidSize = 0.0; - double askSize = 0.0; - long num5 = long.MinValue; - for (int j = 0; j < P_0.Length; j++) - { - HistoryItemTick historyItemTick = (HistoryItemTick)P_1[j]; - num3 += P_2.CalculatePrice(P_0[j], (P_0[j] > 0.0) ? historyItemTick.Bid : historyItemTick.Ask); - num4 += P_2.CalculatePrice(P_0[j], (P_0[j] > 0.0) ? historyItemTick.Ask : historyItemTick.Bid); - if (historyItemTick.TicksLeft > num5) - { - num5 = historyItemTick.TicksLeft; - } - } - return new HistoryItemTick - { - Bid = num3, - Ask = num4, - AskSize = askSize, - BidSize = bidSize, - TicksLeft = num5 - }; - } - double num6 = 0.0; - double num7 = 0.0; - double num8 = 0.0; - double num9 = 0.0; - double volume2 = 0.0; - int num10 = 0; - long num11 = long.MinValue; - long ticksRight = long.MinValue; - for (int k = 0; k < P_0.Length; k++) - { - HistoryItemBar historyItemBar = (HistoryItemBar)P_1[k]; - num6 += P_2.CalculatePrice(P_0[k], historyItemBar.Open); - num8 += P_2.CalculatePrice(P_0[k], historyItemBar.High); - num9 += P_2.CalculatePrice(P_0[k], historyItemBar.Low); - num7 += P_2.CalculatePrice(P_0[k], historyItemBar.Close); - if (historyItemBar.TicksLeft > num11) - { - num11 = historyItemBar.TicksLeft; - ticksRight = historyItemBar.TicksRight; - } - } - double[] source = new double[4] { num6, num8, num9, num7 }; - return new HistoryItemBar - { - Open = num6, - High = source.Max(), - Low = source.Min(), - Close = num7, - Volume = volume2, - Ticks = num10, - TicksLeft = num11, - TicksRight = ticksRight - }; - } - } - internal class ? - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Predicate ??; - - internal bool ?(ISyntheticSynhroniserItem P_0) - { - return P_0.Position == -1; - } - } - - public List ?; - - private bool ?; - - public ?(List P_0, CancellationToken P_1) - { - ? = P_0; - ? = P_0.Count > 0 && P_0[0].HistoricalData?.Aggregation is HistoryAggregationTime { Period: var period } && period.BasePeriod >= BasePeriod.Day; - while (?(P_1) && ?.Exists((ISyntheticSynhroniserItem syntheticSynhroniserItem) => syntheticSynhroniserItem.Position == -1)) - { - } - } - - public bool ?(CancellationToken P_0) - { - foreach (ISyntheticSynhroniserItem item in ?) - { - if (P_0.IsCancellationRequested) - { - return false; - } - long nextPositionTime = item.NextPositionTime; - if (nextPositionTime < 0) - { - continue; - } - foreach (ISyntheticSynhroniserItem item2 in ?) - { - if (P_0.IsCancellationRequested) - { - return false; - } - while (true) - { - nextPositionTime = item.NextPositionTime; - if (nextPositionTime < 0 || ? || (item2.SyntheticItem?.Symbol.CurrentSessionsInfo?.ContainsDate(nextPositionTime) ?? true)) - { - break; - } - if (P_0.IsCancellationRequested) - { - return false; - } - item.Move(); - } - } - } - long num = long.MaxValue; - for (int i = 0; i < ?.Count; i++) - { - if (P_0.IsCancellationRequested) - { - return false; - } - long nextPositionTime2 = ?[i].NextPositionTime; - if (nextPositionTime2 > 0 && nextPositionTime2 < num) - { - num = nextPositionTime2; - } - } - if (num == long.MaxValue) - { - return false; - } - bool result = false; - foreach (ISyntheticSynhroniserItem item3 in ?) - { - if (P_0.IsCancellationRequested) - { - return false; - } - if (item3.NextPositionTime == num) - { - item3.Move(); - result = true; - } - } - return result; - } - } -} -namespace TradingPlatform.BusinessLayer -{ - public interface ISyntheticSynhroniserItem - { - SyntheticItem SyntheticItem { get; set; } - - HistoricalData HistoricalData { get; set; } - - int Position { get; } - - long NextPositionTime { get; } - - void Move(); - } -} -namespace ? -{ - internal class ? : ISyntheticSynhroniserItem - { - [CompilerGenerated] - private SyntheticItem ??; - - [CompilerGenerated] - private HistoricalData ??; - - [CompilerGenerated] - private int ??; - - public SyntheticItem SyntheticItem - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public HistoricalData HistoricalData - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int Position - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public long NextPositionTime - { - get - { - if (Position < HistoricalData.Count - 1) - { - return HistoricalData[Position + 1, SeekOriginHistory.Begin].TicksLeft; - } - return -1L; - } - } - - public ?() - { - Position = -1; - } - - public void Move() - { - Position++; - } - } -} -namespace TradingPlatform.BusinessLayer -{ - public sealed class SyntheticItem : ICloneable, ICustomizable - { - [CompilerGenerated] - private Symbol ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private string ??; - - public Symbol Symbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double Coefficient - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double TradeRatio - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string TradeComment - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IList Settings - { - get - { - return new List - { - new SettingItemSymbol(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Symbol), - new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Coefficient), - new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TradeRatio) - }; - } - set - { - if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemSymbol settingItemSymbol) - { - Symbol = settingItemSymbol.Value as Symbol; - } - if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemDouble settingItemDouble) - { - Coefficient = (double)settingItemDouble.Value; - } - if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemDouble settingItemDouble2) - { - TradeRatio = (double)settingItemDouble2.Value; - } - } - } - - public SyntheticItem() - { - Coefficient = 1.0; - TradeRatio = 1.0; - TradeComment = null; - } - - public SyntheticItem(SyntheticItem syntheticItem) - { - Symbol = syntheticItem.Symbol; - Coefficient = syntheticItem.Coefficient; - TradeRatio = syntheticItem.TradeRatio; - TradeComment = syntheticItem.TradeComment; - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(1, 2); - defaultInterpolatedStringHandler.AppendFormatted(Coefficient); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Symbol?.Name); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public object Clone() - { - return new SyntheticItem(this); - } - } - public sealed class DeliveredAsset : TradingObject, IMessageBuilder - { - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private Action ??; - - public double Quantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public string Status - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public DateTime CreationTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - /// - /// Will be triggered on each invocation - /// - public event Action Updated - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - internal DeliveredAsset(string P_0) - : base(P_0) - { - } - - internal void ?(MessageOpenDeliveredAsset P_0) - { - base.Id = P_0.Id; - if (ConnectionCache != null && ConnectionCache.SymbolsCache.?(P_0.SymbolId, out var symbol)) - { - base.Symbol = symbol; - } - if (ConnectionCache != null && ConnectionCache.AccountsCache.?(P_0.AccountId, out var account)) - { - base.Account = account; - } - Quantity = P_0.Quantity; - Status = P_0.Status; - CreationTime = P_0.CreationTime; - ProcessAdditionalItems(P_0.AdditionalInfoItems); - ???.Invoke(this); - } - - public MessageOpenDeliveredAsset BuildMessage() - { - return new MessageOpenDeliveredAsset - { - Id = base.Id, - AccountId = base.Account?.Id, - SymbolId = base.Symbol?.Id, - Quantity = Quantity, - Status = Status, - CreationTime = CreationTime - }; - } - } - /// - /// Contains all information which belong to the given exchange - /// - [Published] - public sealed class Exchange : BusinessObject, IComparable, IMessageBuilder - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private int ??; - - private string ??; - - /// - /// Gets Exchange Id - /// - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Gets Exchange name - /// - public string ExchangeName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Used for the Exchanges comparing - /// - public int SortIndex - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - internal SessionsContainer CurrentSessionsInfo - { - get - { - if (string.IsNullOrEmpty(??)) - { - return null; - } - ConnectionCache.TradingSessions.TryGetValue(??, out var value); - return value; - } - } - - public ExchangeComplexIdentifier ComplexId => new ExchangeComplexIdentifier(base.ConnectionId, Id); - - internal Exchange(string P_0) - : base(P_0) - { - } - - internal void ?(MessageExchange P_0) - { - Id = P_0.Id; - ExchangeName = P_0.ExchangeName; - SortIndex = P_0.SortIndex; - ?? = P_0.SessionsContainerId; - } - - private MessageExchange ?() - { - return new MessageExchange - { - Id = Id, - ExchangeName = ExchangeName, - SortIndex = SortIndex, - SessionsContainerId = ?? - }; - } - - MessageExchange IMessageBuilder.BuildMessage() - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(); - } - - /// - /// Compares Exchnges in order by next - SortIndex, Exchange name, Connection Id, Exchange Id. - /// - /// - /// - [NotPublished] - public int CompareTo(object obj) - { - if (!(obj is Exchange exchange)) - { - return 1; - } - int num = SortIndex.CompareTo(exchange.SortIndex); - if (num != 0) - { - return num; - } - num = ExchangeName.CompareTo(exchange.ExchangeName); - if (num != 0) - { - return num; - } - num = base.ConnectionId.CompareTo(exchange.ConnectionId); - if (num != 0) - { - return num; - } - return Id.CompareTo(exchange.Id); - } - - public override string ToString() - { - return ExchangeName ?? Id.ToString() ?? base.ToString(); - } - } - /// - /// Provides possibility to group and sort symbols for each connection - /// - [Published] - [DataContract(Name = "InstrumentGroup", Namespace = "TradingPlatform")] - public class SymbolGroup : BusinessObject - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private int ??; - - /// - /// Gets group Id - /// - [DataMember(Name = "GroupId")] - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Gets group name - /// - [DataMember(Name = "GroupName")] - public string GroupName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Gets sort index for comparing process - /// - [DataMember(Name = "SortIndex")] - public int SortIndex - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - internal SymbolGroup(string P_0) - : base(P_0) - { - } - - internal void ?(MessageSymbolGroup P_0) - { - Id = P_0.Id; - GroupName = P_0.GroupName; - SortIndex = P_0.SortIndex; - } - } - public sealed class NewsArticle : BusinessObject - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal bool ?(Symbol P_0) - { - return P_0 != null; - } - } - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private IEnumerable ??; - - private string[] ??; - - private bool ??; - - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public DateTime CreationDate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - public string Title - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public string SourceLink - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public string Category - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public IEnumerable Symbols - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = enumerable; - } - } - - public bool NeedToLoadSymbols - { - get - { - if (?? != null) - { - return ??.Any(); - } - return false; - } - } - - internal NewsArticle(string P_0) - : base(P_0) - { - Symbols = new Symbol[0]; - ?? = new string[0]; - } - - internal void ?(MessageNewsHeadline P_0) - { - Id = P_0.Id; - CreationDate = P_0.CreationDate; - Title = P_0.Title; - SourceLink = P_0.SourceLink; - Category = P_0.Category; - if (P_0.SymbolsIds != null && P_0.SymbolsIds.Any()) - { - ?? = P_0.SymbolsIds.ToArray(); - } - } - - public void LoadSymbols() - { - if (??) - { - return; - } - ?? = true; - if (!NeedToLoadSymbols) - { - return; - } - try - { - Symbols = (from P_0 in ?? - select Connection.?(new GetSymbolRequestParameters - { - SymbolId = P_0 - }) into P_0 - where P_0 != null - select P_0).ToArray(); - ?? = null; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - ?? = false; - } - } - - [CompilerGenerated] - private Symbol ?(string P_0) - { - return Connection.?(new GetSymbolRequestParameters - { - SymbolId = P_0 - }); - } - } - /// - /// Represents trading information about pending order - /// - [DataContract(Name = "Order", Namespace = "TradingPlatform")] - [Published] - public class Order : TradingObject, IMessageBuilder, IOrder, ITradingObject, IUniqueID, IEquatable - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private OrderStatus ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private TimeInForce ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private SlTpHolder[] ??; - - [CompilerGenerated] - private SlTpHolder[] ??; - - [CompilerGenerated] - private Action ??; - - /// - /// The ID of the order group. This group created when trades done by the MAM account. - /// - [DataMember(Name = "GroupId")] - public string GroupId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Gets Position Id. - /// - [DataMember(Name = "PositionId")] - public string PositionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Total quantity of the order - /// - [DataMember(Name = "TotalQuantity")] - public double TotalQuantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Filled quantity of the order - /// - [DataMember(Name = "FilledQuantity")] - public double FilledQuantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Remaining quantity of the order - /// - public double RemainingQuantity => TotalQuantity - FilledQuantity; - - /// - /// Orders Type Id. It is used for the orders type comparing. - /// - [DataMember(Name = "OrderTypeId")] - public string OrderTypeId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Gets OrderType - /// - public OrderType OrderType => ConnectionCache.OrderTypes.FirstOrDefault((OrderType P_0) => P_0.Id == OrderTypeId); - - /// - /// Gets order price value - /// - [DataMember(Name = "Price")] - public double Price - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets order trigger price value - /// - [DataMember(Name = "TriggerPrice")] - public double TriggerPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets order trailing offset value - /// - [DataMember(Name = "TrailOffset")] - public double TrailOffset - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets orders current status - /// - [DataMember(Name = "Status")] - public OrderStatus Status - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = orderStatus; - } - } - - /// - /// Gets open order original status - /// - [DataMember(Name = "OriginalStatus")] - public string OriginalStatus - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Gets order TIF(Time-In-Force) type - /// - [DataMember(Name = "Tif")] - public TimeInForce TimeInForce - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = timeInForce; - } - } - - /// - /// Gets orders expiration time - /// - [DataMember(Name = "ExpirationTime")] - public DateTime ExpirationTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - /// - /// Gets orders last update time - /// - public DateTime LastUpdateTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - public double AverageFillPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets StopLoss holder for given order - /// - public SlTpHolder StopLoss => StopLossItems.FirstOrDefault(); - - /// - /// Gets TakeProfit holder for given order - /// - public SlTpHolder TakeProfit => TakeProfitItems.FirstOrDefault(); - - public SlTpHolder[] StopLossItems - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = array; - } - } - - public SlTpHolder[] TakeProfitItems - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = array; - } - } - - /// - /// Will be triggered on each invocation - /// - public event Action Updated - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - /// - /// Creates Order instance - /// - /// - internal Order(string P_0) - : base(P_0) - { - StopLossItems = new SlTpHolder[0]; - TakeProfitItems = new SlTpHolder[0]; - } - - internal void ?(MessageOpenOrder P_0) - { - base.Id = P_0.OrderId; - GroupId = P_0.GroupId; - PositionId = P_0.PositionId; - LastUpdateTime = P_0.LastUpdateTime; - if (ConnectionCache != null && ConnectionCache.SymbolsCache.?(P_0.SymbolId, out var symbol)) - { - base.Symbol = symbol; - } - else if (!string.IsNullOrEmpty(P_0.SymbolId)) - { - base.Symbol = new Symbol(new BusinessObjectInfo - { - Id = P_0.SymbolId, - Name = P_0.SymbolId - }); - } - if (!string.IsNullOrEmpty(P_0.AccountId) && ConnectionCache != null && ConnectionCache.AccountsCache.?(P_0.AccountId, out var account)) - { - base.Account = account; - } - TotalQuantity = P_0.TotalQuantity; - FilledQuantity = P_0.FilledQuantity; - base.Side = P_0.Side; - OrderTypeId = P_0.OrderTypeId; - Price = P_0.Price; - TriggerPrice = P_0.TriggerPrice; - TrailOffset = P_0.TrailOffset; - TimeInForce = P_0.TimeInForce; - ExpirationTime = P_0.ExpirationTime; - Status = P_0.Status; - OriginalStatus = P_0.OriginalStatus; - AverageFillPrice = P_0.AverageFillPrice; - StopLossItems = P_0.StopLossItems.ToArray(); - TakeProfitItems = P_0.TakeProfitItems.ToArray(); - base.Comment = P_0.Comment; - ProcessAdditionalItems(P_0.AdditionalInfoItems); - ???.Invoke(this); - } - - public MessageOpenOrder BuildMessage() - { - MessageOpenOrder messageOpenOrder = new MessageOpenOrder(base.Symbol?.Id); - messageOpenOrder.OrderId = base.Id; - messageOpenOrder.GroupId = GroupId; - messageOpenOrder.PositionId = PositionId; - messageOpenOrder.LastUpdateTime = LastUpdateTime; - messageOpenOrder.AccountId = base.Account?.Id; - messageOpenOrder.TotalQuantity = TotalQuantity; - messageOpenOrder.FilledQuantity = FilledQuantity; - messageOpenOrder.Side = base.Side; - messageOpenOrder.OrderTypeId = OrderTypeId; - messageOpenOrder.Price = Price; - messageOpenOrder.TriggerPrice = TriggerPrice; - messageOpenOrder.TrailOffset = TrailOffset; - messageOpenOrder.TimeInForce = TimeInForce; - messageOpenOrder.ExpirationTime = ExpirationTime; - messageOpenOrder.Status = Status; - messageOpenOrder.OriginalStatus = OriginalStatus; - messageOpenOrder.Comment = base.Comment; - messageOpenOrder.AdditionalInfoItems = base.AdditionalInfo?.ToList(); - messageOpenOrder.StopLossItems.AddRange(StopLossItems); - messageOpenOrder.TakeProfitItems.AddRange(TakeProfitItems); - return messageOpenOrder; - } - - /// - /// Cancels pending order - /// - /// - public TradingOperationResult Cancel(string sendingSource = null) - { - return Core.Instance.CancelOrder(new CancelOrderRequestParameters - { - Order = this, - SendingSource = sendingSource - }); - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(46, 12); - defaultInterpolatedStringHandler.AppendFormatted(base.Id); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.Symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.Account); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderType?.Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(FilledQuantity); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(TotalQuantity); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(?()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Status); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(PositionId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(GroupId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.Comment); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - private string ?() - { - StringBuilder stringBuilder = new StringBuilder(); - if (!double.IsNaN(Price)) - { - StringBuilder stringBuilder2 = stringBuilder; - StringBuilder stringBuilder3 = stringBuilder2; - StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(5, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(base.Symbol?.FormatPrice(Price) ?? Price.FormatPriceWithMaxPrecision()); - stringBuilder3.Append(ref handler); - } - if (!double.IsNaN(TriggerPrice)) - { - StringBuilder stringBuilder2 = stringBuilder; - StringBuilder stringBuilder4 = stringBuilder2; - StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(8, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(base.Symbol?.FormatPrice(TriggerPrice) ?? TriggerPrice.FormatPriceWithMaxPrecision()); - stringBuilder4.Append(ref handler); - } - if (!double.IsNaN(TrailOffset)) - { - StringBuilder stringBuilder2 = stringBuilder; - StringBuilder stringBuilder5 = stringBuilder2; - StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(12, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(base.Symbol?.FormatOffset(TrailOffset, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? TrailOffset.FormatPriceWithMaxPrecision()); - stringBuilder5.Append(ref handler); - } - return stringBuilder.ToString(); - } - - public bool Equals(Order other) - { - if (other == null) - { - return false; - } - if (this == other) - { - return true; - } - if (base.ConnectionId == other.ConnectionId) - { - return base.Id == other.Id; - } - return false; - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - if (this == obj) - { - return true; - } - if (obj.GetType() != GetType()) - { - return false; - } - return Equals((Order)obj); - } - - public override int GetHashCode() - { - return HashCode.Combine(base.ConnectionId, base.Id); - } - - [CompilerGenerated] - private bool ?(OrderType P_0) - { - return P_0.Id == OrderTypeId; - } - } - /// - /// Represents an wrapper - /// - public class OrderHistory : Order, IMessageBuilder, IEquatable - { - public OrderHistory(string connectionId) - : base(connectionId) - { - } - - private MessageOrderHistory ?() - { - return new MessageOrderHistory(BuildMessage()); - } - - MessageOrderHistory IMessageBuilder.BuildMessage() - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(); - } - - public bool Equals(OrderHistory other) - { - if (other == null) - { - return false; - } - if (this == other) - { - return true; - } - if (base.ConnectionId == other.ConnectionId && base.Id == other.Id && base.UniqueId == other.UniqueId && object.Equals(base.Symbol, other.Symbol) && object.Equals(base.Account, other.Account) && object.Equals(base.OrderType, other.OrderType) && object.Equals(base.StopLoss, other.StopLoss) && object.Equals(base.TakeProfit, other.TakeProfit) && object.Equals(base.StopLossItems, other.StopLossItems) && object.Equals(base.TakeProfitItems, other.TakeProfitItems) && object.Equals(base.AdditionalInfo, other.AdditionalInfo) && base.Comment == other.Comment && base.Price == other.Price && base.TriggerPrice == other.TriggerPrice && base.TrailOffset == other.TrailOffset && base.AverageFillPrice == other.AverageFillPrice && base.TotalQuantity == other.TotalQuantity && base.FilledQuantity == other.FilledQuantity && base.RemainingQuantity == other.RemainingQuantity && base.Side == other.Side && State == other.State && base.Status == other.Status && base.ExpirationTime == other.ExpirationTime && base.GroupId == other.GroupId && base.OriginalStatus == other.OriginalStatus && base.PositionId == other.PositionId && base.LastUpdateTime == other.LastUpdateTime && base.OrderTypeId == other.OrderTypeId) - { - return base.TimeInForce == other.TimeInForce; - } - return false; - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - if (this == obj) - { - return true; - } - if (obj.GetType() != GetType()) - { - return false; - } - return Equals((OrderHistory)obj); - } - - public override int GetHashCode() - { - HashCode hashCode = default(HashCode); - hashCode.Add(base.ConnectionId); - hashCode.Add(base.Id); - hashCode.Add(base.UniqueId); - hashCode.Add(base.Symbol); - hashCode.Add(base.Account); - hashCode.Add(base.OrderType); - hashCode.Add(base.StopLoss); - hashCode.Add(base.TakeProfit); - hashCode.Add(base.StopLossItems); - hashCode.Add(base.TakeProfitItems); - hashCode.Add(base.AdditionalInfo); - hashCode.Add(base.Comment); - hashCode.Add(base.Price); - hashCode.Add(base.TriggerPrice); - hashCode.Add(base.TrailOffset); - hashCode.Add(base.AverageFillPrice); - hashCode.Add(base.TotalQuantity); - hashCode.Add(base.FilledQuantity); - hashCode.Add(base.RemainingQuantity); - hashCode.Add(base.Side); - hashCode.Add(State); - hashCode.Add(base.Status); - hashCode.Add(base.ExpirationTime); - hashCode.Add(base.GroupId); - hashCode.Add(base.OriginalStatus); - hashCode.Add(base.PositionId); - hashCode.Add(base.LastUpdateTime); - hashCode.Add(base.OrderTypeId); - hashCode.Add(base.TimeInForce); - return hashCode.ToHashCode(); - } - } - public class BasicBalanceCalculator : IBalanceCalculator, IDisposable - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - internal bool ?(SlTpHolder P_0) - { - return !double.IsNaN(P_0.QuantityPercentage); - } - - internal double ?(SlTpHolder P_0) - { - return P_0.Quantity; - } - } - - [CompilerGenerated] - private sealed class ? - { - public BasicBalanceCalculator ??; - - public SettingItem[] ??; - - public OrderRequestParameters ??; - - internal void ?() - { - ??.PopulateAction(??, ??); - } - } - - [CompilerGenerated] - private sealed class ? - { - public BasicBalanceCalculator ??; - - public OrderRequestParameters ??; - - public string ??; - - internal void ?() - { - try - { - ??.RequestParameters = ??; - ??.?? = ??; - ??.OnOrderSettingChanged(??); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - ??.?? = null; - } - } - } - - [CompilerGenerated] - private sealed class ? - { - public BasicBalanceCalculator ??; - - public Symbol ??; - - public double ??; - - internal double ?(SlTpHolder P_0) - { - return ??.?(??, P_0, P_0.QuantityPercentage / 100.0, ??); - } - - internal double ?(SlTpHolder P_0) - { - return ??.?(??, P_0, P_0.Quantity, ??); - } - } - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private double? ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private readonly bool ??; - - [CompilerGenerated] - private bool ??; - - protected OrderRequestParameters RequestParameters; - - private string ??; - - private Task ??; - - private Task ??; - - protected SettingItem QuantityItem; - - private SettingItem ??; - - private SettingItem ??; - - public bool DisplayQuantityInLots - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double? CurrentFillPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string QuantityDefiningSettingName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool AsyncBehavior - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - protected bool SkipChanges - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public BasicBalanceCalculator() - { - AsyncBehavior = false; - } - - public void Populate(SettingItem[] orderSettings, OrderRequestParameters requestParameters) - { - if (AsyncBehavior) - { - ?? = Task.Run(delegate - { - PopulateAction(orderSettings, requestParameters); - }); - } - else - { - PopulateAction(orderSettings, requestParameters); - } - } - - protected virtual void PopulateAction(SettingItem[] orderSettings, OrderRequestParameters requestParameters) - { - RequestParameters = requestParameters; - QuantityItem = orderSettings?.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - ?? = orderSettings?.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - ?? = orderSettings?.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - ?(); - Recalculate(); - } - - public void OnOrderSettingChanged(string settingName, OrderRequestParameters requestParameters) - { - ? CS$<>8__locals11 = new ?(); - CS$<>8__locals11.?? = this; - CS$<>8__locals11.?? = requestParameters; - CS$<>8__locals11.?? = settingName; - if (SkipChanges || ?? != null) - { - return; - } - if (AsyncBehavior) - { - ?? = Task.Run(delegate - { - try - { - CS$<>8__locals11.??.RequestParameters = CS$<>8__locals11.??; - CS$<>8__locals11.??.?? = CS$<>8__locals11.??; - CS$<>8__locals11.??.OnOrderSettingChanged(CS$<>8__locals11.??); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - CS$<>8__locals11.??.?? = null; - } - }); - } - else - { - CS$<>8__locals11.?(); - } - } - - protected virtual void OnOrderSettingChanged(string settingName) - { - if (!(settingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (!(settingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (settingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - QuantityDefiningSettingName = settingName; - OnRiskPercentChanged(); - } - else - { - Recalculate(); - } - } - else - { - QuantityDefiningSettingName = settingName; - OnRiskChanged(); - } - } - else - { - QuantityDefiningSettingName = settingName; - OnQuantityChanged(); - } - } - - public void OnTimerTick() - { - OrderRequestParameters requestParameters = RequestParameters; - if (requestParameters != null && requestParameters.OrderType?.Behavior == OrderTypeBehavior.Market && ?? == null) - { - Recalculate(); - } - } - - protected void Recalculate() - { - string text = ??; - try - { - ?? = QuantityDefiningSettingName ?? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - ?(); - RecalculateAction(??); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - ?? = text; - } - } - - protected virtual void RecalculateAction(string processingSettingName) - { - if (!(processingSettingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (!(processingSettingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (processingSettingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - OnRiskPercentChanged(); - } - } - else - { - OnRiskChanged(); - } - } - else - { - OnQuantityChanged(); - } - } - - public void Dispose() - { - if (AsyncBehavior) - { - Task.WhenAll(?? ?? Task.CompletedTask, ?? ?? Task.CompletedTask).ContinueWith(delegate - { - DisposeAction(); - }); - } - else - { - DisposeAction(); - } - } - - protected virtual void DisposeAction() - { - QuantityItem = null; - } - - protected virtual void OnQuantityChanged() - { - if (QuantityItem != null) - { - UpdateRisk(GetQuantity()); - UpdateRiskPercent(GetRisk()); - } - } - - protected virtual void OnRiskChanged() - { - if (?? != null) - { - double? risk = GetRisk(); - ?(risk); - UpdateRiskPercent(risk); - } - } - - protected virtual void OnRiskPercentChanged() - { - double? num = ?(); - double? availableBalance = GetAvailableBalance(); - if (num.HasValue && availableBalance.HasValue) - { - double value = availableBalance.Value * num.Value / 100.0; - ?(value, SettingItemValueChangingReason.Programmatically); - ?(value); - } - } - - protected void UpdateQuantity(double? quantity, SettingItemValueChangingReason reason) - { - if (quantity.HasValue) - { - QuantityItem.SetValueWithReason(CoreMath.FloorToIncrement(quantity.Value, RequestParameters.Symbol.LotStep), reason); - } - } - - private void ?(double? P_0) - { - Symbol ?? = RequestParameters?.Symbol; - List list = RequestParameters?.StopLossItems; - if (!P_0.HasValue || QuantityItem == null || !CurrentFillPrice.HasValue || list == null || list.Count == 0 || ?? == null) - { - return; - } - double ?? = CurrentFillPrice.Value; - double value; - if (list.Count == 1) - { - SlTpHolder slTpHolder = list[0]; - value = CoreMath.RoundToIncrement(P_0.Value / ?(??, slTpHolder, 1.0, ??), ??.LotStep); - } - else if (list.All((SlTpHolder slTpHolder3) => !double.IsNaN(slTpHolder3.QuantityPercentage))) - { - double num = list.Sum((SlTpHolder slTpHolder3) => ?(??, slTpHolder3, slTpHolder3.QuantityPercentage / 100.0, ??)); - value = CoreMath.RoundToIncrement(P_0.Value / num, ??.LotStep); - } - else - { - SlTpHolder[] array = list.Take(list.Count - 1).ToArray(); - SlTpHolder slTpHolder2 = list.Last(); - if (array.Length < 1) - { - return; - } - double num2 = array.Sum((SlTpHolder slTpHolder3) => ?(??, slTpHolder3, slTpHolder3.Quantity, ??)); - double num3 = P_0.Value - num2; - if (num3 <= 0.0) - { - value = ??.MinLot; - } - else - { - double num4 = CoreMath.RoundToIncrement(num3 / ?(??, slTpHolder2, 1.0, ??), ??.LotStep); - value = array.Sum((SlTpHolder slTpHolder3) => slTpHolder3.Quantity) + num4; - } - } - UpdateQuantity(value, SettingItemValueChangingReason.Programmatically); - } - - private void ?(double? P_0, SettingItemValueChangingReason P_1) - { - if (P_0.HasValue) - { - ??.SetValueWithReason(P_0.Value, P_1); - } - } - - protected void UpdateRisk(double? quantity) - { - Symbol symbol = RequestParameters?.Symbol; - List list = RequestParameters?.StopLossItems; - if (!quantity.HasValue || ?? == null || !CurrentFillPrice.HasValue || list == null || list.Count == 0 || symbol == null || !RequestParameters.TryCorrectBracketsQuantity(out var _)) - { - return; - } - double value = CurrentFillPrice.Value; - double num = 0.0; - foreach (SlTpHolder item in list) - { - double num2 = item.Quantity; - if (double.IsNaN(num2)) - { - num2 = quantity.Value; - } - num += ?(symbol, item, num2, value); - } - ??.SetValueWithReason(num, SettingItemValueChangingReason.Programmatically); - } - - protected void UpdateRiskPercent(double? risk) - { - double? availableBalance = GetAvailableBalance(); - if (risk.HasValue && ?? != null && availableBalance.HasValue && availableBalance != 0.0) - { - double num = risk.Value / availableBalance.Value * 100.0; - ??.SetValueWithReason(num, SettingItemValueChangingReason.Programmatically); - } - } - - protected virtual double? GetAvailableBalance() - { - return RequestParameters?.Account?.Balance; - } - - protected double? GetQuantity() - { - double? result = QuantityItem?.GetValue(); - if (!result.HasValue) - { - return null; - } - if (!DisplayQuantityInLots && RequestParameters?.Symbol != null) - { - return result.Value / RequestParameters.Symbol.LotSize; - } - return result; - } - - protected double? GetRisk() - { - return ???.GetValue(); - } - - private double? ?() - { - return ???.GetValue(); - } - - private void ?() - { - CurrentFillPrice = RequestParameters.OrderType?.GetFillPrice(RequestParameters); - } - - private double ?(Symbol P_0, SlTpHolder P_1, double P_2, double P_3) - { - double num = P_1.Price; - if (P_1.PriceMeasurement == PriceMeasurement.Offset) - { - num = RequestParameters.Symbol.CalculatePrice(P_3, (double)((RequestParameters.Side != Side.Buy) ? 1 : (-1)) * num); - } - double num2 = Math.Abs(P_0.CalculateValue(RequestParameters.Side, P_3, P_2)); - double num3 = Math.Abs(P_0.CalculateValue(RequestParameters.Side, num, P_2)); - return Math.Abs(num2 - num3); - } - - [CompilerGenerated] - private void ?(Task P_0) - { - DisposeAction(); - } - } - public abstract class CryptoBalanceCalculator : BasicBalanceCalculator - { - private SettingItemDoubleWithLink ??; - - private SettingItemSlider ??; - - protected override void PopulateAction(SettingItem[] orderSettings, OrderRequestParameters requestParameters) - { - RequestParameters = requestParameters; - if (?? != null) - { - ??.LinkAction = null; - } - ?? = orderSettings?.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) as SettingItemDoubleWithLink; - ?? = orderSettings?.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) as SettingItemSlider; - if (?? != null) - { - ??.LinkAction = OnLinkAction; - PopulateTotal(); - } - base.PopulateAction(orderSettings, requestParameters); - } - - protected override void OnOrderSettingChanged(string settingName) - { - if (!(settingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (!(settingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (settingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - base.QuantityDefiningSettingName = settingName; - OnPercentChanged(); - } - } - else - { - base.QuantityDefiningSettingName = settingName; - OnTotalChanged(); - } - } - else - { - OnSideChanged(); - } - base.OnOrderSettingChanged(settingName); - } - - protected override void RecalculateAction(string processingSettingName) - { - if (!(processingSettingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (processingSettingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - OnPercentChanged(); - } - else - { - base.RecalculateAction(processingSettingName); - } - } - else - { - OnTotalChanged(); - } - } - - protected override void DisposeAction() - { - ?? = null; - ?? = null; - base.DisposeAction(); - } - - protected virtual double CalculateQuantity(double total, double fillPrice) - { - return (double)((decimal)total / (decimal)fillPrice); - } - - protected virtual double CalculateTotal(double quantity, double fillPrice) - { - return (double)((decimal)fillPrice * (decimal)quantity); - } - - protected virtual string GetTotalLinkText() - { - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); - } - - protected virtual ulong CalculateSliderStep() - { - return 0uL; - } - - protected override void OnQuantityChanged() - { - base.OnQuantityChanged(); - if (QuantityItem != null) - { - UpdateTotal(GetQuantity()); - UpdateSlider(); - } - } - - protected override void OnRiskChanged() - { - base.OnRiskChanged(); - if (QuantityItem != null) - { - UpdateTotal(GetQuantity()); - UpdateSlider(); - } - } - - protected override void OnRiskPercentChanged() - { - base.OnRiskPercentChanged(); - if (QuantityItem != null) - { - UpdateTotal(GetQuantity()); - UpdateSlider(); - } - } - - protected virtual void OnSideChanged() - { - } - - protected virtual void OnTotalChanged() - { - if (?? != null) - { - UpdateQuantity(GetTotal()); - UpdateSlider(); - UpdateRisk(GetQuantity()); - UpdateRiskPercent(GetRisk()); - } - } - - protected abstract void OnLinkAction(object obj); - - protected abstract void OnPercentChanged(); - - protected void UpdateQuantity(double? total) - { - if (total.HasValue && QuantityItem != null && base.CurrentFillPrice.HasValue) - { - double value = base.CurrentFillPrice.Value; - if (!value.IsNanOrDefault()) - { - double value2 = CalculateQuantity(total.Value, value); - UpdateQuantity(value2, SettingItemValueChangingReason.Programmatically); - } - } - } - - protected void UpdateTotal(double? quantity) - { - if (quantity.HasValue && ?? != null && base.CurrentFillPrice.HasValue) - { - double value = base.CurrentFillPrice.Value; - if (!double.IsNaN(value)) - { - UpdateTotal(CalculateTotal(quantity.Value, value), SettingItemValueChangingReason.Programmatically); - } - } - } - - protected void UpdateTotal(double? total, SettingItemValueChangingReason reason) - { - if (total.HasValue) - { - ??.SetValueWithReason(total, reason); - } - } - - protected void UpdateTotalLink() - { - if (?? != null) - { - ??.LinkText = GetTotalLinkText(); - } - } - - protected void UpdateSlider() - { - if (?? != null) - { - ulong num = CalculateSliderStep(); - ??.SetValueWithReason(num, SettingItemValueChangingReason.Programmatically); - } - } - - protected void PopulateTotal() - { - if (?? != null) - { - double num = 1.0; - int decimalPlaces = 0; - string dimension = string.Empty; - Asset totalAsset = GetTotalAsset(); - if (totalAsset != null) - { - num = totalAsset.MinimumChange; - decimalPlaces = totalAsset.Precision; - dimension = totalAsset.Name; - } - ??.Minimum = num; - ??.Maximum = double.MaxValue; - ??.Increment = num; - ??.DecimalPlaces = decimalPlaces; - ??.Dimension = dimension; - } - } - - protected double? GetTotal() - { - return ???.GetValue(); - } - - protected double? GetSliderPercent() - { - return (double?)???.GetValue() / 100.0; - } - - protected virtual Asset GetTotalAsset() - { - return RequestParameters?.Symbol?.QuotingCurrency; - } - } - public interface IBalanceCalculator : IDisposable - { - bool DisplayQuantityInLots { get; set; } - - double? CurrentFillPrice { get; set; } - - string QuantityDefiningSettingName { get; set; } - - void Populate(SettingItem[] orderSettings, OrderRequestParameters requestParameters); - - void OnOrderSettingChanged(string settingName, OrderRequestParameters requestParameters); - - void OnTimerTick(); - } - public abstract class MarginBasedBalanceCalculator : CryptoBalanceCalculator - { - private Symbol ??; - - private Account ??; - - private Asset ??; - - protected Symbol CurrentSymbol - { - get - { - return ??; - } - set - { - if (?? == value) - { - return; - } - ?? = null; - if (?? != null) - { - ??.Updated -= ?; - } - ?? = value; - if (?? != null) - { - ??.Updated += ?; - ?? = CurrentSymbol.Connection?.BusinessObjects.Assets.FirstOrDefault((Asset P_0) => P_0.Id == BalanceCurrency); - } - } - } - - protected Account CurrentAccount - { - get - { - return ??; - } - set - { - if (?? != value) - { - if (?? != null) - { - ??.Updated -= ?; - } - ?? = value; - if (?? != null) - { - ??.Updated += ?; - } - } - } - } - - protected virtual string BalanceCurrency => CurrentSymbol?.QuotingCurrency?.Id; - - protected override void PopulateAction(SettingItem[] orderSettings, OrderRequestParameters requestParameters) - { - base.PopulateAction(orderSettings, requestParameters); - CurrentSymbol = requestParameters.Symbol; - CurrentAccount = requestParameters.Account; - PopulateTotal(); - UpdateTotalLink(); - Recalculate(); - } - - protected override void DisposeAction() - { - base.DisposeAction(); - CurrentAccount = null; - } - - protected override string GetTotalLinkText() - { - double? availableBalance = GetAvailableBalance(); - if (!availableBalance.HasValue) - { - return base.GetTotalLinkText(); - } - return ???.FormatPriceWithCurrency(availableBalance.Value); - } - - protected override ulong CalculateSliderStep() - { - double? total = GetTotal(); - if (!total.HasValue) - { - return base.CalculateSliderStep(); - } - double? num = GetAvailableBalance(); - if (!num.HasValue) - { - return base.CalculateSliderStep(); - } - if (num == 0.0) - { - num = 1.0; - } - return (ulong)(total.Value * 100.0 * 100.0 / num).Value; - } - - protected override Asset GetTotalAsset() - { - return ??; - } - - protected abstract double? GetAvailableForOrder(); - - protected abstract int? GetLeverage(); - - protected override void OnLinkAction(object obj) - { - UpdateTotal(GetAvailableBalance(), SettingItemValueChangingReason.Manually); - } - - protected override void OnPercentChanged() - { - double? sliderPercent = GetSliderPercent(); - if (sliderPercent.HasValue) - { - double? availableBalance = GetAvailableBalance(); - if (availableBalance.HasValue) - { - double value = availableBalance.Value * sliderPercent.Value / 100.0; - UpdateQuantity(value); - UpdateTotal(GetQuantity()); - UpdateRisk(GetQuantity()); - UpdateRiskPercent(GetRisk()); - } - } - } - - private void ?(Symbol P_0) - { - try - { - base.SkipChanges = true; - UpdateTotalLink(); - Recalculate(); - } - finally - { - base.SkipChanges = false; - } - } - - private void ?(Account P_0) - { - try - { - base.SkipChanges = true; - UpdateTotalLink(); - Recalculate(); - } - finally - { - base.SkipChanges = false; - } - } - - protected override double? GetAvailableBalance() - { - double? availableForOrder = GetAvailableForOrder(); - if (!availableForOrder.HasValue) - { - return null; - } - int? leverage = GetLeverage(); - if (!leverage.HasValue) - { - return null; - } - return availableForOrder * (double?)leverage; - } - - [CompilerGenerated] - private bool ?(Asset P_0) - { - return P_0.Id == BalanceCurrency; - } - } - public class MultiAssetBalanceCalculator : CryptoBalanceCalculator - { - private CryptoAssetBalances ??; - - private CryptoAccount ??; - - protected CryptoAssetBalances CurrentBalance - { - get - { - return ??; - } - set - { - if (?? != value) - { - ?? = value; - UpdateTotalLink(); - Recalculate(); - } - } - } - - private CryptoAccount CurrentAccount - { - get - { - return ??; - } - set - { - if (?? == cryptoAccount) - { - ?(); - return; - } - if (?? != null) - { - ??.BalanceUpdated -= ?; - } - ?? = cryptoAccount; - if (?? != null) - { - ??.BalanceUpdated += ?; - } - ?(); - } - } - - protected override void PopulateAction(SettingItem[] orderSettings, OrderRequestParameters requestParameters) - { - base.PopulateAction(orderSettings, requestParameters); - CurrentAccount = requestParameters.Account as CryptoAccount; - } - - protected override void DisposeAction() - { - base.DisposeAction(); - CurrentAccount = null; - CurrentBalance = null; - } - - protected override string GetTotalLinkText() - { - if (CurrentBalance == null) - { - return base.GetTotalLinkText(); - } - return CurrentBalance.Asset.FormatPriceWithCurrency(GetAvailableBalance().GetValueOrDefault()); - } - - protected override ulong CalculateSliderStep() - { - if (RequestParameters == null || CurrentBalance == null) - { - return base.CalculateSliderStep(); - } - double? num = ((RequestParameters.Side != Side.Buy) ? GetQuantity() : GetTotal()); - if (!num.HasValue) - { - return base.CalculateSliderStep(); - } - double? num2 = GetAvailableBalance(); - if ((!num2.HasValue || num2.GetValueOrDefault() == 0.0) ? true : false) - { - num2 = 1.0; - } - return (ulong)(num.Value * 100.0 * 100.0 / num2).Value; - } - - protected override double? GetAvailableBalance() - { - return CurrentBalance?.AvailableBalance ?? 0.0; - } - - protected override void OnSideChanged() - { - ?(); - UpdateSlider(); - } - - protected override void OnLinkAction(object obj) - { - if (CurrentBalance != null && RequestParameters != null) - { - double valueOrDefault = GetAvailableBalance().GetValueOrDefault(); - if (RequestParameters.Side == Side.Buy) - { - UpdateTotal(valueOrDefault, SettingItemValueChangingReason.Manually); - } - else - { - UpdateQuantity(valueOrDefault, SettingItemValueChangingReason.Manually); - } - } - } - - protected override void OnPercentChanged() - { - double? sliderPercent = GetSliderPercent(); - if (sliderPercent.HasValue && CurrentBalance != null && RequestParameters != null) - { - double valueOrDefault = GetAvailableBalance().GetValueOrDefault(); - if (RequestParameters.Side == Side.Buy) - { - double value = valueOrDefault * sliderPercent.Value / 100.0; - UpdateQuantity(value); - UpdateTotal(value, SettingItemValueChangingReason.Programmatically); - UpdateRisk(GetQuantity()); - UpdateRiskPercent(GetRisk()); - } - else - { - double value2 = valueOrDefault * sliderPercent.Value / 100.0; - UpdateTotal(value2); - UpdateQuantity(value2, SettingItemValueChangingReason.Programmatically); - UpdateRisk(GetQuantity()); - UpdateRiskPercent(GetRisk()); - } - } - } - - private void ?(object P_0, CryptoAccountEventArgs P_1) - { - if (CurrentBalance != null && !(P_1.Balances.AssetId != CurrentBalance.AssetId)) - { - UpdateTotalLink(); - Recalculate(); - } - } - - private void ?() - { - try - { - CurrentBalance = ?(); - } - finally - { - UpdateTotalLink(); - Recalculate(); - } - } - - [CompilerGenerated] - private CryptoAssetBalances ?() - { - CryptoAccount currentAccount = CurrentAccount; - if (currentAccount == null || currentAccount.State != BusinessObjectState.Normal) - { - return null; - } - string text = ((RequestParameters.Side != Side.Buy) ? RequestParameters.Symbol?.Product?.Id : RequestParameters.Symbol?.QuotingCurrency?.Id); - if (string.IsNullOrEmpty(text)) - { - return null; - } - if (!CurrentAccount.TryGetAssetBalances(text, out var cryptoAssetBalances)) - { - return null; - } - return cryptoAssetBalances; - } - } - public class CustomOrderType : OrderType - { - private readonly string ??; - - private readonly OrderTypeBehavior ??; - - private readonly OrderType ??; - - public override string Id - { - get - { - if (!string.IsNullOrEmpty(??)) - { - return ??; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - } - - public override string Name - { - get - { - if (!string.IsNullOrEmpty(??)) - { - return ??; - } - return ???.Name ?? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - } - - public override string Abbreviation => ???.Abbreviation ?? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override OrderTypeBehavior Behavior => ???.Behavior ?? ??; - - public override string PriceItemId => ???.PriceItemId ?? base.PriceItemId; - - public CustomOrderType(string name, OrderTypeBehavior behavior, params TimeInForce[] allowedTifs) - : this(name, behavior, null, allowedTifs) - { - } - - public CustomOrderType(string name, OrderType baseOrderType) - : this(name, baseOrderType?.Behavior, baseOrderType, baseOrderType?.AllowedTifs ?? new TimeInForce[1]) - { - } - - public CustomOrderType(OrderType baseOrderType) - : this(baseOrderType?.Name, baseOrderType?.Behavior, baseOrderType, baseOrderType?.AllowedTifs ?? new TimeInForce[1]) - { - } - - private CustomOrderType(string P_0, OrderTypeBehavior? P_1, OrderType P_2, params TimeInForce[] allowedTifs) - : base(allowedTifs) - { - ?? = P_0; - ?? = P_1.GetValueOrDefault(); - ?? = P_2; - } - - public override IList GetOrderSettings(OrderRequestParameters parameters, FormatSettings formatSettings) - { - return ???.GetOrderSettings(parameters, formatSettings) ?? base.GetOrderSettings(parameters, formatSettings); - } - - public override IList GetDealTicketItems(OrderRequestParameters request) - { - return ???.GetDealTicketItems(request) ?? base.GetDealTicketItems(request); - } - - public override void SetDefaultPrices(SettingItem[] settings, OrderRequestParameters parameters) - { - if (?? != null) - { - ??.SetDefaultPrices(settings, parameters); - } - else - { - base.SetDefaultPrices(settings, parameters); - } - } - - public override double GetFillPrice(OrderRequestParameters parameters) - { - return ???.GetFillPrice(parameters) ?? double.NaN; - } - - protected override string GetPlaceConfirmMessage(PlaceOrderRequestParameters placeRequest, FormatSettings formatSettings) - { - return ???.GetConfirmMessage(placeRequest, formatSettings); - } - - protected override string GetModifyConfirmMessage(ModifyOrderRequestParameters modifyRequest, FormatSettings formatSettings) - { - return ???.GetConfirmMessage(modifyRequest, formatSettings); - } - - public override string GetCancelConfirmMessage(CancelOrderRequestParameters cancelRequest, FormatSettings formatSettings) - { - return ???.GetCancelConfirmMessage(cancelRequest, formatSettings); - } - - public override ValidateResult ValidateOrderRequestParameters(OrderRequestParameters parameters) - { - return ???.ValidateOrderRequestParameters(parameters) ?? base.ValidateOrderRequestParameters(parameters); - } - } - public enum OrderTypeBehavior - { - Unspecified, - Market, - Limit, - Stop, - TrailingStop, - StopLimit - } - [Flags] - public enum OrderTypeUsage - { - Order = 1, - CloseOrder = 2, - All = 3 - } - public class LimitIfTouchedOrderType : LimitOrderType - { - public override string Id => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override string Name => loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - - public override string Abbreviation => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override OrderTypeBehavior Behavior => OrderTypeBehavior.StopLimit; - - public LimitIfTouchedOrderType(params TimeInForce[] allowedTimeInForce) - : base(allowedTimeInForce) - { - } - - public override IList GetOrderSettings(OrderRequestParameters parameters, FormatSettings formatSettings) - { - IList orderSettings = base.GetOrderSettings(parameters, formatSettings); - double num = 0.0; - double num2 = 1E-05; - int decimalPlaces = 5; - Symbol symbol = parameters.Symbol; - bool enabled = true; - if (symbol != null) - { - if (parameters.Type == RequestType.PlaceOrder) - { - num = ((parameters.Side == Side.Buy) ? symbol.Ask : symbol.Bid); - num = CoreMath.ProcessNaN(num); - } - else if (parameters.Type == RequestType.ModifyOrder) - { - num = parameters.TriggerPrice; - enabled = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), parameters.Account, parameters.Symbol, this).Status == TradingOperationStatus.Allowed; - } - VariableTick variableTick = symbol.FindVariableTick(num); - if (variableTick != null) - { - num2 = variableTick.TickSize; - decimalPlaces = variableTick.Precision; - } - } - SettingItemDouble item = new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - SortIndex = 0, - Minimum = num2, - Maximum = 2147483647.0, - Increment = num2, - DecimalPlaces = decimalPlaces, - Enabled = enabled - }; - orderSettings.Add(item); - return orderSettings; - } - - protected override string GetPlaceConfirmMessage(PlaceOrderRequestParameters placeRequest, FormatSettings formatSettings) - { - string value = placeRequest.TimeInForce.Format(placeRequest.ExpirationTime); - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(38, 9); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatQuantity(placeRequest.Quantity, formatSettings.DisplayQuantityInLots)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatPrice(placeRequest.Price)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatPrice(placeRequest.TriggerPrice)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(placeRequest)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Account.GetCurrentName()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - protected override string GetModifyConfirmMessage(ModifyOrderRequestParameters modifyRequest, FormatSettings formatSettings) - { - string value = modifyRequest.TimeInForce.Format(modifyRequest.ExpirationTime); - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(54, 10); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.OrderId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatQuantity(modifyRequest.Quantity, formatSettings.DisplayQuantityInLots)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatPrice(modifyRequest.Price)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatPrice(modifyRequest.TriggerPrice)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(modifyRequest)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Account.GetCurrentName()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public override string GetCancelConfirmMessage(CancelOrderRequestParameters cancelRequest, FormatSettings formatSettings) - { - IOrder order = cancelRequest?.Order; - if (order == null) - { - return string.Empty; - } - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(54, 9); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Id); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Format(order.PositionId, order.GroupId)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.TimeInForce); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatQuantity(order.TotalQuantity, formatSettings.DisplayQuantityInLots)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatPrice(order.Price)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatPrice(order.TriggerPrice)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Account.GetCurrentName()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public override ValidateResult ValidateOrderRequestParameters(OrderRequestParameters parameters) - { - return base.ValidateOrderRequestParameters(parameters); - } - - public override IList GetDealTicketItems(OrderRequestParameters request) - { - IList dealTicketItems = base.GetDealTicketItems(request); - dealTicketItems.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Symbol.FormatPrice(request.TriggerPrice), 5550)); - return dealTicketItems; - } - } - public class LimitOrderType : OrderType - { - public override string Id => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override string Name => loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - - public override string Abbreviation => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override OrderTypeBehavior Behavior => OrderTypeBehavior.Limit; - - protected virtual string PriceText => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override string PriceItemId => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public LimitOrderType(params TimeInForce[] allowedTimeInForce) - : base(allowedTimeInForce) - { - base.Usage = OrderTypeUsage.All; - } - - public override IList GetOrderSettings(OrderRequestParameters parameters, FormatSettings formatSettings) - { - IList orderSettings = base.GetOrderSettings(parameters, formatSettings); - double num = 0.0; - double num2 = 1E-05; - int decimalPlaces = 5; - Symbol symbol = parameters.Symbol; - bool enabled = true; - if (symbol != null) - { - if (parameters.Type == RequestType.PlaceOrder) - { - num = ((parameters.Side == Side.Buy) ? symbol.Ask : symbol.Bid); - num = CoreMath.ProcessNaN(num); - } - else if (parameters.Type == RequestType.ModifyOrder) - { - num = parameters.Price; - if (double.IsNaN(num)) - { - num = parameters.TriggerPrice; - } - enabled = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), parameters.Account, parameters.Symbol, this).Status == TradingOperationStatus.Allowed; - } - VariableTick variableTick = symbol.FindVariableTick(num); - if (variableTick != null) - { - num2 = variableTick.TickSize; - decimalPlaces = variableTick.Precision; - } - } - SettingItemDouble item = new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num) - { - Text = loc._(PriceText, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - SortIndex = 0, - Minimum = num2, - Maximum = 2147483647.0, - Increment = num2, - DecimalPlaces = decimalPlaces, - Enabled = enabled - }; - orderSettings.Add(item); - return orderSettings; - } - - protected override string GetPlaceConfirmMessage(PlaceOrderRequestParameters placeRequest, FormatSettings formatSettings) - { - string value = placeRequest.TimeInForce.Format(placeRequest.ExpirationTime); - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(16, 8); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatQuantity(placeRequest.Quantity, formatSettings.DisplayQuantityInLots)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatPrice(placeRequest.Price)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(placeRequest)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Account.GetCurrentName()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - protected override string GetModifyConfirmMessage(ModifyOrderRequestParameters modifyRequest, FormatSettings formatSettings) - { - string value = modifyRequest.TimeInForce.Format(modifyRequest.ExpirationTime); - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(32, 9); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.OrderId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatQuantity(modifyRequest.Quantity, formatSettings.DisplayQuantityInLots)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatPrice(modifyRequest.Price)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(modifyRequest)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Account.GetCurrentName()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public override string GetCancelConfirmMessage(CancelOrderRequestParameters cancelRequest, FormatSettings formatSettings) - { - IOrder order = cancelRequest?.Order; - if (order == null) - { - return string.Empty; - } - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(31, 8); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Id); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - defaultInterpolatedStringHandler.AppendFormatted(order.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Format(order.PositionId, order.GroupId)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.TimeInForce); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatQuantity(order.TotalQuantity, formatSettings.DisplayQuantityInLots)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatPrice(order.Price)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Account.GetCurrentName()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public override ValidateResult ValidateOrderRequestParameters(OrderRequestParameters parameters) - { - ValidateResult result = base.ValidateOrderRequestParameters(parameters); - if (result.State == ValidateState.NotValid) - { - return result; - } - double price = parameters.Price; - if (parameters.Side == Side.Buy) - { - SlTpHolder stopLoss = parameters.StopLoss; - if (stopLoss != null && stopLoss.PriceMeasurement == PriceMeasurement.Absolute && stopLoss.Price >= price) - { - return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - } - SlTpHolder takeProfit = parameters.TakeProfit; - if (takeProfit != null && takeProfit.PriceMeasurement == PriceMeasurement.Absolute && takeProfit.Price <= price) - { - return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - } - } - if (parameters.Side == Side.Sell) - { - SlTpHolder stopLoss2 = parameters.StopLoss; - if (stopLoss2 != null && stopLoss2.PriceMeasurement == PriceMeasurement.Absolute && stopLoss2.Price <= price) - { - return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - } - SlTpHolder takeProfit2 = parameters.TakeProfit; - if (takeProfit2 != null && takeProfit2.PriceMeasurement == PriceMeasurement.Absolute && takeProfit2.Price >= price) - { - return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - } - } - return ValidateResult.Valid; - } - - public override IList GetDealTicketItems(OrderRequestParameters request) - { - IList dealTicketItems = base.GetDealTicketItems(request); - dealTicketItems.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Symbol.FormatPrice(request.Price), 5500)); - return dealTicketItems; - } - - public override double GetFillPrice(OrderRequestParameters parameters) - { - SettingItem itemByPath = parameters.AdditionalParameters.GetItemByPath(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (itemByPath != null) - { - return (double)itemByPath.Value; - } - return parameters.Price; - } - - public override void SetDefaultPrices(SettingItem[] settings, OrderRequestParameters parameters) - { - if (parameters.Symbol != null) - { - double num = ((parameters.Side == Side.Buy) ? parameters.Symbol.Ask : parameters.Symbol.Bid); - if (!double.IsNaN(num)) - { - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num); - } - } - } - } - public class MarketIfTouchedOrderType : StopOrderType - { - public override string Id => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override string Name => loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - - public override string Abbreviation => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public MarketIfTouchedOrderType(params TimeInForce[] allowedTimeInForce) - : base(allowedTimeInForce) - { - base.Usage = OrderTypeUsage.All; - } - } - public class MarketOrderType : OrderType - { - public override string Id => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override string Name => loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - - public override string Abbreviation => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override OrderTypeBehavior Behavior => OrderTypeBehavior.Market; - - public MarketOrderType(params TimeInForce[] allowedTimeInForce) - : base(allowedTimeInForce) - { - } - - protected override string GetPlaceConfirmMessage(PlaceOrderRequestParameters placeRequest, FormatSettings formatSettings) - { - string value = placeRequest.TimeInForce.Format(placeRequest.ExpirationTime); - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(6, 6); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatQuantity(placeRequest.Quantity, formatSettings.DisplayQuantityInLots)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(placeRequest)); - return defaultInterpolatedStringHandler.ToStringAndClear() + ((placeRequest.Account != null) ? (3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + placeRequest.Account.GetCurrentName()) : string.Empty); - } - - protected override string GetModifyConfirmMessage(ModifyOrderRequestParameters modifyRequest, FormatSettings formatSettings) - { - string value = modifyRequest.TimeInForce.Format(modifyRequest.ExpirationTime); - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(27, 8); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.OrderId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatQuantity(modifyRequest.Quantity, formatSettings.DisplayQuantityInLots)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(modifyRequest)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Account.GetCurrentName()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public override string GetCancelConfirmMessage(CancelOrderRequestParameters cancelRequest, FormatSettings formatSettings) - { - IOrder order = cancelRequest?.Order; - if (order == null) - { - return string.Empty; - } - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(27, 7); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Id); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - defaultInterpolatedStringHandler.AppendFormatted(order.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Format(order.PositionId, order.GroupId)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.TimeInForce); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatQuantity(order.TotalQuantity, formatSettings.DisplayQuantityInLots)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Account.GetCurrentName()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public override ValidateResult ValidateOrderRequestParameters(OrderRequestParameters parameters) - { - ValidateResult result = base.ValidateOrderRequestParameters(parameters); - if (result.State == ValidateState.NotValid) - { - return result; - } - if (parameters.Side == Side.Buy) - { - double ask = parameters.Symbol.Ask; - SlTpHolder stopLoss = parameters.StopLoss; - if (stopLoss != null && stopLoss.PriceMeasurement == PriceMeasurement.Absolute && stopLoss.Price >= ask) - { - return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - } - SlTpHolder takeProfit = parameters.TakeProfit; - if (takeProfit != null && takeProfit.PriceMeasurement == PriceMeasurement.Absolute && takeProfit.Price <= ask) - { - return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - } - } - if (parameters.Side == Side.Sell) - { - double bid = parameters.Symbol.Bid; - SlTpHolder stopLoss2 = parameters.StopLoss; - if (stopLoss2 != null && stopLoss2.PriceMeasurement == PriceMeasurement.Absolute && stopLoss2.Price <= bid) - { - return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - } - SlTpHolder takeProfit2 = parameters.TakeProfit; - if (takeProfit2 != null && takeProfit2.PriceMeasurement == PriceMeasurement.Absolute && takeProfit2.Price >= bid) - { - return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - } - } - return ValidateResult.Valid; - } - - public override double GetFillPrice(OrderRequestParameters parameters) - { - double result = double.NaN; - if (parameters.Symbol != null) - { - result = ((parameters.Side != Side.Buy) ? parameters.Symbol.Bid : parameters.Symbol.Ask); - } - return result; - } - } - public abstract class OrderType : BusinessObject, IComparable, ?, IEquatable - { - [CompilerGenerated] - private static class ? - { - public static Func ??; - } - - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func> ??; - - internal IEnumerable ?(OrderType P_0) - { - return P_0.AllowedTifs; - } - } - - [CompilerGenerated] - private sealed class ? - { - public TimeInForce? ??; - - internal bool ?(SelectItem P_0) - { - if (??.HasValue) - { - return P_0.Value.Equals((int)??.Value); - } - return true; - } - } - - [CompilerGenerated] - private sealed class ? - { - public OrderRequestParameters ??; - - internal bool ?(SelectItem P_0) - { - return (int)(object)P_0.Value == (int)??.Side; - } - } - - public const string Market = "Market"; - - public const string Limit = "Limit"; - - public const string Stop = "Stop"; - - public const string TrailingStop = "Tr.stop"; - - public const string StopLimit = "StopLimit"; - - public const string MarketIfTouched = "MarketIfTouched"; - - public const string LimitIfTouched = "LimitIfTouched"; - - public const string Custom = "Custom"; - - public const string TIME_IF_FORCE = "Time in force"; - - public const string EXPIRATION = "Expiration"; - - public const string SIDE = "Side"; - - public const string QUANTITY = "Quantity"; - - public const string PRICE = "Price"; - - public const string TRIGGER_PRICE = "TriggerPrice"; - - public const string TRAIL_OFFSET = "TrailOffset"; - - public const string COMMENT = "Comment"; - - public const string TOTAL = "Total"; - - public const string BALANCE_PERCENT = "Balance percent"; - - public const string RISK = "Risk"; - - public const string RISK_PERCENT = "Risk percent"; - - public const string REDUCE_ONLY = "Reduce-Only"; - - public const string POST_ONLY = "Post-Only"; - - public const string PARENT_ORDER_ID = "Parent Order ID"; - - public const int BALANCE_PERCENT_STEPS_COUNT_MULTIPLIER = 100; - - [CompilerGenerated] - private readonly OrderTypeUsage ??; - - [CompilerGenerated] - private readonly TimeInForce[] ??; - - [CompilerGenerated] - private readonly PriceMeasurement ??; - - [CompilerGenerated] - private readonly BalanceCalculatorFactory ??; - - private readonly ? ??; - - public abstract string Id { get; } - - public virtual string Name => Id; - - public abstract string Abbreviation { get; } - - public virtual OrderTypeBehavior Behavior => OrderTypeBehavior.Unspecified; - - public OrderTypeUsage Usage - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public TimeInForce[] AllowedTifs - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public PriceMeasurement SLTPPriceMeasurement - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public BalanceCalculatorFactory BalanceCalculatorFactory - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public virtual string PriceItemId => null; - - int ?.PriorityIndex => 30; - - ? ?.Rules => ??; - - protected OrderType(params TimeInForce[] allowedTimeInForce) - : base(string.Empty) - { - if (allowedTimeInForce.Length == 0) - { - allowedTimeInForce = Enum.GetValues(typeof(TimeInForce)).Cast().ToArray(); - } - AllowedTifs = allowedTimeInForce; - Usage = OrderTypeUsage.Order; - SLTPPriceMeasurement = PriceMeasurement.Absolute; - ?? = new ?(); - Core.Instance.RulesManager.Defaults.ForEach(delegate(Rule P_0) - { - ??.?(P_0.Name, P_0); - }); - } - - public virtual IList GetOrderSettings(OrderRequestParameters parameters, FormatSettings formatSettings) - { - List list = new List(); - ?(list, parameters, -100, (parameters.Type == RequestType.ModifyOrder) ? new TimeInForce?(parameters.TimeInForce) : ((TimeInForce?)null)); - ?((ICollection)list, parameters, -90, (DateTime?)null); - ?(list, parameters, -80, (parameters.Type == RequestType.ModifyOrder) ? VisibilityMode.Hidden : VisibilityMode.Visible); - ?(list, parameters, formatSettings.DisplayQuantityInLots, -70, (parameters.Type == RequestType.ModifyOrder) ? new double?(parameters.Quantity) : ((double?)null)); - if (BalanceCalculatorFactory != null) - { - if (BalanceCalculatorFactory(parameters.Symbol, parameters.Account) is CryptoBalanceCalculator) - { - ?(list, -60); - ?(list, -50); - } - ?(list, parameters.Symbol?.QuotingCurrency, -40); - ?(list, -30); - } - return list; - } - - public abstract double GetFillPrice(OrderRequestParameters parameters); - - public virtual void SetDefaultPrices(SettingItem[] settings, OrderRequestParameters parameters) - { - } - - public virtual string GetConfirmMessage(OrderRequestParameters parameters, FormatSettings formatSettings) - { - string text = string.Empty; - if (!(parameters is PlaceOrderRequestParameters placeRequest)) - { - if (parameters is ModifyOrderRequestParameters modifyRequest) - { - text = GetModifyConfirmMessage(modifyRequest, formatSettings); - } - } - else - { - text = GetPlaceConfirmMessage(placeRequest, formatSettings); - } - string additionalPartConfirmMessage = GetAdditionalPartConfirmMessage(parameters, formatSettings); - if (string.IsNullOrEmpty(additionalPartConfirmMessage)) - { - return text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - return text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + additionalPartConfirmMessage + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - - protected abstract string GetPlaceConfirmMessage(PlaceOrderRequestParameters placeRequest, FormatSettings formatSettings); - - protected abstract string GetModifyConfirmMessage(ModifyOrderRequestParameters modifyRequest, FormatSettings formatSettings); - - protected virtual string GetAdditionalPartConfirmMessage(OrderRequestParameters parameters, FormatSettings formatSettings) - { - return null; - } - - public abstract string GetCancelConfirmMessage(CancelOrderRequestParameters cancelRequest, FormatSettings formatSettings); - - public virtual ValidateResult ValidateOrderRequestParameters(OrderRequestParameters parameters) - { - if (!AllowedTifs.Contains(parameters.TimeInForce)) - { - return ValidateResult.NotValid(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (parameters.StopLossItems != null) - { - foreach (SlTpHolder stopLossItem in parameters.StopLossItems) - { - if (stopLossItem.PriceMeasurement != PriceMeasurement.Absolute && stopLossItem.PriceMeasurement != SLTPPriceMeasurement) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(120, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(SLTPPriceMeasurement); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(stopLossItem.PriceMeasurement); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return ValidateResult.NotValid(defaultInterpolatedStringHandler.ToStringAndClear()); - } - } - } - if (parameters.TakeProfitItems != null) - { - foreach (SlTpHolder takeProfitItem in parameters.TakeProfitItems) - { - if (takeProfitItem.PriceMeasurement != PriceMeasurement.Absolute && takeProfitItem.PriceMeasurement != SLTPPriceMeasurement) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(120, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(SLTPPriceMeasurement); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(takeProfitItem.PriceMeasurement); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return ValidateResult.NotValid(defaultInterpolatedStringHandler.ToStringAndClear()); - } - } - } - return ValidateResult.Valid; - } - - public virtual IList GetDealTicketItems(OrderRequestParameters request) - { - List list = new List(); - list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Symbol.Connection?.Name)); - list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Symbol.Name, 1000)); - string text = Core.Instance.CustomAccountPropertiesProvider.GetProperty(request.Account, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) as string; - list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), string.IsNullOrEmpty(text) ? request.Account.Name : (request.Account.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()), 2000)); - list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Symbol.FormatQuantity(request.Quantity), 3000)); - if (request.Type == RequestType.ModifyOrder && request is ModifyOrderRequestParameters modifyOrderRequestParameters) - { - list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), modifyOrderRequestParameters.OrderId, 3500)); - } - list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Side.ToString(), 4000)); - list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Format(request.PositionId, request.GroupId), 5000)); - list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.TimeInForce.Format(request.ExpirationTime), 6000)); - if (request.StopLossItems != null && request.StopLossItems.Count > 1) - { - for (int i = 0; i < request.StopLossItems.Count; i++) - { - string key; - if (!request.StopLoss.IsTrailing) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(12, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(i + 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - key = defaultInterpolatedStringHandler.ToStringAndClear(); - } - else - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(16, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(i + 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - key = defaultInterpolatedStringHandler.ToStringAndClear(); - } - list.Add(new DealTicketItem(key, request.StopLossItems[i].Format(request.Symbol), 6500 + i)); - } - } - else if (request.StopLoss != null) - { - list.Add(new DealTicketItem(request.StopLoss.IsTrailing ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.StopLoss.Format(request.Symbol), 6500)); - } - if (request.TakeProfitItems != null && request.TakeProfitItems.Count > 1) - { - for (int j = 0; j < request.TakeProfitItems.Count; j++) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(j + 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - list.Add(new DealTicketItem(defaultInterpolatedStringHandler.ToStringAndClear(), request.TakeProfitItems[j].Format(request.Symbol), 6510 + j)); - } - } - else if (request.TakeProfit != null) - { - list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.TakeProfit.Format(request.Symbol), 6510)); - } - list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Core.Instance.TimeUtils.DateTimeUtcNow.ToString(), 7000)); - if (!string.IsNullOrEmpty(request.Comment)) - { - list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Comment, 8000)); - } - if (!string.IsNullOrEmpty(request.SendingSource)) - { - list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.SendingSource, 9000)); - } - return list; - } - - private void ?(ICollection P_0, OrderRequestParameters P_1, int P_2, TimeInForce? P_3 = null) - { - List obj = P_1?.OrderType?.AllowedTifs?.ToList() ?? P_1?.Symbol?.GetAlowedOrderTypes(OrderTypeUsage.Order)?.SelectMany((OrderType orderType) => orderType.AllowedTifs).Distinct().ToList(); - obj?.Sort(new TimeInForceComparer()); - List list = obj?.Select(?).ToList(); - if (list != null && list.Any()) - { - SelectItem value = list.FirstOrDefault((SelectItem selectItem) => !P_3.HasValue || selectItem.Value.Equals((int)P_3.Value)); - P_0.Add(new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value, list, P_2) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - }); - } - } - - private void ?(ICollection P_0, OrderRequestParameters P_1, int P_2, DateTime? P_3 = null) - { - TimeInForce[] array = P_1?.OrderType?.AllowedTifs; - if (array != null && (array.Contains(TimeInForce.GTD) || array.Contains(TimeInForce.GTT))) - { - DateTime minDate = Core.Instance.TimeUtils.DateTimeUtcNow.ToSelectedTimeZone(); - DateTime value = P_3 ?? minDate.AddDays(1.0); - P_0.Add(new SettingItemDateTime(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value, P_2) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - MinDate = minDate, - MaxDate = (P_1.Symbol?.ExpirationDate ?? DateTime.MaxValue), - Relation = new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ?(TimeInForce.GTD), ?(TimeInForce.GTT)) - }); - } - } - - private void ?(ICollection P_0, OrderRequestParameters P_1, int P_2, VisibilityMode P_3 = VisibilityMode.Visible) - { - List list = new List - { - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1) - }; - SelectItem value = list.First(); - if (P_1 != null && P_1.Type == RequestType.ModifyOrder) - { - value = list.FirstOrDefault((SelectItem selectItem) => (int)(object)selectItem.Value == (int)P_1.Side); - } - P_0.Add(new SettingItemRadioLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value, list, P_2) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - VisibilityMode = P_3 - }); - } - - private void ?(ICollection P_0, OrderRequestParameters P_1, bool P_2, int P_3, double? P_4 = null) - { - double num = 0.0; - double maximum = 0.0; - double num2 = 1.0; - int decimalPlaces = 1; - double value = 1.0; - string dimension = null; - if (P_1 != null && P_1.Symbol?.State == BusinessObjectState.Normal) - { - double num3 = (P_2 ? 1.0 : P_1.Symbol.LotSize); - num = P_1.Symbol.MinLot * num3; - maximum = P_1.Symbol.MaxLot * num3; - num2 = (P_2 ? P_1.Symbol.LotStep : P_1.Symbol.NotionalValueStep); - decimalPlaces = CoreMath.GetValuePrecision((decimal)num2); - value = (P_4 * num3) ?? num; - dimension = P_1.Symbol.Product?.Name; - } - if (P_2) - { - dimension = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - P_0.Add(new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value, P_3) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - Minimum = num, - Maximum = maximum, - Increment = num2, - DecimalPlaces = decimalPlaces, - UseTradingNumeric = true, - Dimension = dimension - }); - } - - private void ?(ICollection P_0, int P_1) - { - double num = 1.0; - int decimalPlaces = 0; - double maximum = double.MaxValue; - string empty = string.Empty; - P_0.Add(new SettingItemDoubleWithLink(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num, null, P_1) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - Minimum = num, - Maximum = maximum, - Increment = num, - DecimalPlaces = decimalPlaces, - UseTradingNumeric = true, - Dimension = empty - }); - } - - private void ?(ICollection P_0, int P_1) - { - P_0.Add(new SettingItemSlider(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0uL, P_1) - { - StepsCount = 10000uL - }); - } - - private void ?(ICollection P_0, Asset P_1, int P_2) - { - P_0.Add(new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0.01, P_2) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - Minimum = 0.01, - Maximum = double.MaxValue, - Increment = 0.01, - DecimalPlaces = 2, - UseTradingNumeric = true, - Dimension = P_1?.Name - }); - } - - private void ?(ICollection P_0, int P_1) - { - P_0.Add(new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0.1, P_1) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - Minimum = 0.1, - Maximum = double.MaxValue, - Increment = 0.1, - DecimalPlaces = 1, - UseTradingNumeric = true, - Dimension = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }); - } - - private static SelectItem ?(TimeInForce P_0) - { - return new SelectItem(P_0.GetDescription(), (int)P_0); - } - - public int CompareTo(object obj) - { - return Id.CompareTo((obj as OrderType).Id); - } - - public static string GetSLTPComfirmMessage(OrderRequestParameters requestParameters) - { - string text = string.Empty; - try - { - bool flag = requestParameters.StopLossItems.Count > 1 || requestParameters.TakeProfitItems.Count > 1; - if (requestParameters.StopLoss != null) - { - for (int i = 0; i < requestParameters.StopLossItems.Count; i++) - { - SlTpHolder slTpHolder = requestParameters.StopLossItems[i]; - string text2 = slTpHolder.Format(requestParameters.Symbol); - string value = (flag ? (i + 1).ToString() : string.Empty); - string value2 = (flag ? (3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + requestParameters.Symbol.FormatQuantity(slTpHolder.Quantity)) : string.Empty); - if (slTpHolder.IsTrailing) - { - text = text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + text2; - } - else - { - string text3 = text; - string text4; - if (slTpHolder.PriceMeasurement != PriceMeasurement.Absolute) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(12, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(text2); - defaultInterpolatedStringHandler.AppendFormatted(value2); - text4 = defaultInterpolatedStringHandler.ToStringAndClear(); - } - else - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(11, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(text2); - defaultInterpolatedStringHandler.AppendFormatted(value2); - text4 = defaultInterpolatedStringHandler.ToStringAndClear(); - } - text = text3 + text4; - } - if (i != requestParameters.StopLossItems.Count - 1) - { - text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - } - } - if (requestParameters.TakeProfit != null) - { - if (!string.IsNullOrEmpty(text)) - { - text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - for (int j = 0; j < requestParameters.TakeProfitItems.Count; j++) - { - SlTpHolder slTpHolder2 = requestParameters.TakeProfitItems[j]; - string value3 = slTpHolder2.Format(requestParameters.Symbol); - string value4 = (flag ? (j + 1).ToString() : string.Empty); - string value5 = (flag ? (3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + requestParameters.Symbol.FormatQuantity(slTpHolder2.Quantity)) : string.Empty); - string text5 = text; - string text6 = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - string text7; - if (slTpHolder2.PriceMeasurement != PriceMeasurement.Absolute) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(11, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value4); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value3); - defaultInterpolatedStringHandler.AppendFormatted(value5); - text7 = defaultInterpolatedStringHandler.ToStringAndClear(); - } - else - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(11, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value4); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value3); - defaultInterpolatedStringHandler.AppendFormatted(value5); - text7 = defaultInterpolatedStringHandler.ToStringAndClear(); - } - text = text5 + text6 + text7; - if (j != requestParameters.TakeProfitItems.Count - 1) - { - text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - return text; - } - - public string Format(string positionId = null, string groupId = null) - { - if (!string.IsNullOrEmpty(positionId)) - { - string value = Behavior switch - { - OrderTypeBehavior.Limit => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - OrderTypeBehavior.Stop => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - OrderTypeBehavior.TrailingStop => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - _ => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), - }; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(7, 3); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(positionId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - if (!string.IsNullOrEmpty(groupId)) - { - return Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - return Name; - } - - public static string Format(IOrder order) - { - if (order is LocalOrder) - { - return order.OrderType.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - return Format(order.OrderTypeId, order.ConnectionId, order.PositionId, order.GroupId); - } - - public static string Format(string orderTypeId, string connectionId = null, string positionId = null, string groupId = null) - { - return Core.Instance.GetOrderType(orderTypeId, connectionId)?.Format(positionId, groupId) ?? orderTypeId; - } - - public bool Equals(OrderType other) - { - if (other == null) - { - return false; - } - if (this == other) - { - return true; - } - if (Id == other.Id) - { - return base.ConnectionId == other.ConnectionId; - } - return false; - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - if (this == obj) - { - return true; - } - if (obj.GetType() != GetType()) - { - return false; - } - return Equals((OrderType)obj); - } - - public override int GetHashCode() - { - return HashCode.Combine(Id, base.ConnectionId); - } - - [CompilerGenerated] - private void ?(Rule P_0) - { - ??.?(P_0.Name, P_0); - } - } - public delegate IBalanceCalculator BalanceCalculatorFactory(Symbol symbol, Account account); -} -namespace ? -{ - internal class ? : SettingItemRelation - { - [CompilerGenerated] - private new static class ? - { - public static SettingItemRelationDelegate ??; - } - - public ?(string P_0, params object[] relationValues) - : base(new Dictionary> { - { - P_0, - new List(relationValues) - } }, ?) - { - } - - private static bool ?(SettingItemRelationParameters P_0) - { - SettingItemRelation.CheckVisibilityRelation(P_0); - if (!SettingItemRelation.CheckValues(P_0.RelationValuesByParentItem, P_0.MultipleRelationCondition) || !(P_0.DependentItem is SettingItemDateTime settingItemDateTime)) - { - return false; - } - TimeInForce value = P_0.ChangedItem.GetValue(); - settingItemDateTime.Format = ((value != TimeInForce.GTD) ? DatePickerFormat.DateTime : DatePickerFormat.Date); - return true; - } - } -} -namespace TradingPlatform.BusinessLayer -{ - public class StopLimitOrderType : LimitOrderType - { - public override string Id => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override string Name => loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - - public override string Abbreviation => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override OrderTypeBehavior Behavior => OrderTypeBehavior.StopLimit; - - public StopLimitOrderType(params TimeInForce[] allowedTimeInForce) - : base(allowedTimeInForce) - { - } - - public override IList GetOrderSettings(OrderRequestParameters parameters, FormatSettings formatSettings) - { - IList orderSettings = base.GetOrderSettings(parameters, formatSettings); - double price = 0.0; - double num = 0.0; - double minimum = 1E-05; - double increment = 1E-05; - int decimalPlaces = 5; - Symbol symbol = parameters.Symbol; - bool enabled = true; - if (symbol != null) - { - if (parameters.Type == RequestType.PlaceOrder) - { - num = ((parameters.Side == Side.Buy) ? symbol.Ask : symbol.Bid); - num = CoreMath.ProcessNaN(num); - price = symbol.CalculatePrice(num, (parameters.Side != Side.Buy) ? 1 : (-1)); - } - else if (parameters.Type == RequestType.ModifyOrder) - { - price = parameters.Price; - num = parameters.TriggerPrice; - enabled = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), parameters.Account, parameters.Symbol, this).Status == TradingOperationStatus.Allowed; - } - VariableTick variableTick = symbol.FindVariableTick(price); - if (variableTick != null) - { - minimum = variableTick.TickSize; - } - variableTick = symbol.FindVariableTick(num); - if (variableTick != null) - { - increment = variableTick.TickSize; - decimalPlaces = variableTick.Precision; - } - } - SettingItemDouble item = new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - SortIndex = 0, - Minimum = minimum, - Maximum = 2147483647.0, - Increment = increment, - DecimalPlaces = decimalPlaces, - Enabled = enabled - }; - orderSettings.Add(item); - return orderSettings; - } - - protected override string GetPlaceConfirmMessage(PlaceOrderRequestParameters placeRequest, FormatSettings formatSettings) - { - string value = placeRequest.TimeInForce.Format(placeRequest.ExpirationTime); - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(38, 9); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatQuantity(placeRequest.Quantity, formatSettings.DisplayQuantityInLots)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatPrice(placeRequest.Price)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatPrice(placeRequest.TriggerPrice)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(placeRequest)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Account.GetCurrentName()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - protected override string GetModifyConfirmMessage(ModifyOrderRequestParameters modifyRequest, FormatSettings formatSettings) - { - string value = modifyRequest.TimeInForce.Format(modifyRequest.ExpirationTime); - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(54, 10); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.OrderId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatQuantity(modifyRequest.Quantity, formatSettings.DisplayQuantityInLots)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatPrice(modifyRequest.Price)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatPrice(modifyRequest.TriggerPrice)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(modifyRequest)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Account.GetCurrentName()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public override string GetCancelConfirmMessage(CancelOrderRequestParameters cancelRequest, FormatSettings formatSettings) - { - IOrder order = cancelRequest?.Order; - if (order == null) - { - return string.Empty; - } - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(54, 9); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Id); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Format(order.PositionId, order.GroupId)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.TimeInForce); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatQuantity(order.TotalQuantity, formatSettings.DisplayQuantityInLots)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatPrice(order.Price)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatPrice(order.TriggerPrice)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(cancelRequest.Order.Account.GetCurrentName()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public override IList GetDealTicketItems(OrderRequestParameters request) - { - IList dealTicketItems = base.GetDealTicketItems(request); - dealTicketItems.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Symbol.FormatPrice(request.TriggerPrice), 5550)); - return dealTicketItems; - } - - public override void SetDefaultPrices(SettingItem[] settings, OrderRequestParameters parameters) - { - if (parameters.Symbol != null) - { - double num = ((parameters.Side == Side.Buy) ? parameters.Symbol.Ask : parameters.Symbol.Bid); - if (!double.IsNaN(num)) - { - double num2 = parameters.Symbol.CalculatePrice(num, (parameters.Side != Side.Buy) ? 1 : (-1)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num2); - } - } - } - } - public class StopOrderType : OrderType - { - public override string Id => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override string Name => loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - - public override string Abbreviation => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override OrderTypeBehavior Behavior => OrderTypeBehavior.Stop; - - public override string PriceItemId => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public StopOrderType(params TimeInForce[] allowedTimeInForce) - : base(allowedTimeInForce) - { - base.Usage = OrderTypeUsage.All; - } - - public override IList GetOrderSettings(OrderRequestParameters parameters, FormatSettings formatSettings) - { - IList orderSettings = base.GetOrderSettings(parameters, formatSettings); - double num = 0.0; - double num2 = 1E-05; - int decimalPlaces = 5; - Symbol symbol = parameters.Symbol; - bool enabled = true; - if (symbol != null) - { - if (parameters.Type == RequestType.PlaceOrder) - { - num = ((parameters.Side == Side.Buy) ? symbol.Bid : symbol.Ask); - num = CoreMath.ProcessNaN(num); - } - else if (parameters.Type == RequestType.ModifyOrder) - { - num = parameters.TriggerPrice; - if (double.IsNaN(num)) - { - num = parameters.Price; - } - enabled = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), parameters.Account, parameters.Symbol, this).Status == TradingOperationStatus.Allowed; - } - VariableTick obj = symbol.FindVariableTick(num) ?? symbol.VariableTickList.FirstOrDefault(); - num2 = obj.TickSize; - decimalPlaces = obj.Precision; - } - SettingItemDouble item = new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - SortIndex = 0, - Minimum = num2, - Maximum = 2147483647.0, - Increment = num2, - DecimalPlaces = decimalPlaces, - Enabled = enabled - }; - orderSettings.Add(item); - return orderSettings; - } - - protected override string GetPlaceConfirmMessage(PlaceOrderRequestParameters placeRequest, FormatSettings formatSettings) - { - string value = placeRequest.TimeInForce.Format(placeRequest.ExpirationTime); - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(15, 8); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatQuantity(placeRequest.Quantity, formatSettings.DisplayQuantityInLots)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatPrice(placeRequest.TriggerPrice)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(placeRequest)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Account.GetCurrentName()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - protected override string GetModifyConfirmMessage(ModifyOrderRequestParameters modifyRequest, FormatSettings formatSettings) - { - string value = modifyRequest.TimeInForce.Format(modifyRequest.ExpirationTime); - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(31, 9); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.OrderId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatQuantity(modifyRequest.Quantity, formatSettings.DisplayQuantityInLots)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatPrice(modifyRequest.TriggerPrice)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(modifyRequest)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Account.GetCurrentName()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public override string GetCancelConfirmMessage(CancelOrderRequestParameters cancelRequest, FormatSettings formatSettings) - { - IOrder order = cancelRequest?.Order; - if (order == null) - { - return string.Empty; - } - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(31, 8); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Id); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - defaultInterpolatedStringHandler.AppendFormatted(order.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Format(order.PositionId, order.GroupId)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.TimeInForce); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatQuantity(order.TotalQuantity, formatSettings.DisplayQuantityInLots)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatPrice(order.TriggerPrice)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(cancelRequest.Order.Account.GetCurrentName()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public override ValidateResult ValidateOrderRequestParameters(OrderRequestParameters parameters) - { - ValidateResult result = base.ValidateOrderRequestParameters(parameters); - if (result.State == ValidateState.NotValid) - { - return result; - } - double triggerPrice = parameters.TriggerPrice; - if (parameters.Side == Side.Buy) - { - SlTpHolder stopLoss = parameters.StopLoss; - if (stopLoss != null && stopLoss.PriceMeasurement == PriceMeasurement.Absolute && stopLoss.Price >= triggerPrice) - { - return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - } - SlTpHolder takeProfit = parameters.TakeProfit; - if (takeProfit != null && takeProfit.PriceMeasurement == PriceMeasurement.Absolute && takeProfit.Price <= triggerPrice) - { - return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - } - } - if (parameters.Side == Side.Sell) - { - SlTpHolder stopLoss2 = parameters.StopLoss; - if (stopLoss2 != null && stopLoss2.PriceMeasurement == PriceMeasurement.Absolute && stopLoss2.Price <= triggerPrice) - { - return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - } - SlTpHolder takeProfit2 = parameters.TakeProfit; - if (takeProfit2 != null && takeProfit2.PriceMeasurement == PriceMeasurement.Absolute && takeProfit2.Price >= triggerPrice) - { - return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - } - } - return ValidateResult.Valid; - } - - public override IList GetDealTicketItems(OrderRequestParameters request) - { - IList dealTicketItems = base.GetDealTicketItems(request); - dealTicketItems.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Symbol.FormatPrice(request.TriggerPrice), 5500)); - return dealTicketItems; - } - - public override double GetFillPrice(OrderRequestParameters parameters) - { - SettingItem itemByPath = parameters.AdditionalParameters.GetItemByPath(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (itemByPath != null) - { - return (double)itemByPath.Value; - } - return parameters.TriggerPrice; - } - - public override void SetDefaultPrices(SettingItem[] settings, OrderRequestParameters parameters) - { - if (parameters.Symbol != null) - { - double num = ((parameters.Side == Side.Buy) ? parameters.Symbol.Bid : parameters.Symbol.Ask); - if (!double.IsNaN(num)) - { - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num); - } - } - } - } - public class TrailingStopOrderType : OrderType - { - public override string Id => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override string Name => loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - - public override string Abbreviation => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override OrderTypeBehavior Behavior => OrderTypeBehavior.TrailingStop; - - public TrailingStopOrderType(params TimeInForce[] allowedTimeInForce) - : base(allowedTimeInForce) - { - base.Usage = OrderTypeUsage.All; - base.SLTPPriceMeasurement = PriceMeasurement.Offset; - } - - public override IList GetOrderSettings(OrderRequestParameters parameters, FormatSettings formatSettings) - { - IList orderSettings = base.GetOrderSettings(parameters, formatSettings); - int value = 1; - if (parameters.Type == RequestType.ModifyOrder) - { - value = (int)parameters.TrailOffset; - } - orderSettings.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - Minimum = 1 - }); - return orderSettings; - } - - protected override string GetPlaceConfirmMessage(PlaceOrderRequestParameters placeRequest, FormatSettings formatSettings) - { - string value = placeRequest.TimeInForce.Format(placeRequest.ExpirationTime); - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(15, 8); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatQuantity(placeRequest.Quantity, formatSettings.DisplayQuantityInLots)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatOffset(placeRequest.TrailOffset, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(placeRequest)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Account.GetCurrentName()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - protected override string GetModifyConfirmMessage(ModifyOrderRequestParameters modifyRequest, FormatSettings formatSettings) - { - string value = modifyRequest.TimeInForce.Format(modifyRequest.ExpirationTime); - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(31, 9); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.OrderId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatQuantity(modifyRequest.Quantity, formatSettings.DisplayQuantityInLots)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatOffset(modifyRequest.TrailOffset, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(modifyRequest)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Account.GetCurrentName()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public override string GetCancelConfirmMessage(CancelOrderRequestParameters cancelRequest, FormatSettings formatSettings) - { - IOrder order = cancelRequest?.Order; - if (order == null) - { - return string.Empty; - } - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(33, 9); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Id); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - defaultInterpolatedStringHandler.AppendFormatted(order.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Format(order.PositionId, order.GroupId)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.TimeInForce); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatQuantity(order.TotalQuantity, formatSettings.DisplayQuantityInLots)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatPrice(order.TriggerPrice)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatOffset(order.TrailOffset, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(order.Account.GetCurrentName()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public override IList GetDealTicketItems(OrderRequestParameters request) - { - IList dealTicketItems = base.GetDealTicketItems(request); - dealTicketItems.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Symbol.FormatOffset(request.TrailOffset, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), 5500)); - return dealTicketItems; - } - - public override double GetFillPrice(OrderRequestParameters parameters) - { - double result = double.NaN; - SettingItem itemByPath = parameters.AdditionalParameters.GetItemByPath(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - int num = ((itemByPath == null) ? ((int)parameters.TrailOffset) : ((int)itemByPath.Value)); - if (parameters.Symbol != null) - { - result = ((parameters.Side != Side.Buy) ? parameters.Symbol.CalculatePrice(parameters.Symbol.Bid, -num) : parameters.Symbol.CalculatePrice(parameters.Symbol.Ask, num)); - } - return result; - } - } - /// - /// Represents trading information about related position - /// - [DataContract(Name = "Position", Namespace = "TradingPlatform")] - [Published] - public class Position : TradingObject, IMessageBuilder - { - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private DateTime ??; - - private PnLItem ??; - - private PnLItem ??; - - private PnLItem ??; - - private PnLItem ??; - - [CompilerGenerated] - private double ??; - - /// - /// Gets position quantity value - /// - [DataMember(Name = "Quantity")] - public double Quantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets position open order price - /// - [DataMember(Name = "OpenPrice")] - public double OpenPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets position openning time - /// - [DataMember(Name = "OpenTime")] - public DateTime OpenTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - /// - /// Gets Profit/loss (without swaps or commissions) all calculated based on the current broker's price. For open position it shows the profit/loss you would make if you close the position at the current price. If position closed, this parameter show profit/loss what trader have after closing this position. - /// - public PnLItem GrossPnL - { - get - { - return ??; - } - internal set - { - ?? = pnLItem; - } - } - - /// - /// Gets Profit/loss calculated based on the current broker's price. For open position it shows the profit/loss you would make if you close the position at the current price. If position closed, this parameter show profit/loss what trader have after closing this position. - /// - public PnLItem NetPnL - { - get - { - return ??; - } - internal set - { - ?? = pnLItem; - } - } - - /// - /// Gets fee amount for the position. - /// - public PnLItem Fee - { - get - { - return ??; - } - internal set - { - ?? = pnLItem; - } - } - - /// - /// Gets PnL swaps - /// - public PnLItem Swaps - { - get - { - return ??; - } - internal set - { - ?? = pnLItem; - } - } - - /// - /// The market price obtainable from your broker. - /// - public double CurrentPrice => ((base.Side != Side.Buy) ? base.Symbol?.Ask : base.Symbol?.Bid) ?? double.NaN; - - public double LiquidationPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets StopLoss order which belongs to the position - /// - public Order StopLoss => ConnectionCache.Orders.FirstOrDefault((Order P_0) => P_0.PositionId == base.Id && (P_0.OrderType.Behavior == OrderTypeBehavior.Stop || P_0.OrderType.Behavior == OrderTypeBehavior.TrailingStop) && P_0.OrderType.Usage.HasFlag(OrderTypeUsage.CloseOrder)); - - /// - /// Gets TakeProfit order which belongs to the position - /// - public Order TakeProfit => ConnectionCache.Orders.FirstOrDefault((Order P_0) => P_0.PositionId == base.Id && P_0.OrderType.Behavior == OrderTypeBehavior.Limit && P_0.OrderType.Usage.HasFlag(OrderTypeUsage.CloseOrder)); - - /// - /// Returns ticks amount between open and current price. - /// - public double GrossPnLTicks - { - get - { - if (base.Symbol == null || OpenPrice.IsNanOrDefault() || CurrentPrice.IsNanOrDefault()) - { - return 0.0; - } - if (base.Side == Side.Buy) - { - return base.Symbol.CalculateTicks(OpenPrice, CurrentPrice); - } - return base.Symbol.CalculateTicks(CurrentPrice, OpenPrice); - } - } - - /// - /// Will be triggered on each and invocation - /// - public event Action Updated - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - internal Position(string P_0) - : base(P_0) - { - LiquidationPrice = double.NaN; - } - - /// - /// Closes position if quantity is not specified else - uses partial closing operation. - /// - /// - /// - public virtual TradingOperationResult Close(double closeQuantity = -1.0) - { - return Core.Instance.ClosePosition(new ClosePositionRequestParameters - { - Position = this, - CloseQuantity = ((closeQuantity != -1.0) ? closeQuantity : Quantity) - }); - } - - public void ForceRecalculatePnl() - { - PnL pnL = Connection.?(new PnLRequestParameters - { - Symbol = base.Symbol, - Account = base.Account, - OpenPrice = OpenPrice, - ClosePrice = CurrentPrice, - Side = base.Side, - Quantity = Quantity, - PositionId = base.Id - }); - if (pnL != null) - { - ?(pnL); - } - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(18, 6); - defaultInterpolatedStringHandler.AppendFormatted(base.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Quantity); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.Symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.Symbol.FormatPrice(OpenPrice)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.Account); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.Id); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - internal virtual void ?(MessageOpenPosition P_0) - { - base.Id = P_0.PositionId; - if (ConnectionCache != null && ConnectionCache.SymbolsCache.?(P_0.SymbolId, out var symbol)) - { - base.Symbol = symbol; - } - if (ConnectionCache != null && ConnectionCache.AccountsCache.?(P_0.AccountId, out var account)) - { - base.Account = account; - } - OpenPrice = P_0.OpenPrice; - OpenTime = P_0.OpenTime; - Quantity = P_0.Quantity; - base.Side = P_0.Side; - base.Comment = P_0.Comment; - LiquidationPrice = P_0.LiquidationPrice; - ProcessAdditionalItems(P_0.AdditionalInfoItems); - ???.Invoke(this); - } - - public MessageOpenPosition BuildMessage() - { - return new MessageOpenPosition(base.Symbol?.Id) - { - PositionId = base.Id, - AccountId = base.Account?.Id, - OpenPrice = OpenPrice, - OpenTime = OpenTime, - Quantity = Quantity, - Side = base.Side, - Comment = base.Comment, - LiquidationPrice = LiquidationPrice, - AdditionalInfoItems = base.AdditionalInfo?.ToList() - }; - } - - internal void ?(PnL P_0) - { - if ((0u | (?(ref ??, P_0.GrossPnL) ? 1u : 0u) | (?(ref ??, P_0.NetPnL) ? 1u : 0u) | (?(ref ??, P_0.Fee) ? 1u : 0u) | (?(ref ??, P_0.Swaps) ? 1u : 0u)) != 0) - { - ???.Invoke(this); - } - } - - private bool ?(ref PnLItem P_0, PnLItem P_1) - { - if (P_1 != null) - { - PnLItem obj = P_0; - if (obj == null || !obj.Equals(P_1)) - { - P_0 = P_1; - P_0.ConnectionId = base.ConnectionId; - return true; - } - } - return false; - } - - [CompilerGenerated] - private bool ?(Order P_0) - { - if (P_0.PositionId == base.Id && (P_0.OrderType.Behavior == OrderTypeBehavior.Stop || P_0.OrderType.Behavior == OrderTypeBehavior.TrailingStop)) - { - return P_0.OrderType.Usage.HasFlag(OrderTypeUsage.CloseOrder); - } - return false; - } - - [CompilerGenerated] - private bool ?(Order P_0) - { - if (P_0.PositionId == base.Id && P_0.OrderType.Behavior == OrderTypeBehavior.Limit) - { - return P_0.OrderType.Usage.HasFlag(OrderTypeUsage.CloseOrder); - } - return false; - } - } - /// - /// Represents a report grid which can hold system reports based on s and s content. - /// - public class Report - { - /// - /// Columns collection - /// - public List Columns; - - /// - /// Rows collection - /// - public List Rows; - - internal string ?; - - /// - /// Initializes report grid - /// - public Report() - { - Columns = new List(); - Rows = new List(); - } - - /// - /// Adds coloring column to the report - /// - public void AddColumn(string header, ComparingType valueType, ColouringModes coloringModes) - { - Columns.Add(new ReportColumn(header, valueType, coloringModes)); - } - - /// - /// Adds default(non-colored) column to the report - /// - public void AddColumn(string header, ComparingType valueType) - { - AddColumn(header, valueType, ColouringModes.None); - } - } - /// - /// Exposes report cell decoration - /// - public class ReportCell - { - /// - /// Cell label - /// - public string Label; - - /// - /// Cell value - /// - public object Value; - - public IFormattingDescription formattingDescription; - - internal ReportCell(string P_0, object P_1, IFormattingDescription P_2 = null) - { - Label = P_0; - Value = P_1; - formattingDescription = P_2; - } - } - /// - /// Exposes report column decoration - /// - public class ReportColumn - { - [CompilerGenerated] - private Color ?; - - [CompilerGenerated] - private Color ?; - - /// - /// Header of the column - /// - public string Header; - - public ColouringModes ColoringModes; - - /// - /// Column value type - /// - public ComparingType ValueType; - - public Color UpForeColor - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = color; - } - } - - public Color DownForeColor - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = color; - } - } - - internal ReportColumn(string P_0, ComparingType P_1, ColouringModes P_2) - { - Header = P_0; - ValueType = P_1; - ColoringModes = P_2; - if (P_2 == ColouringModes.Signed) - { - UpForeColor = Color.FromArgb(55, 219, 186); - DownForeColor = Color.FromArgb(235, 96, 47); - } - } - } - /// - /// Exposes report row decoration - /// - public class ReportRow - { - /// - /// A collection of cells - /// - public List Cells; - - /// - /// Initializes cells in the row - /// - public ReportRow() - { - Cells = new List(); - } - - /// - /// Adds cells to the row by label and value - /// - public void AddCell(string label, object value, IFormattingDescription formattingDescription = null) - { - Cells.Add(new ReportCell(label, value, formattingDescription)); - } - - /// - /// Adds cells to the row by value only - /// - public void AddCell(object value, IFormattingDescription formattingDescription = null) - { - if (value == null) - { - AddCell(string.Empty, string.Empty, formattingDescription); - return; - } - string label = ((!(value is double d)) ? value.ToString() : (double.IsNaN(d) ? string.Empty : d.ToString())); - AddCell(label, value, formattingDescription); - } - } - /// - /// Defines report request parameters from which can be used in - /// - public class ReportType : BusinessObject, IComparable, ICustomizable - { - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private string ??; - - private IList ??; - - /// - /// Gets report Id - /// - public int Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets report Name - /// - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// report settings - /// - public IList Settings - { - get - { - return ??; - } - set - { - ?? = new List(); - foreach (SettingItem item in value) - { - ??.Add(item.GetCopy()); - } - } - } - - internal ReportType(string P_0) - : base(P_0) - { - ?? = new List(); - } - - internal void ?(MessageReportType P_0) - { - Id = P_0.Id; - Name = P_0.Name; - if (?? == null) - { - ?? = new List(); - } - foreach (SettingItem parameter in P_0.Parameters) - { - ??.Add(parameter); - } - } - - internal ReportType ?() - { - return new ReportType(base.ConnectionId) - { - Id = Id, - Name = Name, - Settings = Settings - }; - } - - public int CompareTo(object obj) - { - return 0; - } - } -} -namespace ? -{ - internal interface ? - { - int PriorityIndex { get; } - - ? Rules { get; } - } -} -namespace TradingPlatform.BusinessLayer -{ - public abstract class Rule - { - public const string ALLOW_TRADING = "Allow trading"; - - public const string ALLOW_SCREENER = "Allow screener"; - - public const string ALLOW_CONTAINS_SCREENER_CONDITIONS = "Allow 'contains' screener conditions"; - - public const string ALLOW_NEWS = "Allow news"; - - public const string ALLOW_SL = "Allow SL"; - - public const string ALLOW_TP = "Allow TP"; - - public const string ALLOW_SL_TRAILING = "Allow SL Trailing"; - - public const string ALLOW_TP_TRAILING = "Allow TP Trailing"; - - public const string ALLOW_MULTI_SL_TP = "ALLOW_MULTI_SL_TP"; - - public const string ALLOW_MODIFY_ORDER = "Allow modify order"; - - public const string ALLOW_MODIFY_ORDER_TYPE = "Allow modify order type"; - - public const string ALLOW_MODIFY_AMOUNT = "Allow modify amount"; - - public const string ALLOW_MODIFY_PRICE = "Allow modify price"; - - public const string ALLOW_MODIFY_TIF = "Allow modify tif"; - - public const string ALLOW_CHANGE_TO_MARKET = "Allow change to market"; - - public const string ALLOW_REVERSE_POSITION = "Allow reverse position"; - - public const string ALLOW_REDUCE_ONLY = "Allow reduce-only"; - - public const string ALLOW_EXPORT = "Allow export"; - - public const string ALLOW_LINK_OCO = "Allow Link OCO"; - - public const string ALLOW_NEW_OCO = "Allow New OCO"; - - public const string ALLOW_GROUP_ORDERS = "Allow group orders"; - - public const string ALLOW_PARTIAL_CLOSE_POSITION = "Allow partial close position"; - - public const string DEFAULT_SHOW_STRIKES_COUNT = "DEFAULT_SHOW_STRIKES_COUNT"; - - public const string LEVEL2_IS_AGGREGATED = "LEVEL2_IS_AGGREGATED"; - - public const string LEVEL2_HAS_IMPLIED_SIZE = "LEVEL2_HAS_IMPLIED_SIZE"; - - public const string PLACE_ORDER_TRADING_OPERATION_HAS_ORDER_ID = "PLACE_ORDER_TRADING_OPERATION_HAS_ORDER_ID"; - - public const string ALLOW_VOLUME_ANALYSIS_FROM_TICK_HISTORY = "ALLOW_VOLUME_ANALYSIS_FROM_TICK_HISTORY"; - - [CompilerGenerated] - private string ?; - - internal string Name - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = text; - } - } - - protected Rule(string name) - { - Name = name; - } - - internal virtual void ?(MessageRule P_0) - { - Name = P_0.Name; - } - - internal static Rule ?(MessageRule P_0) - { - object value = P_0.Value; - if (!(value is string text)) - { - if (!(value is int num)) - { - if (value is bool flag) - { - return new ?(P_0.Name, flag); - } - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - return new ?(P_0.Name, num); - } - return new ?(P_0.Name, text); - } - } -} -namespace ? -{ - internal sealed class ? : Rule - { - [CompilerGenerated] - private ? ??; - - internal ? Value - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = val; - } - } - - internal ?(string P_0, ? P_1) - : base(P_0) - { - Value = P_1; - } - - internal override void ?(MessageRule P_0) - { - if (!(P_0.Value is ? value)) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + typeof(?).Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - base.?(P_0); - Value = value; - } - } -} -namespace TradingPlatform.BusinessLayer -{ - /// - /// Represents a permisions checking tool which use next priority order , , and - /// - public sealed class RulesManager - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal bool ?(FieldInfo P_0) - { - if (P_0.IsLiteral) - { - return !P_0.IsInitOnly; - } - return false; - } - - internal bool ?(FieldInfo P_0) - { - return P_0.FieldType == typeof(string); - } - - internal string ?(FieldInfo P_0) - { - return P_0.GetValue(null) as string; - } - - internal Symbol ?(SyntheticItem P_0) - { - return P_0.Symbol; - } - } - - [Serializable] - [CompilerGenerated] - private sealed class ? where ? : Rule - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - internal bool ?(? P_0) - { - return P_0 != null; - } - - internal int ?(? P_0) - { - return P_0.PriorityIndex; - } - } - - internal static HashSet ?; - - internal const int ? = 0; - - internal const int ? = 10; - - internal const int ? = 20; - - internal const int ? = 30; - - internal List Defaults => new List - { - new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), - new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), - new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), - new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), - new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), - new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), - new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), - new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), - new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), - new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), - new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), - new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true) - }; - - static RulesManager() - { - ? = new HashSet(from P_0 in typeof(CoreLicenceKeys).GetFields(BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy) - where P_0.IsLiteral && !P_0.IsInitOnly - where P_0.FieldType == typeof(string) - select P_0.GetValue(null) as string); - } - - public AllowedResult IsAllowed(string ruleName, string connectionId) - { - ?(ruleName); - return ?(ruleName, ?(connectionId)); - } - - public AllowedResult IsAllowed(string ruleName, Account account) - { - ?(ruleName, account); - return ?(ruleName, ?(account.ConnectionId), account); - } - - public AllowedResult IsAllowed(string ruleName, Symbol symbol) - { - ?(ruleName, symbol); - if (ruleName != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() || !(symbol is Synthetic synthetic)) - { - return ?(ruleName, ?(symbol.ConnectionId), symbol); - } - ?[] rulesContainers = synthetic.LegsConnectionsIds.Select(?).Cast().Concat(synthetic.Items.Select((SyntheticItem P_0) => P_0.Symbol)) - .ToArray(); - return ?(ruleName, rulesContainers); - } - - public AllowedResult IsAllowed(string ruleName, Account account, Symbol symbol) - { - ?(ruleName, account, symbol); - return ?(ruleName, ?(account.ConnectionId), account, symbol); - } - - public AllowedResult IsAllowed(string ruleName, Account account, Symbol symbol, OrderType orderType) - { - ?(ruleName, account, symbol, orderType); - return ?(ruleName, ?(account.ConnectionId), account, symbol, orderType); - } - - public int GetIntValue(string ruleName, string connectionId) - { - ?(ruleName); - return ?(ruleName, ?(connectionId)); - } - - public int GetIntValue(string ruleName, Account account) - { - ?(ruleName, account); - return ?(ruleName, ?(account.ConnectionId), account); - } - - public int GetIntValue(string ruleName, Account account, Symbol symbol) - { - ?(ruleName, account, symbol); - return ?(ruleName, ?(account.ConnectionId), account, symbol); - } - - public int GetIntValue(string ruleName, Account account, Symbol symbol, OrderType orderType) - { - ?(ruleName, account, symbol, orderType); - return ?(ruleName, ?(account.ConnectionId), account, symbol, orderType); - } - - public string GetStringValue(string ruleName, string connectionId) - { - ?(ruleName); - return ?(ruleName, ?(connectionId)); - } - - public string GetStringValue(string ruleName, Account account) - { - ?(ruleName, account); - return ?(ruleName, ?(account.ConnectionId), account); - } - - public string GetStringValue(string ruleName, Account account, Symbol symbol) - { - ?(ruleName, account, symbol); - return ?(ruleName, ?(account.ConnectionId), account, symbol); - } - - public string GetStringValue(string ruleName, Account account, Symbol symbol, OrderType orderType) - { - ?(ruleName, account, symbol, orderType); - return ?(ruleName, ?(account.ConnectionId), account, symbol, orderType); - } - - private AllowedResult ?(string P_0, params ?[] rulesContainers) - { - IEnumerable> enumerable = ?>(P_0, rulesContainers); - if (enumerable.Count() == 0) - { - return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - foreach (? item in enumerable) - { - if (!item.Value) - { - return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - } - return AllowedResult.GetAllowedResult(); - } - - private int ?(string P_0, params ?[] rulesContainers) - { - return ?>(P_0, rulesContainers).LastOrDefault()?.Value ?? (-1); - } - - private string ?(string P_0, params ?[] rulesContainers) - { - return ?>(P_0, rulesContainers).LastOrDefault()?.Value ?? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); - } - - private IEnumerable ?(string P_0, params ?[] rulesContainers) where ? : Rule - { - IOrderedEnumerable orderedEnumerable = from ? in rulesContainers - where ? != null - orderby ?.PriorityIndex - select ?; - foreach (? item in orderedEnumerable) - { - if (item.Rules != null && item.Rules.?(P_0, out var rule) && rule is ? val) - { - yield return val; - } - } - } - - private ? ?(string P_0) - { - return Core.Instance.Connections[P_0]?.??; - } - - private void ?(string P_0) - { - if (string.IsNullOrEmpty(P_0)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - } - - private void ?(string P_0, Account P_1) - { - ?(P_0); - if (P_1 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - } - - private void ?(string P_0, Symbol P_1) - { - ?(P_0); - if (P_1 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - } - - private void ?(string P_0, Account P_1, Symbol P_2) - { - ?(P_0, P_1); - if (P_2 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - if (P_2.SymbolType == SymbolType.Synthetic || !(P_1.ConnectionId != P_2.ConnectionId)) - { - return; - } - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - - private void ?(string P_0, Account P_1, Symbol P_2, OrderType P_3) - { - ?(P_0, P_1, P_2); - if (P_3 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - if (P_2.SymbolType == SymbolType.Synthetic || !(P_1.ConnectionId != P_3.ConnectionId)) - { - return; - } - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - } - [ProtoContract] - public class HolidayInfo : IXElementSerialization - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private DateTime ??; - - [ProtoMember(1)] - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(2)] - public DateTime Date - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public HolidayInfo() - { - } - - internal HolidayInfo(HolidayInfo P_0) - { - Name = P_0.Name; - Date = P_0.Date; - } - - public override string ToString() - { - return Core.Instance.TimeUtils.GetFormatedDate(Core.Instance.TimeUtils.ConvertFromSelectedTimeZoneToUTC(Date)) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Name; - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Date)); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - Name = xElement.Value; - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - Date = xElement2.ToDateTime(toUTC: true); - } - } - } - [ProtoContract] - public class Session : ISession, IXElementSerialization - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private TimeSpan ??; - - [CompilerGenerated] - private TimeSpan ??; - - [CompilerGenerated] - private SessionType ??; - - [CompilerGenerated] - private bool ??; - - [ProtoMember(1)] - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - [ProtoMember(2)] - public TimeSpan OpenTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = timeSpan; - } - } - - [ProtoMember(3)] - public TimeSpan CloseTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = timeSpan; - } - } - - [ProtoMember(4)] - public SessionType Type - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = sessionType; - } - } - - [ProtoMember(5)] - public bool IsPrimary - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Session(string name, TimeSpan openTime, TimeSpan closeTime, SessionType type = SessionType.Main, bool isPrimary = false) - : this() - { - Name = name; - OpenTime = openTime; - CloseTime = closeTime; - Type = type; - IsPrimary = isPrimary; - } - - public Session(Session session) - : this(session.Name, session.OpenTime, session.CloseTime, session.Type, session.IsPrimary) - { - } - - internal Session() - { - Type = SessionType.Main; - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OpenTime)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OpenTime)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)Type)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsPrimary)); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - Name = xElement.Value; - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - OpenTime = xElement2.ToTimeSpan(); - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - CloseTime = xElement3.ToTimeSpan(); - } - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - Type = (SessionType)xElement4.ToInt(); - } - XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement5 != null) - { - IsPrimary = xElement5.ToBool(); - } - } - } - public class SessionsContainer : BusinessObject, ISessionsContainer, IMessageBuilder - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func> ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - internal IEnumerable ?(SessionsSet P_0) - { - return P_0.Sessions; - } - - internal HolidayInfo ?(HolidayInfo P_0) - { - return new HolidayInfo(P_0); - } - - internal SessionsSet ?(SessionsSet P_0) - { - return new SessionsSet(P_0); - } - - internal HolidayInfo ?(HolidayInfo P_0) - { - return new HolidayInfo(P_0); - } - - internal SessionsSet ?(SessionsSet P_0) - { - return new SessionsSet(P_0); - } - } - - [CompilerGenerated] - private sealed class ? - { - public DateTime ??; - - public DayOfWeek ??; - - public Func ??; - - public Func ??; - - internal bool ?(HolidayInfo P_0) - { - return P_0.Date.Date == ??.Date; - } - - internal bool ?(SessionsSet P_0) - { - return P_0.CertainDates?.Any((DateTime dateTime) => dateTime.Date == ??.Date) ?? false; - } - - internal bool ?(DateTime P_0) - { - return P_0.Date == ??.Date; - } - - internal bool ?(SessionsSet P_0) - { - return P_0.Days?.Any((DayOfWeek dayOfWeek) => dayOfWeek == ??) ?? false; - } - - internal bool ?(DayOfWeek P_0) - { - return P_0 == ??; - } - } - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private HolidayInfo[] ??; - - [CompilerGenerated] - private SessionsSet[] ??; - - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public string Description - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public HolidayInfo[] Holidays - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = array; - } - } - - public SessionsSet[] SessionsSets - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = array; - } - } - - public ISession[] ActiveSessions => SessionsSets?.SelectMany((SessionsSet P_0) => P_0.Sessions).Cast().ToArray(); - - public TimeZoneInfo TimeZone => null; - - internal SessionsContainer(string P_0) - : base(P_0) - { - } - - public void UpdateByMessage(MessageSessionsContainer message) - { - Id = message.Id; - Name = message.Name; - Description = message.Description; - Holidays = message.Holidays?.Select((HolidayInfo P_0) => new HolidayInfo(P_0)).ToArray(); - SessionsSets = message.SessionsSets?.Select((SessionsSet P_0) => new SessionsSet(P_0)).ToArray(); - } - - public ISession[] GetSessionsForDate(DateTime dateTime) - { - if (Holidays?.FirstOrDefault((HolidayInfo P_0) => P_0.Date.Date == dateTime.Date) != null) - { - return Array.Empty(); - } - DayOfWeek ?? = dateTime.DayOfWeek; - return (SessionsSets.FirstOrDefault((SessionsSet P_0) => P_0.CertainDates?.Any((DateTime dateTime2) => dateTime2.Date == dateTime.Date) ?? false) ?? SessionsSets.FirstOrDefault((SessionsSet P_0) => P_0.Days?.Any((DayOfWeek dayOfWeek) => dayOfWeek == ??) ?? false))?.Sessions.Cast().ToArray() ?? Array.Empty(); - } - - public MessageSessionsContainer BuildMessage() - { - return new MessageSessionsContainer - { - Id = Id, - Name = Name, - Description = Description, - Holidays = Holidays?.Select((HolidayInfo P_0) => new HolidayInfo(P_0)).ToArray(), - SessionsSets = SessionsSets?.Select((SessionsSet P_0) => new SessionsSet(P_0)).ToArray() - }; - } - } - [ProtoContract] - public class SessionsSet : IXElementSerialization - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func ??; - - internal Session ?(Session P_0) - { - return new Session(P_0); - } - - internal DayOfWeek ?(XElement P_0) - { - return (DayOfWeek)P_0.ToInt(); - } - - internal DateTime ?(XElement P_0) - { - return P_0.ToDateTime(toUTC: true); - } - } - - [CompilerGenerated] - private Session[] ??; - - [CompilerGenerated] - private DayOfWeek[] ??; - - [CompilerGenerated] - private DateTime[] ??; - - [ProtoMember(1)] - public Session[] Sessions - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(2)] - public DayOfWeek[] Days - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(3)] - public DateTime[] CertainDates - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SessionsSet() - { - } - - internal SessionsSet(SessionsSet P_0) - { - Sessions = P_0.Sessions.Select((Session session) => new Session(session)).ToArray(); - Days = P_0.Days?.Clone() as DayOfWeek[]; - CertainDates = P_0.CertainDates?.ToArray(); - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - Session[] sessions = Sessions; - foreach (Session session in sessions) - { - xElement2.Add(session.ToXElement()); - } - xElement.Add(xElement2); - XElement xElement3 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - DayOfWeek[] days = Days; - foreach (DayOfWeek dayOfWeek in days) - { - xElement3.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)dayOfWeek)); - } - xElement.Add(xElement3); - if (CertainDates != null) - { - XElement xElement4 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - DateTime[] certainDates = CertainDates; - foreach (DateTime dateTime in certainDates) - { - xElement4.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), dateTime)); - } - xElement.Add(xElement4); - } - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - List list = new List(); - foreach (XElement item in xElement.Elements()) - { - Session session = new Session(); - session.FromXElement(item, deserializationInfo); - list.Add(session); - } - Sessions = list.ToArray(); - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - Days = (from P_0 in xElement2.Elements() - select (DayOfWeek)P_0.ToInt()).ToArray(); - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - CertainDates = (from P_0 in xElement3.Elements() - select P_0.ToDateTime(toUTC: true)).ToArray(); - } - } - } - /// - /// Represent access to symbol information and properties. - /// - [Published] - public class Symbol : BusinessObject, IComparable, ?, IMessageBuilder, IMessageBuilder, IEquatable, IConnectionStateDependent - { - [CompilerGenerated] - private static class ? - { - public static Func ??; - } - - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - internal double ?(double P_0, double P_1) - { - return P_0; - } - - internal long ?(long P_0, long P_1) - { - return P_0; - } - - internal DateTime ?(DateTime P_0, DateTime P_1) - { - return P_0; - } - - internal long ?(long P_0, long P_1) - { - if (P_0 < 0) - { - return P_1; - } - return P_0; - } - - internal DateTime ?(DateTime P_0, DateTime P_1) - { - if (!(P_0 != default(DateTime))) - { - return P_1; - } - return P_0; - } - - internal string ?(Exchange P_0) - { - return P_0.Id; - } - } - - [CompilerGenerated] - private sealed class ? - { - public MessageSymbolInfo ??; - - internal bool ?(OptionSerie P_0) - { - return P_0.Id == ??.OptionSerieId; - } - } - - [CompilerGenerated] - private sealed class ? - { - public OrderTypeUsage? ??; - - internal bool ?(OrderType P_0) - { - return P_0.Usage.HasFlag(??); - } - } - - public const string SPOT_SYMBOL_ID = "spotSymbolId"; - - public const string TRADING_SYMBOL_ID = "TradingSymbol"; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private SymbolType ??; - - [CompilerGenerated] - private Asset ??; - - [CompilerGenerated] - private Asset ??; - - private Exchange ??; - - private string ??; - - [CompilerGenerated] - private TimeSpan ??; - - [CompilerGenerated] - private AdditionalInfoCollection ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private NettingType ??; - - [CompilerGenerated] - private SymbolGroup ??; - - [CompilerGenerated] - private SymbolQuotingType ??; - - [CompilerGenerated] - private double ??; - - private List ??; - - private double? ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private OptionCodingStyle ??; - - [CompilerGenerated] - private OptionType ??; - - [CompilerGenerated] - private OptionSerie ??; - - [CompilerGenerated] - private string ??; - - private Symbol ??; - - private string ??; - - [CompilerGenerated] - private AvailableDerivatives ??; - - [CompilerGenerated] - private AvailableDerivatives ??; - - private List ??; - - [CompilerGenerated] - private FutureContractType? ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private long ??; - - [CompilerGenerated] - private long ??; - - [CompilerGenerated] - private DepthOfMarket ??; - - private double ??; - - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - private readonly object ??; - - private TickDirection ??; - - private TickDirection ??; - - private TickDirection ??; - - [CompilerGenerated] - private HistoryType ??; - - protected HistoryMetadata historyMetadata; - - [CompilerGenerated] - private SymbolVolumeType ??; - - protected VolumeAnalysisMetadata volumeAnalysisMetadata; - - private QuoteHandler ??; - - private Level2Handler ??; - - private LastHandler ??; - - private MarkHandler ??; - - [CompilerGenerated] - private DayBarHandler ??; - - [CompilerGenerated] - private SymbolUpdateHandler ??; - - private readonly ? ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private DeltaCalculationType ??; - - [CompilerGenerated] - private double ??; - - private string ??; - - private const double ?? = 1.0 / 32.0; - - private const double ?? = 1.0 / 64.0; - - private const double ?? = 1.0 / 128.0; - - private const double ?? = 1.0 / 256.0; - - /// - /// Gets symbol Id - /// - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected set - { - ?? = value; - } - } - - public SymbolComplexIdentifier ComplexId => new SymbolComplexIdentifier(base.ConnectionId, ExchangeId, Id); - - /// - /// Gets symbol name - /// - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected set - { - ?? = value; - } - } - - /// - /// Gets symbol description - /// - public string Description - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Gets symbol type - /// - public SymbolType SymbolType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = symbolType; - } - } - - /// - /// Gets symbol base Asset - /// - public Asset Product - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected set - { - ?? = value; - } - } - - /// - /// Gets symbol counter Asset - /// - public Asset QuotingCurrency - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected set - { - ?? = value; - } - } - - /// - /// Gets Exchange of current symbol - /// - public Exchange Exchange - { - get - { - return ??; - } - protected set - { - ?? = value; - ExchangeId = Exchange?.Id; - } - } - - /// - /// Gets Exchange id of current symbol - /// - public string ExchangeId - { - get - { - return Exchange?.Id ?? ??; - } - private set - { - ?? = text; - } - } - - /// - /// Returns delay with which quote come in platform. - /// - public TimeSpan QuoteDelay - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = timeSpan; - } - } - - /// - /// Gets symbol additional info - /// - [NotPublished] - public AdditionalInfoCollection AdditionalInfo - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = additionalInfoCollection; - } - } - - /// - /// The highest trade allowed - /// - public double MaxLot - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// The lowest trade allowed - /// - public double MinLot - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets symbol NettingType - /// - public NettingType NettingType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = nettingType; - } - } - - /// - /// Gets SymbolGroup - /// - public SymbolGroup Group - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected set - { - ?? = value; - } - } - - /// - /// Gets current SymbolQuotingType - /// - public SymbolQuotingType QuotingType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = symbolQuotingType; - } - } - - /// - /// Amount of base asset for one lot. - /// - public double LotSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Stores list of symbol ticksizes - /// - public List VariableTickList - { - get - { - return ??; - } - private set - { - ?? = list; - List list2 = ??; - if (list2 != null && list2.Count == 1) - { - ?? = ??[0].TickSize; - } - else - { - ?? = null; - } - } - } - - /// - /// Step of the lot changes - /// - public double LotStep - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Step of the notional value changes - /// - public double NotionalValueStep - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets derivative expiration date - /// - public DateTime ExpirationDate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - /// - /// Gets derivative last trading date - /// - public DateTime LastTradingDate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - /// - /// Gets derivative maturity date - /// - public DateTime MaturityDate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - /// - /// Gets derivative strike price - /// - [NotPublished] - public double StrikePrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets derivative option style - /// - [NotPublished] - public OptionCodingStyle OptionStyle - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = optionCodingStyle; - } - } - - /// - /// Gets derivative option type - /// - [NotPublished] - public OptionType OptionType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = optionType; - } - } - - /// - /// Gets derivative option serie - /// - [NotPublished] - public OptionSerie OptionSerie - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = optionSerie; - } - } - - /// - /// Gets derivative underlier name - /// - public string Root - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Gets derivative underlier symbol - /// - public Symbol Underlier - { - get - { - return ??; - } - private set - { - ?? = symbol; - UnderlierId = Underlier?.Id; - } - } - - /// - /// Gets derivative underlier symbol id - /// - public string UnderlierId - { - get - { - return Underlier?.Id ?? ??; - } - private set - { - ?? = text; - } - } - - public AvailableDerivatives AvailableFutures - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = availableDerivatives; - } - } - - public AvailableDerivatives AvailableOptions - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = availableDerivatives; - } - } - - public Exchange[] AvailableOptionsExchanges => ??.ToArray(); - - public FutureContractType? FutureContractType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = futureContractType; - } - } - - /// - /// Gets Ask price - /// - public double Ask - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets Ask size - /// - public double AskSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets Bid price - /// - public double Bid - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets Bid size - /// - public double BidSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets quote time - /// - public DateTime QuoteDateTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - /// - /// Gets last price - /// - public double Last - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets last size - /// - public double LastSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets last time - /// - public DateTime LastDateTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - /// - /// Gets mark price - /// - public double Mark - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets mark size - /// - public double MarkSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets open price - /// - public double Open - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets previous close price - /// - public double PrevClose - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets high price - /// - public double High - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets low price - /// - public double Low - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets volume value - /// - public double Volume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets quote asset volume value - /// - public double QuoteAssetVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets PrevSettlement value - /// - [NotPublished] - public double PrevSettlement - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets ticks amount - /// - public long Ticks - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets trades amount - /// - public long Trades - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets Level2 data - /// - public DepthOfMarket DepthOfMarket - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = depthOfMarket; - } - } - - /// - /// Gets spread value between Bid and Ask - /// - public double Spread - { - get - { - if (double.IsNaN(Bid) || double.IsNaN(Ask)) - { - return double.NaN; - } - return CalculateTicks(Bid, Ask); - } - } - - /// - /// Gets percentage value - /// - public double SpreadPercentage - { - get - { - if (double.IsNaN(Bid) || double.IsNaN(Ask)) - { - return double.NaN; - } - decimal num = (decimal)Ask; - decimal num2 = (decimal)Bid; - decimal num3 = (num + num2) / 2m; - if (num3 == 0m) - { - return double.NaN; - } - return (double)((num - num2) / num3 * 100m); - } - } - - /// - /// Gets change value between Bid/Last and Close price - /// - public double Change - { - get - { - if (AllowCalculateRealtimeChange) - { - return CurrentPrice - ClosePrice; - } - return ??; - } - } - - /// - /// Gets percentage value - /// - public double ChangePercentage - { - get - { - if (AllowCalculateRealtimeChange) - { - double change = Change; - double closePrice = ClosePrice; - if (double.IsNaN(change) || double.IsNaN(closePrice) || closePrice == 0.0) - { - return double.NaN; - } - return (double)((decimal)change / Math.Abs((decimal)closePrice) * 100m); - } - return ??; - } - } - - private double CurrentPrice => HistoryType switch - { - HistoryType.Ask => Ask, - HistoryType.Last => Last, - HistoryType.Midpoint => (Bid + Ask) / 2.0, - HistoryType.Mark => Mark, - _ => Bid, - }; - - private double ClosePrice - { - get - { - if (!double.IsNaN(PrevSettlement) && PrevSettlement != 0.0) - { - return PrevSettlement; - } - return PrevClose; - } - } - - public double OpenInterest - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public double FundingRate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public DateTime FundingTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - public double TopPriceLimit - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public double BottomPriceLimit - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public double AverageTradedPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public double TotalBuyQuantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public double TotalSellQuantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public double IV - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public double Delta - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public double Vega - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public double Gamma - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public double Theta - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public double Rho - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - internal bool HasAnySubscription => QuotesSubscribed | Level2Subscribed | LastsSubscribed | MarkSubscribed; - - /// - /// Default history type - /// - public HistoryType HistoryType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = historyType; - } - } - - /// - /// List of all available history types - /// - [NotPublished] - public virtual HistoryMetadata HistoryMetadata - { - get - { - HistoryMetadata historyMetaData = historyMetadata; - if (historyMetaData == null) - { - Connection connection = Connection; - if (connection == null) - { - return null; - } - historyMetaData = connection.HistoryMetaData; - } - return historyMetaData; - } - } - - /// - /// Gets SymbolVolumeType - /// - public SymbolVolumeType VolumeType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = symbolVolumeType; - } - } - - /// - /// List of all available history types - /// - [NotPublished] - public virtual VolumeAnalysisMetadata VolumeAnalysisMetadata - { - get - { - VolumeAnalysisMetadata obj = volumeAnalysisMetadata; - if (obj == null) - { - Connection connection = Connection; - if (connection == null) - { - return null; - } - obj = connection.VolumeAnalysisMetadata; - } - return obj; - } - } - - internal bool QuotesSubscribed => ?? != null; - - internal bool Level2Subscribed => ?? != null; - - internal bool LastsSubscribed => ?? != null; - - internal bool MarkSubscribed => ?? != null; - - int ?.PriorityIndex => 20; - - ? ?.Rules => ??; - - /// - /// Gets real time calculation setting - /// - [NotPublished] - public bool AllowCalculateRealtimeTicks - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = flag; - } - } - - /// - /// Gets real time calculation setting - /// - [NotPublished] - public bool AllowCalculateRealtimeTrades - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = flag; - } - } - - /// - /// Gets real time calculation setting - /// - [NotPublished] - public bool AllowCalculateRealtimeVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = flag; - } - } - - /// - /// Gets real time calculation setting - /// - [NotPublished] - public bool AllowCalculateRealtimeChange - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = flag; - } - } - - [NotPublished] - public bool AllowAbbreviatePriceByTickSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DeltaCalculationType DeltaCalculationType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = deltaCalculationType; - } - } - - public double MinVolumeAnalysisTickSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public SessionsContainer CurrentSessionsInfo - { - get - { - if (string.IsNullOrEmpty(??)) - { - return Exchange?.CurrentSessionsInfo; - } - if (ConnectionCache?.TradingSessions == null) - { - return null; - } - ConnectionCache.TradingSessions.TryGetValue(??, out var value); - return value; - } - } - - internal int TotalSubscriptionsCount => (LastsSubscribed ? 1 : 0) + (MarkSubscribed ? 1 : 0) + (QuotesSubscribed ? 1 : 0) + (Level2Subscribed ? 1 : 0); - - /// - /// Gets cached tick size if it available, else tries to obtain with Last, Bid, Ask, first element of list otherwise - - /// - public double TickSize - { - get - { - if (??.HasValue) - { - return ??.Value; - } - if (!double.IsNaN(Last)) - { - return GetTickSize(Last); - } - if (!double.IsNaN(Bid)) - { - return GetTickSize(Bid); - } - if (!double.IsNaN(Ask)) - { - return GetTickSize(Ask); - } - return VariableTickList?.FirstOrDefault()?.TickSize ?? double.NaN; - } - } - - /// - /// Will be triggered when new Level1 quote is comming - /// - public event QuoteHandler NewQuote - { - add - { - ?(ref ??, value, SubscribeQuoteType.Quote); - } - remove - { - ?(ref ??, value, SubscribeQuoteType.Quote); - } - } - - /// - /// Will be triggered when new Level2 quote is comming - /// - public event Level2Handler NewLevel2 - { - add - { - ?(ref ??, value, SubscribeQuoteType.Level2); - } - remove - { - ?(ref ??, value, SubscribeQuoteType.Level2); - } - } - - /// - /// Will be triggered when new trade quote is comming - /// - public event LastHandler NewLast - { - add - { - ?(ref ??, value, SubscribeQuoteType.Last); - } - remove - { - ?(ref ??, value, SubscribeQuoteType.Last); - } - } - - public event MarkHandler NewMark - { - add - { - ?(ref ??, value, SubscribeQuoteType.Mark); - } - remove - { - ?(ref ??, value, SubscribeQuoteType.Mark); - } - } - - /// - /// Will be triggered when new correctional quote is comming from the vendor. - /// - public event DayBarHandler NewDayBar - { - [CompilerGenerated] - add - { - DayBarHandler dayBarHandler = ??; - DayBarHandler dayBarHandler2; - do - { - dayBarHandler2 = dayBarHandler; - DayBarHandler value2 = (DayBarHandler)Delegate.Combine(dayBarHandler2, value); - dayBarHandler = Interlocked.CompareExchange(ref ??, value2, dayBarHandler2); - } - while ((object)dayBarHandler != dayBarHandler2); - } - [CompilerGenerated] - remove - { - DayBarHandler dayBarHandler = ??; - DayBarHandler dayBarHandler2; - do - { - dayBarHandler2 = dayBarHandler; - DayBarHandler value2 = (DayBarHandler)Delegate.Remove(dayBarHandler2, value); - dayBarHandler = Interlocked.CompareExchange(ref ??, value2, dayBarHandler2); - } - while ((object)dayBarHandler != dayBarHandler2); - } - } - - /// - /// Will be triggered when symbol updated. - /// - public event SymbolUpdateHandler Updated - { - [CompilerGenerated] - add - { - SymbolUpdateHandler symbolUpdateHandler = ??; - SymbolUpdateHandler symbolUpdateHandler2; - do - { - symbolUpdateHandler2 = symbolUpdateHandler; - SymbolUpdateHandler value2 = (SymbolUpdateHandler)Delegate.Combine(symbolUpdateHandler2, value); - symbolUpdateHandler = Interlocked.CompareExchange(ref ??, value2, symbolUpdateHandler2); - } - while ((object)symbolUpdateHandler != symbolUpdateHandler2); - } - [CompilerGenerated] - remove - { - SymbolUpdateHandler symbolUpdateHandler = ??; - SymbolUpdateHandler symbolUpdateHandler2; - do - { - symbolUpdateHandler2 = symbolUpdateHandler; - SymbolUpdateHandler value2 = (SymbolUpdateHandler)Delegate.Remove(symbolUpdateHandler2, value); - symbolUpdateHandler = Interlocked.CompareExchange(ref ??, value2, symbolUpdateHandler2); - } - while ((object)symbolUpdateHandler != symbolUpdateHandler2); - } - } - - private void ?(ref ? P_0, ? P_1, SubscribeQuoteType P_2) where ? : Delegate - { - lock (??) - { - if (P_0 == null) - { - SubscribeAction(P_2); - } - P_0 = (?)Delegate.Combine(P_0, P_1); - } - } - - private void ?(ref ? P_0, ? P_1, SubscribeQuoteType P_2) where ? : Delegate - { - lock (??) - { - bool flag = P_0 != null; - P_0 = (?)Delegate.Remove(P_0, P_1); - if (P_0 == null && flag) - { - UnSubscribeAction(P_2); - } - } - } - - protected internal Symbol() - { - } - - [NotPublished] - protected internal Symbol(string connectionId) - : base(connectionId) - { - ?? = new object(); - ?(); - ?? = new ?(); - Core.Instance.RulesManager.Defaults.ForEach(delegate(Rule P_0) - { - ??.?(P_0.Name, P_0); - }); - } - - private protected void ?() - { - NettingType = NettingType.Undefined; - Ask = double.NaN; - AskSize = double.NaN; - Bid = double.NaN; - BidSize = double.NaN; - Last = double.NaN; - LastSize = double.NaN; - Mark = double.NaN; - MarkSize = double.NaN; - Open = double.NaN; - PrevClose = double.NaN; - High = double.NaN; - Low = double.NaN; - Volume = double.NaN; - QuoteAssetVolume = double.NaN; - PrevSettlement = double.NaN; - ?? = double.NaN; - ?? = double.NaN; - OpenInterest = double.NaN; - FundingRate = double.NaN; - TopPriceLimit = double.NaN; - BottomPriceLimit = double.NaN; - TotalBuyQuantity = double.NaN; - TotalSellQuantity = double.NaN; - IV = double.NaN; - Delta = double.NaN; - Vega = double.NaN; - Gamma = double.NaN; - Theta = double.NaN; - Rho = double.NaN; - Ticks = 0L; - Trades = 0L; - DepthOfMarket = new DepthOfMarket(this); - AllowCalculateRealtimeTicks = true; - AllowCalculateRealtimeTrades = true; - AllowCalculateRealtimeVolume = true; - AllowCalculateRealtimeChange = true; - DeltaCalculationType = DeltaCalculationType.AggressorFlag; - MinVolumeAnalysisTickSize = double.NaN; - AvailableFutures = AvailableDerivatives.None; - AvailableOptions = AvailableDerivatives.None; - MinLot = 1.0; - MaxLot = 2147483647.0; - LotStep = 1.0; - LotSize = 1.0; - NotionalValueStep = 1.0; - ?? = new List(); - } - - [NotPublished] - protected internal Symbol(BusinessObjectInfo objectInfo) - : this(objectInfo.ConnectionId) - { - Id = objectInfo.Id; - Name = objectInfo.Name; - State = BusinessObjectState.Fake; - if (objectInfo is SymbolInfo symbolInfo) - { - ExchangeId = symbolInfo.ExchangeId; - SymbolType = symbolInfo.SymbolType; - FutureContractType = symbolInfo.FutureContractType; - UnderlierId = symbolInfo.UnderlierId; - Root = symbolInfo.Root; - ExpirationDate = symbolInfo.ExpirationDate; - } - } - - internal void ?(MessageSymbolInfo P_0) - { - if (string.IsNullOrEmpty(Id)) - { - Id = P_0.Id; - } - Name = P_0.Name; - Description = P_0.Description; - SymbolType = P_0.SymbolType; - AvailableFutures = P_0.AvailableFutures; - AvailableOptions = P_0.AvailableOptions; - Root = P_0.Root; - LotStep = P_0.LotStep; - MinLot = P_0.MinLot; - MaxLot = P_0.MaxLot; - HistoryType = P_0.HistoryType; - VariableTickList = P_0.VariableTickList; - StrikePrice = P_0.StrikePrice; - OptionType = P_0.OptionType; - ExpirationDate = P_0.ExpirationDate; - LastTradingDate = P_0.LastTradingDate; - FutureContractType = P_0.FutureContractType; - if (ConnectionCache != null && !string.IsNullOrEmpty(P_0.ExchangeId)) - { - if (ConnectionCache.ExchangesCache.?(P_0.ExchangeId, out var exchange)) - { - Exchange = exchange; - } - else - { - ExchangeId = P_0.ExchangeId; - } - if (P_0.AvailableOptionsExchanges != null) - { - string[] availableOptionsExchanges = P_0.AvailableOptionsExchanges; - foreach (string text in availableOptionsExchanges) - { - if (ConnectionCache.ExchangesCache.?(text, out var item)) - { - ??.Add(item); - } - } - } - } - if (string.IsNullOrEmpty(P_0.UnderlierId)) - { - return; - } - if (ConnectionCache != null && ConnectionCache.SymbolsCache.?(P_0.UnderlierId, out var underlier)) - { - Underlier = underlier; - } - else - { - UnderlierId = P_0.UnderlierId; - } - if (P_0.OptionSerieId != null && Underlier != null) - { - OptionSerie = Connection.?(new GetOptionSeriesRequestParameters(Underlier))?.FirstOrDefault((OptionSerie optionSerie) => optionSerie.Id == P_0.OptionSerieId); - } - } - - internal void ?(MessageSymbol P_0) - { - ?((MessageSymbolInfo)P_0); - if (ConnectionCache != null) - { - if (P_0.ProductAssetId != null && ConnectionCache.??.TryGetValue(P_0.ProductAssetId, out var value)) - { - Product = value; - } - if (P_0.QuotingCurrencyAssetID != null && ConnectionCache.??.TryGetValue(P_0.QuotingCurrencyAssetID, out var value2)) - { - QuotingCurrency = value2; - } - if (!string.IsNullOrEmpty(P_0.GroupId) && ConnectionCache.SymbolGroupsCache.TryGetValue(P_0.GroupId, out var value3)) - { - Group = value3; - } - } - QuoteDelay = P_0.QuoteDelay; - MaturityDate = P_0.MaturityDate; - QuotingType = P_0.QuotingType; - LotSize = P_0.LotSize; - NotionalValueStep = P_0.NotionalValueStep; - NettingType = P_0.NettingType; - if (P_0.SymbolAdditionalInfo != null) - { - if (AdditionalInfo == null) - { - AdditionalInfoCollection additionalInfoCollection = (AdditionalInfo = new AdditionalInfoCollection()); - } - foreach (AdditionalInfoItem item in P_0.SymbolAdditionalInfo) - { - AdditionalInfo.?(item); - } - } - historyMetadata = P_0.HistoryMetadata; - volumeAnalysisMetadata = P_0.VolumeAnalysisMetadata; - VolumeType = P_0.VolumeType; - AllowCalculateRealtimeTicks = P_0.AllowCalculateRealtimeTicks; - AllowCalculateRealtimeTrades = P_0.AllowCalculateRealtimeTrades; - AllowCalculateRealtimeVolume = P_0.AllowCalculateRealtimeVolume; - AllowCalculateRealtimeChange = P_0.AllowCalculateRealtimeChange; - AllowAbbreviatePriceByTickSize = P_0.AllowAbbreviatePriceByTickSize; - DeltaCalculationType = P_0.DeltaCalculationType; - MinVolumeAnalysisTickSize = P_0.MinVolumeAnalysisTickSize; - ?? = P_0.SessionsContainerId; - ?(); - } - - protected internal virtual void SubscribeAction(SubscribeQuoteType type) - { - if (State == BusinessObjectState.Fake) - { - return; - } - if (Core.Instance.SymbolsMapping.TryGetQuotesSymbol(this, out var quotesSymbol) && quotesSymbol != this) - { - switch (type) - { - case SubscribeQuoteType.Quote: - quotesSymbol.NewQuote += ?; - break; - case SubscribeQuoteType.Level2: - { - DOMQuote dOMQuote = ((IMessageBuilder)quotesSymbol.DepthOfMarket).BuildMessage(); - dOMQuote.SymbolId = Id; - ?(dOMQuote); - quotesSymbol.NewLevel2 += ?; - break; - } - case SubscribeQuoteType.Last: - quotesSymbol.NewLast += ?; - break; - case SubscribeQuoteType.Mark: - quotesSymbol.NewMark += ?; - break; - } - bool flag = ((type == SubscribeQuoteType.Quote || (uint)(type - 2) <= 1u) ? true : false); - if (flag && (quotesSymbol.?? == null || !quotesSymbol.??.GetInvocationList().Contains(new DayBarHandler(?)))) - { - quotesSymbol.NewDayBar += ?; - DayBar dayBar = ((IMessageBuilder)quotesSymbol).BuildMessage(); - dayBar.SymbolId = Id; - ?((MessageQuote)dayBar); - } - } - else - { - Core.Instance.Connections[base.ConnectionId]?.?(this, type); - } - } - - protected internal virtual void UnSubscribeAction(SubscribeQuoteType type) - { - if (State == BusinessObjectState.Fake) - { - return; - } - if (Core.Instance.SymbolsMapping.TryGetQuotesSymbol(this, out var quotesSymbol) && quotesSymbol != this) - { - switch (type) - { - case SubscribeQuoteType.Quote: - quotesSymbol.NewQuote -= ?; - break; - case SubscribeQuoteType.Level2: - quotesSymbol.NewLevel2 -= ?; - break; - case SubscribeQuoteType.Last: - quotesSymbol.NewLast -= ?; - break; - case SubscribeQuoteType.Mark: - quotesSymbol.NewMark -= ?; - break; - } - QuoteHandler quoteHandler = quotesSymbol.??; - if (quoteHandler == null || !quoteHandler.GetInvocationList().Contains(new QuoteHandler(?))) - { - LastHandler lastHandler = quotesSymbol.??; - if (lastHandler == null || !lastHandler.GetInvocationList().Contains(new LastHandler(?))) - { - MarkHandler markHandler = quotesSymbol.??; - if (markHandler == null || !markHandler.GetInvocationList().Contains(new MarkHandler(?))) - { - quotesSymbol.NewDayBar -= ?; - ?((MessageQuote)new DayBar(Id, Core.Instance.TimeUtils.DateTimeUtcNow)); - } - } - } - } - else - { - Core.Instance.Connections[base.ConnectionId]?.?(this, type); - } - if (type == SubscribeQuoteType.Level2) - { - DepthOfMarket.?(); - } - } - - private void ?(Symbol P_0, Quote P_1) - { - ?((MessageQuote)P_1); - } - - private void ?(Symbol P_0, Level2Quote P_1, DOMQuote P_2) - { - ?(P_2); - ?(P_1); - } - - private void ?(Symbol P_0, Last P_1) - { - ?((MessageQuote)P_1); - } - - private void ?(Symbol P_0, Mark P_1) - { - ?((MessageQuote)P_1); - } - - private void ?(Symbol P_0, DayBar P_1) - { - ?((MessageQuote)P_1); - } - - internal void ?(Action P_0) - { - lock (??) - { - P_0(); - } - } - - internal void ?(MessageQuote P_0) - { - if (P_0 == null) - { - return; - } - if (!(P_0 is Quote quote)) - { - if (!(P_0 is Level2Quote level2Quote)) - { - if (!(P_0 is DOMQuote dOMQuote)) - { - if (!(P_0 is Last last)) - { - if (!(P_0 is Mark mark)) - { - if (!(P_0 is DayBar dayBar)) - { - return; - } - Func func; - Func func2; - Func func3; - if (dayBar.FullRefresh) - { - func = (double result, double num) => result; - func2 = (long result, long num) => result; - func3 = (DateTime result, DateTime dateTime) => result; - } - else - { - func = CoreMath.ProcessNaN; - func2 = (long num, long num2) => (num < 0) ? num2 : num; - func3 = (DateTime dateTime, DateTime dateTime2) => (!(dateTime != default(DateTime))) ? dateTime2 : dateTime; - } - Open = func(dayBar.Open, Open); - High = func(dayBar.High, High); - Low = func(dayBar.Low, Low); - PrevClose = func(dayBar.PreviousClose, PrevClose); - Volume = func(dayBar.Volume, Volume); - QuoteAssetVolume = func(dayBar.QuoteAssetVolume, QuoteAssetVolume); - PrevSettlement = func(dayBar.PrevSettlementPrice, PrevSettlement); - Ticks = func2(dayBar.Ticks, Ticks); - Trades = func2(dayBar.Trades, Trades); - Bid = func(dayBar.Bid, Bid); - BidSize = func(dayBar.BidSize, BidSize); - Ask = func(dayBar.Ask, Ask); - AskSize = func(dayBar.AskSize, AskSize); - Last = func(dayBar.Last, Last); - LastSize = func(dayBar.LastSize, LastSize); - Mark = func(dayBar.Mark, Mark); - MarkSize = func(dayBar.MarkSize, MarkSize); - if (!AllowCalculateRealtimeChange) - { - ?? = func(dayBar.Change, ??); - ?? = func(dayBar.ChangePercentage, ??); - } - OpenInterest = func(dayBar.OpenInterest, OpenInterest); - FundingRate = func(dayBar.FundingRate, FundingRate); - FundingTime = func3(dayBar.FundingTime, FundingTime); - TopPriceLimit = func(dayBar.TopPriceLimit, TopPriceLimit); - BottomPriceLimit = func(dayBar.BottomPriceLimit, BottomPriceLimit); - AverageTradedPrice = func(dayBar.AverageTradedPrice, AverageTradedPrice); - TotalBuyQuantity = dayBar.TotalBuyQuantity; - TotalSellQuantity = dayBar.TotalSellQuantity; - IV = dayBar.IV; - Delta = dayBar.Delta; - Vega = dayBar.Vega; - Gamma = dayBar.Gamma; - Theta = dayBar.Theta; - Rho = dayBar.Rho; - ?(dayBar); - } - else - { - Mark = mark.Price; - MarkSize = CoreMath.ProcessNaN(mark.Size, MarkSize); - ?(mark); - } - return; - } - if (HistoryMetadata != null && !HistoryMetadata.ServerSideTickDirectionAvailable) - { - last.TickDirection = DetermineTickDirection(Last, last.Price, ??); - } - ?? = last.TickDirection; - Last = last.Price; - LastSize = last.Size; - LastDateTime = last.Time; - if (AllowCalculateRealtimeVolume) - { - Volume += last.Size; - if (!double.IsNaN(last.QuoteAssetVolume)) - { - QuoteAssetVolume += last.QuoteAssetVolume; - } - } - if (AllowCalculateRealtimeTrades) - { - Trades++; - } - if (!double.IsNaN(last.OpenInterest)) - { - OpenInterest = last.OpenInterest; - } - ?(last); - } - else - { - DepthOfMarket.?(dOMQuote); - ?(null, dOMQuote); - } - } - else - { - DepthOfMarket.?(level2Quote); - ?(level2Quote, null); - } - } - else - { - quote.BidTickDirection = DetermineTickDirection(Bid, quote.Bid, ??); - quote.AskTickDirection = DetermineTickDirection(Ask, quote.Ask, ??); - ?? = quote.BidTickDirection; - ?? = quote.AskTickDirection; - if (!double.IsNaN(quote.Bid)) - { - Bid = quote.Bid; - } - if (!double.IsNaN(quote.BidSize)) - { - BidSize = quote.BidSize; - } - if (!double.IsNaN(quote.Ask)) - { - Ask = quote.Ask; - } - if (!double.IsNaN(quote.AskSize)) - { - AskSize = quote.AskSize; - } - QuoteDateTime = quote.Time; - if (AllowCalculateRealtimeTicks) - { - Ticks++; - } - ?(quote); - } - } - - private void ?(Quote P_0) - { - ???.Invoke(this, P_0); - } - - private void ?(Level2Quote P_0, DOMQuote P_1) - { - ???.Invoke(this, P_0, P_1); - } - - private void ?(Last P_0) - { - ???.Invoke(this, P_0); - } - - private void ?(Mark P_0) - { - ???.Invoke(this, P_0); - } - - private void ?(DayBar P_0) - { - ???.Invoke(this, P_0); - } - - /// - /// Gets historical data according to period and other parameters - /// - /// - /// - /// - /// - public HistoricalData GetHistory(Period period, DateTime fromTime, DateTime toTime = default(DateTime)) - { - return GetHistory(period, HistoryType, fromTime, toTime); - } - - /// - /// Gets historical data according to period and other parameters - /// - /// - /// - /// - /// - /// - public HistoricalData GetHistory(Period period, HistoryType historyType, DateTime fromTime, DateTime toTime = default(DateTime)) - { - HistoryAggregation aggregation = ((period.BasePeriod != BasePeriod.Tick) ? new HistoryAggregationTime(period, historyType) : ((period.PeriodMultiplier != 1) ? ((HistoryAggregation)new HistoryAggregationTickBars(period.PeriodMultiplier, historyType)) : ((HistoryAggregation)new HistoryAggregationTick(historyType)))); - HistoryRequestParameters historyRequestParameters = new HistoryRequestParameters - { - Symbol = this, - Aggregation = aggregation, - FromTime = fromTime, - ToTime = toTime - }; - return GetHistory(historyRequestParameters); - } - - /// - /// Gets historical data according to aggregation and other parameters - /// - /// - /// - /// - /// - /// - public HistoricalData GetHistory(HistoryAggregation aggregation, DateTime fromTime, DateTime toTime = default(DateTime)) - { - return GetHistory(new HistoryRequestParameters - { - Symbol = this, - Aggregation = aggregation, - FromTime = fromTime, - ToTime = toTime - }); - } - - /// - /// Gets historical data according to given history request - /// - /// - /// - public HistoricalData GetHistory(HistoryRequestParameters historyRequestParameters) - { - if (historyRequestParameters == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - historyRequestParameters.Symbol = this; - HistoricalData historicalData = ?(historyRequestParameters); - historicalData.Reload(); - return historicalData; - } - - private protected virtual HistoricalData ?(HistoryRequestParameters P_0) - { - return new HistoricalData(P_0); - } - - /// - /// Gets historical ticks data according to given parameters - /// - /// - /// - /// - /// - public HistoricalData GetTickHistory(HistoryType historyType, DateTime fromTime, DateTime toTime = default(DateTime)) - { - return GetHistory(new HistoryRequestParameters - { - Symbol = this, - Aggregation = new HistoryAggregationTick(historyType), - FromTime = fromTime, - ToTime = toTime - }); - } - - /// - /// Returns rounded to price - /// - public double RoundPriceToTickSize(double price, double tickSize = double.NaN) - { - if (double.IsNaN(price) || (VariableTickList == null && tickSize.IsNanOrDefault())) - { - return 0.0; - } - if (tickSize.IsNanOrDefault()) - { - VariableTick variableTick = FindVariableTick(price); - if (variableTick == null) - { - return price; - } - tickSize = variableTick.TickSize; - } - return CoreMath.RoundToIncrement(price, tickSize); - } - - /// - /// Calculates new price which equal to given price shifted by a number of given ticks - /// - /// - /// - /// - public double CalculatePrice(double price, double ticks) - { - decimal num = (decimal)price; - decimal num2 = (decimal)ticks; - return (double)(num + num2 * (decimal)GetTickSize(price)); - } - - /// - /// Calculates ticks between two prices - /// - /// - /// - /// - public double CalculateTicks(double price1, double price2) - { - if (double.IsNaN(price1) || double.IsNaN(price2)) - { - return double.NaN; - } - decimal num = (decimal)price1; - decimal num2 = (decimal)price2; - decimal num3 = (decimal)GetTickSize(price1); - decimal num4 = default(decimal); - if (num3 != 0m) - { - num4 = (num2 - num) / num3; - } - return (double)num4; - } - - /// - /// Gets cached symbol tick size or retrives it from the list - /// - /// - /// - public double GetTickSize(double price) - { - if (??.HasValue) - { - return ??.Value; - } - return FindVariableTick(price)?.TickSize ?? double.NaN; - } - - /// - /// Gets symbol tick cost retrived from the list by price - /// - /// - /// - public double GetTickCost(double price) - { - return FindVariableTick(price)?.TickCost ?? double.NaN; - } - - /// - /// Returns VariableTick if it can be retrived from list by price or null - /// - /// - /// - public VariableTick FindVariableTick(double price) - { - List variableTickList = VariableTickList; - if (variableTickList == null) - { - if (Underlier != null) - { - variableTickList = Underlier.VariableTickList; - } - if (variableTickList == null) - { - return null; - } - } - for (int num = variableTickList.Count - 1; num >= 0; num--) - { - VariableTick variableTick = variableTickList[num]; - if (variableTick.CheckPrice(price)) - { - return variableTick; - } - } - return null; - } - - private protected void ?() - { - ???.Invoke(this); - } - - [NotPublished] - public override string ToString() - { - return Name; - } - - [NotPublished] - public override BusinessObjectInfo CreateInfo() - { - return new SymbolInfo - { - ConnectionId = base.ConnectionId, - Id = Id, - Name = Name, - ExchangeId = ExchangeId, - SymbolType = SymbolType, - FutureContractType = FutureContractType, - UnderlierId = UnderlierId, - Root = Root, - ExpirationDate = ExpirationDate - }; - } - - public override bool Equals(object obj) - { - return Equals(obj as Symbol); - } - - public bool Equals(Symbol other) - { - if (other != null && base.ConnectionId == other.ConnectionId) - { - return Id == other.Id; - } - return false; - } - - public override int GetHashCode() - { - return (-1919740922 * -1521134295 + EqualityComparer.Default.GetHashCode(base.ConnectionId)) * -1521134295 + EqualityComparer.Default.GetHashCode(Id); - } - - /// - /// Formats price value to the appropriative string with a counting on tick precision. - /// - /// - /// - public string FormatPrice(double price) - { - VariableTick variableTick = FindVariableTick(price); - return FormatPrice(price, variableTick); - } - - /// - /// Formats price value to the appropriative string with a counting on tick precision. - /// - /// - /// - /// - public string FormatPrice(double price, VariableTick variableTick) - { - double num = Math.Abs(price); - if (AllowAbbreviatePriceByTickSize && GlobalSettings.AbbreviateCryptoPrices && price != 0.0 && num < 1.0 && variableTick != null) - { - int num2 = -(int)Math.Floor(Math.Log10(num)) - 1; - if (num2 < 0) - { - num2 *= -1; - } - if (num2 == 0) - { - if (variableTick != null) - { - return price.Format(variableTick.Precision); - } - return price.Format(); - } - string value = string.Empty; - if (price < 0.0) - { - value = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(2, 2); - defaultInterpolatedStringHandler.AppendFormatted(value); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(num2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - return defaultInterpolatedStringHandler.ToStringAndClear() + (num / variableTick.TickSize).ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo.InvariantCulture); - } - if (variableTick != null && (variableTick.TickSize == 1.0 / 32.0 || variableTick.TickSize == 1.0 / 64.0 || variableTick.TickSize == 1.0 / 128.0 || variableTick.TickSize == 1.0 / 256.0)) - { - return ?(price, variableTick); - } - if (variableTick != null) - { - return price.Format(variableTick.Precision); - } - return price.Format(); - } - - /// - /// Formats price value to the appropriative string with a counting on max tick precision. - /// - /// - /// - public string FormatPriceWithMaxPrecision(double price) - { - VariableTick variableTick = FindVariableTick(price); - if (variableTick != null && (variableTick.TickSize == 1.0 / 32.0 || variableTick.TickSize == 1.0 / 64.0 || variableTick.TickSize == 1.0 / 128.0 || variableTick.TickSize == 1.0 / 256.0)) - { - return ?(price, variableTick); - } - if (variableTick != null) - { - return price.FormatPriceWithMaxPrecision(variableTick.Precision); - } - return price.FormatPriceWithMaxPrecision(); - } - - private static string ?(double P_0, VariableTick P_1) - { - double num = Math.Abs(P_0 - (double)(long)P_0); - string value = ((P_1.TickSize == 1.0 / 32.0) ? ((double)(decimal)(num / P_1.TickSize)).ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) : ((P_1.TickSize == 1.0 / 64.0) ? ((double)(decimal)(num / P_1.TickSize / 2.0 * 10.0)).ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) : ((P_1.TickSize != 1.0 / 128.0) ? ((double)(decimal)(long)(num / P_1.TickSize / 8.0 * 10.0)).ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) : ((double)(decimal)(long)(num / P_1.TickSize / 4.0 * 10.0)).ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())))); - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(1, 3); - defaultInterpolatedStringHandler.AppendFormatted((P_0 < 0.0) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - defaultInterpolatedStringHandler.AppendFormatted((long)Math.Abs(P_0)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public virtual string FormatQuantity(double quantity, bool inLots = true, bool abbreviate = false) - { - if (inLots) - { - int valuePrecision = CoreMath.GetValuePrecision((decimal)LotStep); - return quantity.Format(valuePrecision, abbreviate); - } - return (quantity * LotSize).Format(CoreMath.GetValuePrecision((decimal)NotionalValueStep), abbreviate); - } - - /// - /// Returns string with formatted ticks value - /// - /// - /// - /// - public string FormatOffset(double offset, string dimension = "ticks") - { - return offset.FormatPriceWithMaxPrecision(0) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + dimension; - } - - [NotPublished] - public string FormatQuoteAssetVolume(double volume) - { - return volume.Format(); - } - - /// - /// Comparing by value - /// - [NotPublished] - public int CompareTo(Symbol symbol) - { - return Name.CompareTo(symbol.Name); - } - - private MessageSymbol ?() - { - return new MessageSymbol(Id) - { - GroupId = Group?.Id, - Name = Name, - Description = Description, - SymbolType = SymbolType, - ProductAssetId = Product?.Id, - QuotingCurrencyAssetID = QuotingCurrency?.Id, - ExchangeId = ExchangeId, - QuoteDelay = QuoteDelay, - QuotingType = QuotingType, - LotSize = LotSize, - VariableTickList = VariableTickList, - LotStep = LotStep, - NotionalValueStep = NotionalValueStep, - MaxLot = MaxLot, - MinLot = MinLot, - SymbolAdditionalInfo = AdditionalInfo?.Items.ToList(), - NettingType = NettingType, - Root = Root, - OptionType = OptionType, - StrikePrice = StrikePrice, - ExpirationDate = ExpirationDate, - HistoryType = HistoryType, - VolumeType = VolumeType, - LastTradingDate = LastTradingDate, - AllowCalculateRealtimeTicks = AllowCalculateRealtimeTicks, - AllowCalculateRealtimeTrades = AllowCalculateRealtimeTrades, - AllowCalculateRealtimeVolume = AllowCalculateRealtimeVolume, - AllowCalculateRealtimeChange = AllowCalculateRealtimeChange, - AllowAbbreviatePriceByTickSize = AllowAbbreviatePriceByTickSize, - DeltaCalculationType = DeltaCalculationType, - MinVolumeAnalysisTickSize = MinVolumeAnalysisTickSize, - AvailableFutures = AvailableFutures, - AvailableOptions = AvailableOptions, - AvailableOptionsExchanges = (AvailableOptionsExchanges.Any() ? AvailableOptionsExchanges.Select((Exchange P_0) => P_0.Id).ToArray() : null), - UnderlierId = Underlier?.Id, - MaturityDate = MaturityDate, - OptionSerieId = OptionSerie?.Id, - SessionsContainerId = ??, - HistoryMetadata = ((historyMetadata == null) ? null : new HistoryMetadata(historyMetadata)), - FutureContractType = FutureContractType - }; - } - - MessageSymbol IMessageBuilder.BuildMessage() - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(); - } - - private DayBar ?() - { - return new DayBar(Id, Core.Instance.TimeUtils.DateTimeUtcNow) - { - Ask = Ask, - AskSize = AskSize, - AverageTradedPrice = AverageTradedPrice, - TotalBuyQuantity = TotalBuyQuantity, - TotalSellQuantity = TotalSellQuantity, - Bid = Bid, - BidSize = BidSize, - BottomPriceLimit = BottomPriceLimit, - Change = Change, - ChangePercentage = ChangePercentage, - High = High, - Last = Last, - LastSize = LastSize, - Mark = Mark, - Low = Low, - Open = Open, - OpenInterest = OpenInterest, - FundingRate = FundingRate, - FundingTime = FundingTime, - PreviousClose = PrevClose, - PrevSettlementPrice = PrevSettlement, - Ticks = Ticks, - TopPriceLimit = TopPriceLimit, - Trades = Trades, - Volume = Volume, - QuoteAssetVolume = QuoteAssetVolume, - IV = IV, - Delta = Delta, - Vega = Vega, - Gamma = Gamma, - Theta = Theta, - Rho = Rho - }; - } - - DayBar IMessageBuilder.BuildMessage() - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(); - } - - /// - /// Gets symbol orders types list which are allowed. - /// - /// - /// - [NotPublished] - public virtual List GetAlowedOrderTypes(OrderTypeUsage? usage) - { - if (State == BusinessObjectState.Fake) - { - return new List(); - } - string connectionId = base.ConnectionId; - Connection connection = Core.Instance.Connections[connectionId]; - if (connection == null || connection.BusinessObjects.OrderTypes == null) - { - return null; - } - if (!usage.HasValue) - { - return connection.BusinessObjects.OrderTypes.ToList(); - } - return connection.BusinessObjects.OrderTypes.Where((OrderType P_0) => P_0.Usage.HasFlag(usage)).ToList(); - } - - public virtual bool IsTradingAllowed(Account account) - { - return TradingOperations.IsAllowed(TradingOperation.PlaceOrder, new TradingOperationParameters - { - Symbol = this, - Account = account - }).Status != TradingOperationStatus.NotAllowed; - } - - internal virtual TradingOperationResult ?(PlaceOrderRequestParameters P_0) - { - if (P_0 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return Connection.?(P_0); - } - - /// - /// An symbol has possibility to obtain the default account - /// - [NotPublished] - public virtual Account GetDefaultAccount(Account currentValue = null) - { - if (currentValue?.ConnectionId == base.ConnectionId) - { - return currentValue; - } - return Connection?.BusinessObjects?.Accounts?.FirstOrDefault(); - } - - public MarginInfo GetMarginInfo(OrderRequestParameters orderRequestParameters) - { - return Connection?.?(orderRequestParameters); - } - - public virtual ConnectionDependency GetConnectionStateDependency() - { - ConnectionDependency connectionDependency = new ConnectionDependency(); - connectionDependency.Behavior = ConnectionDependencyBehavior.PartialDependency; - connectionDependency.DependentConnectionsIds = new string[1] { base.ConnectionId }; - return connectionDependency; - } - - public virtual void OnConnectionStateChanged(Connection connection, ConnectionStateChangedEventArgs e) - { - } - - public static TickDirection DetermineTickDirection(double previousPrice, double currentPrice, TickDirection prevItemTickDirection) - { - if (double.IsNaN(previousPrice)) - { - return TickDirection.NotSet; - } - if (double.IsNaN(currentPrice)) - { - return TickDirection.NotSet; - } - if (currentPrice > previousPrice) - { - return TickDirection.Up; - } - if (currentPrice < previousPrice) - { - return TickDirection.Down; - } - return prevItemTickDirection; - } - - [NotPublished] - public static AggressorFlag ConvertTickDirection(TickDirection tickDirection) - { - return tickDirection switch - { - TickDirection.None => AggressorFlag.None, - TickDirection.Up => AggressorFlag.Buy, - TickDirection.Down => AggressorFlag.Sell, - _ => AggressorFlag.NotSet, - }; - } - - [CompilerGenerated] - private void ?(Rule P_0) - { - ??.?(P_0.Name, P_0); - } - } - public delegate void QuoteHandler(Symbol symbol, Quote quote); - public delegate void Level2Handler(Symbol symbol, Level2Quote level2, DOMQuote dom); - public delegate void LastHandler(Symbol symbol, Last last); - public delegate void MarkHandler(Symbol symbol, Mark mark); - public delegate void DayBarHandler(Symbol symbol, DayBar dayBar); - public delegate void SymbolUpdateHandler(Symbol symbol); - public struct VWAP - { - [CompilerGenerated] - private double ?; - - [CompilerGenerated] - private Side ?; - - public double Price - { - [CompilerGenerated] - readonly get - { - return ?; - } - [CompilerGenerated] - internal set - { - ? = num; - } - } - - public Side Side - { - [CompilerGenerated] - readonly get - { - return ?; - } - [CompilerGenerated] - internal set - { - ? = side; - } - } - } - /// - /// Represents information about trade. - /// - [Published] - public class Trade : TradingObject, IMessageBuilder - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private PnLItem ??; - - [CompilerGenerated] - private PnLItem ??; - - [CompilerGenerated] - private PnLItem ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private PositionImpactType ??; - - [CompilerGenerated] - private Action ??; - - /// - /// Gets the unique identifier of the order initiating the trade. - /// - public string OrderId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Gets a unique identifier of the position, which is related to this trade. - /// - public string PositionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Get the price where trade was executed - /// - public double Price - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Get the trade quantity - /// - public double Quantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Get the date and time when trade was executed - /// - public DateTime DateTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - /// - /// Get the trade Gross P&L - /// - public PnLItem GrossPnl - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = pnLItem; - } - } - - /// - /// Get the trade Net P&L - /// - public PnLItem NetPnl - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = pnLItem; - } - } - - /// - /// Get the fee value that was charged for this trade - /// - public PnLItem Fee - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = pnLItem; - } - } - - /// - /// Get the trade order type - /// - public string OrderTypeId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - public PositionImpactType PositionImpactType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = positionImpactType; - } - } - - /// - /// Will be triggered on trade updating - /// - public event Action Updated - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public Trade(string connectionId) - : base(connectionId) - { - } - - internal void ?(MessageTrade P_0) - { - base.Id = P_0.TradeId; - if (ConnectionCache != null && ConnectionCache.SymbolsCache.?(P_0.SymbolId, out var symbol)) - { - base.Symbol = symbol; - } - else if (!string.IsNullOrEmpty(P_0.SymbolId)) - { - base.Symbol = new Symbol(new BusinessObjectInfo - { - Id = P_0.SymbolId, - Name = P_0.SymbolId - }); - } - if (ConnectionCache != null && ConnectionCache.AccountsCache.?(P_0.AccountId, out var account)) - { - base.Account = account; - } - else if (!string.IsNullOrEmpty(P_0.AccountId)) - { - base.Account = new Account(new BusinessObjectInfo - { - Id = P_0.AccountId, - Name = P_0.AccountId - }); - } - OrderId = P_0.OrderId; - PositionId = P_0.PositionId; - Price = P_0.Price; - Quantity = P_0.Quantity; - base.Side = P_0.Side; - base.Comment = P_0.Comment; - DateTime = P_0.DateTime; - OrderTypeId = P_0.OrderTypeId; - PositionImpactType = P_0.PositionImpactType; - GrossPnl = P_0.GrossPnl; - if (GrossPnl != null) - { - GrossPnl.ConnectionId = base.ConnectionId; - } - NetPnl = P_0.NetPnl; - if (NetPnl != null) - { - NetPnl.ConnectionId = base.ConnectionId; - } - Fee = P_0.Fee; - if (Fee != null) - { - Fee.ConnectionId = base.ConnectionId; - } - ???.Invoke(); - } - - public MessageTrade BuildMessage() - { - return new MessageTrade - { - TradeId = base.Id, - SymbolId = base.Symbol?.Id, - AccountId = base.Account?.Id, - OrderId = OrderId, - PositionId = PositionId, - Price = Price, - Quantity = Quantity, - Side = base.Side, - Comment = base.Comment, - DateTime = DateTime, - OrderTypeId = OrderTypeId, - PositionImpactType = PositionImpactType, - GrossPnl = GrossPnl, - NetPnl = NetPnl, - Fee = Fee - }; - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(50, 7); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.Symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.Account); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Quantity); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Price); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.Comment); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - public sealed class TradingSignal : BusinessObject, IMessageBuilder - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private Side ??; - - [CompilerGenerated] - private OrderTypeBehavior ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public string Ticker - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public string Root - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public string VendorName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public Side Side - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = side; - } - } - - public OrderTypeBehavior OrderTypeBehavior - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = orderTypeBehavior; - } - } - - public double EntryPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public double TargetPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public double StopPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public double Confidence - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public double Profitability - { - get - { - if (Side != Side.Buy) - { - return 1.0 - TargetPrice / EntryPrice; - } - return TargetPrice / EntryPrice - 1.0; - } - } - - public DateTime Published - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - public DateTime Updated - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - public DateTime ExpiresAt - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - public string Duration - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public string Status - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public string Description - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public string Details - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public string Source - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - internal TradingSignal(string P_0) - : base(P_0) - { - } - - internal void ?(MessageTradingSignal P_0) - { - Id = P_0.Id; - Ticker = P_0.Ticker; - Root = P_0.Root; - VendorName = P_0.VendorName; - Side = P_0.Side; - OrderTypeBehavior = P_0.OrderTypeBehavior; - EntryPrice = P_0.EntryPrice; - TargetPrice = P_0.TargetPrice; - StopPrice = P_0.StopPrice; - Confidence = P_0.Confidence; - Published = P_0.Published; - Updated = P_0.Updated; - ExpiresAt = P_0.ExpiresAt; - Duration = P_0.Duration; - Status = P_0.Status; - Description = P_0.Description; - Details = P_0.Details; - Source = P_0.Source; - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(5, 4); - defaultInterpolatedStringHandler.AppendFormatted(Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderTypeBehavior); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Ticker ?? Root); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - defaultInterpolatedStringHandler.AppendFormatted(Description); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - private MessageTradingSignal ?() - { - return new MessageTradingSignal(Id) - { - Ticker = Ticker, - Root = Root, - VendorName = VendorName, - Side = Side, - OrderTypeBehavior = OrderTypeBehavior, - EntryPrice = EntryPrice, - TargetPrice = TargetPrice, - StopPrice = StopPrice, - Confidence = Confidence, - Published = Published, - Updated = Updated, - ExpiresAt = ExpiresAt, - Duration = Duration, - Status = Status, - Description = Description, - Details = Details, - Source = Source - }; - } - - MessageTradingSignal IMessageBuilder.BuildMessage() - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(); - } - - public string Format() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(18, 7); - defaultInterpolatedStringHandler.AppendFormatted(Confidence, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Status); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Ticker ?? Root); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(EntryPrice); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(TargetPrice); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(StopPrice); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Updated, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } -} -namespace ? -{ - [Serializable] - [DataContract] - internal class ? : BusinessObjectInfo - { - [CompilerGenerated] - private bool ??; - - [DataMember(Name = "IsCrypto")] - public bool IsCrypto - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = flag; - } - } - - protected override bool NeedToEncryptInfo => true; - - public override XElement ToXElement() - { - XElement xElement = base.ToXElement(); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsCrypto)); - return xElement; - } - - public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - base.FromXElement(element, deserializationInfo); - IsCrypto = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToBool() ?? false; - } - } -} -namespace TradingPlatform.BusinessLayer -{ - [Serializable] - [DataContract] - public class BusinessObjectInfo : IXElementSerialization, IEquatable - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [DataMember(Name = "Id")] - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - [DataMember(Name = "ConnectionId")] - public string ConnectionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - [DataMember(Name = "Name")] - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - protected virtual bool NeedToEncryptInfo => false; - - public static BusinessObjectInfo Empty => new BusinessObjectInfo - { - Id = string.Empty, - ConnectionId = string.Empty, - Name = string.Empty - }; - - public virtual XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), NeedToEncryptInfo ? Encryptor.?(Id) : Id)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ConnectionId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), NeedToEncryptInfo ? Encryptor.?(Name) : Name)); - return xElement; - } - - public virtual void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - string value = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; - if (NeedToEncryptInfo) - { - string text = Encryptor.?(value); - if (text != null) - { - Id = text; - goto IL_0038; - } - } - Id = value; - goto IL_0038; - IL_0038: - ConnectionId = ConnectionsManager.??.?(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value); - string value2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; - if (NeedToEncryptInfo) - { - string text2 = Encryptor.?(value2); - if (text2 != null) - { - Name = text2; - return; - } - } - Name = value2; - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(6, 3); - defaultInterpolatedStringHandler.AppendFormatted(ConnectionId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Id); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public bool Equals(BusinessObjectInfo other) - { - if ((object)other == null) - { - return false; - } - if ((object)this == other) - { - return true; - } - if (Id == other.Id && ConnectionId == other.ConnectionId) - { - return Name == other.Name; - } - return false; - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - if (this == obj) - { - return true; - } - if (obj.GetType() != GetType()) - { - return false; - } - return Equals((BusinessObjectInfo)obj); - } - - public override int GetHashCode() - { - return HashCode.Combine(Id, ConnectionId, Name); - } - - public static bool operator ==(BusinessObjectInfo left, BusinessObjectInfo right) - { - return object.Equals(left, right); - } - - public static bool operator !=(BusinessObjectInfo left, BusinessObjectInfo right) - { - return !object.Equals(left, right); - } - } - public class CryptoAccountEventArgs : EventArgs - { - [CompilerGenerated] - private readonly AccountBalanceEventReason ?; - - [CompilerGenerated] - private readonly CryptoAssetBalances ?; - - public AccountBalanceEventReason Reason - { - [CompilerGenerated] - get - { - return ?; - } - } - - public CryptoAssetBalances Balances - { - [CompilerGenerated] - get - { - return ?; - } - } - - public CryptoAccountEventArgs(AccountBalanceEventReason reason, CryptoAssetBalances balances) - { - ? = reason; - ? = balances; - } - } - public sealed class CustomAccountPropertiesProvider : ICustomizable - { - public const string CUSTOM_NAME = "CustomName"; - - public const string LOCKED = "Locked"; - - [CompilerGenerated] - private Action ??; - - private readonly ConcurrentDictionary> ??; - - public IList Settings - { - get - { - List list = new List(); - foreach (KeyValuePair> item2 in ??) - { - List list2 = new List - { - new SettingItemAccount(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), item2.Key) - }; - foreach (KeyValuePair item3 in item2.Value) - { - list2.Add(?(item3.Key, item3.Value)); - } - SettingItemGroup item = new SettingItemGroup(string.Empty, list2); - list.Add(item); - } - return list; - } - set - { - foreach (SettingItem item in value) - { - if (!(item is SettingItemGroup settingItemGroup)) - { - continue; - } - Account account = null; - Dictionary dictionary = new Dictionary(); - foreach (SettingItem item2 in settingItemGroup.Value as IList) - { - if (item2.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - account = item2.Value as Account; - } - else - { - dictionary[item2.Name] = item2.Value; - } - } - if (account != null) - { - ??[account] = dictionary; - } - } - } - } - - public event Action ParametersChanged - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public CustomAccountPropertiesProvider() - { - ?? = new ConcurrentDictionary>(); - } - - public void SetProperty(Account account, string name, object value) - { - if (??.ContainsKey(account)) - { - ??[account][name] = value; - } - else - { - ??[account] = new Dictionary { { name, value } }; - } - ???.Invoke(); - } - - public object GetProperty(Account account, string name) - { - if (account == null) - { - return null; - } - if (??.TryGetValue(account, out var value) && value.TryGetValue(name, out var value2)) - { - return value2; - } - return null; - } - - private SettingItem ?(string P_0, object P_1) - { - if (!(P_1 is int)) - { - if (!(P_1 is double)) - { - if (!(P_1 is string)) - { - if (P_1 is bool) - { - return new SettingItemBoolean(P_0, (bool)P_1); - } - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return new SettingItemString(P_0, (string)P_1); - } - return new SettingItemDouble(P_0, (double)P_1); - } - return new SettingItemInteger(P_0, (int)P_1); - } - } - public class DealTicket - { - [CompilerGenerated] - private readonly string ?; - - [CompilerGenerated] - private readonly string ?; - - [CompilerGenerated] - private readonly DealTicketType ?; - - [CompilerGenerated] - private readonly DateTime ?; - - [CompilerGenerated] - private readonly Action ?; - - public string Header - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - init - { - ? = value; - } - } - - public string Description - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - init - { - ? = value; - } - } - - public DealTicketType Type - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - init - { - ? = value; - } - } - - public DateTime CreationTime - { - [CompilerGenerated] - get - { - return ?; - } - } - - public Action CustomAction - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - init - { - ? = value; - } - } - - internal DealTicket(string P_0, string P_1, DealTicketType P_2) - : this() - { - Header = P_0; - Description = P_1; - Type = P_2; - } - - protected DealTicket() - { - ? = Core.Instance.TimeUtils.DateTimeUtcNow; - } - } - public sealed class DealticketConnection : DealTicket, IConnectionBindedObject, ILoggable - { - private readonly string ??; - - string IConnectionBindedObject.ConnectionId => ??; - - public string Event => base.Header; - - public string Message => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + base.Description + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public DealticketConnection(string connectionId, MessageDealTicket message) - { - ?? = connectionId; - base.Header = message.Header; - base.Description = message.Description; - base.Type = message.DealTicketType; - } - } - [DataContract] - public sealed class DealTicketItem - { - [CompilerGenerated] - private string ?; - - private readonly object ?; - - [CompilerGenerated] - private readonly int ?; - - [DataMember(Name = "key")] - public string Key - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = text; - } - } - - [DataMember(Name = "value")] - public string FormattedValue => ??.ToString(); - - public int SortIndex - { - [CompilerGenerated] - get - { - return ?; - } - } - - public DealTicketItem(string key, object value, int sortIndex = 0) - { - Key = key; - ? = value; - ? = sortIndex; - } - } - public readonly struct ExchangeComplexIdentifier : IEquatable - { - [CompilerGenerated] - private readonly string ?; - - [CompilerGenerated] - private readonly string ?; - - public string ConnectionId - { - [CompilerGenerated] - get - { - return ?; - } - } - - public string ExchangeId - { - [CompilerGenerated] - get - { - return ?; - } - } - - public ExchangeComplexIdentifier(string connectionId, string exchangeId) - { - ? = connectionId; - ? = exchangeId; - } - - public bool Equals(ExchangeComplexIdentifier other) - { - if (ConnectionId == other.ConnectionId) - { - return ExchangeId == other.ExchangeId; - } - return false; - } - - public override bool Equals(object obj) - { - if (obj is ExchangeComplexIdentifier other) - { - return Equals(other); - } - return false; - } - - public override int GetHashCode() - { - return (ConnectionId.GetHashCode() * 397) ^ ExchangeId.GetHashCode(); - } - - public static bool operator ==(ExchangeComplexIdentifier left, ExchangeComplexIdentifier right) - { - return left.Equals(right); - } - - public static bool operator !=(ExchangeComplexIdentifier left, ExchangeComplexIdentifier right) - { - return !left.Equals(right); - } - } - /// - /// The symbols list manager. - /// - public sealed class SymbolsListManager : ICustomizable - { - [CompilerGenerated] - private static class ? - { - public static Func ??; - } - - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func ??; - - internal bool ?(FtpListItem P_0) - { - return P_0.Type == FtpObjectType.Directory; - } - - internal bool ?(FtpListItem P_0) - { - return P_0.Type == FtpObjectType.File; - } - - internal bool ?(FtpListItem P_0) - { - return Path.GetExtension(P_0.Name) == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - } - - private readonly Dictionary ??; - - private readonly Dictionary ??; - - /// - /// Gets the count. - /// - public int Count => ??.Count + ??.Count; - - /// - /// Gets or Sets the settings. - /// - public IList Settings - { - get - { - List list = new List(); - foreach (KeyValuePair item in ??) - { - list.Add(new SettingItemGroup(item.Key, item.Value.Settings)); - } - return list; - } - set - { - foreach (SettingItem item in value) - { - if (item.Value is IList settings) - { - if (??.TryGetValue(item.Name, out var value2)) - { - value2.Settings = settings; - continue; - } - value2 = new SymbolList - { - Settings = settings - }; - ??.Add(item.Name, value2); - } - } - } - } - - internal SymbolList[] Items => ??.Values.Concat(??.Values).ToArray(); - - internal SymbolsListManager() - { - ?? = new Dictionary(); - ?? = new Dictionary(); - } - - internal void ?() - { - } - - internal void ?(string P_0, IEnumerable P_1) - { - ??.Add(P_0, new SymbolList(P_0, P_1)); - } - - internal void ?(string P_0, IList P_1) - { - ??[P_0].Symbols = P_1; - } - - internal void ?(string P_0) - { - ??.Remove(P_0); - } - - internal void ?(string P_0, string P_1) - { - if (!??.TryGetValue(P_0, out var value)) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0); - } - ??.Remove(P_0); - value.?(P_1); - ??.Add(P_1, value); - } - - [Conditional("quantower_in_licences")] - private void ?() - { - Task.Factory.StartNew(delegate - { - try - { - using FtpClient ftpClient = new FtpClient(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - ftpClient.Connect(); - foreach (FtpListItem item in from P_0 in ftpClient.GetListing(Path.Combine(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - where P_0.Type == FtpObjectType.Directory - select P_0) - { - FtpListItem[] array = (from P_0 in ftpClient.GetListing(item.FullName) - where P_0.Type == FtpObjectType.File - where Path.GetExtension(P_0.Name) == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - select P_0).ToArray(); - foreach (FtpListItem ftpListItem in array) - { - using MemoryStream memoryStream = new MemoryStream(); - ftpClient.DownloadStream(memoryStream, ftpListItem.FullName, 0L, null, 0L); - memoryStream.Position = 0L; - double version; - List list = Serializer.DeserializeXML(memoryStream, out version, SettingItem.DesserrializationFabric).OfType().ToList(); - if (list != null && list.Any()) - { - SymbolList symbolList = new SymbolList(list, false) - { - Group = item.Name - }; - string key = Path.Combine(item.Name, symbolList.Name); - ??[key] = symbolList; - } - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - }); - } - - [CompilerGenerated] - private void ?() - { - try - { - using FtpClient ftpClient = new FtpClient(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - ftpClient.Connect(); - foreach (FtpListItem item in from P_0 in ftpClient.GetListing(Path.Combine(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - where P_0.Type == FtpObjectType.Directory - select P_0) - { - FtpListItem[] array = (from P_0 in ftpClient.GetListing(item.FullName) - where P_0.Type == FtpObjectType.File - where Path.GetExtension(P_0.Name) == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - select P_0).ToArray(); - foreach (FtpListItem ftpListItem in array) - { - using MemoryStream memoryStream = new MemoryStream(); - ftpClient.DownloadStream(memoryStream, ftpListItem.FullName, 0L, null, 0L); - memoryStream.Position = 0L; - double version; - List list = Serializer.DeserializeXML(memoryStream, out version, SettingItem.DesserrializationFabric).OfType().ToList(); - if (list != null && list.Any()) - { - SymbolList symbolList = new SymbolList(list, false) - { - Group = item.Name - }; - string key = Path.Combine(item.Name, symbolList.Name); - ??[key] = symbolList; - } - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - } - /// - /// Represent access to level2 data. - /// - [Published] - public class DepthOfMarket : IMessageBuilder - { - [CompilerGenerated] - private ? ?; - - [CompilerGenerated] - private ? ?; - - private Dictionary ?; - - private readonly Symbol ?; - - private readonly object ?; - - /// - /// Gets Level2 Asks list - /// - internal ? Asks - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = ?; - } - } - - /// - /// Gets Level2 Bids list - /// - internal ? Bids - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = ?; - } - } - - internal DepthOfMarket(Symbol P_0) - { - ? = P_0; - bool flag = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ?.ConnectionId).Status == TradingOperationStatus.Allowed; - Asks = new ?(QuotePriceType.Ask, flag); - Bids = new ?(QuotePriceType.Bid, flag); - ? = new object(); - ? = new Dictionary(); - } - - internal void ?(Level2Quote P_0) - { - lock (?) - { - if (P_0.PriceType == QuotePriceType.Ask) - { - Asks.?(P_0); - } - else - { - Bids.?(P_0); - } - ? = new Dictionary(); - } - } - - internal void ?(DOMQuote P_0) - { - lock (?) - { - Asks.?(P_0.Asks); - Bids.?(P_0.Bids); - ? = new Dictionary(); - } - } - - internal void ?() - { - lock (?) - { - Asks.?(); - Bids.?(); - ?.Clear(); - } - } - - /// - /// Gets current Level2 data - /// - /// Parameters of DepthOfMarket - /// - public DepthOfMarketAggregatedCollections GetDepthOfMarketAggregatedCollections(GetDepthOfMarketParameters parameters = null) - { - if (parameters == null) - { - parameters = new GetDepthOfMarketParameters(); - } - lock (?) - { - int hashCode = parameters.GetHashCode(); - if (!?.TryGetValue(hashCode, out var value)) - { - value = new DepthOfMarketAggregatedCollections - { - Asks = Asks.?(parameters.GetLevel2ItemsParameters), - Bids = Bids.?(parameters.GetLevel2ItemsParameters) - }; - if (parameters.CalculateImbalancePercent) - { - ?(value.Asks, value.Bids); - } - ?[hashCode] = value; - } - return value; - } - } - - /// - /// Gets current Level2 data - /// - /// Parameters of request for Leve2Item collection - /// - public DepthOfMarketAggregatedCollections GetDepthOfMarketAggregatedCollections(GetLevel2ItemsParameters parameters) - { - return GetDepthOfMarketAggregatedCollections(new GetDepthOfMarketParameters - { - GetLevel2ItemsParameters = parameters - }); - } - - private static void ?(Level2Item[] P_0, Level2Item[] P_1) - { - int num = Math.Min(P_1.Length, P_0.Length); - for (int i = 0; i < num; i++) - { - Level2Item level2Item = P_0[i]; - Level2Item level2Item2 = P_1[i]; - double cumulative = level2Item.Cumulative; - double cumulative2 = level2Item2.Cumulative; - if (cumulative >= 0.0 && cumulative2 >= 0.0) - { - level2Item.ImbalancePercent = Math.Round(level2Item.Cumulative / (level2Item.Cumulative + level2Item2.Cumulative) * 100.0, 2); - level2Item2.ImbalancePercent = 100.0 - level2Item.ImbalancePercent; - } - } - } - - private DOMQuote ?() - { - return new DOMQuote(?.Id, Core.Instance.TimeUtils.DateTimeUtcNow) - { - Asks = Asks.Items.Values.ToList(), - Bids = Bids.Items.Values.ToList() - }; - } - - DOMQuote IMessageBuilder.BuildMessage() - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(); - } - } - /// - /// Leve2 data. Contains Bids and Ask collections - /// - [Published] - public class DepthOfMarketAggregatedCollections - { - [CompilerGenerated] - private Level2Item[] ?; - - [CompilerGenerated] - private Level2Item[] ?; - - public Level2Item[] Asks - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - internal set - { - ? = array; - } - } - - public Level2Item[] Bids - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - internal set - { - ? = array; - } - } - } - /// - /// Represent parameters of DepthOfMarket - /// - [Published] - public class GetDepthOfMarketParameters - { - [CompilerGenerated] - private GetLevel2ItemsParameters ?; - - [CompilerGenerated] - private bool ?; - - public GetLevel2ItemsParameters GetLevel2ItemsParameters - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - public bool CalculateImbalancePercent - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - public GetDepthOfMarketParameters() - { - GetLevel2ItemsParameters = new GetLevel2ItemsParameters(); - } - - public static bool operator ==(GetDepthOfMarketParameters p1, GetDepthOfMarketParameters p2) - { - if ((object)p1 == null || (object)p2 == null) - { - if ((object)p1 == null) - { - return (object)p2 == null; - } - return false; - } - return p1.Equals(p2); - } - - public static bool operator !=(GetDepthOfMarketParameters p1, GetDepthOfMarketParameters p2) - { - if ((object)p1 == null || (object)p2 == null) - { - if ((object)p1 == null) - { - return (object)p2 != null; - } - return true; - } - return !p1.Equals(p2); - } - - public override bool Equals(object obj) - { - if (!(obj is GetDepthOfMarketParameters getDepthOfMarketParameters)) - { - return false; - } - if (GetLevel2ItemsParameters != getDepthOfMarketParameters.GetLevel2ItemsParameters) - { - return false; - } - if (CalculateImbalancePercent != getDepthOfMarketParameters.CalculateImbalancePercent) - { - return false; - } - return true; - } - - public override int GetHashCode() - { - return GetLevel2ItemsParameters.GetHashCode() ^ CalculateImbalancePercent.GetHashCode(); - } - } - /// - /// Represent parameters of request for Leve2Item collection - /// - [Published] - public class GetLevel2ItemsParameters - { - [CompilerGenerated] - private AggregateMethod ?; - - [CompilerGenerated] - private ImplicitOrderBookType ?; - - [CompilerGenerated] - private int ?; - - [CompilerGenerated] - private double ?; - - [CompilerGenerated] - private bool ?; - - [CompilerGenerated] - private bool ?; - - /// - /// Aggregation method - /// - public AggregateMethod AggregateMethod - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - public ImplicitOrderBookType ImplicitOrderBookType - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - /// - /// Required amount of level2 - /// - public int LevelsCount - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - /// - /// Use custom tick size - /// - public double CustomTickSize - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - /// - /// Calculate cumulative size - /// - public bool CalculateCumulative - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - public bool GetMBOItems - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - public static bool operator ==(GetLevel2ItemsParameters p1, GetLevel2ItemsParameters p2) - { - if ((object)p1 == null || (object)p2 == null) - { - if ((object)p1 == null) - { - return (object)p2 == null; - } - return false; - } - return p1.Equals(p2); - } - - public static bool operator !=(GetLevel2ItemsParameters p1, GetLevel2ItemsParameters p2) - { - if ((object)p1 == null || (object)p2 == null) - { - if ((object)p1 == null) - { - return (object)p2 != null; - } - return true; - } - return !p1.Equals(p2); - } - - public override bool Equals(object obj) - { - if (!(obj is GetLevel2ItemsParameters getLevel2ItemsParameters)) - { - return false; - } - if (AggregateMethod != getLevel2ItemsParameters.AggregateMethod) - { - return false; - } - if (LevelsCount != getLevel2ItemsParameters.LevelsCount) - { - return false; - } - if (CustomTickSize != getLevel2ItemsParameters.CustomTickSize) - { - return false; - } - if (CalculateCumulative != getLevel2ItemsParameters.CalculateCumulative) - { - return false; - } - if (ImplicitOrderBookType != getLevel2ItemsParameters.ImplicitOrderBookType) - { - return false; - } - if (GetMBOItems != getLevel2ItemsParameters.GetMBOItems) - { - return false; - } - return true; - } - - public override int GetHashCode() - { - return (int)((uint)AggregateMethod ^ (uint)LevelsCount ^ (uint)CustomTickSize.GetHashCode() ^ (uint)CalculateCumulative.GetHashCode() ^ (uint)ImplicitOrderBookType.GetHashCode()) ^ GetMBOItems.GetHashCode(); - } - } -} -namespace ? -{ - internal sealed class ? - { - [CompilerGenerated] - private static class ? - { - public static Func ??; - } - - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - internal string ?(Level2Quote P_0) - { - return P_0.Id; - } - - internal Level2Quote ?(Level2Quote P_0) - { - return P_0; - } - - internal double ?(Level2Quote P_0) - { - return P_0.ImpliedSize; - } - - internal double ?(Level2Quote P_0) - { - return P_0.Size - P_0.ImpliedSize; - } - - internal double ?(Level2Quote P_0) - { - return P_0.Size; - } - - internal double ?(Level2Quote P_0) - { - return P_0.Price; - } - - internal Level2Item ?(Level2Item P_0) - { - return P_0; - } - - internal Level2Item ?(Level2Item P_0) - { - return P_0; - } - } - - [CompilerGenerated] - private sealed class ? - { - public ? ??; - - public GetLevel2ItemsParameters ??; - - public Func ??; - - public Func ??; - - public Func ??; - - internal double ?(Level2Quote P_0) - { - return (double)??.?((decimal)P_0.Price, (decimal)??.CustomTickSize); - } - - internal Level2Item ?(IGrouping P_0) - { - Level2Quote level2Quote = P_0.First(); - if (P_0.Count() == 1) - { - double num = ??(level2Quote); - return new Level2Item(P_0.Key, num, level2Quote.Time, level2Quote.Broker, level2Quote.Priority, level2Quote.NumberOrders, (!??.GetMBOItems) ? new Level2Item[0] : new Level2Item[1] - { - new Level2Item(P_0.Key, num, level2Quote.Time, level2Quote.Broker, level2Quote.Priority, 1) - { - Id = level2Quote.Id - } - }); - } - return new Level2Item(P_0.Key, P_0.Sum((Level2Quote arg) => ??(arg)), level2Quote.Time, string.Empty, 0L, P_0.Count(), ??.GetMBOItems ? P_0.Select((Level2Quote level2Quote2) => new Level2Item(level2Quote2.Price, ??(level2Quote2), level2Quote2.Time, level2Quote2.Broker, level2Quote2.Priority, 1) - { - Id = level2Quote2.Id - }).OrderBy(?.?.??.?, ??.?).ToArray() : new Level2Item[0]); - } - - internal double ?(Level2Quote P_0) - { - return ??(P_0); - } - - internal Level2Item ?(Level2Quote P_0) - { - return new Level2Item(P_0.Price, ??(P_0), P_0.Time, P_0.Broker, P_0.Priority, 1) - { - Id = P_0.Id - }; - } - - internal Level2Item ?(Level2Quote P_0) - { - return new Level2Item(P_0.Price, ??(P_0), P_0.Time, P_0.Broker, P_0.Priority, P_0.NumberOrders); - } - } - - [CompilerGenerated] - private sealed class ? - { - public double ??; - - internal Level2Item ?(Level2Item P_0) - { - ?? += P_0.Size; - P_0.Cumulative = ??; - return P_0; - } - } - - [CompilerGenerated] - private Dictionary ?; - - private readonly object ?; - - private readonly QuotePriceType ?; - - private readonly ? ?; - - private readonly Func ?; - - private Dictionary ?; - - private readonly bool ?; - - internal Dictionary Items - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = dictionary; - } - } - - internal ?(QuotePriceType P_0, bool P_1) - { - ? = P_0; - ? = P_1; - ? = new ?(? == QuotePriceType.Bid); - ? = ?; - Items = new Dictionary(); - ? = new Dictionary(); - ? = new object(); - } - - internal void ?() - { - lock (?) - { - Items.Clear(); - ?.Clear(); - } - } - - internal Level2Item[] ?(GetLevel2ItemsParameters P_0 = null) - { - if (P_0 == null) - { - P_0 = new GetLevel2ItemsParameters(); - } - lock (?) - { - int hashCode = P_0.GetHashCode(); - if (!?.TryGetValue(hashCode, out var value)) - { - value = ?(P_0); - ?[hashCode] = value; - } - return value; - } - } - - internal void ?(Level2Quote P_0) - { - lock (?) - { - if (P_0.Closed) - { - Items.Remove(P_0.Id); - } - else - { - Items[P_0.Id] = P_0; - } - ? = new Dictionary(); - } - } - - internal void ?(IEnumerable P_0) - { - lock (?) - { - Items = P_0.ToDictionary((Level2Quote level2Quote) => level2Quote.Id, (Level2Quote result) => result); - ? = new Dictionary(); - } - } - - private Level2Item[] ?(GetLevel2ItemsParameters P_0) - { - Dictionary.ValueCollection values = Items.Values; - bool flag = P_0.CustomTickSize > 0.0 && !P_0.CustomTickSize.IsNanOrDefault(); - _ = P_0.AggregateMethod; - if (?) - { - } - Func ?? = P_0.ImplicitOrderBookType switch - { - ImplicitOrderBookType.Implied => (Level2Quote level2Quote) => level2Quote.ImpliedSize, - ImplicitOrderBookType.Outright => (Level2Quote level2Quote) => level2Quote.Size - level2Quote.ImpliedSize, - _ => (Level2Quote level2Quote) => level2Quote.Size, - }; - IEnumerable source = (P_0.AggregateMethod switch - { - AggregateMethod.ByPriceLVL => (flag ? (from level2Quote in values - group level2Quote by (double)?((decimal)level2Quote.Price, (decimal)P_0.CustomTickSize)) : (from level2Quote in values - group level2Quote by level2Quote.Price)).Select(delegate(IGrouping grouping) - { - Level2Quote level2Quote = grouping.First(); - if (grouping.Count() == 1) - { - double num = ??(level2Quote); - return new Level2Item(grouping.Key, num, level2Quote.Time, level2Quote.Broker, level2Quote.Priority, level2Quote.NumberOrders, (!P_0.GetMBOItems) ? new Level2Item[0] : new Level2Item[1] - { - new Level2Item(grouping.Key, num, level2Quote.Time, level2Quote.Broker, level2Quote.Priority, 1) - { - Id = level2Quote.Id - } - }); - } - return new Level2Item(grouping.Key, grouping.Sum((Level2Quote arg) => ??(arg)), level2Quote.Time, string.Empty, 0L, grouping.Count(), P_0.GetMBOItems ? grouping.Select((Level2Quote level2Quote2) => new Level2Item(level2Quote2.Price, ??(level2Quote2), level2Quote2.Time, level2Quote2.Broker, level2Quote2.Priority, 1) - { - Id = level2Quote2.Id - }).OrderBy(?.?.??.?, ?).ToArray() : new Level2Item[0]); - }), - _ => values.Select((Level2Quote level2Quote) => new Level2Item(level2Quote.Price, ??(level2Quote), level2Quote.Time, level2Quote.Broker, level2Quote.Priority, level2Quote.NumberOrders)), - }).OrderBy((Level2Item result) => result, ?); - if (P_0.LevelsCount > 0) - { - source = source.Take(P_0.LevelsCount); - } - if (P_0.CalculateCumulative) - { - double ?? = 0.0; - source = source.Select(delegate(Level2Item level2Item) - { - ?? += level2Item.Size; - level2Item.Cumulative = ??; - return level2Item; - }); - } - return source.ToArray(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static decimal ?(decimal P_0, decimal P_1) - { - return P_0 - P_0 % P_1; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static decimal ?(decimal P_0, decimal P_1) - { - decimal num = ?(P_0, P_1); - if (num == P_0) - { - return P_0; - } - return num + P_1; - } - } -} -namespace TradingPlatform.BusinessLayer -{ - /// - /// Aggregation method - /// - [Published] - public enum AggregateMethod - { - ByPriceLVL, - ByMMIDAndPrice, - None - } - public enum ImplicitOrderBookType - { - Combined, - Implied, - Outright - } - /// - /// Represent access to level2 item. - /// - [Published] - public class Level2Item - { - [CompilerGenerated] - private string ?; - - [CompilerGenerated] - private double ?; - - [CompilerGenerated] - private double ?; - - [CompilerGenerated] - private double ?; - - [CompilerGenerated] - private double ?; - - [CompilerGenerated] - private DateTime ?; - - [CompilerGenerated] - private string ?; - - [CompilerGenerated] - private long ?; - - [CompilerGenerated] - private int ?; - - [CompilerGenerated] - private Level2Item[] ?; - - public string Id - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - internal set - { - ? = text; - } - } - - /// - /// Cumulative size - /// - public double Cumulative - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - internal set - { - ? = num; - } - } - - /// - /// Imbalance Percent - /// - public double ImbalancePercent - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - internal set - { - ? = num; - } - } - - /// - /// Price - /// - public double Price - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = num; - } - } - - /// - /// Size - /// - public double Size - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = num; - } - } - - /// - /// Time - /// - public DateTime QuoteTime - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = dateTime; - } - } - - /// - /// MMID - /// - public string MMID - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = text; - } - } - - public long Priority - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = num; - } - } - - /// - /// Number orders - /// - public int NumberOrders - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = num; - } - } - - public Level2Item[] DetailedLevels - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - private Level2Item() - { - Cumulative = double.NaN; - ImbalancePercent = double.NaN; - } - - internal Level2Item(double P_0, double P_1, DateTime P_2, string P_3, long P_4, int P_5) - : this() - { - Price = P_0; - Size = P_1; - QuoteTime = P_2; - MMID = P_3; - Priority = P_4; - NumberOrders = P_5; - } - - internal Level2Item(double P_0, double P_1, DateTime P_2, string P_3, long P_4, int P_5, Level2Item[] P_6) - : this(P_0, P_1, P_2, P_3, P_4, P_5) - { - DetailedLevels = P_6; - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - defaultInterpolatedStringHandler.AppendFormatted(Price); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - defaultInterpolatedStringHandler.AppendFormatted(Size); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } -} -namespace ? -{ - internal class ? : IComparer - { - private readonly bool ?; - - public ?(bool P_0) - { - ? = P_0; - } - - public int Compare(Level2Item x, Level2Item y) - { - double price = x.Price; - double size = x.Size; - long ticks = x.QuoteTime.Ticks; - double price2 = y.Price; - double size2 = y.Size; - long ticks2 = y.QuoteTime.Ticks; - double num = price - price2; - if (num <= -1E-12) - { - if (!?) - { - return -1; - } - return 1; - } - if (num >= 1E-12) - { - if (!?) - { - return 1; - } - return -1; - } - if (ticks > ticks2) - { - return 1; - } - if (ticks < ticks2) - { - return -1; - } - if (size > size2) - { - return -1; - } - if (size < size2) - { - return 1; - } - return string.CompareOrdinal(x.MMID, y.MMID); - } - } -} -namespace TradingPlatform.BusinessLayer -{ - [DataContract(Name = "OptionSerie", Namespace = "TradingPlatform")] - public sealed class OptionSerie : BusinessObject, IMessageBuilder, IComparable - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private Exchange ??; - - [CompilerGenerated] - private OptionSerieType ??; - - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public DateTime ExpirationDate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public string UnderlierId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public Exchange Exchange - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = exchange; - } - } - - public OptionSerieType SerieType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = optionSerieType; - } - } - - public string VisualName - { - get - { - string text = ExpirationDate.ToShortDateString(); - if (string.IsNullOrEmpty(Name)) - { - return text; - } - return Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + text; - } - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(2, 3); - defaultInterpolatedStringHandler.AppendFormatted(UnderlierId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(ExpirationDate.ToShortDateString()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - internal OptionSerie(string P_0) - : base(P_0) - { - } - - internal void ?(MessageOptionSerie P_0) - { - Id = P_0.Id; - ExpirationDate = P_0.ExpirationDate; - Name = P_0.Name; - UnderlierId = P_0.UnderlierId; - SerieType = P_0.SerieType; - if (!string.IsNullOrEmpty(P_0.ExchangeId) && ConnectionCache != null && ConnectionCache.ExchangesCache.?(P_0.ExchangeId, out var exchange)) - { - Exchange = exchange; - } - } - - private MessageOptionSerie ?() - { - return new MessageOptionSerie - { - Id = Id, - ExpirationDate = ExpirationDate, - Name = Name, - UnderlierId = UnderlierId - }; - } - - MessageOptionSerie IMessageBuilder.BuildMessage() - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(); - } - - public override bool Equals(object obj) - { - if (obj is OptionSerie optionSerie && base.ConnectionId == optionSerie.ConnectionId && Id == optionSerie.Id) - { - return UnderlierId == optionSerie.UnderlierId; - } - return false; - } - - public override int GetHashCode() - { - return ((-1159877490 * -1521134295 + ExpirationDate.GetHashCode()) * -1521134295 + EqualityComparer.Default.GetHashCode(Id)) * -1521134295 + EqualityComparer.Default.GetHashCode(UnderlierId); - } - - public int CompareTo(object obj) - { - return CompareTo(obj); - } - } - [ProtoContract] - public class PnL - { - [CompilerGenerated] - private PnLItem ?; - - [CompilerGenerated] - private PnLItem ?; - - [CompilerGenerated] - private PnLItem ?; - - [CompilerGenerated] - private PnLItem ?; - - [ProtoMember(1)] - public PnLItem GrossPnL - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - [ProtoMember(2)] - public PnLItem NetPnL - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - [ProtoMember(3)] - public PnLItem Fee - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - [ProtoMember(4)] - public PnLItem Swaps - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - } - [DataContract(Name = "PnLItem", Namespace = "TradingPlatform")] - [ProtoContract] - public class PnLItem : BusinessObject - { - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private double ??; - - private Asset ??; - - [DataMember(Name = "Value")] - [ProtoMember(1)] - public double Value - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "AssetID")] - [ProtoMember(2)] - public string AssetID - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "ValuePercent")] - [ProtoMember(3)] - public double ValuePercent - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Asset Asset => ?? ?? (?? = Core.Instance.Assets.FirstOrDefault((Asset P_0) => P_0.ConnectionId == base.ConnectionId && P_0.Id == AssetID)); - - public PnLItem() - : base(string.Empty) - { - ValuePercent = double.NaN; - } - - public override bool Equals(object obj) - { - if (!(obj is PnLItem pnLItem)) - { - return false; - } - if (Value != pnLItem.Value) - { - return false; - } - if (AssetID != pnLItem.AssetID) - { - return false; - } - return true; - } - - public override int GetHashCode() - { - return (13 * 7 + Value.GetHashCode()) * 7 + AssetID.GetHashCode(); - } - - public string Format() - { - string text = FormatPercent(); - if (text == null) - { - return FormatValue(); - } - return FormatValue() + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); - } - - public string FormatValue() - { - return Asset?.FormatPriceWithCurrency(Value) ?? Value.Format(); - } - - public string FormatPercent() - { - if (!double.IsNaN(ValuePercent)) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(0, 1); - defaultInterpolatedStringHandler.AppendFormatted(ValuePercent, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - return null; - } - - public override string ToString() - { - return Format(); - } - - [CompilerGenerated] - private bool ?(Asset P_0) - { - if (P_0.ConnectionId == base.ConnectionId) - { - return P_0.Id == AssetID; - } - return false; - } - } - [ProtoContract] - public sealed class SlTpHolder : ICloneable, IXElementSerialization, IEquatable, ICustomizable - { - [CompilerGenerated] - private CloseOrderType ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private PriceMeasurement ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private double ??; - - [ProtoMember(1)] - public CloseOrderType Type - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = closeOrderType; - } - } - - [ProtoMember(2)] - public double Price - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - [ProtoMember(3)] - public double Quantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(4)] - public PriceMeasurement PriceMeasurement - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = priceMeasurement; - } - } - - [ProtoMember(5)] - public bool IsTrailing - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = flag; - } - } - - [ProtoMember(6)] - public double QuantityPercentage - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IList Settings - { - get - { - return new List - { - new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)Type, new List - { - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1) - }), - new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Price), - new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Quantity), - new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)PriceMeasurement, new List - { - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1) - }), - new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsTrailing), - new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), QuantityPercentage) - }; - } - set - { - Type = (CloseOrderType)value.GetValueOrDefault((int)Type, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - Price = value.GetValueOrDefault(Price, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - Quantity = value.GetValueOrDefault(Quantity, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - PriceMeasurement = (PriceMeasurement)value.GetValueOrDefault((int)PriceMeasurement, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - IsTrailing = value.GetValueOrDefault(IsTrailing, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - QuantityPercentage = value.GetValueOrDefault(QuantityPercentage, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - [NotPublished] - public SlTpHolder(IList settings) - { - Settings = settings; - } - - internal SlTpHolder() - { - } - - public static SlTpHolder CreateSL(double price, PriceMeasurement priceMeasurement = PriceMeasurement.Absolute, bool isTrailing = false, double quantity = double.NaN, double quantityPercentage = double.NaN) - { - return new SlTpHolder - { - Type = CloseOrderType.StopLoss, - Price = price, - Quantity = quantity, - PriceMeasurement = priceMeasurement, - IsTrailing = isTrailing, - QuantityPercentage = quantityPercentage - }; - } - - public static SlTpHolder CreateTP(double price, PriceMeasurement priceMeasurement = PriceMeasurement.Absolute, double quantity = double.NaN, double quantityPercentage = double.NaN) - { - return new SlTpHolder - { - Type = CloseOrderType.TakeProfit, - Price = price, - Quantity = quantity, - PriceMeasurement = priceMeasurement, - IsTrailing = false, - QuantityPercentage = quantityPercentage - }; - } - - public string Format(Symbol symbol) - { - if (symbol == null) - { - return Price.ToString(); - } - if (PriceMeasurement == PriceMeasurement.Absolute) - { - return symbol.FormatPrice(Price); - } - return symbol.FormatOffset(Price, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - - public object Clone() - { - if (Type == CloseOrderType.StopLoss) - { - return CreateSL(Price, PriceMeasurement, IsTrailing, Quantity, QuantityPercentage); - } - return CreateTP(Price, PriceMeasurement, Quantity, QuantityPercentage); - } - - public XElement ToXElement() - { - XElement xElement = new XElement(GetType().Name); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)Type).ToString())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Price)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Quantity)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)PriceMeasurement).ToString())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsTrailing)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), QuantityPercentage)); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - Type = (CloseOrderType)xElement.ToInt(); - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - Price = xElement2.ToDouble(); - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - PriceMeasurement = (PriceMeasurement)xElement3.ToInt(); - } - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - IsTrailing = xElement4.ToBool(); - } - XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement5 != null) - { - Quantity = xElement5.ToDouble(); - } - XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement6 != null) - { - QuantityPercentage = xElement6.ToDouble(); - } - if (Quantity == 0.0) - { - Quantity = double.NaN; - } - } - - public bool Equals(SlTpHolder other) - { - if (other == null) - { - return false; - } - if (this == other) - { - return true; - } - if (Type == other.Type && Price.Equals(other.Price) && Quantity.Equals(other.Quantity) && QuantityPercentage.Equals(other.QuantityPercentage) && PriceMeasurement == other.PriceMeasurement) - { - return IsTrailing == other.IsTrailing; - } - return false; - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - if (this == obj) - { - return true; - } - if (obj.GetType() != GetType()) - { - return false; - } - return Equals((SlTpHolder)obj); - } - - public override int GetHashCode() - { - return (int)(((uint)((((((((int)Type * 397) ^ Price.GetHashCode()) * 397) ^ Quantity.GetHashCode()) * 397) ^ QuantityPercentage.GetHashCode()) * 397) ^ (uint)PriceMeasurement) * 397) ^ IsTrailing.GetHashCode(); - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(9, 4); - defaultInterpolatedStringHandler.AppendFormatted(Type); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(PriceMeasurement); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Price); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - object value; - if (!double.IsNaN(QuantityPercentage)) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler2 = new DefaultInterpolatedStringHandler(0, 1); - defaultInterpolatedStringHandler2.AppendFormatted(QuantityPercentage, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - value = defaultInterpolatedStringHandler2.ToStringAndClear(); - } - else - { - value = $"{Quantity}"; - } - defaultInterpolatedStringHandler.AppendFormatted((string?)value); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - public readonly struct SymbolComplexIdentifier : IEquatable - { - [CompilerGenerated] - private readonly string ?; - - private readonly ExchangeComplexIdentifier ?; - - public string ConnectionId => ?.ConnectionId; - - public string ExchangeId => ?.ExchangeId; - - public string SymbolId - { - [CompilerGenerated] - get - { - return ?; - } - } - - public SymbolComplexIdentifier(string connectionId, string exchangeId, string symbolId) - { - ? = new ExchangeComplexIdentifier(connectionId, exchangeId); - ? = symbolId; - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(4, 3); - defaultInterpolatedStringHandler.AppendFormatted(SymbolId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - defaultInterpolatedStringHandler.AppendFormatted(ExchangeId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - defaultInterpolatedStringHandler.AppendFormatted(ConnectionId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public bool Equals(SymbolComplexIdentifier other) - { - if (?.Equals(other.?)) - { - return SymbolId == other.SymbolId; - } - return false; - } - - public override bool Equals(object obj) - { - if (obj is SymbolComplexIdentifier other) - { - return Equals(other); - } - return false; - } - - public override int GetHashCode() - { - return (?.GetHashCode() * 397) ^ SymbolId.GetHashCode(); - } - - public static bool operator ==(SymbolComplexIdentifier left, SymbolComplexIdentifier right) - { - return left.Equals(right); - } - - public static bool operator !=(SymbolComplexIdentifier left, SymbolComplexIdentifier right) - { - return !left.Equals(right); - } - } - [Serializable] - [DataContract] - public class SymbolInfo : BusinessObjectInfo, IEquatable - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private SymbolType ??; - - [CompilerGenerated] - private FutureContractType? ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private DateTime ??; - - [DataMember(Name = "exchangeId")] - public string ExchangeId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - [DataMember(Name = "symbolType")] - public SymbolType SymbolType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = symbolType; - } - } - - [DataMember(Name = "futuresContractType")] - public FutureContractType? FutureContractType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = futureContractType; - } - } - - [DataMember(Name = "underlierId")] - public string UnderlierId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - [DataMember(Name = "root")] - public string Root - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - [DataMember(Name = "expirationTime")] - public DateTime ExpirationDate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = dateTime; - } - } - - public new static SymbolInfo Empty => new SymbolInfo - { - Id = string.Empty, - ConnectionId = string.Empty, - Name = string.Empty, - ExchangeId = string.Empty, - SymbolType = SymbolType.Unknown, - FutureContractType = null, - UnderlierId = string.Empty, - Root = string.Empty, - ExpirationDate = default(DateTime) - }; - - public override XElement ToXElement() - { - XElement xElement = base.ToXElement(); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExchangeId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SymbolType.ToString())); - if (FutureContractType.HasValue) - { - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), FutureContractType.ToString())); - } - if (!string.IsNullOrEmpty(UnderlierId)) - { - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), UnderlierId)); - } - if (!string.IsNullOrEmpty(Root)) - { - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Root)); - } - if (ExpirationDate != default(DateTime)) - { - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExpirationDate)); - } - return xElement; - } - - public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - base.FromXElement(element, deserializationInfo); - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - ExchangeId = xElement.Value; - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null && Enum.TryParse(xElement2.Value, out var result)) - { - FutureContractType = result; - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null && Enum.TryParse(xElement3.Value, out var result2)) - { - SymbolType = result2; - } - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - UnderlierId = xElement4.Value; - } - XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement5 != null) - { - Root = xElement5.Value; - } - XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement6 != null) - { - ExpirationDate = xElement6.ToDateTime(); - } - } - - public bool Equals(SymbolInfo other) - { - if ((object)other == null) - { - return false; - } - if ((object)this == other) - { - return true; - } - if (Equals((BusinessObjectInfo)other) && ExchangeId == other.ExchangeId && SymbolType == other.SymbolType && FutureContractType == other.FutureContractType && UnderlierId == other.UnderlierId && Root == other.Root) - { - return ExpirationDate.Equals(other.ExpirationDate); - } - return false; - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - if (this == obj) - { - return true; - } - if (obj.GetType() != GetType()) - { - return false; - } - return Equals((SymbolInfo)obj); - } - - public override int GetHashCode() - { - return HashCode.Combine(base.GetHashCode(), ExchangeId, (int)SymbolType, FutureContractType, UnderlierId, Root, ExpirationDate); - } - - public static bool operator ==(SymbolInfo left, SymbolInfo right) - { - return object.Equals(left, right); - } - - public static bool operator !=(SymbolInfo left, SymbolInfo right) - { - return !object.Equals(left, right); - } - } - [DataContract(Name = "TradingObject")] - public abstract class TradingObject : BusinessObject, ITradingObject - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private Account ??; - - [CompilerGenerated] - private Symbol ??; - - [CompilerGenerated] - private Side ??; - - [CompilerGenerated] - private string ??; - - private readonly Lazy ??; - - [DataMember(Name = "ID")] - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected set - { - ?? = value; - } - } - - [DataMember(Name = "Account")] - public Account Account - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected set - { - ?? = value; - } - } - - [DataMember(Name = "Instrument")] - public Symbol Symbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected set - { - ?? = value; - } - } - - [DataMember(Name = "Side")] - public Side Side - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected set - { - ?? = value; - } - } - - [DataMember(Name = "Comment")] - public string Comment - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected set - { - ?? = value; - } - } - - public AdditionalInfoCollection AdditionalInfo - { - get - { - if (!??.IsValueCreated) - { - return null; - } - return ??.Value; - } - } - - protected TradingObject(string connectionId) - : base(connectionId) - { - ?? = new Lazy(); - } - - protected void ProcessAdditionalItems(List items) - { - if (items == null) - { - return; - } - foreach (AdditionalInfoItem item in items) - { - ??.Value.?(item); - } - } - } - public class TradingSignalEventArgs : EntityLifecycleEventArgs - { - [CompilerGenerated] - private readonly TradingSignal ??; - - public TradingSignal TradingSignal - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - } - [DataContract(Name = "VariableTick", Namespace = "TradingPlatform")] - [ProtoContract] - public class VariableTick : IXElementSerialization - { - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private int ??; - - [DataMember] - [ProtoMember(1)] - public double LeftBorder - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - [DataMember] - [ProtoMember(2)] - public bool IncludeLeftBorder - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = flag; - } - } - - [DataMember] - [ProtoMember(3)] - public double TickSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - [DataMember] - [ProtoMember(4)] - public double TickCost - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - [DataMember] - [ProtoMember(5)] - public double RightBorder - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - [DataMember] - [ProtoMember(6)] - public int Precision - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// ???????? ?? ????????? - /// - public bool CheckPrice(double price) - { - if ((!(price > LeftBorder) || !(price < RightBorder)) && (price != LeftBorder || !IncludeLeftBorder)) - { - if (price == RightBorder) - { - return !IncludeLeftBorder; - } - return false; - } - return true; - } - - public VariableTick(double lowLimit, double highLimit, bool allowLimit, double tickSize, double tickCost, int? precision = null) - { - LeftBorder = lowLimit; - RightBorder = highLimit; - IncludeLeftBorder = allowLimit; - TickSize = (double)(decimal)tickSize; - TickCost = tickCost; - Precision = ((!precision.HasValue) ? CoreMath.GetValuePrecision((decimal)TickSize) : precision.Value); - } - - public VariableTick(double tickSize, double tickCost = 1.0, int? precision = null) - : this(double.NegativeInfinity, double.PositiveInfinity, allowLimit: true, tickSize, tickCost, precision) - { - } - - internal VariableTick() - { - } - - public override string ToString() - { - return LeftBorder + ((IncludeLeftBorder && LeftBorder != double.NegativeInfinity) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ((!IncludeLeftBorder && RightBorder != double.PositiveInfinity) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + RightBorder; - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LeftBorder.ToString(CultureInfo.InvariantCulture))); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), RightBorder.ToString(CultureInfo.InvariantCulture))); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IncludeLeftBorder)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TickSize)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TickCost)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Precision)); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - LeftBorder = xElement.ToDouble(); - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - RightBorder = xElement2.ToDouble(); - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - IncludeLeftBorder = xElement3.ToBool(); - } - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - TickSize = xElement4.ToDouble(); - } - XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement5 != null) - { - TickCost = xElement5.ToDouble(); - } - XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement6 != null) - { - Precision = xElement6.ToInt(); - } - } - } - /// - /// Represents information about connection and provides an access to the current trading information(Symbols, Orders, Position, Accounts etc.). - /// - [Published] - public sealed class Connection : ICustomizable, IComparable - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func> ??; - - public static Func> ??; - - public static Func ??; - - public static Func, Symbol> ??; - - public static Func ??; - - public static Func, Symbol> ??; - - internal SettingItem ?(SettingItem P_0) - { - return P_0.GetCopy(); - } - - internal int ?(Symbol P_0) - { - return P_0.TotalSubscriptionsCount; - } - - internal long ?(Period P_0) - { - return P_0.Ticks; - } - - internal bool ?(Connection P_0) - { - if (P_0.State != ConnectionState.Connected) - { - return P_0.State == ConnectionState.Connecting; - } - return true; - } - - internal bool ?(Connection P_0) - { - return P_0.Type == ConnectionType.General; - } - - internal bool ?(Connection P_0) - { - return Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), P_0.Id).Status != TradingOperationStatus.Allowed; - } - - internal bool ?(SettingItem P_0) - { - return P_0 is SettingItemOAuth; - } - - internal string ?(PlaceOrderRequestParameters P_0) - { - return P_0.Symbol.ConnectionId; - } - - internal DateTime ?(OptionSerie P_0) - { - return P_0.ExpirationDate; - } - - internal DateTime ?(UserTradesInterval P_0) - { - return P_0.Interval.From; - } - - internal IEnumerable ?(UserTradesInterval P_0) - { - return P_0.Trades; - } - - internal IEnumerable ?(UserTradesInterval P_0) - { - return P_0.Trades; - } - - internal Symbol ?(Order P_0) - { - return P_0.Symbol; - } - - internal Symbol ?(IGrouping P_0) - { - return P_0.Key; - } - - internal Symbol ?(Position P_0) - { - return P_0.Symbol; - } - - internal Symbol ?(IGrouping P_0) - { - return P_0.Key; - } - } - - [CompilerGenerated] - private sealed class ? - { - public GetStrikesRequestParameters ??; - - internal bool ?(Symbol P_0) - { - if (P_0.OptionSerie != null) - { - return P_0.OptionSerie.Id == ??.SerieId; - } - return false; - } - } - - [CompilerGenerated] - private sealed class ? - { - public IList ??; - - public IList ??; - - public string[] ??; - - public SearchSymbolsRequestParameters ??; - - internal bool ?(Symbol P_0) - { - return ??.Contains(P_0.ExchangeId); - } - - internal bool ?(Symbol P_0) - { - return ??.Contains(P_0.SymbolType); - } - - internal bool ?(Symbol P_0) - { - return Connection.?(??, P_0, ??.GetSynonyms); - } - } - - [CompilerGenerated] - private sealed class ? - { - public TradesHistoryRequestParameters ??; - - internal bool ?(MessageTrade P_0) - { - if (!string.IsNullOrEmpty(??.SymbolId)) - { - return P_0.SymbolId == ??.SymbolId; - } - return true; - } - } - - [CompilerGenerated] - private sealed class ? - { - public CancellationToken ??; - - public AccountTradesLoadingCallback ??; - - public Connection ??; - - public TradesHistoryRequestParameters ??; - - public CancellationTokenSource ??; - } - - [CompilerGenerated] - private sealed class ? - { - public Interval ??; - - public TradesHistoryRequestParameters ??; - - public List ??; - - public ? ??; - - internal void ?(IList P_0, bool P_1) - { - try - { - if (??.??.IsCancellationRequested) - { - return; - } - if (P_0 == null) - { - if (P_1) - { - ??.??.InvokeSafely(new List(), P_1); - } - return; - } - P_0 = ??.??.?(??, P_0).Trades.ToList(); - ??.AddRange(P_0); - List list = ??.??.?(P_0, ??.??).ToList(); - ??.??.InvokeSafely(list, P_1); - if (P_1 && string.IsNullOrEmpty(??.??.SymbolId) && !??.??.??.UsersTradesCacheMetadata.AllowSingleSymbolLoading) - { - ??.??.???.Save(new UserTradesInterval - { - Interval = ??, - Trades = ?? - }); - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - if (P_1) - { - ??.??.Dispose(); - } - } - } - } - - [CompilerGenerated] - private sealed class ? - { - public TradesHistoryRequestParameters ??; - - internal bool ?(MessageTrade P_0) - { - return ??.Interval.Contains(P_0.DateTime); - } - } - - [CompilerGenerated] - private sealed class ? - { - public Connection ??; - - public CancellationToken ??; - - internal void ?(string P_0) - { - ??.ConnectingProgress = P_0; - } - - internal bool ?(Connection P_0) - { - return P_0 != ??; - } - } - - [CompilerGenerated] - private sealed class ? - { - public DateTime ??; - - public ? ??; - - internal void ?() - { - try - { - ??.??.GetTrades(new TradesHistoryRequestParameters - { - From = ??.AddDays(-2.0), - To = ??, - CancellationToken = ??.?? - }); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - } - - [CompilerGenerated] - private sealed class ? - { - public Connection ??; - - public SubscribeQuotesParameters ??; - - internal void ?() - { - ??.??.SubscribeSymbol(??); - } - } - - [CompilerGenerated] - private sealed class ? - { - public Connection ??; - - public SubscribeQuotesParameters ??; - - internal void ?() - { - ??.??.UnSubscribeSymbol(??); - } - } - - internal const string ?? = "Test"; - - internal ? ??; - - private string ??; - - [CompilerGenerated] - private ConnectionType ??; - - [CompilerGenerated] - private EventHandler ??; - - [CompilerGenerated] - private EventHandler ??; - - [CompilerGenerated] - private TimeSpan? ??; - - [CompilerGenerated] - private TimeSpan? ??; - - private DateTime ??; - - [CompilerGenerated] - private ConnectionResult ??; - - [CompilerGenerated] - private ? ??; - - [CompilerGenerated] - private VolumeAnalysisStorage ??; - - private UsersTradesStorage ??; - - private Vendor ??; - - private CancellationTokenSource ??; - - [CompilerGenerated] - private readonly ConnectionInfo ??; - - [CompilerGenerated] - private EventHandler ??; - - [CompilerGenerated] - private EventHandler ??; - - [CompilerGenerated] - private Limiter ??; - - private readonly ActionBufferedProcessor ??; - - /// - /// Provides access to all business objects which are belong to this connection - /// - public IBusinessObjectsProvider BusinessObjects => ??; - - /// - /// Gets connection Id - /// - public string Id - { - get - { - return Info.ConnectionId; - } - private set - { - Info.ConnectionId = connectionId; - } - } - - /// - /// Gets connection Name - /// - public string Name - { - get - { - return Info.Name; - } - set - { - Info.Name = value; - } - } - - /// - /// Gets connection's vendor name - /// - public string VendorName => Info.VendorName; - - /// - /// Contains list of connection settings. Will be reused on each population time. - /// - public IList Settings - { - get - { - return Info.Settings; - } - set - { - Info.Settings = value; - } - } - - /// - /// Gets connection's state (Connected/Connecting/Fail etc.) - /// - public ConnectionState State - { - get - { - return Info.ConnectionState; - } - private set - { - if (Info.ConnectionState != connectionState) - { - ConnectionState connectionState2 = Info.ConnectionState; - Info.ConnectionState = connectionState; - ?? = ((connectionState == ConnectionState.Connected) ? Core.Instance.TimeUtils.DateTimeUtcNow : default(DateTime)); - ?(connectionState2); - } - } - } - - public string ConnectingProgress - { - get - { - return ??; - } - private set - { - if (!(?? == text)) - { - ?? = text; - ???.Invoke(this, new ConnectionConnectingProgressChangedEventArgs(ConnectingProgress)); - } - } - } - - /// - /// Defines connection type - /// - public ConnectionType Type - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Represents connection ping time - /// - public TimeSpan? PingTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = timeSpan; - } - } - - public TimeSpan? RoundTripTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = timeSpan; - } - } - - /// - /// Messages count that one is waited to process - /// - public int MessagesQueueDepth => ???.QueueDepth ?? 0; - - public TimeSpan Uptime - { - get - { - if (!(?? == default(DateTime))) - { - return Core.Instance.TimeUtils.DateTimeUtcNow - ??; - } - return TimeSpan.Zero; - } - } - - /// - /// Gets a matched available metadata info with the vendor's side - /// - public HistoryMetadata HistoryMetaData => ??.HistoryMetadata?.Copy; - - public TradesHistoryMetadata TradesHistoryMetadata - { - get - { - if (??.UsersTradesCacheMetadata != null) - { - return new TradesHistoryMetadata(??.UsersTradesCacheMetadata); - } - return null; - } - } - - public VolumeAnalysisMetadata VolumeAnalysisMetadata => ??.VolumeAnalysisMetadata?.Copy; - - public IEnumerable NewsFeedSettings => ???.NewsFeedSettings?.Select((SettingItem P_0) => P_0.GetCopy()); - - public ConnectionResult LastConnectionResult - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = connectionResult; - } - } - - internal ? HistoryLoadingManager - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = ?; - } - } - - internal VolumeAnalysisStorage VolumeAnalysisStorage - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = volumeAnalysisStorage; - } - } - - internal bool Connected => State == ConnectionState.Connected; - - public ConnectionInfo Info - { - [CompilerGenerated] - get - { - return ??; - } - } - - public int TotalSubscriptionsCount => BusinessObjects.Symbols.Sum((Symbol P_0) => P_0.TotalSubscriptionsCount); - - public DateTime ServerTime => ???.ServerTime ?? Core.Instance.TimeUtils.DateTimeUtcNow; - - [NotPublished] - public Limiter Limitation - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = limiter; - } - } - - /// - /// Will be triggered when changed. - /// - public event EventHandler StateChanged - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - /// - /// Will be triggered when changed. - /// - public event EventHandler ConnectingProgressChanged - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - public event EventHandler NewRequest - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - public event EventHandler NewPerformedRequest - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - internal Connection(ConnectionInfo P_0) - { - ?? = P_0; - Type = ConnectionType.General; - if (string.IsNullOrEmpty(P_0.ConnectionId)) - { - Id = Guid.NewGuid().ToString(); - } - State = ConnectionState.Disconnected; - ?? = new ActionBufferedProcessor(); - } - - /// - /// Establishes a connection to a specified vendor - /// - /// - public ConnectionResult Connect() - { - LastConnectionResult = new ConnectionResult(); - IProgress progress = new Progress(delegate(string P_0) - { - ConnectingProgress = P_0; - }); - if (State == ConnectionState.Connected) - { - return LastConnectionResult; - } - if (State == ConnectionState.Connecting) - { - LastConnectionResult.State = ConnectionState.Connecting; - LastConnectionResult.Message = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - return LastConnectionResult; - } - if (State == ConnectionState.Disconnecting) - { - LastConnectionResult.State = ConnectionState.Connecting; - LastConnectionResult.Message = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - return LastConnectionResult; - } - ?? = new CancellationTokenSource(); - CancellationToken ?? = ??.Token; - ?? = (Info.SyncMsgProcessing ? new ?(Id) : new ?(Id)); - progress.Report(null); - State = ConnectionState.Connecting; - ??.?(); - VendorInfo vendorInfo = Core.Instance.Vendors[VendorName]; - ?? = vendorInfo.?(); - ??.NewMessage += ?; - try - { - ??.ThrowIfCancellationRequested(); - vendorInfo.?(); - Core.Instance.Loggers.Log(Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - ?(??); - LastConnectionResult = ??.Connect(new ConnectRequestParameters - { - ConnectionSettings = Settings, - BrowserFactory = Core.Instance.BrowserFactory, - ConnectionId = Id, - CancellationToken = ??, - ConnectingProgress = progress - }); - if (LastConnectionResult.UpdatedSettings != null) - { - Settings = LastConnectionResult.UpdatedSettings; - } - ??.ThrowIfCancellationRequested(); - if (LastConnectionResult.State == ConnectionState.Fail) - { - State = ConnectionState.Disconnecting; - ?(); - State = ConnectionState.Disconnected; - Core.Instance.Loggers.Log(Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + LastConnectionResult.Message); - return LastConnectionResult; - } - ??.ThrowIfCancellationRequested(); - progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - IList sessions = ??.GetSessions(??); - if (sessions != null) - { - foreach (MessageSessionsContainer item in sessions) - { - ?(item); - } - } - ??.ThrowIfCancellationRequested(); - progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - IList exchanges = ??.GetExchanges(??); - if (exchanges != null) - { - foreach (MessageExchange item2 in exchanges) - { - ?(item2); - } - } - ??.ThrowIfCancellationRequested(); - progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - IList symbolGroups = ??.GetSymbolGroups(??); - if (symbolGroups != null) - { - foreach (MessageSymbolGroup item3 in symbolGroups) - { - ?(item3); - } - } - ??.ThrowIfCancellationRequested(); - ??.HistoryMetadata = ??.GetHistoryMetadata(??); - ??.HistoryMetadata.AllowedPeriodsHistoryAggregationTime = ??.HistoryMetadata.AllowedPeriodsHistoryAggregationTime.OrderByDescending((Period P_0) => P_0.Ticks).ToArray(); - ??.VolumeAnalysisMetadata = ??.GetVolumeAnalysisMetadata(); - ??.NewsFeedSettings = ??.GetNewsProviderSettings(??); - ??.UsersTradesCacheMetadata = ??.GetTradesMetadata(); - ??.LimitationMetadata = ??.GetLimitationMetadata(); - if (??.LimitationMetadata?.Limits != null) - { - Limitation = new Limiter(??.LimitationMetadata); - } - ??.ThrowIfCancellationRequested(); - progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - foreach (OrderType allowedOrderType in ??.GetAllowedOrderTypes(??)) - { - allowedOrderType.ConnectionId = Id; - ??.OrderTypesCache.?(allowedOrderType.Id, allowedOrderType); - } - ??.ThrowIfCancellationRequested(); - progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - foreach (MessageAsset asset in ??.GetAssets(??)) - { - ?(asset); - } - progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - ?(??.GetSymbolTypes(??)); - ??.ThrowIfCancellationRequested(); - progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - foreach (MessageAccount account in ??.GetAccounts(??)) - { - ?(account); - } - ??.ThrowIfCancellationRequested(); - foreach (MessageCryptoAssetBalances cryptoAssetBalance in ??.GetCryptoAssetBalances(??)) - { - ?(cryptoAssetBalance); - } - ??.ThrowIfCancellationRequested(); - progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - foreach (MessageOptionSerie item4 in ??.GetAllOptionSeries(??)) - { - ?(item4); - } - ??.ThrowIfCancellationRequested(); - progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - foreach (MessageSymbol symbol in ??.GetSymbols(??)) - { - ?(symbol); - } - ??.ThrowIfCancellationRequested(); - progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - foreach (MessageRule rule in ??.GetRules(??)) - { - ?(rule); - } - ??.ThrowIfCancellationRequested(); - progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - foreach (MessageOpenPosition position in ??.GetPositions(??)) - { - ?(position); - } - ??.ThrowIfCancellationRequested(); - progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - foreach (MessageClosedPosition closedPosition in ??.GetClosedPositions(??)) - { - ?(closedPosition); - } - ??.ThrowIfCancellationRequested(); - progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - foreach (MessageReportType reportsMetaDatum in ??.GetReportsMetaData(??)) - { - ?(reportsMetaDatum); - } - ??.ThrowIfCancellationRequested(); - progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - foreach (MessageOpenOrder pendingOrder in ??.GetPendingOrders(??)) - { - ?(pendingOrder); - } - ??.ThrowIfCancellationRequested(); - progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - foreach (MessageAccountOperation accountOperation in ??.GetAccountOperations(??)) - { - ?(accountOperation); - } - ??.ThrowIfCancellationRequested(); - progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - foreach (MessageTradingSignal tradingSignal in ??.GetTradingSignals(??)) - { - ?(tradingSignal); - } - ??.ThrowIfCancellationRequested(); - progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - ??.WaitAllMessagesProcess(??); - progress.Report(null); - ??.ThrowIfCancellationRequested(); - ??.OnConnected(??); - ??.ThrowIfCancellationRequested(); - ? ? = new ? - { - AllowLocalStorage = ??.HistoryMetadata.UseHistoryLocalCache, - DegreeOfParallelism = ??.HistoryMetadata.DegreeOfParallelism, - LoadHistoryDelegate = ? - }; - if (?.AllowLocalStorage) - { - ?.LocalStorageConnectionString = Path.Combine(Const.HISTORY_PATH, (Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + Id + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()).EncodeFilePathPart(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - HistoryLoadingManager = ?.?(?); - if (?.AllowLocalStorage) - { - VolumeAnalysisStorage = VolumeAnalysisStorage.Create(Path.Combine(Const.VOLUME_ANALYSIS_PATH, (Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + Id + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()).EncodeFilePathPart(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - } - if (??.UsersTradesCacheMetadata.AllowLocalStorage) - { - ?? = UsersTradesStorage.Create(Path.Combine(Const.USER_TRADES_CACHE_PATH, (Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + Id + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()).EncodeFilePathPart(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), Id); - if (??.UsersTradesCacheMetadata.LoadTradesFromCurrentTradingDate) - { - DateTime ?? = Core.Instance.TimeUtils.DateTimeUtcNow; - Task.Factory.StartNew(delegate - { - try - { - GetTrades(new TradesHistoryRequestParameters - { - From = ??.AddDays(-2.0), - To = ??, - CancellationToken = ?? - }); - } - catch (Exception ex3) - { - Core.Instance.Loggers.Log(ex3); - } - }, ??); - } - } - ??.?? = true; - ???.Start(); - State = ConnectionState.Connected; - } - catch (OperationCanceledException) - { - LastConnectionResult.State = ConnectionState.Fail; - LastConnectionResult.Message = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - LastConnectionResult.Cancelled = true; - State = ConnectionState.Disconnecting; - ?(); - State = ConnectionState.Disconnected; - } - catch (Exception exception) - { - LastConnectionResult.State = ConnectionState.Fail; - LastConnectionResult.Message = exception.GetFullMessageRecursive(); - State = ConnectionState.Fail; - Core.Instance.Loggers.Log(LastConnectionResult.Message, LoggingLevel.Verbose); - ?(); - State = ConnectionState.Disconnected; - } - finally - { - vendorInfo.?(); - } - ConnectionResult lastConnectionResult = LastConnectionResult; - if (lastConnectionResult != null && lastConnectionResult.State == ConnectionState.Connected) - { - Core.Instance.Loggers.Log(Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - else - { - Core.Instance.Loggers.Log(Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + LastConnectionResult?.Message); - } - if (Type == ConnectionType.General && State == ConnectionState.Connected && Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), Id).Status != TradingOperationStatus.Allowed) - { - try - { - if ((Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())) == null) - { - Connection[] array = (from P_0 in Core.Instance.Connections.All - where P_0 != this - where P_0.State == ConnectionState.Connected || P_0.State == ConnectionState.Connecting - where P_0.Type == ConnectionType.General - where Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), P_0.Id).Status != TradingOperationStatus.Allowed - select P_0).ToArray(); - if (array.Any()) - { - Connection[] array2 = array; - foreach (Connection connection in array2) - { - if (connection.LastConnectionResult != null) - { - connection.LastConnectionResult.State = ConnectionState.Fail; - connection.LastConnectionResult.Message = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - connection.Disconnect(); - } - MessageDealTicket messageDealTicket = new MessageDealTicket(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - ?(messageDealTicket); - } - } - } - catch (Exception ex2) - { - Core.Instance.Loggers.Log(ex2); - } - } - return LastConnectionResult; - } - - private void ?(CancellationToken P_0) - { - IList settings = Settings; - if (!(settings.GetItemByPath(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemGroup { Value: IList value }) || !(value.FirstOrDefault((SettingItem settingItem) => settingItem is SettingItemOAuth) is SettingItemOAuth settingItemOAuth)) - { - return; - } - OidcClientOptions copy = settingItemOAuth.OidcOptions.GetCopy(); - if (copy == null) - { - throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (settingItemOAuth.UpdateIdentityAuthorityUrl != null) - { - copy.Authority = settingItemOAuth.UpdateIdentityAuthorityUrl(settings, P_0); - } - if (string.IsNullOrEmpty(copy.Authority) && copy.ProviderInformation == null) - { - return; - } - int value2 = 55650; - try - { - value2 = TcpIpHelper.GetRandomUnusedPort; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - copy.Browser = new ?(settingItemOAuth.AllowOpenNewWindow, value2) - { - ?? = Core.Instance.OAuthBrowserCreator - }; - if (string.IsNullOrEmpty(copy.RedirectUri)) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(17, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value2); - string postLogoutRedirectUri = (copy.RedirectUri = defaultInterpolatedStringHandler.ToStringAndClear()); - copy.PostLogoutRedirectUri = postLogoutRedirectUri; - } - OidcClient oidcClient = new OidcClient(copy); - LoginRequest loginRequest = new LoginRequest - { - BrowserDisplayMode = DisplayMode.Visible, - BrowserTimeout = 300, - BackChannelExtraParameters = settingItemOAuth.BackChannelExtraParameters - }; - OAuthResult oAuthResult = settingItemOAuth.Value as OAuthResult; - Result result = null; - if (oAuthResult != null && !string.IsNullOrEmpty(oAuthResult.RefreshToken) && oAuthResult.UseSavedTokens) - { - RefreshTokenResult refreshTokenResult = null; - if (VendorName.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - UriBuilder uriBuilder = new UriBuilder(copy.ProviderInformation.TokenEndpoint); - NameValueCollection nameValueCollection = HttpUtility.ParseQueryString(string.Empty); - nameValueCollection.Add(new NameValueCollection - { - { - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - copy.ClientId - }, - { - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - copy.ClientSecret - }, - { - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - oAuthResult.RefreshToken - }, - { - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - } - }); - uriBuilder.Query = nameValueCollection.ToString(); - using HttpClient httpClient = new HttpClient(); - TokenResponse result2 = ProtocolResponse.FromHttpResponseAsync(httpClient.Send(new HttpRequestMessage(HttpMethod.Get, uriBuilder.Uri), P_0)).Result; - if (result2 != null && !result2.IsError) - { - refreshTokenResult = new RefreshTokenResult(); - try - { - Type? typeFromHandle = typeof(RefreshTokenResult); - typeFromHandle.GetProperty(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.SetValue(refreshTokenResult, result2.AccessToken); - typeFromHandle.GetProperty(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.SetValue(refreshTokenResult, result2.RefreshToken); - typeFromHandle.GetProperty(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.SetValue(refreshTokenResult, result2.ExpiresIn); - } - catch (Exception ex2) - { - Core.Instance.Loggers.Log(ex2, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - } - else - { - refreshTokenResult = oidcClient.RefreshTokenAsync(oAuthResult.RefreshToken, null, null, P_0).Result; - } - result = refreshTokenResult; - oAuthResult.RequestRefreshResult = refreshTokenResult; - } - else if (VendorName.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - result = new LoginResult(); - BrowserOptions options = new BrowserOptions(new RequestUrl(copy.ProviderInformation.AuthorizeEndpoint).CreateAuthorizeUrl(copy.ClientId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), redirectUri: copy.RedirectUri, scope: copy.Scope), copy.RedirectUri) - { - Timeout = TimeSpan.FromSeconds(loginRequest.BrowserTimeout), - DisplayMode = loginRequest.BrowserDisplayMode - }; - BrowserResult result3 = copy.Browser.InvokeAsync(options, P_0).Result; - if (result3.IsError) - { - throw new Exception(result3.Error); - } - NameValueCollection nameValueCollection2 = HttpUtility.ParseQueryString(result3.Response); - if (!nameValueCollection2.AllKeys.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - using HttpClient httpClient2 = new HttpClient(); - new TokenClient(httpClient2, new TokenClientOptions - { - Address = copy.ProviderInformation.TokenEndpoint, - ClientId = copy.ClientId, - ClientSecret = copy.ClientSecret - }); - string value3 = nameValueCollection2[3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()]; - UriBuilder uriBuilder2 = new UriBuilder(copy.ProviderInformation.TokenEndpoint); - NameValueCollection nameValueCollection3 = HttpUtility.ParseQueryString(string.Empty); - nameValueCollection3.Add(new NameValueCollection - { - { - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - copy.ClientId - }, - { - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - copy.ClientSecret - }, - { - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - copy.RedirectUri - }, - { - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }, - { - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - value3 - } - }); - uriBuilder2.Query = nameValueCollection3.ToString(); - TokenResponse result4 = ProtocolResponse.FromHttpResponseAsync(httpClient2.Send(new HttpRequestMessage(HttpMethod.Get, uriBuilder2.Uri), P_0)).Result; - if (result4.IsError) - { - result.Error = result4.Error; - } - oAuthResult.TokenResponce = result4; - } - else - { - if (oAuthResult != null && !string.IsNullOrEmpty(oAuthResult.IdentityToken)) - { - LogoutRequest request = new LogoutRequest - { - IdTokenHint = oAuthResult.IdentityToken - }; - oidcClient.LogoutAsync(request, P_0).Wait(P_0); - Task.Delay(700, P_0).Wait(P_0); - } - result = (oAuthResult.RequestTokenResult = oidcClient.LoginAsync(loginRequest, P_0).Result); - } - Settings = new List - { - new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new List { settingItemOAuth }) - }; - if (!result.IsError) - { - return; - } - if (result.Error == BrowserResultType.UserCancel.ToString()) - { - throw new OperationCanceledException(); - } - throw new Exception(result.Error); - } - - /// - /// Closes a connection. - /// - public void Disconnect() - { - if (State == ConnectionState.Connecting) - { - ??.Cancel(); - } - else if (State == ConnectionState.Connected) - { - ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - State = ConnectionState.Disconnecting; - Core.Instance.Loggers.Log(Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - ?(); - State = ConnectionState.Disconnected; - Core.Instance.Loggers.Log(Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - private void ?() - { - ???.Stop(); - if (?? != null) - { - try - { - ??.Disconnect(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); - } - ??.NewMessage -= ?; - ?? = null; - } - ???.Stop(); - if (HistoryLoadingManager != null) - { - HistoryLoadingManager.Dispose(); - HistoryLoadingManager = null; - } - if (VolumeAnalysisStorage != null) - { - VolumeAnalysisStorage.Dispose(); - VolumeAnalysisStorage = null; - } - if (?? != null) - { - ??.Dispose(); - ?? = null; - } - if (Limitation != null) - { - Limitation.Dispose(); - Limitation = null; - } - } - - internal void ?() - { - if (?? == null || State != ConnectionState.Connected) - { - return; - } - PingResult pingResult; - try - { - pingResult = ??.Ping(); - if (State != ConnectionState.Connected) - { - return; - } - } - catch (Exception ex) - { - pingResult = new PingResult - { - State = PingEnum.Disconnected - }; - Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); - } - if (pingResult != null && pingResult.State == PingEnum.Connected) - { - PingTime = pingResult.PingTime; - RoundTripTime = pingResult.RoundTripTime; - } - else - { - ?(); - State = (pingResult.StopReconnecting ? ConnectionState.Disconnected : ConnectionState.ConnectionLost); - Core.Instance.Loggers.Log(Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + (pingResult.StopReconnecting ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : string.Empty)); - } - } - - public void SendCustomRequest(RequestParameters parameters) - { - try - { - if (!Connected) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - return; - } - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(parameters.CancellationToken, ??.Token); - parameters.CancellationToken = cancellationTokenSource.Token; - ?(parameters); - ??.SendCustomRequest(parameters); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); - } - finally - { - ?(parameters, (object)null); - } - } - - internal void ?(Symbol P_0, SubscribeQuoteType P_1) - { - if (?? != null) - { - SubscribeQuotesParameters ?? = new SubscribeQuotesParameters(P_0.Id, P_1); - ??.Push(delegate - { - ??.SubscribeSymbol(??); - }); - } - } - - internal void ?(Symbol P_0, SubscribeQuoteType P_1) - { - if (?? != null) - { - SubscribeQuotesParameters ?? = new SubscribeQuotesParameters(P_0.Id, P_1); - ??.Push(delegate - { - ??.UnSubscribeSymbol(??); - }); - } - } - - internal TradingOperationResult ?(PlaceOrderRequestParameters P_0) - { - TradingOperationResult tradingOperationResult = null; - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); - PlaceOrderRequestParameters placeOrderRequestParameters = new PlaceOrderRequestParameters(P_0) - { - CancellationToken = cancellationTokenSource.Token - }; - try - { - if (!Connected) - { - long requestId = placeOrderRequestParameters.RequestId; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(State); - tradingOperationResult = TradingOperationResult.CreateError(requestId, defaultInterpolatedStringHandler.ToStringAndClear()); - return tradingOperationResult; - } - AllowedResult allowedResult = TradingOperations.IsAllowed(TradingOperation.PlaceOrder, new TradingOperationParameters - { - Account = placeOrderRequestParameters.Account, - Symbol = placeOrderRequestParameters.Symbol - }); - if (allowedResult.Status == TradingOperationStatus.NotAllowed) - { - tradingOperationResult = TradingOperationResult.CreateError(placeOrderRequestParameters.RequestId, allowedResult.Reason); - return tradingOperationResult; - } - if (placeOrderRequestParameters.OrderType == null) - { - tradingOperationResult = TradingOperationResult.CreateError(placeOrderRequestParameters.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return tradingOperationResult; - } - if (placeOrderRequestParameters.TimeInForce == TimeInForce.Default) - { - placeOrderRequestParameters.TimeInForce = placeOrderRequestParameters.OrderType.AllowedTifs.FirstOrDefault(); - } - ?((RequestParameters)placeOrderRequestParameters); - Core.Instance.Loggers.Log(placeOrderRequestParameters, LoggingLevel.Trading, Name); - tradingOperationResult = ??.PlaceOrder(placeOrderRequestParameters); - } - catch (Exception ex) - { - tradingOperationResult = TradingOperationResult.CreateError(placeOrderRequestParameters.RequestId, ex.Message); - } - finally - { - Core.Instance.Loggers.Log(tradingOperationResult, LoggingLevel.Trading, Name); - ?(placeOrderRequestParameters, tradingOperationResult); - } - return tradingOperationResult; - } - - internal TradingOperationResult ?(PlaceMultiOrderOrderRequestParameters P_0) - { - TradingOperationResult tradingOperationResult = null; - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); - PlaceMultiOrderOrderRequestParameters placeMultiOrderOrderRequestParameters = new PlaceMultiOrderOrderRequestParameters(P_0) - { - CancellationToken = cancellationTokenSource.Token - }; - try - { - if (!Connected) - { - long requestId = placeMultiOrderOrderRequestParameters.RequestId; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(State); - tradingOperationResult = TradingOperationResult.CreateError(requestId, defaultInterpolatedStringHandler.ToStringAndClear()); - return tradingOperationResult; - } - if (placeMultiOrderOrderRequestParameters.OrderParameters == null || !placeMultiOrderOrderRequestParameters.OrderParameters.Any()) - { - tradingOperationResult = TradingOperationResult.CreateError(placeMultiOrderOrderRequestParameters.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return tradingOperationResult; - } - if (placeMultiOrderOrderRequestParameters.OrderParameters.Select((PlaceOrderRequestParameters placeOrderRequestParameters2) => placeOrderRequestParameters2.Symbol.ConnectionId).Distinct().Count() > 1) - { - tradingOperationResult = TradingOperationResult.CreateError(placeMultiOrderOrderRequestParameters.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return tradingOperationResult; - } - if (placeMultiOrderOrderRequestParameters.GroupOrderType == GroupOrderType.OCO && Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id).Status != TradingOperationStatus.Allowed) - { - tradingOperationResult = TradingOperationResult.CreateError(placeMultiOrderOrderRequestParameters.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return tradingOperationResult; - } - PlaceOrderRequestParameters[] orderParameters = placeMultiOrderOrderRequestParameters.OrderParameters; - foreach (PlaceOrderRequestParameters placeOrderRequestParameters in orderParameters) - { - AllowedResult allowedResult = TradingOperations.IsAllowed(TradingOperation.PlaceOrder, new TradingOperationParameters - { - Account = placeOrderRequestParameters.Account, - Symbol = placeOrderRequestParameters.Symbol - }); - if (allowedResult.Status == TradingOperationStatus.NotAllowed) - { - tradingOperationResult = TradingOperationResult.CreateError(placeMultiOrderOrderRequestParameters.RequestId, allowedResult.Reason); - return tradingOperationResult; - } - } - ?((RequestParameters)placeMultiOrderOrderRequestParameters); - Core.Instance.Loggers.Log(placeMultiOrderOrderRequestParameters, LoggingLevel.Trading, Name); - tradingOperationResult = ??.PlaceMultiOrder(placeMultiOrderOrderRequestParameters); - } - catch (Exception ex) - { - tradingOperationResult = TradingOperationResult.CreateError(placeMultiOrderOrderRequestParameters.RequestId, ex.Message); - } - finally - { - Core.Instance.Loggers.Log(tradingOperationResult, LoggingLevel.Trading, Name); - ?(placeMultiOrderOrderRequestParameters, tradingOperationResult); - } - return tradingOperationResult; - } - - internal TradingOperationResult ?(ModifyOrderRequestParameters P_0) - { - TradingOperationResult tradingOperationResult = null; - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); - ModifyOrderRequestParameters modifyOrderRequestParameters = new ModifyOrderRequestParameters(P_0) - { - CancellationToken = cancellationTokenSource.Token - }; - try - { - if (!Connected) - { - long requestId = modifyOrderRequestParameters.RequestId; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(State); - tradingOperationResult = TradingOperationResult.CreateError(requestId, defaultInterpolatedStringHandler.ToStringAndClear()); - return tradingOperationResult; - } - AllowedResult allowedResult = TradingOperations.IsAllowed(TradingOperation.ModifyOrder, new TradingOperationParameters - { - Account = modifyOrderRequestParameters.Account, - Symbol = modifyOrderRequestParameters.Symbol - }); - if (allowedResult.Status == TradingOperationStatus.NotAllowed) - { - tradingOperationResult = TradingOperationResult.CreateError(modifyOrderRequestParameters.RequestId, allowedResult.Reason); - return tradingOperationResult; - } - if (modifyOrderRequestParameters.TimeInForce == TimeInForce.Default) - { - modifyOrderRequestParameters.TimeInForce = modifyOrderRequestParameters.OrderType.AllowedTifs.FirstOrDefault(); - } - ?((RequestParameters)modifyOrderRequestParameters); - Core.Instance.Loggers.Log(modifyOrderRequestParameters, LoggingLevel.Trading, Name); - tradingOperationResult = ??.ModifyOrder(modifyOrderRequestParameters); - } - catch (Exception ex) - { - tradingOperationResult = TradingOperationResult.CreateError(modifyOrderRequestParameters.RequestId, ex.Message); - } - finally - { - Core.Instance.Loggers.Log(tradingOperationResult, LoggingLevel.Trading, Name); - ?(modifyOrderRequestParameters, tradingOperationResult); - } - return tradingOperationResult; - } - - internal TradingOperationResult ?(ClosePositionRequestParameters P_0) - { - TradingOperationResult tradingOperationResult = null; - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); - ClosePositionRequestParameters closePositionRequestParameters = new ClosePositionRequestParameters(P_0) - { - CancellationToken = cancellationTokenSource.Token - }; - try - { - if (!Connected) - { - long requestId = closePositionRequestParameters.RequestId; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(State); - tradingOperationResult = TradingOperationResult.CreateError(requestId, defaultInterpolatedStringHandler.ToStringAndClear()); - return tradingOperationResult; - } - AllowedResult allowedResult = TradingOperations.IsAllowed(TradingOperation.ClosePosition, new TradingOperationParameters - { - Position = closePositionRequestParameters.Position - }); - if (allowedResult.Status == TradingOperationStatus.NotAllowed) - { - tradingOperationResult = TradingOperationResult.CreateError(closePositionRequestParameters.RequestId, allowedResult.Reason); - return tradingOperationResult; - } - ?((RequestParameters)closePositionRequestParameters); - Core.Instance.Loggers.Log(closePositionRequestParameters, LoggingLevel.Trading, Name); - tradingOperationResult = ??.ClosePosition(closePositionRequestParameters); - } - catch (Exception ex) - { - tradingOperationResult = TradingOperationResult.CreateError(closePositionRequestParameters.RequestId, ex.Message); - } - finally - { - Core.Instance.Loggers.Log(tradingOperationResult, LoggingLevel.Trading, Name); - ?(closePositionRequestParameters, tradingOperationResult); - } - return tradingOperationResult; - } - - internal TradingOperationResult ?(CancelOrderRequestParameters P_0) - { - TradingOperationResult tradingOperationResult = null; - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); - CancelOrderRequestParameters cancelOrderRequestParameters = new CancelOrderRequestParameters(P_0) - { - CancellationToken = cancellationTokenSource.Token - }; - try - { - if (!Connected) - { - long requestId = cancelOrderRequestParameters.RequestId; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(State); - tradingOperationResult = TradingOperationResult.CreateError(requestId, defaultInterpolatedStringHandler.ToStringAndClear()); - return tradingOperationResult; - } - AllowedResult allowedResult = TradingOperations.IsAllowed(TradingOperation.CancelOrder, new TradingOperationParameters - { - Order = cancelOrderRequestParameters.Order - }); - if (allowedResult.Status == TradingOperationStatus.NotAllowed) - { - tradingOperationResult = TradingOperationResult.CreateError(cancelOrderRequestParameters.RequestId, allowedResult.Reason); - return tradingOperationResult; - } - ?((RequestParameters)cancelOrderRequestParameters); - Core.Instance.Loggers.Log(cancelOrderRequestParameters, LoggingLevel.Trading, Name); - tradingOperationResult = ??.CancelOrder(cancelOrderRequestParameters); - return tradingOperationResult; - } - catch (Exception ex) - { - tradingOperationResult = TradingOperationResult.CreateError(P_0.RequestId, ex.Message); - return tradingOperationResult; - } - finally - { - Core.Instance.Loggers.Log(tradingOperationResult, LoggingLevel.Trading, Name); - ?(cancelOrderRequestParameters, tradingOperationResult); - } - } - - internal MarginInfo ?(OrderRequestParameters P_0) - { - MarginInfo result = null; - if (!Connected) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - return result; - } - try - { - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); - P_0.CancellationToken = cancellationTokenSource.Token; - result = ??.GetMarginInfo(P_0); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); - } - return result; - } - - internal Symbol ?(GetSymbolRequestParameters P_0, NonFixedListDownload P_1 = NonFixedListDownload.Download) - { - if (!Connected) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - return null; - } - return ?(P_0, P_1); - } - - internal Symbol ?(GetSymbolRequestParameters P_0, NonFixedListDownload P_1 = NonFixedListDownload.Download) - { - Symbol symbol = null; - if (string.IsNullOrEmpty(P_0.SymbolId)) - { - return symbol; - } - if (??.SymbolsCache.?(P_0.SymbolId, out symbol)) - { - return symbol; - } - if (!??.AllowNonFixedList || P_1 == NonFixedListDownload.IgnoreDownload) - { - return symbol; - } - ? ? = ??.GetSymbolRequestCache.?(P_0); - if (? != null && ?.Finished) - { - return ?.Result; - } - try - { - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); - GetSymbolRequestParameters getSymbolRequestParameters = new GetSymbolRequestParameters(P_0) - { - CancellationToken = cancellationTokenSource.Token - }; - MessageSymbol nonFixedSymbol = ??.GetNonFixedSymbol(getSymbolRequestParameters); - if (nonFixedSymbol == null) - { - return symbol; - } - ??.Push(nonFixedSymbol); - CancellationTokenSource cancellationTokenSource2 = new CancellationTokenSource(TimeSpan.FromSeconds(15.0)); - using CancellationTokenSource cancellationTokenSource3 = CancellationTokenSource.CreateLinkedTokenSource(getSymbolRequestParameters.CancellationToken, cancellationTokenSource2.Token); - while (!cancellationTokenSource3.IsCancellationRequested) - { - if (??.SymbolsCache.?(nonFixedSymbol.Id, out symbol)) - { - return symbol; - } - Thread.Sleep(100); - } - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.SymbolId, LoggingLevel.Verbose); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); - } - finally - { - if (!P_0.CancellationToken.IsCancellationRequested) - { - ??.GetSymbolRequestCache.?(P_0, symbol); - } - } - return symbol; - } - - internal IList ?(SearchSymbolsRequestParameters P_0) - { - List list = new List(); - if (!Connected) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - return null; - } - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); - SearchSymbolsRequestParameters searchSymbolsRequestParameters = new SearchSymbolsRequestParameters(P_0) - { - CancellationToken = cancellationTokenSource.Token - }; - searchSymbolsRequestParameters.SymbolTypes = searchSymbolsRequestParameters.SymbolTypes.Intersect(BusinessObjects.SymbolTypes).ToList(); - if (string.IsNullOrEmpty(searchSymbolsRequestParameters.FilterName) || !??.AllowNonFixedList) - { - return ?(searchSymbolsRequestParameters); - } - ?> ? = ??.SearchSymbolsRequestCache.?(searchSymbolsRequestParameters); - if (? != null && ?.Finished) - { - return new List(?.Result); - } - try - { - IList list2 = ??.SearchSymbols(new SearchSymbolsRequestParameters(searchSymbolsRequestParameters)); - if (list2 == null || list2.Count == 0) - { - return list; - } - foreach (MessageSymbolInfo item in list2) - { - if (item != null) - { - list.Add(??.?(item)); - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); - } - finally - { - if (!searchSymbolsRequestParameters.CancellationToken.IsCancellationRequested) - { - ??.SearchSymbolsRequestCache.?(searchSymbolsRequestParameters, new List(list)); - } - } - return list; - } - - internal IList ?(GetFutureContractsRequestParameters P_0) - { - IList list = new List(); - if (!Connected) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - return null; - } - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); - GetFutureContractsRequestParameters getFutureContractsRequestParameters = new GetFutureContractsRequestParameters(P_0) - { - CancellationToken = cancellationTokenSource.Token - }; - if (!??.AllowNonFixedList) - { - return ?(getFutureContractsRequestParameters, false); - } - ?> ? = ??.GetFutureContractsRequestCache.?(getFutureContractsRequestParameters); - if (? != null && ?.Finished) - { - return new List(?.Result); - } - try - { - IList futureContracts = ??.GetFutureContracts(new GetFutureContractsRequestParameters(getFutureContractsRequestParameters)); - if (futureContracts == null || futureContracts.Count == 0) - { - return list; - } - foreach (MessageSymbolInfo item in futureContracts) - { - if (item != null) - { - list.Add(??.?(item)); - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); - } - finally - { - if (!getFutureContractsRequestParameters.CancellationToken.IsCancellationRequested) - { - ??.GetFutureContractsRequestCache.?(getFutureContractsRequestParameters, new List(list)); - } - } - return list; - } - - internal IList ?(GetOptionSeriesRequestParameters P_0) - { - List list = new List(); - if (!Connected) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - return list; - } - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); - GetOptionSeriesRequestParameters getOptionSeriesRequestParameters = new GetOptionSeriesRequestParameters(P_0) - { - CancellationToken = cancellationTokenSource.Token - }; - if (!??.AllowNonFixedList) - { - return ?(getOptionSeriesRequestParameters); - } - ?> ? = ??.GetOptionSeriesRequestCache.?(getOptionSeriesRequestParameters); - if (? != null && ?.Finished) - { - return new List(?.Result); - } - try - { - IList optionSeries = ??.GetOptionSeries(new GetOptionSeriesRequestParameters(getOptionSeriesRequestParameters)); - if (optionSeries == null) - { - return list; - } - foreach (MessageOptionSerie item in optionSeries) - { - if (item != null) - { - list.Add(??.?(item)); - } - } - list = list.OrderBy((OptionSerie optionSerie) => optionSerie.ExpirationDate).ToList(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); - } - finally - { - if (!getOptionSeriesRequestParameters.CancellationToken.IsCancellationRequested) - { - ??.GetOptionSeriesRequestCache.?(getOptionSeriesRequestParameters, new List(list)); - } - } - return list; - } - - internal IList ?(GetStrikesRequestParameters P_0) - { - List list = new List(); - if (!Connected) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - return null; - } - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); - GetStrikesRequestParameters getStrikesRequestParameters = new GetStrikesRequestParameters(P_0) - { - CancellationToken = cancellationTokenSource.Token - }; - if (!??.AllowNonFixedList) - { - return ??.Symbols.Where((Symbol symbol) => symbol.OptionSerie != null && symbol.OptionSerie.Id == P_0.SerieId).ToList(); - } - ?> ? = ??.GetStrikesRequestCache.?(getStrikesRequestParameters); - if (? != null && ?.Finished) - { - return new List(?.Result); - } - try - { - IList strikes = ??.GetStrikes(new GetStrikesRequestParameters(getStrikesRequestParameters)); - if (strikes == null) - { - return list; - } - foreach (MessageSymbolInfo item in strikes) - { - if (item != null) - { - list.Add(??.?(item)); - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); - } - finally - { - if (!getStrikesRequestParameters.CancellationToken.IsCancellationRequested) - { - ??.GetStrikesRequestCache.?(getStrikesRequestParameters, new List(list)); - } - } - return list; - } - - private IList ?(SearchSymbolsRequestParameters P_0) - { - IEnumerable source = ??.Symbols; - IList ?? = P_0.ExchangeIds; - if (?? != null && ??.Any()) - { - source = source.Where((Symbol symbol) => ??.Contains(symbol.ExchangeId)); - } - IList ?? = P_0.SymbolTypes; - if (?? != null && ??.Any()) - { - source = source.Where((Symbol symbol) => ??.Contains(symbol.SymbolType)); - } - string filterName = P_0.FilterName; - if (string.IsNullOrEmpty(filterName)) - { - return source.ToList(); - } - string[] ?? = filterName.Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - return source.Where((Symbol symbol) => ?(??, symbol, P_0.GetSynonyms)).ToList(); - } - - private IList ?(GetFutureContractsRequestParameters P_0, bool P_1 = false) - { - List list = new List(); - ICollection collection; - if (!P_1) - { - ICollection symbols = ??.Symbols; - collection = symbols; - } - else - { - collection = ??.SymbolsInfoCache.Values; - } - foreach (Symbol item in collection) - { - if (item.SymbolType != SymbolType.Futures && item.SymbolType != SymbolType.Forward) - { - continue; - } - if (!string.IsNullOrEmpty(P_0.UnderlierId)) - { - if (item.Underlier != null && item.Underlier.Id == P_0.UnderlierId) - { - list.Add(item); - } - } - else if (item.Root == P_0.Root) - { - list.Add(item); - } - } - return list; - } - - private IList ?(GetOptionSeriesRequestParameters P_0) - { - if (??.OptionSeriesCache.?(P_0.UnderlierId, out var result)) - { - return result; - } - return new List(); - } - - private static bool ?(string[] P_0, Symbol P_1, Func P_2) - { - bool result = true; - foreach (string text in P_0) - { - bool num = P_1.Name.Contains(text, StringComparison.InvariantCultureIgnoreCase); - bool flag = !string.IsNullOrEmpty(P_1.Description) && P_1.Description.Contains(text, StringComparison.InvariantCultureIgnoreCase); - bool flag2 = text.Length > 2 && P_1.Name.Contains(text.Insert(3, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), StringComparison.InvariantCultureIgnoreCase); - bool flag3 = text.Length > 3 && text[3] == '/' && P_1.Name.Contains(text.Remove(3, 1), StringComparison.InvariantCultureIgnoreCase); - bool flag4 = false; - bool flag5 = false; - bool flag6 = false; - if (P_2 != null) - { - string text2 = P_2(text); - if (!string.IsNullOrEmpty(text2)) - { - flag4 = P_1.Name.Contains(text2, StringComparison.InvariantCultureIgnoreCase); - flag5 = text2.Length > 2 && P_1.Name.Contains(text2.Insert(3, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), StringComparison.InvariantCultureIgnoreCase); - flag6 = text2.Length > 3 && text2[3] == '/' && P_1.Name.Contains(text2.Remove(3, 1), StringComparison.InvariantCultureIgnoreCase); - } - } - if (!num && !flag && !flag2 && !flag3 && !flag4 && !flag5 && !flag6) - { - result = false; - break; - } - } - return result; - } - - internal Order ?(string P_0) - { - if (State != ConnectionState.Connected) - { - return null; - } - if (?? == null) - { - return null; - } - if (??.OrdersCache.?(P_0, out var result)) - { - return result; - } - return null; - } - - internal PnL ?(PnLRequestParameters P_0) - { - if (!Connected) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - return null; - } - try - { - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); - PnL pnL = ??.CalculatePnL(new PnLRequestParameters(P_0) - { - CancellationToken = cancellationTokenSource.Token - }); - if (pnL == null) - { - return pnL; - } - if (pnL.GrossPnL != null) - { - pnL.GrossPnL.ConnectionId = Id; - } - if (pnL.NetPnL != null) - { - pnL.NetPnL.ConnectionId = Id; - } - if (pnL.Fee != null) - { - pnL.Fee.ConnectionId = Id; - } - return pnL; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); - } - return null; - } - - internal Position ?(string P_0) - { - if (State != ConnectionState.Connected) - { - return null; - } - if (?? == null) - { - return null; - } - if (??.PositionsCache.?(P_0, out var result)) - { - return result; - } - return null; - } - - private IList ?(HistoryRequestParameters P_0) - { - IList list = new List(); - if (!Connected) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - return list; - } - try - { - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(20, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.Aggregation); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.FromTime); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.ToTime); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.LoadingHistory, Name); - Stopwatch stopwatch = new Stopwatch(); - stopwatch.Start(); - list = ??.LoadHistory(new HistoryRequestParameters(P_0) - { - CancellationToken = cancellationTokenSource.Token - }); - stopwatch.Stop(); - bool flag = list != null; - LoggerManager loggers2 = Core.Instance.Loggers; - defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(54, 6); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.Aggregation); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.FromTime); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.ToTime); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(flag ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(list?.Count ?? 0); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(stopwatch.Elapsed.TotalSeconds, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers2.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.LoadingHistory, Name); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); - } - return list; - } - - [Obfuscation(Exclude = true)] - internal VolumeAnalysisInterval LoadVolumeAnalysis(VolumeAnalysisByPeriodRequestParameters requestParameters) - { - if (!Connected) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - return null; - } - try - { - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(requestParameters.CancellationToken, ??.Token); - VolumeAnalysisByPeriodRequestParameters volumeAnalysisByPeriodRequestParameters = new VolumeAnalysisByPeriodRequestParameters(requestParameters) - { - CancellationToken = cancellationTokenSource.Token - }; - VendorVolumeAnalysisByPeriodResponse vendorVolumeAnalysisByPeriodResponse = ??.LoadVolumeAnalysis(volumeAnalysisByPeriodRequestParameters); - if (vendorVolumeAnalysisByPeriodResponse == null) - { - return null; - } - return new VolumeAnalysisInterval - { - Interval = vendorVolumeAnalysisByPeriodResponse.ActualDataInterval, - Description = volumeAnalysisByPeriodRequestParameters.ToDescription(), - VolumeAnalysis = vendorVolumeAnalysisByPeriodResponse.Data - }; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); - } - return null; - } - - public IEnumerable GetNews(GetNewsRequestParameters requestParameters) - { - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(requestParameters.CancellationToken, ??.Token); - IEnumerable news = ??.GetNews(new GetNewsRequestParameters(requestParameters) - { - CancellationToken = cancellationTokenSource.Token - }); - if (news == null) - { - return Array.Empty(); - } - if (!news.Any()) - { - return Array.Empty(); - } - List list = new List(); - foreach (MessageNewsHeadline item in news) - { - if (item != null) - { - if (requestParameters.CancellationToken.IsCancellationRequested) - { - break; - } - NewsArticle newsArticle = new NewsArticle(Id); - newsArticle.?(item); - list.Add(newsArticle); - } - } - return list.ToArray(); - } - - public string GetNewsArticleContent(GetNewsArticleContentRequestParameters requestParameters) - { - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(requestParameters.CancellationToken, ??.Token); - return ??.GetNewsArticleContent(new GetNewsArticleContentRequestParameters(requestParameters) - { - CancellationToken = cancellationTokenSource.Token - }); - } - - public void SubscribeNewsUpdates(SubscribeNewsRequestParameters subscribeNewsRequestParameters, Action updateAction) - { - if (updateAction == null) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - int hashCode = updateAction.GetHashCode(); - if (!??.NewsSubscribersCache.TryGetValue(hashCode, out var value)) - { - value = new HashSet>(); - ??.NewsSubscribersCache[hashCode] = value; - } - int count = value.Count; - value.Add(updateAction); - if (value.Count > count) - { - using (CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(subscribeNewsRequestParameters.CancellationToken, ??.Token)) - { - subscribeNewsRequestParameters.SubscribeId = hashCode.ToString(); - subscribeNewsRequestParameters.CancellationToken = cancellationTokenSource.Token; - ??.SubscribeNewsUpdates(subscribeNewsRequestParameters); - } - } - } - - public void UnsubscribeNewsUpdates(SubscribeNewsRequestParameters subscribeNewsRequestParameters, Action updateAction) - { - if (updateAction == null) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - int hashCode = updateAction.GetHashCode(); - if (!??.NewsSubscribersCache.TryGetValue(hashCode, out var value)) - { - return; - } - int count = value.Count; - value.Remove(updateAction); - if (value.Count > count) - { - using (CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(subscribeNewsRequestParameters.CancellationToken, ??.Token)) - { - subscribeNewsRequestParameters.SubscribeId = hashCode.ToString(); - subscribeNewsRequestParameters.CancellationToken = cancellationTokenSource.Token; - ??.UnsubscribeNewsUpdates(subscribeNewsRequestParameters); - } - } - } - - [Obsolete("Use Core.Instance.GetTrades() instead")] - public IList GetTrades(TradesHistoryRequestParameters parameters) - { - parameters.Progress?.Report(0f); - if (parameters.To > Core.Instance.TimeUtils.DateTimeUtcNow) - { - parameters.To = Core.Instance.TimeUtils.DateTimeUtcNow; - } - if (parameters.ForceReload && !TradesHistoryMetadata.AllowReloadFromServer) - { - parameters.ForceReload = false; - } - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(parameters.CancellationToken, ??.Token); - CancellationToken token = cancellationTokenSource.Token; - List> list2; - IList list = ?(parameters, out list2); - foreach (Interval item in list2) - { - if (token.IsCancellationRequested) - { - break; - } - TradesHistoryRequestParameters tradesHistoryRequestParameters = new TradesHistoryRequestParameters - { - From = item.From, - To = item.To, - SymbolId = parameters.SymbolId, - ForceReload = parameters.ForceReload, - CancellationToken = token, - Progress = parameters.Progress - }; - IList list3 = null; - try - { - list3 = ??.GetTrades(tradesHistoryRequestParameters); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - if (token.IsCancellationRequested) - { - break; - } - if (list3 != null) - { - UserTradesInterval userTradesInterval = ?(tradesHistoryRequestParameters, list3); - list.Add(userTradesInterval); - if (string.IsNullOrEmpty(parameters.SymbolId) || !??.UsersTradesCacheMetadata.AllowSingleSymbolLoading) - { - ???.Save(userTradesInterval); - } - } - } - if (token.IsCancellationRequested) - { - return Array.Empty(); - } - MessageTrade[] array = (from P_0 in list.OrderBy((UserTradesInterval P_0) => P_0.Interval.From).SelectMany((UserTradesInterval P_0) => P_0.Trades) - where string.IsNullOrEmpty(parameters.SymbolId) || P_0.SymbolId == parameters.SymbolId - select P_0).ToArray(); - if (!array.Any()) - { - return Array.Empty(); - } - return ?(array, token); - } - - internal void ?(TradesHistoryRequestParameters P_0, AccountTradesLoadingCallback P_1) - { - if (P_0 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (P_1 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - P_0.Progress?.Report(0f); - if (P_0.To > Core.Instance.TimeUtils.DateTimeUtcNow) - { - P_0.To = Core.Instance.TimeUtils.DateTimeUtcNow; - } - CancellationTokenSource ?? = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); - CancellationToken ?? = ??.Token; - List> list; - IList source = ?(P_0, out list); - P_1.InvokeSafely(?(source.SelectMany((UserTradesInterval userTradesInterval) => userTradesInterval.Trades).ToList(), ??), !list.Any()); - foreach (Interval ?? in list) - { - if (??.IsCancellationRequested) - { - break; - } - TradesHistoryRequestParameters ?? = new TradesHistoryRequestParameters - { - From = ??.From, - To = ??.To, - SymbolId = P_0.SymbolId, - ForceReload = P_0.ForceReload, - CancellationToken = ??, - Progress = P_0.Progress - }; - List ?? = new List(); - ??.GetTrades(??, delegate(IList list2, bool flag) - { - try - { - if (!??.IsCancellationRequested) - { - if (list2 == null) - { - if (flag) - { - P_1.InvokeSafely(new List(), flag); - } - } - else - { - list2 = ?(??, list2).Trades.ToList(); - ??.AddRange(list2); - List list3 = ?(list2, ??).ToList(); - P_1.InvokeSafely(list3, flag); - if (flag && string.IsNullOrEmpty(P_0.SymbolId) && !??.UsersTradesCacheMetadata.AllowSingleSymbolLoading) - { - ???.Save(new UserTradesInterval - { - Interval = ??, - Trades = ?? - }); - } - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - if (flag) - { - ??.Dispose(); - } - } - }); - } - } - - private IList ?(TradesHistoryRequestParameters P_0, out List> P_1) - { - List list = new List(); - P_1 = new List>(); - if (!P_0.ForceReload && ?? != null) - { - IList collection = ??.Load(P_0.Interval, out P_1); - list.AddRange(collection); - } - else - { - P_1.Add(P_0.Interval); - } - if (!(?? == default(DateTime)) && !P_0.ForceReload) - { - UsersTradesStorage usersTradesStorage = ??; - if (usersTradesStorage != null && usersTradesStorage.IsRealtimeCollectingAllowed) - { - for (int i = 0; i < P_1.Count; i++) - { - Interval interval = P_1[i]; - if (!(interval.To <= ??)) - { - if (interval.From >= ??) - { - P_1.RemoveAt(i--); - } - else - { - P_1[i] = new Interval(interval.From, ??); - } - } - } - return list; - } - } - return list; - } - - private UserTradesInterval ?(TradesHistoryRequestParameters P_0, IList P_1) - { - List trades = P_1.Where((MessageTrade messageTrade) => P_0.Interval.Contains(messageTrade.DateTime)).ToList(); - return new UserTradesInterval - { - Trades = trades, - Interval = new Interval(P_0.From, P_0.To) - }; - } - - private Trade[] ?(IList P_0, CancellationToken P_1) - { - List list = new List(); - foreach (MessageTrade item in P_0) - { - if (item != null) - { - if (P_1.IsCancellationRequested) - { - break; - } - ?(new GetSymbolRequestParameters - { - SymbolId = item.SymbolId, - CancellationToken = P_1 - }); - Trade trade = new Trade(Id); - trade.?(item); - list.Add(trade); - } - } - return list.ToArray(); - } - - public IList GetOrdersHistory(OrdersHistoryRequestParameters parameters) - { - parameters.Progress?.Report(0f); - if (parameters.To > Core.Instance.TimeUtils.DateTimeUtcNow) - { - parameters.To = Core.Instance.TimeUtils.DateTimeUtcNow; - } - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(parameters.CancellationToken, ??.Token); - parameters.CancellationToken = cancellationTokenSource.Token; - IList list = null; - try - { - list = ??.GetOrdersHistory(parameters); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - if (parameters.CancellationToken.IsCancellationRequested) - { - return Array.Empty(); - } - if (list == null) - { - return Array.Empty(); - } - if (!list.Any()) - { - return Array.Empty(); - } - List list2 = new List(); - foreach (MessageOrderHistory item in list) - { - if (item != null) - { - if (parameters.CancellationToken.IsCancellationRequested) - { - break; - } - ?(new GetSymbolRequestParameters - { - SymbolId = item.SymbolId, - CancellationToken = parameters.CancellationToken - }); - OrderHistory orderHistory = new OrderHistory(Id); - orderHistory.?(item); - list2.Add(orderHistory); - } - } - return list2.ToArray(); - } - - internal Report ?(ReportRequestParameters P_0) - { - using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); - ReportRequestParameters reportRequestParameters = new ReportRequestParameters(P_0) - { - CancellationToken = cancellationTokenSource.Token - }; - Report report = ??.GenerateReport(reportRequestParameters); - foreach (ReportRow row in report.Rows) - { - foreach (ReportCell cell in row.Cells) - { - if (cell.formattingDescription != null) - { - cell.formattingDescription.ConnectionId = Id; - } - } - } - return report; - } - - private void ?(object P_0, VendorEventArgs P_1) - { - ?(P_1.Message); - } - - private void ?(Message P_0) - { - if (P_0 != null) - { - ??.Push(P_0); - } - } - - private void ?(ConnectionState P_0) - { - try - { - ???.Invoke(this, new ConnectionStateChangedEventArgs(P_0, State, LastConnectionResult.Clone() as ConnectionResult)); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - private void ?(RequestParameters P_0) - { - RequestEventArgs e = new RequestEventArgs(P_0); - ???.InvokeSafely(this, e); - Core.Instance.?(this, e); - } - - private void ?(RequestParameters P_0, object P_1) - { - ???.InvokeSafely(this, new PerformedRequestEventArgs(P_0, P_1)); - Core.Instance.?(P_0, P_1); - } - - private void ?(string P_0) - { - try - { - int num = ??.Orders.Length; - int num2 = ??.Positions.Length; - if (num <= 0 && num2 <= 0) - { - return; - } - string value = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler; - if (num > 0) - { - defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(19, 2); - defaultInterpolatedStringHandler.AppendFormatted(num); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(string.Join(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (from order in ??.Orders - group order by order.Symbol into grouping - select grouping.Key).ToList())); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - value = defaultInterpolatedStringHandler.ToStringAndClear(); - } - string value2 = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - if (num2 > 0) - { - defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(15, 2); - defaultInterpolatedStringHandler.AppendFormatted(num2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(string.Join(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (from position in ??.Positions - group position by position.Symbol into grouping - select grouping.Key).ToList())); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - value2 = defaultInterpolatedStringHandler.ToStringAndClear(); - } - LoggerManager loggers = Core.Instance.Loggers; - defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(13, 4); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Trading); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - [Obfuscation(Exclude = true)] - private void SubscribeOnMessage(Action handler) - { - if (?? != null) - { - ??.?(handler); - } - } - - public int CompareTo(object obj) - { - if (obj is Connection connection) - { - return string.Compare(Name, connection.Name, StringComparison.Ordinal); - } - return 0; - } - - public override string ToString() - { - return Name; - } - } - public delegate void AccountTradesLoadingCallback(IList trades, bool isFinished); -} -namespace ? -{ - internal class ? : BufferedProcessor, ?, IBusinessObjectsProvider - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - internal bool ?(AdditionalInfoItem P_0) - { - return P_0.FormattingDescription != null; - } - - internal IFormattingDescription ?(AdditionalInfoItem P_0) - { - return P_0.FormattingDescription; - } - - internal bool ?(AdditionalInfoItem P_0) - { - return P_0.FormattingDescription != null; - } - - internal IFormattingDescription ?(AdditionalInfoItem P_0) - { - return P_0.FormattingDescription; - } - } - - [CompilerGenerated] - private sealed class ? - { - public ? ??; - - public Message ??; - - public INeedSymbolToPocess ??; - - internal void ?() - { - Symbol symbol = Core.Instance.Connections[??.??].?(new GetSymbolRequestParameters - { - SymbolId = ??.SymbolId - }); - if (symbol == null || symbol.Id != ??.SymbolId) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(50, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(??.GetType()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(??.SymbolId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Error); - } - else - { - ??.Push(??); - } - } - } - - [CompilerGenerated] - private sealed class ? - { - public MessageOptionSerie ??; - - internal bool ?(OptionSerie P_0) - { - return P_0.Id == ??.Id; - } - } - - private readonly string ??; - - [CompilerGenerated] - private HistoryMetadata ??; - - [CompilerGenerated] - private VolumeAnalysisMetadata ??; - - [CompilerGenerated] - private IEnumerable ??; - - [CompilerGenerated] - private TradesHistoryMetadata ??; - - [CompilerGenerated] - private LimitationMetadata ??; - - internal readonly Dictionary ??; - - [CompilerGenerated] - private readonly Dictionary ??; - - [CompilerGenerated] - private readonly ? ??; - - [CompilerGenerated] - private readonly ? ??; - - [CompilerGenerated] - private readonly ? ??; - - [CompilerGenerated] - private readonly ? ??; - - [CompilerGenerated] - private readonly ? ??; - - [CompilerGenerated] - private readonly ? ??; - - [CompilerGenerated] - private readonly ? ??; - - [CompilerGenerated] - private readonly ? ??; - - [CompilerGenerated] - private ? ??; - - [CompilerGenerated] - private readonly ? ??; - - [CompilerGenerated] - private readonly ? ??; - - [CompilerGenerated] - private readonly ?> ??; - - [CompilerGenerated] - private readonly Dictionary ??; - - [CompilerGenerated] - private readonly ? ??; - - [CompilerGenerated] - private readonly ? ??; - - [CompilerGenerated] - private readonly ConcurrentDictionary>> ??; - - [CompilerGenerated] - private readonly ? ??; - - [CompilerGenerated] - private SymbolType[] ??; - - internal bool ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private readonly ? ??; - - [CompilerGenerated] - private readonly ?> ??; - - [CompilerGenerated] - private readonly ?> ??; - - [CompilerGenerated] - private readonly ?> ??; - - [CompilerGenerated] - private readonly ?> ??; - - internal HistoryMetadata HistoryMetadata - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = historyMetadata; - } - } - - internal VolumeAnalysisMetadata VolumeAnalysisMetadata - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = volumeAnalysisMetadata; - } - } - - internal IEnumerable NewsFeedSettings - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = enumerable; - } - } - - internal TradesHistoryMetadata UsersTradesCacheMetadata - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = tradesHistoryMetadata; - } - } - - internal LimitationMetadata LimitationMetadata - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = limitationMetadata; - } - } - - internal Dictionary SymbolGroupsCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ? AccountsCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ? SymbolsCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ? SymbolsInfoCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ? OrdersCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ? PositionsCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ? ClosedPositionsCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ? CorporateActionCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ? ReportTypeCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ? OrderTypesCache - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = ?2; - } - } - - internal ? ExchangesCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ? RulesCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ?> OptionSeriesCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal Dictionary TradingSessions - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ? DeliveredAssetsCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ? AccountOperationsCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ConcurrentDictionary>> NewsSubscribersCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ? TradingSignalsCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - public Symbol[] Symbols => SymbolsCache.?(); - - public SymbolType[] SymbolTypes - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = array; - } - } - - public Account[] Accounts => AccountsCache.?(); - - public Asset[] Assets => ??.Values.ToArray(); - - public Exchange[] Exchanges => ExchangesCache.Values.ToArray(); - - public Order[] Orders => OrdersCache.?(); - - public OrderType[] OrderTypes => OrderTypesCache.?(); - - public Position[] Positions => PositionsCache.?(); - - public ClosedPosition[] ClosedPositions => ClosedPositionsCache.?(); - - public CorporateAction[] CorporateActions => CorporateActionCache.?(); - - public ReportType[] ReportTypes => ReportTypeCache.?(); - - public DeliveredAsset[] DeliveredAssets => DeliveredAssetsCache.?(); - - public AccountOperation[] AccountOperations => AccountOperationsCache.?(); - - public TradingSignal[] TradingSignals => TradingSignalsCache.?(); - - int ?.PriorityIndex => 0; - - ? ?.Rules => RulesCache; - - internal ? GetSymbolRequestCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ?> SearchSymbolsRequestCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ?> GetFutureContractsRequestCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ?> GetOptionSeriesRequestCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ?> GetStrikesRequestCache - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ?(string P_0) - { - ?? = P_0; - ?? = new ?(); - ?? = new ?(); - ?? = new ?(); - ?? = new Dictionary(); - ?? = new ?(); - ?? = new ?(); - ?? = new ?(); - ?? = new ?(); - ?? = new ?(); - OrderTypesCache = new ?(); - ?? = new ?(); - ?? = new ?>(); - ?? = new Dictionary(); - SymbolTypes = new SymbolType[0]; - ?? = new ?(); - ?? = new Dictionary(); - ?? = new ?(); - ?? = new ?(); - ?? = new ConcurrentDictionary>>(); - ?? = new ?(); - ?? = new ?(); - ?? = new ?>(); - ?? = new ?>(); - ?? = new ?>(); - ?? = new ?>(); - } - - internal void ?() - { - Core.Instance.RulesManager.Defaults.ForEach(delegate(Rule P_0) - { - RulesCache.?(P_0.Name, P_0); - }); - Start(); - } - - protected internal override void Clear() - { - List list = new List(); - list.AddRange(AccountsCache); - AccountsCache.?(); - list.AddRange(SymbolsCache); - SymbolsCache.?(); - SymbolsInfoCache.?(); - SymbolTypes = new SymbolType[0]; - OrdersCache.?(); - PositionsCache.?(); - ClosedPositionsCache.?(); - CorporateActionCache.?(); - ReportTypeCache.?(); - ??.Clear(); - OrderTypesCache.?(); - ExchangesCache.?(); - RulesCache.?(); - AccountOperationsCache.?(); - TradingSignalsCache.?(); - GetSymbolRequestCache.Dispose(); - SearchSymbolsRequestCache.Dispose(); - GetFutureContractsRequestCache.Dispose(); - GetOptionSeriesRequestCache.Dispose(); - GetStrikesRequestCache.Dispose(); - foreach (BusinessObject item in list) - { - item.State = BusinessObjectState.Fake; - } - base.Clear(); - } - - [Obfuscation(Exclude = true)] - protected override void Process(Message message) - { - if (message == null) - { - return; - } - try - { - INeedSymbolToPocess ?? = message as INeedSymbolToPocess; - if (?? != null && !string.IsNullOrEmpty(??.SymbolId) && !SymbolsCache.?(??.SymbolId)) - { - Task.Factory.StartNew(delegate - { - Symbol symbol = Core.Instance.Connections[??].?(new GetSymbolRequestParameters - { - SymbolId = ??.SymbolId - }); - if (symbol == null || symbol.Id != ??.SymbolId) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(50, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(message.GetType()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(??.SymbolId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Error); - } - else - { - Push(message); - } - }); - return; - } - switch (message.Type) - { - case MessageType.Account: - case MessageType.CryptoAccount: - ?(message as MessageAccount); - break; - case MessageType.Symbol: - ?(message as MessageSymbol); - break; - case MessageType.SymbolInfo: - ?(message as MessageSymbolInfo); - break; - case MessageType.Quote: - case MessageType.Level2: - case MessageType.Last: - case MessageType.DayBar: - case MessageType.DOM: - case MessageType.Mark: - ?(message as MessageQuote); - break; - case MessageType.Asset: - ?(message as MessageAsset); - break; - case MessageType.CryptoAssetBalances: - ?(message as MessageCryptoAssetBalances); - break; - case MessageType.OpenOrder: - ?(message as MessageOpenOrder); - break; - case MessageType.CloseOrder: - ?(message as MessageCloseOrder); - break; - case MessageType.OpenPosition: - ?(message as MessageOpenPosition); - break; - case MessageType.ClosedPosition: - ?(message as MessageClosedPosition); - break; - case MessageType.ClosePosition: - ?(message as MessageClosePosition); - break; - case MessageType.Trade: - ?(message as MessageTrade); - break; - case MessageType.CorporateAction: - ?(message as MessageCorporateAction); - break; - case MessageType.ReportMetadata: - ?(message as MessageReportType); - break; - case MessageType.Exchange: - ?(message as MessageExchange); - break; - case MessageType.SymbolTypes: - ?(message as MessageSymbolTypes); - break; - case MessageType.OrderHistory: - ?(message as MessageOrderHistory); - break; - case MessageType.Rule: - ?(message as MessageRule); - break; - case MessageType.DealTicket: - ?(message as MessageDealTicket); - break; - case MessageType.SymbolGroup: - ?(message as MessageSymbolGroup); - break; - case MessageType.OptionSerie: - ?(message as MessageOptionSerie); - break; - case MessageType.Session: - ?(message as MessageSessionsContainer); - break; - case MessageType.OpenDeliveredAsset: - ?(message as MessageOpenDeliveredAsset); - break; - case MessageType.CloseDeliveredAsset: - ?(message as MessageCloseDeliveredAsset); - break; - case MessageType.AccountOperation: - ?(message as MessageAccountOperation); - break; - case MessageType.NewsHeadline: - ?(message as MessageNewsHeadline); - break; - case MessageType.TradingSignal: - ?(message as MessageTradingSignal); - break; - case MessageType.RemoveTradingSignal: - ?(message as MessageRemoveTradingSignal); - break; - case MessageType.Custom: - ?(message as CustomMessage); - break; - } - } - finally - { - ???.Invoke(message); - } - } - - private void ?(MessageSymbolGroup P_0) - { - if (P_0 != null) - { - if (!SymbolGroupsCache.TryGetValue(P_0.Id, out var value)) - { - value = new SymbolGroup(??); - value.?(P_0); - SymbolGroupsCache.Add(value.Id, value); - } - else - { - value.?(P_0); - } - } - } - - private void ?(MessageSymbolTypes P_0) - { - if (P_0 != null) - { - SymbolTypes = P_0.SymbolTypes?.ToArray() ?? new SymbolType[0]; - } - } - - private void ?(MessageExchange P_0) - { - if (P_0 != null) - { - if (!ExchangesCache.?(P_0.Id, out var exchange)) - { - exchange = new Exchange(??); - exchange.?(P_0); - ExchangesCache[exchange.Id] = exchange; - } - else - { - exchange.?(P_0); - } - } - } - - private void ?(MessageAsset P_0) - { - if (P_0 != null) - { - if (!??.TryGetValue(P_0.Id, out var value)) - { - value = new Asset(??); - value.?(P_0); - ??[value.Id] = value; - } - else - { - value.?(P_0); - } - } - } - - private void ?(MessageAccount P_0) - { - if (P_0 == null) - { - return; - } - IEnumerable enumerable = (from additionalInfoItem in P_0.AccountAdditionalInfo?.Where((AdditionalInfoItem additionalInfoItem) => additionalInfoItem.FormattingDescription != null) - select additionalInfoItem.FormattingDescription); - if (enumerable != null) - { - foreach (IFormattingDescription item in enumerable) - { - item.ConnectionId = ??; - } - } - if (!AccountsCache.?(P_0.AccountId, out var account)) - { - account = ((!(P_0 is MessageCryptoAccount)) ? new Account(??) : new CryptoAccount(??)); - account.?(P_0); - AccountsCache.?(account.Id, account); - Core.Instance.?(account); - } - else - { - account.?(P_0); - } - } - - private void ?(MessageSymbol P_0) - { - if (P_0 == null) - { - return; - } - IEnumerable enumerable = (from additionalInfoItem in P_0.SymbolAdditionalInfo?.Where((AdditionalInfoItem additionalInfoItem) => additionalInfoItem.FormattingDescription != null) - select additionalInfoItem.FormattingDescription); - if (enumerable != null) - { - foreach (IFormattingDescription item in enumerable) - { - item.ConnectionId = ??; - } - } - Symbol symbol = SymbolsCache[P_0.Id]; - if (symbol == null) - { - lock (SymbolsInfoCache) - { - if (SymbolsInfoCache.?(P_0.Id, out symbol)) - { - SymbolsInfoCache.?(P_0.Id); - } - else - { - symbol = new Symbol(??); - } - } - symbol.?(P_0); - SymbolsCache.?(symbol.Id, symbol); - Core.Instance.?(symbol); - } - else - { - symbol.?(P_0); - } - } - - internal Symbol ?(MessageSymbolInfo P_0) - { - if (P_0 == null) - { - return null; - } - if (SymbolsCache.?(P_0.Id, out var symbol)) - { - return symbol; - } - lock (SymbolsInfoCache) - { - symbol = SymbolsInfoCache[P_0.Id]; - } - if (symbol == null) - { - symbol = new Symbol(??); - symbol.?(P_0); - try - { - lock (SymbolsInfoCache) - { - SymbolsInfoCache.?(symbol.Id, symbol); - } - } - catch (ArgumentException ex) - { - Core.Instance.Loggers.Log(ex); - } - } - else - { - symbol.?(P_0); - } - return symbol; - } - - private void ?(MessageQuote P_0) - { - if (P_0 != null) - { - SymbolsCache[P_0.SymbolId]?.?(P_0); - SymbolsInfoCache[P_0.SymbolId]?.?(P_0); - } - } - - private void ?(MessageOpenOrder P_0) - { - if (P_0 == null) - { - return; - } - if (string.IsNullOrEmpty(P_0.AccountId)) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.PositionId, LoggingLevel.Error); - return; - } - if (string.IsNullOrEmpty(P_0.SymbolId)) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.PositionId, LoggingLevel.Error); - return; - } - if (!OrdersCache.?(P_0.OrderId, out var order)) - { - order = new Order(??); - order.?(P_0); - OrdersCache.?(order.Id, order); - } - else - { - order.?(P_0); - } - Core.Instance.?(order); - } - - private void ?(MessageCloseOrder P_0) - { - if (P_0 != null && OrdersCache.?(P_0.OrderId, out var order)) - { - OrdersCache.?(order.Id); - order.State = BusinessObjectState.Fake; - Core.Instance.?(order); - } - } - - private void ?(MessageOpenPosition P_0) - { - if (P_0 == null) - { - return; - } - if (string.IsNullOrEmpty(P_0.AccountId)) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.PositionId, LoggingLevel.Error); - return; - } - if (string.IsNullOrEmpty(P_0.SymbolId)) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.PositionId, LoggingLevel.Error); - return; - } - if (!PositionsCache.?(P_0.PositionId, out var position)) - { - position = new Position(??); - position.?(P_0); - PositionsCache.?(position.Id, position); - } - else - { - position.?(P_0); - } - Core.Instance.?(position); - } - - private void ?(MessageClosedPosition P_0) - { - if (P_0 == null) - { - return; - } - if (string.IsNullOrEmpty(P_0.AccountId)) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.PositionId, LoggingLevel.Error); - return; - } - if (string.IsNullOrEmpty(P_0.SymbolId)) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.PositionId, LoggingLevel.Error); - return; - } - if (!ClosedPositionsCache.?(P_0.PositionId, out var closedPosition)) - { - closedPosition = new ClosedPosition(??); - closedPosition.?(P_0); - ClosedPositionsCache.?(closedPosition.Id, closedPosition); - } - else - { - closedPosition.?(P_0); - } - Core.Instance.?(closedPosition); - } - - private void ?(MessageClosePosition P_0) - { - if (P_0 != null) - { - ClosedPosition closedPosition; - if (PositionsCache.?(P_0.PositionId, out var position)) - { - PositionsCache.?(position.Id); - position.State = BusinessObjectState.Fake; - Core.Instance.?(position); - } - else if (ClosedPositionsCache.?(P_0.PositionId, out closedPosition)) - { - ClosedPositionsCache.?(closedPosition.Id); - closedPosition.State = BusinessObjectState.Fake; - Core.Instance.?(closedPosition); - } - } - } - - private void ?(MessageTrade P_0) - { - if (P_0 != null) - { - Trade trade = new Trade(??); - trade.?(P_0); - Core.Instance.?(trade); - } - } - - private void ?(MessageCorporateAction P_0) - { - if (P_0 != null) - { - if (!CorporateActionCache.?(P_0.CorporateActionId, out var corporateAction)) - { - corporateAction = new CorporateAction(??); - corporateAction.?(P_0); - CorporateActionCache.?(corporateAction.Id, corporateAction); - Core.Instance.?(corporateAction); - } - else - { - corporateAction.?(P_0); - } - } - } - - private void ?(MessageReportType P_0) - { - if (P_0 != null) - { - ReportType reportType = new ReportType(??); - reportType.?(P_0); - ReportTypeCache.?(P_0.Id, reportType); - } - } - - private void ?(MessageOrderHistory P_0) - { - if (P_0 != null) - { - OrderHistory orderHistory = new OrderHistory(??); - orderHistory.?(P_0); - Core.Instance.?(orderHistory); - } - } - - private void ?(MessageRule P_0) - { - if (P_0 == null) - { - return; - } - ? ?2 = null; - if (P_0.OrderTypeId != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) - { - if (OrderTypesCache.?(P_0.OrderTypeId, out var orderType)) - { - ?2 = orderType; - } - } - else if (P_0.SymbolId != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) - { - if (SymbolsCache.?(P_0.SymbolId, out var symbol)) - { - ?2 = symbol; - } - else if (SymbolsInfoCache.?(P_0.SymbolId, out symbol)) - { - ?2 = symbol; - } - } - else if (P_0.AccountId != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) - { - if (AccountsCache.?(P_0.AccountId, out var account)) - { - ?2 = account; - } - } - else - { - ?2 = this; - } - if (?2 != null) - { - if (?2.Rules.?(P_0.Name, out var rule)) - { - rule.?(P_0); - } - else if (P_0 is LicenceMessageRule || !RulesManager.?.Contains(P_0.Name)) - { - rule = Rule.?(P_0); - ?2.Rules.?(rule.Name, rule); - } - } - } - - private void ?(MessageDealTicket P_0) - { - if (P_0 != null) - { - DealticketConnection dealticketConnection = new DealticketConnection(??, P_0); - Core.Instance.Loggers.Log(dealticketConnection, LoggingLevel.Trading, Core.Instance.Connections[((IConnectionBindedObject)dealticketConnection)?.ConnectionId]?.Name); - Core.Instance.?(dealticketConnection); - } - } - - private void ?(MessageCryptoAssetBalances P_0) - { - if (P_0 == null) - { - return; - } - Account account; - if (string.IsNullOrEmpty(P_0.AccountId)) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Error); - } - else if (string.IsNullOrEmpty(P_0.AssetId)) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Error); - } - else if (AccountsCache.?(P_0.AccountId, out account)) - { - if (account is CryptoAccount cryptoAccount) - { - cryptoAccount.?(P_0); - return; - } - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(32, 3); - defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.AccountId); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Error); - } - else - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.AccountId, LoggingLevel.Error); - } - } - - internal OptionSerie ?(MessageOptionSerie P_0) - { - if (P_0 == null) - { - return null; - } - if (!OptionSeriesCache.?(P_0.UnderlierId, out var list)) - { - OptionSeriesCache.?(P_0.UnderlierId, list = new List()); - } - OptionSerie optionSerie = list.FirstOrDefault((OptionSerie optionSerie2) => optionSerie2.Id == P_0.Id); - if (optionSerie == null) - { - optionSerie = new OptionSerie(??); - list.Add(optionSerie); - } - optionSerie.?(P_0); - return optionSerie; - } - - private void ?(MessageSessionsContainer P_0) - { - if (P_0 != null) - { - if (!TradingSessions.TryGetValue(P_0.Id, out var value)) - { - value = new SessionsContainer(??); - value.UpdateByMessage(P_0); - TradingSessions.Add(value.Id, value); - } - else - { - value.UpdateByMessage(P_0); - } - } - } - - private void ?(MessageOpenDeliveredAsset P_0) - { - if (P_0 == null) - { - return; - } - if (string.IsNullOrEmpty(P_0.AccountId)) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.Id, LoggingLevel.Error); - return; - } - if (string.IsNullOrEmpty(P_0.SymbolId)) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.Id, LoggingLevel.Error); - return; - } - if (!DeliveredAssetsCache.?(P_0.Id, out var deliveredAsset)) - { - deliveredAsset = new DeliveredAsset(??); - deliveredAsset.?(P_0); - DeliveredAssetsCache.?(deliveredAsset.Id, deliveredAsset); - } - else - { - deliveredAsset.?(P_0); - } - Core.Instance.?(deliveredAsset); - } - - private void ?(MessageCloseDeliveredAsset P_0) - { - if (P_0 != null && DeliveredAssetsCache.?(P_0.Id, out var deliveredAsset)) - { - DeliveredAssetsCache.?(deliveredAsset.Id); - Core.Instance.?(deliveredAsset); - } - } - - private void ?(MessageAccountOperation P_0) - { - if (P_0 != null) - { - if (!AccountOperationsCache.?(P_0.Name, out var accountOperation)) - { - AccountOperationsCache.?(P_0.Name, accountOperation = new AccountOperation(??)); - } - accountOperation.?(P_0); - } - } - - private void ?(MessageNewsHeadline P_0) - { - if (P_0 == null || string.IsNullOrEmpty(P_0.SubscribeId) || !int.TryParse(P_0.SubscribeId, out var result) || !NewsSubscribersCache.TryGetValue(result, out var value)) - { - return; - } - foreach (Action item in value) - { - NewsArticle newsArticle = new NewsArticle(??); - newsArticle.?(P_0); - item(newsArticle); - } - } - - private void ?(MessageTradingSignal P_0) - { - if (P_0 != null) - { - if (!TradingSignalsCache.?(P_0.Id, out var tradingSignal)) - { - tradingSignal = new TradingSignal(??); - tradingSignal.?(P_0); - TradingSignalsCache.?(tradingSignal.Id, tradingSignal); - Core.Instance.?(tradingSignal, EntityLifecycle.Created); - } - else - { - tradingSignal.?(P_0); - Core.Instance.?(tradingSignal, EntityLifecycle.Changed); - } - } - } - - private void ?(MessageRemoveTradingSignal P_0) - { - if (P_0 != null && TradingSignalsCache.?(P_0.TradingSignalId, out var tradingSignal)) - { - Core.Instance.?(tradingSignal, EntityLifecycle.Removed); - } - } - - private void ?(CustomMessage P_0) - { - if (P_0 != null) - { - P_0.ConnectionId = ??; - Core.Instance.CustomMessageProcessor.?(P_0); - } - } - - [SpecialName] - [CompilerGenerated] - internal void ?(Action P_0) - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value = (Action)Delegate.Combine(action2, P_0); - action = Interlocked.CompareExchange(ref ??, value, action2); - } - while ((object)action != action2); - } - - [SpecialName] - [CompilerGenerated] - internal void ?(Action P_0) - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value = (Action)Delegate.Remove(action2, P_0); - action = Interlocked.CompareExchange(ref ??, value, action2); - } - while ((object)action != action2); - } - - [CompilerGenerated] - private void ?(Rule P_0) - { - RulesCache.?(P_0.Name, P_0); - } - } - internal sealed class ? : ? - { - internal ?(string P_0) - : base(P_0) - { - } - - public override void Push(Message subject) - { - Process(subject); - } - } -} -namespace TradingPlatform.BusinessLayer -{ - public class ConnectionConnectingProgressChangedEventArgs - { - [CompilerGenerated] - private string ?; - - public string Progress - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = text; - } - } - - internal ConnectionConnectingProgressChangedEventArgs(string P_0) - { - Progress = P_0; - } - } - public class ConnectionDependency - { - [CompilerGenerated] - private ConnectionDependencyBehavior ?; - - private string[] ?; - - public static ConnectionDependency NoDependency => new ConnectionDependency - { - Behavior = ConnectionDependencyBehavior.NoDependency - }; - - public static ConnectionDependency TotalDependency => new ConnectionDependency - { - Behavior = ConnectionDependencyBehavior.TotalDependency - }; - - public ConnectionDependencyBehavior Behavior - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - public string[] DependentConnectionsIds - { - get - { - return ?; - } - set - { - ? = value ?? new string[0]; - } - } - } - /// - /// Server connection status - /// - public enum ConnectionState - { - Connected, - Connecting, - Disconnected, - Disconnecting, - ConnectionLost, - Fail - } - /// - /// Specifies connection using type. - /// - public enum ConnectionType - { - General, - TradingSimulator, - HistoryPlayer, - Backtester, - Technical - } - /// - /// Specifies how connection was created: by default or by user - /// - public enum ConnectionCreationType - { - Default, - Custom, - Technical - } - public enum ConnectionDependencyBehavior - { - NoDependency, - PartialDependency, - TotalDependency - } - public enum ConnectionStateObserverPriority - { - Low = 10, - Normal = 20, - High = 30 - } - /// - /// Represents all needed parameters for the connection constructing process. - /// - [Published] - public sealed class ConnectionInfo : ICustomizable, IRenamable, IComparable, IComparable - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal SettingItem ?(SettingItem P_0) - { - return P_0.GetCopy(); - } - } - - internal const string ?? = "ConnectionId"; - - private const string ?? = "Name"; - - internal const string ?? = "Group"; - - private const string ?? = "VendorName"; - - private const string ?? = "IsFavourite"; - - private const string ?? = "ConnectionState"; - - private const string ?? = "CreationType"; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private ConnectionState ??; - - [CompilerGenerated] - private IList ??; - - [CompilerGenerated] - private IList ??; - - [CompilerGenerated] - private ConnectionCreationType ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private List ??; - - [CompilerGenerated] - private string ??; - - private VendorInfo ??; - - [CompilerGenerated] - private bool ??; - - /// - /// Gets a user friendly name of the connection - /// - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - /// - /// Gets connection group - /// - public string Group - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Gets vendor's name - /// - public string VendorName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Gets connection Id - /// - public string ConnectionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - /// - /// Favorites one will be displayed in Control center toolbar - /// - public bool IsFavourite - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets ConnectionState - /// - public ConnectionState ConnectionState - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = connectionState; - } - } - - /// - /// Gets vendor's settings - /// - public IList VendorSettings - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = list; - } - } - - internal IList ConnectionSettings - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = list; - } - } - - /// - /// Specifies how connection was created: by default or by user - /// - public ConnectionCreationType CreationType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = connectionCreationType; - } - } - - public string ConnectionLogoPath - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - public bool AllowCreateCustomConnections - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = flag; - } - } - - public List Links - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = list; - } - } - - public string Copyrights - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - public VendorInfo VendorInfo - { - get - { - return ??; - } - internal set - { - if (vendorInfo == null) - { - return; - } - ?? = vendorInfo; - List list = new List(??.ConnectionParameters); - if (ConnectionSettings != null) - { - list.MergeWith(ConnectionSettings.Select((SettingItem P_0) => P_0.GetCopy()).ToList()); - } - VendorSettings = list; - } - } - - /// - /// realization - /// - public IList Settings - { - get - { - int value = (int)((ConnectionState != ConnectionState.Connecting) ? ((ConnectionState == ConnectionState.Disconnecting) ? ConnectionState.Disconnected : ((ConnectionState != ConnectionState.ConnectionLost) ? ConnectionState : ConnectionState.Connected)) : ConnectionState.Connected); - List list = new List - { - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ConnectionId) - { - VisibilityMode = VisibilityMode.Hidden - }, - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name) - { - Text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }, - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Group) - { - VisibilityMode = VisibilityMode.Hidden - }, - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), VendorName) - { - VisibilityMode = VisibilityMode.Hidden - }, - new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsFavourite) - { - VisibilityMode = VisibilityMode.Hidden - }, - new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value) - { - VisibilityMode = VisibilityMode.Hidden - }, - new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)CreationType) - { - VisibilityMode = VisibilityMode.Hidden - } - }; - if (VendorSettings != null) - { - for (int i = 0; i < VendorSettings.Count; i++) - { - list.Add(VendorSettings[i].GetCopy()); - } - } - return list; - } - set - { - if (value == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - foreach (SettingItem item in value) - { - try - { - string name = item.Name; - if (name != null) - { - switch (name.Length) - { - case 12: - switch (name[1]) - { - case 'o': - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - ConnectionId = item.Value as string; - goto end_IL_0021; - case 'r': - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - CreationType = (ConnectionCreationType)(int)item.Value; - goto end_IL_0021; - } - break; - case 4: - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - Name = item.Value as string; - goto end_IL_0021; - case 10: - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - VendorName = item.Value as string; - ?(); - goto end_IL_0021; - case 5: - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - Group = item.Value as string; - goto end_IL_0021; - case 11: - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - IsFavourite = (bool)item.Value; - goto end_IL_0021; - case 15: - { - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - ConnectionState connectionState = (ConnectionState)(int)item.Value; - if (connectionState == ConnectionState.Disconnecting) - { - connectionState = ConnectionState.Disconnected; - } - ConnectionState = connectionState; - goto end_IL_0021; - } - } - } - VendorSettings?.UpdateItemValue(item.Name, item.Value); - end_IL_0021:; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - if (string.IsNullOrEmpty(ConnectionLogoPath) && CreationType == ConnectionCreationType.Custom) - { - ?(); - } - } - } - - public bool SyncMsgProcessing - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - string IRenamable.Name - { - get - { - return Name; - } - set - { - Core.Instance.Connections.RenameConnectionInfo(this, newName); - } - } - - /// - /// Creates connection info instance - /// - /// - internal ConnectionInfo(string P_0) - { - Name = P_0; - ConnectionState = ConnectionState.Disconnected; - ConnectionId = string.Empty; - } - - internal ConnectionInfo(string P_0, string P_1) - : this(P_0, P_1, P_1, ConnectionCreationType.Custom) - { - } - - /// - /// Creates connection info instance. - /// - /// - /// - /// - /// - internal ConnectionInfo(string P_0, string P_1, string P_2, ConnectionCreationType P_3 = ConnectionCreationType.Default) - : this(P_0) - { - Group = P_1 ?? P_2; - VendorName = P_2; - CreationType = P_3; - ConnectionId = ?(); - if (CreationType == ConnectionCreationType.Custom) - { - ?(); - ?(); - } - else if (CreationType == ConnectionCreationType.Technical) - { - ?(); - } - } - - private string ?() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 4); - defaultInterpolatedStringHandler.AppendFormatted(VendorName); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Group); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(CreationType); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted((CreationType == ConnectionCreationType.Default) ? Name : Guid.NewGuid().ToShortString()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - private void ?() - { - ConnectionInfo connectionInfo = Core.Instance.Connections.ConnectionsInfo.FirstOrDefault((ConnectionInfo P_0) => P_0.CreationType == ConnectionCreationType.Default && P_0.Group == Group); - if (connectionInfo != null) - { - ConnectionLogoPath = connectionInfo.ConnectionLogoPath; - } - } - - private void ?() - { - if (VendorInfo == null) - { - VendorInfo vendorInfo = Core.Instance.Vendors.Vendors.FirstOrDefault((VendorInfo P_0) => P_0.MetaData.VendorName == VendorName); - ConnectionInfo connectionInfo = vendorInfo?.DefaultConnections.FirstOrDefault((ConnectionInfo P_0) => P_0.Group == Group); - if (connectionInfo != null) - { - ConnectionSettings = connectionInfo.ConnectionSettings; - } - VendorInfo = vendorInfo; - } - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(26, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(VendorName); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(IsFavourite); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public override bool Equals(object obj) - { - if (obj is ConnectionInfo connectionInfo) - { - return ConnectionId == connectionInfo.ConnectionId; - } - return false; - } - - public override int GetHashCode() - { - return -463474436 + EqualityComparer.Default.GetHashCode(ConnectionId); - } - - private bool ?(string P_0, ref string P_1) - { - return true; - } - - bool IRenamable.IsNameAllowed(string P_0, ref string P_1) - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(P_0, ref P_1); - } - - public int CompareTo(object obj) - { - return CompareTo(obj as ConnectionInfo); - } - - public int CompareTo(ConnectionInfo other) - { - if (this == other) - { - return 0; - } - if (other == null) - { - return 1; - } - return string.Compare(ConnectionId, other.ConnectionId, StringComparison.Ordinal); - } - - [CompilerGenerated] - private bool ?(ConnectionInfo P_0) - { - if (P_0.CreationType == ConnectionCreationType.Default) - { - return P_0.Group == Group; - } - return false; - } - - [CompilerGenerated] - private bool ?(VendorInfo P_0) - { - return P_0.MetaData.VendorName == VendorName; - } - - [CompilerGenerated] - private bool ?(ConnectionInfo P_0) - { - return P_0.Group == Group; - } - } - public sealed class ConnectionInfoLink - { - [CompilerGenerated] - private string ?; - - [CompilerGenerated] - private string ?; - - public string Text - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - public string URL - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - } - public sealed class ConnectionsManager : ICustomizable, IDisposable - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func> ??; - - public static Func ??; - - internal bool ?(Connection P_0) - { - return P_0.Connected; - } - - internal IEnumerable ?(VendorInfo P_0) - { - return P_0.DefaultConnections; - } - - internal bool ?(ConnectionInfo P_0) - { - return P_0.AllowCreateCustomConnections; - } - } - - [CompilerGenerated] - private sealed class ? - { - public string ??; - - public string ??; - - internal bool ?(ConnectionInfo P_0) - { - if (P_0.CreationType == ConnectionCreationType.Default && P_0.VendorName == ??) - { - return P_0.Group == ??; - } - return false; - } - } - - [CompilerGenerated] - private sealed class ? - { - public ConnectionInfo ??; - - internal bool ?(ConnectionInfo P_0) - { - if (P_0.CreationType == ConnectionCreationType.Default && P_0.VendorName == ??.VendorName) - { - return P_0.Group == ??.Group; - } - return false; - } - } - - [CompilerGenerated] - private sealed class ? - { - public ? ??; - - public ConnectionsManager ??; - - internal void ?() - { - ??.?(??.Connection); - } - - internal Task ?(Task t) - { - return ??.CurrentTask = null; - } - } - - private const int ?? = 10000; - - private readonly ? ??; - - private readonly object ??; - - private readonly ? ??; - - private Timer ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private EventHandler ??; - - [CompilerGenerated] - private EventHandler ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - private bool ??; - - private readonly List ??; - - private readonly object ??; - - private readonly Dictionary ??; - - private int ??; - - internal static readonly ? ?? = new ?(); - - public Connection[] All => ??.Values.ToArray(); - - public Connection[] Connected => (from P_0 in ??.Values.ToList() - where P_0.Connected - select P_0).ToArray(); - - public ConnectionInfo[] ConnectionsInfo => ??.Values.ToArray(); - - public Connection this[string id] - { - get - { - if (string.IsNullOrEmpty(id)) - { - return null; - } - return ??[id]; - } - } - - public IList Settings - { - get - { - List list = new List(); - ConnectionInfo[] connectionsInfo = Core.Instance.Connections.ConnectionsInfo; - foreach (ConnectionInfo connectionInfo in connectionsInfo) - { - try - { - list.Add(new SettingItemGroup(connectionInfo.Name, connectionInfo.Settings)); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, connectionInfo.Name); - } - } - return list; - } - set - { - foreach (SettingItem item in value) - { - ??.?(item); - ConnectionInfo connectionInfo = new ConnectionInfo(item.Name) - { - Settings = (item.Value as IList) - }; - if (connectionInfo.VendorInfo != null) - { - AddConnectionInfo(connectionInfo); - } - } - } - } - - public event Action ConnectionAdded - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public event Action ConnectionRemoved - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public event EventHandler ConnectionStateChanged - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - public event EventHandler ConnectionConnectingProgressChanged - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - public event Action PingUpdated - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public event Action ConnectionInfoAdded - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public event Action ConnectionInfoRemoved - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public event Action ConnectionInfoRenamed - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public ConnectionsManager() - { - ?? = ?.?(); - ?? = new ?(); - ?? = new Dictionary(); - ?? = new object(); - ?? = new List(); - ?? = new object(); - } - - internal ConnectionsManager(List P_0) - : this() - { - foreach (Connection item in P_0) - { - ??.?(item.Id, item); - } - } - - public void Initialize() - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - foreach (ConnectionInfo item in Core.Instance.Vendors.Vendors.SelectMany((VendorInfo P_0) => P_0.DefaultConnections)) - { - ??[item.ConnectionId] = item; - } - ?(); - Core.Instance.?(?); - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - } - - public Connection CreateConnection(ConnectionInfo info) - { - lock (??) - { - if (??.?(info.ConnectionId, out var result)) - { - return result; - } - result = new Connection(info); - ??.?(result.Id, result); - ?(result); - return result; - } - } - - public void RemoveConnection(Connection connection) - { - if (connection == null) - { - return; - } - lock (??) - { - ??.Remove(connection.Id); - if (??.?(connection.Id)) - { - connection.Disconnect(); - ??.?(connection.Id); - ?(connection); - } - } - } - - public ConnectionInfo CreateCustomConnectionInfo(string name, string vendorName, string group = null) - { - if (name == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (vendorName == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (group == null) - { - group = vendorName; - } - List list = ConnectionsInfo.Where((ConnectionInfo P_0) => P_0.CreationType == ConnectionCreationType.Default && P_0.VendorName == vendorName && P_0.Group == group).ToList(); - if (list.Count == 0) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + vendorName + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + group); - } - if (!list.Any((ConnectionInfo P_0) => P_0.AllowCreateCustomConnections)) - { - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + vendorName + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + group); - } - return new ConnectionInfo(name, group, vendorName, ConnectionCreationType.Custom) - { - Links = list[0].Links - }; - } - - public ConnectionInfo CreateTechnicalConnectionInfo(string name, string vendorName, string id = null) - { - if (name == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (vendorName == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ConnectionInfo connectionInfo = new ConnectionInfo(name, vendorName, vendorName, ConnectionCreationType.Technical); - if (!string.IsNullOrEmpty(id)) - { - connectionInfo.ConnectionId = id; - } - return connectionInfo; - } - - public void AddConnectionInfo(ConnectionInfo connectionInfo) - { - if (connectionInfo == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (connectionInfo.CreationType == ConnectionCreationType.Technical) - { - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (??.?(connectionInfo.ConnectionId, out var connectionInfo2)) - { - connectionInfo2.Settings = connectionInfo.Settings; - return; - } - ??[connectionInfo.ConnectionId] = connectionInfo; - List list = ConnectionsInfo.Where((ConnectionInfo P_0) => P_0.CreationType == ConnectionCreationType.Default && P_0.VendorName == connectionInfo.VendorName && P_0.Group == connectionInfo.Group).ToList(); - if (list.Count > 0) - { - connectionInfo.Links = list[0].Links; - connectionInfo.Copyrights = list[0].Copyrights; - } - ??.InvokeSafely(connectionInfo); - } - - public void RemoveConnectionInfo(ConnectionInfo connectionInfo) - { - if (connectionInfo == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (??.?(connectionInfo.ConnectionId)) - { - ??.?(connectionInfo.ConnectionId); - if (??.?(connectionInfo.ConnectionId, out var connection)) - { - RemoveConnection(connection); - } - ??.InvokeSafely(connectionInfo); - } - } - - public void RenameConnectionInfo(ConnectionInfo connectionInfo, string newName) - { - if (connectionInfo == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (string.IsNullOrEmpty(newName)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (!(connectionInfo.Name == newName)) - { - connectionInfo.Name = newName; - ??.InvokeSafely(connectionInfo); - } - } - - private void ?(Connection P_0) - { - P_0.StateChanged += ?; - P_0.ConnectingProgressChanged += ?; - ??.InvokeSafely(P_0); - } - - private void ?(Connection P_0) - { - P_0.StateChanged -= ?; - P_0.ConnectingProgressChanged -= ?; - ??.InvokeSafely(P_0); - } - - private void ?(object P_0, ConnectionStateChangedEventArgs P_1) - { - if (!(P_0 is Connection connection)) - { - return; - } - lock (??) - { - if (P_1.NewState == ConnectionState.ConnectionLost && !??.ContainsKey(connection.Id)) - { - ??.Add(connection.Id, new ?(connection)); - } - } - List list = null; - lock (??) - { - list = new List(??); - } - foreach (ConnectionStateObserver item in list) - { - item.?(P_0, P_1); - } - ??.InvokeSafely(P_0, P_1); - } - - private void ?(object P_0, ConnectionConnectingProgressChangedEventArgs P_1) - { - if (P_0 is Connection) - { - ???.Invoke(P_0, P_1); - } - } - - public void Dispose() - { - ?(); - if (?? != null) - { - List list = new List(??.Values); - foreach (Connection item in list) - { - item.Disconnect(); - } - ??.?(); - list.Clear(); - } - Core.Instance.?(?); - } - - internal void ?(ConnectionStateObserver P_0) - { - lock (??) - { - ??.Add(P_0); - ??.Sort(); - } - } - - internal void ?(ConnectionStateObserver P_0) - { - lock (??) - { - ??.Remove(P_0); - } - } - - private void ?() - { - try - { - if (?? == null) - { - ?? = new Timer(?); - ??.Change(0, 10000); - } - } - catch - { - } - } - - private void ?() - { - try - { - if (?? != null) - { - ??.Change(-1, -1); - ??.Dispose(); - ?? = null; - } - } - catch (Exception) - { - } - } - - private void ?(object P_0) - { - if (??) - { - return; - } - try - { - ?? = true; - Connection[] all = All; - for (int i = 0; i < all.Length; i++) - { - all[i].?(); - } - ???.Invoke(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - ?? = false; - } - } - - private void ?() - { - if (?? < 10) - { - ??++; - return; - } - List list = new List(); - lock (??) - { - list.AddRange(??.Values); - } - foreach (? ?? in list) - { - if (??.CurrentTask != null || ??.Connection.State == ConnectionState.Connecting) - { - continue; - } - ??.ReconnectDelay -= 1.0; - if (??.ReconnectDelay <= 0.0) - { - ??.CurrentTask = Task.Run(delegate - { - ?(??.Connection); - }).ContinueWith((Task t) => ??.CurrentTask = null); - } - } - ?? = 0; - } - - private void ?(Connection P_0) - { - ? value; - lock (??) - { - if (!??.TryGetValue(P_0.Id, out value)) - { - return; - } - } - value.ReconnectAttempts++; - ConnectionResult connectionResult = P_0.Connect(); - if (P_0.State == ConnectionState.Connected || connectionResult.Cancelled) - { - lock (??) - { - ??.Remove(P_0.Id); - return; - } - } - if (connectionResult.State == ConnectionState.Fail) - { - value.ReconnectDelay = 5.0; - } - } - } - public class ConnectionStateChangedEventArgs : EventArgs - { - [CompilerGenerated] - private ConnectionState ?; - - [CompilerGenerated] - private ConnectionState ?; - - [CompilerGenerated] - private ConnectionResult ?; - - public ConnectionState PreviousState - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = connectionState; - } - } - - public ConnectionState NewState - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = connectionState; - } - } - - public ConnectionResult LastConnectionResult - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = connectionResult; - } - } - - internal ConnectionStateChangedEventArgs(ConnectionState P_0, ConnectionState P_1, ConnectionResult P_2) - { - PreviousState = P_0; - NewState = P_1; - LastConnectionResult = P_2; - } - } - public sealed class ConnectionStateObserver : IDisposable, IComparable - { - private IConnectionStateDependent ?; - - private readonly ConnectionStateObserverPriority ?; - - private readonly ConnectionState[] ?; - - public ConnectionStateObserver(IConnectionStateDependent dependencyObject, ConnectionStateObserverPriority priority = ConnectionStateObserverPriority.Normal, params ConnectionState[] monitoringStates) - { - ? = dependencyObject; - ? = priority; - ? = monitoringStates; - Core.Instance.Connections.?(this); - } - - internal void ?(object P_0, ConnectionStateChangedEventArgs P_1) - { - if (!?.Contains(P_1.NewState) || !(P_0 is Connection connection)) - { - return; - } - try - { - ConnectionDependency connectionDependency = ??.GetConnectionStateDependency(); - if ((connectionDependency == null || connectionDependency.Behavior != ConnectionDependencyBehavior.NoDependency) && ((connectionDependency != null && connectionDependency.Behavior == ConnectionDependencyBehavior.TotalDependency) || connectionDependency?.DependentConnectionsIds?.Contains(connection.Id) == true)) - { - ??.OnConnectionStateChanged(connection, P_1); - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - public void Dispose() - { - Core.Instance.Connections.?(this); - ? = null; - } - - public int CompareTo(ConnectionStateObserver other) - { - return -1 * ?.CompareTo(other.?); - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(4, 2); - defaultInterpolatedStringHandler.AppendFormatted(?); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - defaultInterpolatedStringHandler.AppendFormatted(?); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } -} -namespace ? -{ - internal class ? - { - [CompilerGenerated] - private int ?; - - [CompilerGenerated] - private double ?; - - [CompilerGenerated] - private Connection ?; - - [CompilerGenerated] - private Task ?; - - public int ReconnectAttempts - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = num; - } - } - - public double ReconnectDelay - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = num; - } - } - - public Connection Connection - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = connection; - } - } - - public Task CurrentTask - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = task; - } - } - - public ?(Connection P_0) - { - Connection = P_0; - } - } - internal class ? : IDisposable where ? : CachedRequestParameters - { - [CompilerGenerated] - private Dictionary> ?; - - private Dictionary> RequestsCache - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = dictionary; - } - } - - public ?() - { - RequestsCache = new Dictionary>(); - } - - public ? ?(? P_0) - { - int cacheKey = P_0.GetCacheKey(); - ? value; - lock (RequestsCache) - { - if (!RequestsCache.TryGetValue(cacheKey, out value)) - { - value = new ?(); - RequestsCache[cacheKey] = value; - } - else if (value.Finished) - { - return value; - } - } - Monitor.Enter(value); - if (value.Finished) - { - Monitor.Exit(value); - } - return value; - } - - public void ?(? P_0, ? P_1) - { - int cacheKey = P_0.GetCacheKey(); - ? value; - bool finished; - lock (RequestsCache) - { - if (!RequestsCache.TryGetValue(cacheKey, out value)) - { - value = (RequestsCache[cacheKey] = new ?(P_1)); - return; - } - finished = value.Finished; - value.Result = P_1; - value.Finished = true; - } - if (!finished) - { - try - { - Monitor.Exit(value); - } - catch - { - } - } - } - - public void Dispose() - { - RequestsCache.Clear(); - } - } - internal class ? - { - [CompilerGenerated] - private bool ?; - - [CompilerGenerated] - private ? ?; - - public bool Finished - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = flag; - } - } - - public ? Result - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = val; - } - } - - internal ?() - { - Result = default(?); - } - - internal ?(? P_0) - { - Result = P_0; - Finished = true; - } - } -} -namespace TradingPlatform.BusinessLayer -{ - /// - /// The main entry point in the API. Core keeps access to all business logic entities and their properties: - /// connections, accounts, symbols, positions, orders, etc. Some of them can be reached through using managers or directly via specified collections. - /// You can always access the Core object via static Core.Instance property. - /// - [Published] - public class Core : IDisposable, IBusinessObjectsProvider - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func> ??; - - public static Func> ??; - - public static Func> ??; - - public static Func> ??; - - public static Func> ??; - - public static Func> ??; - - public static Func> ??; - - public static Func> ??; - - public static Func> ??; - - public static Func> ??; - - public static Func> ??; - - public static Func> ??; - - public static Func> ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func> ??; - - public static Func ??; - - public static Func ??; - - internal IEnumerable ?(Connection P_0) - { - return P_0.BusinessObjects.Symbols; - } - - internal IEnumerable ?(Connection P_0) - { - return P_0.BusinessObjects.SymbolTypes; - } - - internal IEnumerable ?(Connection P_0) - { - return P_0.BusinessObjects.Accounts; - } - - internal IEnumerable ?(Connection P_0) - { - return P_0.BusinessObjects.Assets; - } - - internal IEnumerable ?(Connection P_0) - { - return P_0.BusinessObjects.Exchanges; - } - - internal IEnumerable ?(Connection P_0) - { - return P_0.BusinessObjects.Orders; - } - - internal IEnumerable ?(Connection P_0) - { - return P_0.BusinessObjects.OrderTypes; - } - - internal IEnumerable ?(Connection P_0) - { - return P_0.BusinessObjects.Positions; - } - - internal IEnumerable ?(Connection P_0) - { - return P_0.BusinessObjects.ClosedPositions; - } - - internal IEnumerable ?(Connection P_0) - { - return P_0.BusinessObjects.CorporateActions; - } - - internal IEnumerable ?(Connection P_0) - { - return P_0.BusinessObjects.ReportTypes; - } - - internal IEnumerable ?(Connection P_0) - { - return P_0.BusinessObjects.AccountOperations; - } - - internal IEnumerable ?(Connection P_0) - { - return P_0.BusinessObjects.TradingSignals; - } - - internal bool ?(Connection P_0) - { - return P_0.Connected; - } - - internal bool ?(Connection P_0) - { - return P_0.Connected; - } - - internal bool ?(Connection P_0) - { - return P_0.Connected; - } - - internal bool ?(Connection P_0) - { - return P_0.Connected; - } - - internal string ?(PlaceOrderRequestParameters P_0) - { - return P_0.ConnectionId; - } - - internal IEnumerable ?(Connection P_0) - { - return P_0.BusinessObjects.DeliveredAssets; - } - - internal bool ?(Connection P_0) - { - if (P_0 != null) - { - string vendorName = P_0.VendorName; - if (vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - return true; - } - } - return false; - } - - internal bool ?(Connection P_0) - { - if (P_0 != null) - { - string vendorName = P_0.VendorName; - if (vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - return true; - } - } - return false; - } - } - - [CompilerGenerated] - private sealed class ? - { - public BusinessObjectInfo ??; - - internal bool ?(Account P_0) - { - return P_0.Id == ??.Id; - } - } - - [CompilerGenerated] - private sealed class ? - { - public GetSymbolRequestParameters ??; - - internal bool ?(Synthetic P_0) - { - return P_0.Id == ??.SymbolId; - } - - internal bool ?(HistoricalSymbol P_0) - { - return P_0.Id == ??.SymbolId; - } - } - - [CompilerGenerated] - private sealed class ? - { - public string ??; - - internal bool ?(OrderType P_0) - { - return P_0.Id == ??; - } - - internal bool ?(OrderType P_0) - { - return P_0.Id == ??; - } - } - - [CompilerGenerated] - private sealed class ? - { - public string ??; - - internal bool ?(Connection P_0) - { - return P_0.Id == ??; - } - } - - [CompilerGenerated] - private sealed class ? - { - public ModifyOrderRequestParameters ??; - - internal bool ?(Connection P_0) - { - return P_0.Id == ??.ConnectionId; - } - } - - [CompilerGenerated] - private sealed class ? - { - public ClosePositionRequestParameters ??; - - internal bool ?(Connection P_0) - { - return P_0.Id == ??.ConnectionId; - } - } - - [CompilerGenerated] - private sealed class ? - { - public CancelOrderRequestParameters ??; - - internal bool ?(Connection P_0) - { - return P_0.Id == ??.ConnectionId; - } - } - - [CompilerGenerated] - private sealed class ? - { - public string ??; - - internal bool ?(Connection P_0) - { - return P_0.Id == ??; - } - } - - [CompilerGenerated] - private sealed class ? - { - public HistoricalSymbol ??; - - internal bool ?(HistoricalSymbol P_0) - { - return P_0.Id == ??.Id; - } - } - - private static Core ??; - - [CompilerGenerated] - private readonly ConnectionsManager ??; - - [CompilerGenerated] - private readonly LoggerManager ??; - - [CompilerGenerated] - private readonly LicencesManager ??; - - [CompilerGenerated] - private readonly VendorManager ??; - - [CompilerGenerated] - private readonly HistoryAggregationManager ??; - - [CompilerGenerated] - private readonly VolumeAnalysisManager ??; - - [CompilerGenerated] - private readonly IndicatorManager ??; - - [CompilerGenerated] - private readonly StrategyManager ??; - - [CompilerGenerated] - private readonly OrderPlacingStrategiesManager ??; - - [CompilerGenerated] - private readonly MessengersManager ??; - - [CompilerGenerated] - private readonly LocalOrdersManager ??; - - [CompilerGenerated] - private readonly RulesManager ??; - - [CompilerGenerated] - private readonly SymbolsMappingManager ??; - - [CompilerGenerated] - private readonly CustomSessionsManager ??; - - [CompilerGenerated] - private readonly TimeUtils ??; - - [CompilerGenerated] - private readonly MailUtils ??; - - [CompilerGenerated] - private readonly TradingProtector ??; - - [CompilerGenerated] - private IBrandingInformation ??; - - private TradingStatus ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private ? ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private CustomAccountPropertiesProvider ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private AdvancedTradingOperations ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private readonly SymbolsListManager ??; - - private readonly List ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private readonly List ?? = new List(); - - [CompilerGenerated] - private EventHandler ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - private Timer ??; - - [CompilerGenerated] - private IBrowserFactory ??; - - [CompilerGenerated] - private IOAuthBrowserCreator ??; - - [CompilerGenerated] - private Func ??; - - [CompilerGenerated] - private EventHandler ??; - - [CompilerGenerated] - private EventHandler ??; - - /// - /// Gets a singleton instance of . API entry point - /// - public static Core Instance - { - get - { - lock (typeof(Core)) - { - if (?? == null) - { - ?? = new Core(); - } - } - return ??; - } - } - - /// - /// Gets an access to all created connections and manages them - /// - public ConnectionsManager Connections - { - [CompilerGenerated] - get - { - return ??; - } - } - - /// - /// Gets an access to the system logging mechanism - /// - public LoggerManager Loggers - { - [CompilerGenerated] - get - { - return ??; - } - } - - /// - /// Obtains licence rules for the current user - /// - [NotPublished] - public LicencesManager Licences - { - [CompilerGenerated] - get - { - return ??; - } - } - - /// - /// Gets an access to all available trading data vendors and creates them - /// - [NotPublished] - public VendorManager Vendors - { - [CompilerGenerated] - get - { - return ??; - } - } - - /// - /// Gets an access to the all available aggregation types - /// - [NotPublished] - public HistoryAggregationManager HistoryAggregations - { - [CompilerGenerated] - get - { - return ??; - } - } - - /// - /// Access to Volume Analysis calculations - /// - public VolumeAnalysisManager VolumeAnalysis - { - [CompilerGenerated] - get - { - return ??; - } - } - - /// - /// Gets an access to the all available indicators and creates them - /// - public IndicatorManager Indicators - { - [CompilerGenerated] - get - { - return ??; - } - } - - /// - /// Gets an access to the all available trading strategies and manages them - /// - public StrategyManager Strategies - { - [CompilerGenerated] - get - { - return ??; - } - } - - public OrderPlacingStrategiesManager OrderPlacingStrategies - { - [CompilerGenerated] - get - { - return ??; - } - } - - public MessengersManager Messengers - { - [CompilerGenerated] - get - { - return ??; - } - } - - public LocalOrdersManager LocalOrders - { - [CompilerGenerated] - get - { - return ??; - } - } - - /// - /// Gets a permissions checking mechanism - /// - [NotPublished] - public RulesManager RulesManager - { - [CompilerGenerated] - get - { - return ??; - } - } - - public SymbolsMappingManager SymbolsMapping - { - [CompilerGenerated] - get - { - return ??; - } - } - - public CustomSessionsManager CustomSessions - { - [CompilerGenerated] - get - { - return ??; - } - } - - /// - /// Gets a time based conversion and synchronization mechanism - /// - public TimeUtils TimeUtils - { - [CompilerGenerated] - get - { - return ??; - } - } - - /// - /// Gets SMTP mail service for sending emails - /// - public MailUtils MailUtils - { - [CompilerGenerated] - get - { - return ??; - } - } - - public TradingProtector TradingProtection - { - [CompilerGenerated] - get - { - return ??; - } - } - - public IBrandingInformation BrandingInformation - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = brandingInformation; - } - } - - public Version CurrentVersion => new Version(GetType().Assembly.GetName().Version.ToString(3)); - - /// - /// Represents current trading status - /// - public TradingStatus TradingStatus - { - get - { - return ??; - } - set - { - ?? = value; - ???.Invoke(value); - } - } - - internal ? CustomMessageProcessor - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = ?; - } - } - - private bool AlreadyInitialized - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = flag; - } - } - - public CustomAccountPropertiesProvider CustomAccountPropertiesProvider - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = customAccountPropertiesProvider; - } - } - - /// - /// Gets all available s from open connections - /// - public Symbol[] Symbols => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.Symbols).ToArray(); - - /// - /// Gets all available s from open connections - /// - public SymbolType[] SymbolTypes => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.SymbolTypes).Distinct().ToArray(); - - /// - /// Gets all available s from open connections - /// - public Account[] Accounts => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.Accounts).ToArray(); - - /// - /// Gets all available s from open connections - /// - public Asset[] Assets => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.Assets).ToArray(); - - /// - /// Gets all available s from open connections - /// - public Exchange[] Exchanges => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.Exchanges).ToArray(); - - /// - /// Gets all available s from open connections - /// - public Order[] Orders => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.Orders).ToArray(); - - /// - /// Gets all available s from open connections - /// - public OrderType[] OrderTypes => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.OrderTypes).ToArray(); - - /// - /// Gets all available s from open connections - /// - public Position[] Positions => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.Positions).ToArray(); - - /// - /// Gets all available s from open connections - /// - public ClosedPosition[] ClosedPositions => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.ClosedPositions).ToArray(); - - /// - /// Gets all available s from open connections - /// - public CorporateAction[] CorporateActions => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.CorporateActions).ToArray(); - - /// - /// Gets all available s from open connections. Otherwise returns empty list - /// > - public ReportType[] ReportTypes => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.ReportTypes).ToArray(); - - public AccountOperation[] AccountOperations => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.AccountOperations).ToArray(); - - /// - /// Gets all available s from open connections. Otherwise returns empty list - /// > - public TradingSignal[] TradingSignals => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.TradingSignals).ToArray(); - - public AdvancedTradingOperations AdvancedTradingOperations - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = advancedTradingOperations; - } - } - - public DeliveredAsset[] DeliveredAssets => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.DeliveredAssets).ToArray(); - - /// - /// Gets all previously configured s - /// - [NotPublished] - public SymbolList[] SymbolList => SymbolListManager.Items; - - /// - /// Gets an access to s and manages them - /// - [NotPublished] - public SymbolsListManager SymbolListManager - { - [CompilerGenerated] - get - { - return ??; - } - } - - /// - /// Represent all available Historical Symbols - /// - [NotPublished] - public List HistoricalSymbols => new List(??); - - /// - /// Represent all available Synthetic items - /// - [NotPublished] - public List Synthetics - { - [CompilerGenerated] - get - { - return ??; - } - } - - [NotPublished] - public IBrowserFactory BrowserFactory - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [NotPublished] - public IOAuthBrowserCreator OAuthBrowserCreator - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Will be triggered when changed - /// - public event Action OnTradingStatusChanged - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - /// - /// Will be triggered when new added to the core - /// - public event Action AccountAdded - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - /// - /// Will be triggered when new added to the core - /// - public event Action SymbolAdded - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - /// - /// Will be triggered when new placed - /// - public event Action OrderAdded - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - /// - /// Will be triggered when canceled - /// - public event Action OrderRemoved - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - /// - /// Will be triggered when new opened - /// - public event Action PositionAdded - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - /// - /// Will be triggered when closed - /// - public event Action PositionRemoved - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - /// - /// Will be triggered when new added - /// - public event Action ClosedPositionAdded - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - /// - /// Will be triggered when removed - /// - public event Action ClosedPositionRemoved - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - /// - /// Will be triggered when new occured - /// - public event Action TradeAdded - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - /// - /// Will be triggered when new occured - /// - public event Action CorporateActionAdded - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - /// - /// Will be triggered when new added - /// - public event Action OrdersHistoryAdded - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public event Action DeliveredAssetAdded - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public event Action DeliveredAssetRemoved - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - /// - /// Will be triggered when new received - /// - public event Action DealTicketReceived - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - [NotPublished] - public event Action HistoricalSymbolAdded - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - [NotPublished] - public event Action HistoricalSymbolRemoved - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - [NotPublished] - public event Action HistoricalSymbolUpdated - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - /// - /// Will be triggered when custom symbol added - /// - [NotPublished] - public event Action SyntheticAdded - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - /// - /// Will be triggered when custom symbol removed - /// - [NotPublished] - public event Action SyntheticRemoved - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - /// - /// Will be triggered when custom symbol updated - /// - [NotPublished] - public event Action SyntheticUpdated - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - /// - /// Will be triggered when created/chenged/removed - /// - public event EventHandler TradingSignalUpdate - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - public event Action OnAlert - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public event Action OnRequestOTP - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public event Func OnAskUserConfirmationForTradingWithRunningEmulator - { - [CompilerGenerated] - add - { - Func func = ??; - Func func2; - do - { - func2 = func; - Func value2 = (Func)Delegate.Combine(func2, value); - func = Interlocked.CompareExchange(ref ??, value2, func2); - } - while ((object)func != func2); - } - [CompilerGenerated] - remove - { - Func func = ??; - Func func2; - do - { - func2 = func; - Func value2 = (Func)Delegate.Remove(func2, value); - func = Interlocked.CompareExchange(ref ??, value2, func2); - } - while ((object)func != func2); - } - } - - public event EventHandler NewRequest - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - public event EventHandler NewPerformedRequest - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - private Core() - { - global::?.?.?(GetType().Assembly.Location); - ?? = new ConnectionsManager(); - ?? = new LoggerManager(); - ?? = new LicencesManager(); - ?? = new VendorManager(); - ?? = new HistoryAggregationManager(); - ?? = new VolumeAnalysisManager(); - ?? = new IndicatorManager(); - ?? = new StrategyManager(); - ?? = new OrderPlacingStrategiesManager(); - ?? = new SymbolsListManager(); - ?? = new RulesManager(); - ?? = new SymbolsMappingManager(); - ?? = new CustomSessionsManager(); - ?? = new MessengersManager(); - ?? = new LocalOrdersManager(); - ?? = new TimeUtils(); - ?? = new MailUtils(); - ?? = new TradingProtector(); - ?? = new List(); - CustomAccountPropertiesProvider = new CustomAccountPropertiesProvider(); - } - - /// - /// Starts a initialization process which initializes given Managers, and Utils. And provides a subscribing on events. - /// - [NotPublished] - public void Initialize() - { - lock (??) - { - if (AlreadyInitialized) - { - return; - } - AlreadyInitialized = true; - } - CustomMessageProcessor = new ?(); - ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; - Loggers.?(); - Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - TimeUtils.?(); - Licences.?(); - Vendors.?(); - HistoryAggregations.?(); - VolumeAnalysis.?(); - Indicators.?(); - Strategies.?(); - OrderPlacingStrategies.?(); - Connections.Initialize(); - SymbolsMapping.?(); - Messengers.?(); - SymbolListManager.?(); - LocalOrders.Initialize(); - AdvancedTradingOperations = new AdvancedTradingOperations(); - ?(); - Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - } - - /// - /// Disposes all previously initialized modules and unsubscribe from events - /// - [NotPublished] - public void Dispose() - { - lock (??) - { - if (!AlreadyInitialized) - { - return; - } - Licences.Dispose(); - Vendors.?(); - HistoryAggregations.?(); - VolumeAnalysis.?(); - Indicators.Dispose(); - Strategies.Dispose(); - OrderPlacingStrategies.Dispose(); - Messengers.Dispose(); - Connections.Dispose(); - TimeUtils.?(); - MailUtils.?(); - Loggers.Dispose(); - if (?? != null) - { - ??.Dispose(); - ?? = null; - } - AlreadyInitialized = false; - lock (typeof(Core)) - { - ?? = null; - } - } - } - - /// - /// Gets an instance of exist Account or creates a new one with given info parameter - /// - /// - /// - public Account GetAccount(BusinessObjectInfo accountInfo) - { - if (accountInfo == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - Account account = Connections[accountInfo.ConnectionId]?.BusinessObjects?.Accounts?.FirstOrDefault((Account P_0) => P_0.Id == accountInfo.Id); - if (account != null) - { - return account; - } - if (accountInfo is ? { IsCrypto: not false }) - { - return new CryptoAccount(accountInfo); - } - return new Account(accountInfo); - } - - internal void ?(Account P_0) - { - ??.InvokeSafely(P_0); - } - - internal void ?(Symbol P_0) - { - ??.InvokeSafely(P_0); - } - - /// - /// Returns all s from open connections which satisfy given request parameters, otherwise returns empty list - /// - /// - /// - [NotPublished] - public IList SearchSymbols(SearchSymbolsRequestParameters requestParameters) - { - List list = new List(); - if (string.IsNullOrEmpty(requestParameters.ConnectionId)) - { - Connection[] connected = Connections.Connected; - for (int i = 0; i < connected.Length; i++) - { - IList list2 = connected[i].?(requestParameters); - if (list2 != null) - { - list.AddRange(list2); - } - } - } - else - { - IList list3 = Connections[requestParameters.ConnectionId]?.?(requestParameters); - if (list3 != null) - { - list.AddRange(list3); - } - } - return list; - } - - /// - /// Retrieves any by given request parameters. Otherwise returns null - /// - /// - /// Must be specified if open connections total is more than one. Will search only in Synthetic symbols list if id is equal to - /// - /// - public Symbol GetSymbol(GetSymbolRequestParameters requestParameters, string connectionId = null, NonFixedListDownload downloadSymbol = NonFixedListDownload.Download) - { - if (connectionId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - return Synthetics.Find((Synthetic P_0) => P_0.Id == requestParameters.SymbolId); - } - if (connectionId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - return HistoricalSymbols.Find((HistoricalSymbol P_0) => P_0.Id == requestParameters.SymbolId); - } - if (!string.IsNullOrEmpty(connectionId)) - { - return Connections[connectionId]?.?(requestParameters, downloadSymbol); - } - if (Connections.All.Count((Connection P_0) => P_0.Connected) > 1) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return Connections.All.FirstOrDefault((Connection P_0) => P_0.Connected)?.?(requestParameters, downloadSymbol); - } - - /// - /// Gets an instance of exist symbol or creates a new one with given info parameter - /// - /// - /// - public Symbol GetSymbol(BusinessObjectInfo symbolInfo) - { - if (symbolInfo == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - GetSymbolRequestParameters requestParameters = new GetSymbolRequestParameters - { - SymbolId = symbolInfo.Id - }; - return GetSymbol(requestParameters, symbolInfo.ConnectionId) ?? new Symbol(symbolInfo); - } - - [NotPublished] - public IList GetFutureContracts(Symbol underlier) - { - return GetFutureContracts(new GetFutureContractsRequestParameters - { - ConnectionId = underlier.ConnectionId, - ExchangeId = underlier.Exchange.Id, - UnderlierId = underlier.Id - }); - } - - [NotPublished] - public IList GetFutureContracts(string root, string exchangeId, string connectionId = null) - { - return GetFutureContracts(new GetFutureContractsRequestParameters - { - ConnectionId = connectionId, - Root = root, - ExchangeId = exchangeId - }); - } - - [NotPublished] - public IList GetFutureContracts(GetFutureContractsRequestParameters requestParameters) - { - if (requestParameters == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (string.IsNullOrEmpty(requestParameters.Root) && string.IsNullOrEmpty(requestParameters.UnderlierId)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (!string.IsNullOrEmpty(requestParameters.ConnectionId)) - { - return Connections[requestParameters.ConnectionId]?.?(requestParameters); - } - if (Connections.All.Count((Connection P_0) => P_0.Connected) > 1) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return Connections.All.FirstOrDefault()?.?(requestParameters); - } - - [NotPublished] - public virtual IList GetOptionSeries(Symbol underlier) - { - return GetOptionSeries(new GetOptionSeriesRequestParameters(underlier)); - } - - [NotPublished] - public virtual IList GetOptionSeries(GetOptionSeriesRequestParameters requestParameters) - { - if (requestParameters == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (string.IsNullOrEmpty(requestParameters.ConnectionId)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (string.IsNullOrEmpty(requestParameters.UnderlierId)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return Connections[requestParameters.ConnectionId]?.?(requestParameters); - } - - [NotPublished] - public virtual IList GetStrikes(OptionSerie serie) - { - return GetStrikes(new GetStrikesRequestParameters(serie)); - } - - [NotPublished] - public virtual IList GetStrikes(GetStrikesRequestParameters requestParameters) - { - if (requestParameters == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (string.IsNullOrEmpty(requestParameters.ConnectionId)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (string.IsNullOrEmpty(requestParameters.UnderlierId)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (string.IsNullOrEmpty(requestParameters.SerieId)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return Connections[requestParameters.ConnectionId]?.?(requestParameters); - } - - internal void ?(Order P_0) - { - Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.ToString()); - ??.InvokeSafely(P_0); - } - - internal void ?(Order P_0) - { - Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.ToString()); - ??.InvokeSafely(P_0); - } - - /// - /// Gets instance by given Id string. Otherwise returns null - /// - /// - /// Must be specified if open connections total is more than one - /// - public OrderType GetOrderType(string orderTypeId, string connectionId = null) - { - if (string.IsNullOrEmpty(orderTypeId)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (!string.IsNullOrEmpty(connectionId)) - { - return Connections[connectionId]?.BusinessObjects?.OrderTypes?.FirstOrDefault((OrderType P_0) => P_0.Id == orderTypeId); - } - Connection[] array = Connections.All.Where((Connection P_0) => P_0.Connected).ToArray(); - if (array.Length > 1) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return array.First().BusinessObjects.OrderTypes.SingleOrDefault((OrderType P_0) => P_0.Id == orderTypeId); - } - - /// - /// Gets instance by given Id string. Otherwise returns null - /// - /// - /// Must be specified if open connections total is more than one - /// - public Order GetOrderById(string orderId, string connectionId = null) - { - Connection connection = Connections[connectionId]; - if (connection != null) - { - return connection.?(orderId); - } - Connection[] all = Connections.All; - for (int i = 0; i < all.Length; i++) - { - Order order = all[i].?(orderId); - if (order != null) - { - return order; - } - } - return null; - } - - internal void ?(Position P_0) - { - ??.InvokeSafely(P_0); - } - - internal void ?(Position P_0) - { - ??.InvokeSafely(P_0); - } - - /// - /// Gets instance by given Id string. Otherwise returns null - /// - /// - /// Must be specified if open connections total is more than one - /// - public Position GetPositionById(string positionId, string connectionId = null) - { - Connection connection = Connections[connectionId]; - if (connection != null) - { - return connection.?(positionId); - } - Connection[] all = Connections.All; - for (int i = 0; i < all.Length; i++) - { - Position position = all[i].?(positionId); - if (position != null) - { - return position; - } - } - return null; - } - - /// - /// Gets Profit'n'Loss with given request parameters from open connection. Otherwise returns null - /// - /// - /// - public PnL CalculatePnL(PnLRequestParameters parameters) - { - string ?? = parameters.Account?.ConnectionId ?? parameters.Symbol.ConnectionId; - Connection connection = Connections.All.FirstOrDefault((Connection P_0) => P_0.Id == ??); - if (connection == null) - { - Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Error); - return null; - } - if (!connection.Connected) - { - Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Error); - return null; - } - return connection.?(parameters); - } - - internal void ?(ClosedPosition P_0) - { - ??.InvokeSafely(P_0); - } - - internal void ?(ClosedPosition P_0) - { - ??.InvokeSafely(P_0); - } - - internal void ?(Trade P_0) - { - Order orderById = GetOrderById(P_0.OrderId, P_0.ConnectionId); - LoggerManager loggers = Loggers; - string text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 2); - defaultInterpolatedStringHandler.AppendFormatted(P_0); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted((orderById == null) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : $"{orderById}"); - loggers.Log(text, defaultInterpolatedStringHandler.ToStringAndClear()); - ??.InvokeSafely(P_0); - } - - /// - /// Gets collection of by given parameters - /// - /// - /// - /// - public IList GetTrades(TradesHistoryRequestParameters parameters, string connectionId = null) - { - if (parameters == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (string.IsNullOrEmpty(connectionId)) - { - List list = new List(); - Connection[] all = Connections.All; - for (int i = 0; i < all.Length; i++) - { - IList trades = all[i].GetTrades(new TradesHistoryRequestParameters(parameters)); - if (trades != null) - { - list.AddRange(trades); - } - } - return list; - } - return Connections[connectionId]?.GetTrades(parameters) ?? new List(); - } - - /// - /// Gets collection of by given parameters and callback - /// - /// - /// - /// - /// - public void GetTrades(TradesHistoryRequestParameters parameters, AccountTradesLoadingCallback callback, string connectionId = null) - { - if (parameters == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (callback == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (string.IsNullOrEmpty(connectionId)) - { - Connection[] all = Connections.All; - for (int i = 0; i < all.Length; i++) - { - all[i].?(new TradesHistoryRequestParameters(parameters), callback); - } - } - Connections[connectionId]?.?(parameters, callback); - } - - internal void ?(CorporateAction P_0) - { - ??.InvokeSafely(P_0); - } - - internal void ?(OrderHistory P_0) - { - Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.ToString()); - ??.InvokeSafely(P_0); - } - - /// - /// Gets collection of by given parameters - /// - /// - /// - /// - public IList GetOrdersHistory(OrdersHistoryRequestParameters parameters, string connectionId = null) - { - if (parameters == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (string.IsNullOrEmpty(connectionId)) - { - List list = new List(); - Connection[] all = Connections.All; - for (int i = 0; i < all.Length; i++) - { - IList ordersHistory = all[i].GetOrdersHistory(parameters); - if (ordersHistory != null) - { - list.AddRange(ordersHistory); - } - } - return list; - } - return Connections[connectionId]?.GetOrdersHistory(parameters) ?? new List(); - } - - public TradingOperationResult PlaceOrder(Symbol symbol, Account account, Side side, TimeInForce timeInForce = TimeInForce.Day, double quantity = 1.0, double price = -1.0, double triggerPrice = -1.0, double trailOffset = -1.0) - { - if (symbol == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - if (account == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - PlaceOrderRequestParameters placeOrderRequestParameters = new PlaceOrderRequestParameters - { - Symbol = symbol, - Account = account, - Side = side, - Quantity = quantity, - TimeInForce = timeInForce - }; - if (price > 0.0 && triggerPrice <= 0.0 && trailOffset <= 0.0) - { - placeOrderRequestParameters.OrderTypeId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - placeOrderRequestParameters.Price = price; - } - else if (triggerPrice > 0.0 && price <= 0.0 && trailOffset <= 0.0) - { - placeOrderRequestParameters.OrderTypeId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - placeOrderRequestParameters.TriggerPrice = triggerPrice; - } - else if (price > 0.0 && triggerPrice > 0.0 && trailOffset <= 0.0) - { - placeOrderRequestParameters.OrderTypeId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - placeOrderRequestParameters.Price = price; - placeOrderRequestParameters.TriggerPrice = triggerPrice; - } - else if (trailOffset > 0.0 && price <= 0.0 && triggerPrice <= 0.0) - { - placeOrderRequestParameters.OrderTypeId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - placeOrderRequestParameters.TrailOffset = trailOffset; - } - else - { - placeOrderRequestParameters.OrderTypeId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - return PlaceOrder(placeOrderRequestParameters); - } - - /// - /// Places with given request parameters - /// - /// - /// - public TradingOperationResult PlaceOrder(PlaceOrderRequestParameters request) - { - if (request == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (!?(request.Symbol?.Connection, request.RequestId, out var result)) - { - return result; - } - if (!?(request.Symbol?.Connection, request.RequestId, out result)) - { - return result; - } - return request.Symbol?.?(request); - } - - /// - /// Places multiple s with given request parameters - /// - /// - /// - /// - public void PlaceOrders(ICollection requests, GroupOrderType groupOrderType = GroupOrderType.None) - { - if (requests == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (requests.Count == 1) - { - PlaceOrder(requests.Single()); - return; - } - foreach (IGrouping item in from P_0 in requests - group P_0 by P_0.ConnectionId) - { - Connection connection = Connections[item.Key]; - if (RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), connection.Id).Status == TradingOperationStatus.Allowed) - { - PlaceMultiOrderOrderRequestParameters placeMultiOrderOrderRequestParameters = new PlaceMultiOrderOrderRequestParameters - { - GroupOrderType = groupOrderType, - OrderParameters = item.ToArray() - }; - if (?(connection, placeMultiOrderOrderRequestParameters.RequestId, out var tradingOperationResult) && ?(connection, placeMultiOrderOrderRequestParameters.RequestId, out tradingOperationResult)) - { - connection.?(placeMultiOrderOrderRequestParameters); - } - } - else if (groupOrderType == GroupOrderType.None) - { - PlaceOrderRequestParameters[] array = item.ToArray(); - foreach (PlaceOrderRequestParameters request in array) - { - PlaceOrder(request); - } - } - } - } - - public TradingOperationResult ModifyOrder(Order order, TimeInForce timeInForce = TimeInForce.Default, double quantity = 1.0, double price = -1.0, double triggerPrice = -1.0, double trailOffset = -1.0) - { - if (order == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ModifyOrderRequestParameters modifyOrderRequestParameters = new ModifyOrderRequestParameters(order); - if (timeInForce != TimeInForce.Default) - { - modifyOrderRequestParameters.TimeInForce = timeInForce; - } - if (quantity > 0.0) - { - modifyOrderRequestParameters.Quantity = quantity; - } - if (price > 0.0) - { - modifyOrderRequestParameters.Price = price; - } - if (triggerPrice > 0.0) - { - modifyOrderRequestParameters.TriggerPrice = triggerPrice; - } - if (trailOffset > 0.0) - { - modifyOrderRequestParameters.TrailOffset = trailOffset; - } - return ModifyOrder(modifyOrderRequestParameters); - } - - /// - /// Modifies by given request parameters - /// - /// - /// - public TradingOperationResult ModifyOrder(ModifyOrderRequestParameters request) - { - if (request == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (LocalOrders.TryHandleTradingOperationRequest(request, out var result)) - { - return result; - } - Connection connection = Connections.All.FirstOrDefault((Connection P_0) => P_0.Id == request.ConnectionId); - if (connection == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (!?(connection, request.RequestId, out result)) - { - return result; - } - return connection.?(request); - } - - public TradingOperationResult ClosePosition(Position position, double closeQuantity = -1.0) - { - if (position == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ClosePositionRequestParameters request = new ClosePositionRequestParameters - { - Position = position, - CloseQuantity = ((closeQuantity > 0.0) ? closeQuantity : position.Quantity) - }; - return ClosePosition(request); - } - - /// - /// Closes with given request parameters - /// - /// - /// - public TradingOperationResult ClosePosition(ClosePositionRequestParameters request) - { - if (request == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - Connection connection = Connections.All.FirstOrDefault((Connection P_0) => P_0.Id == request.ConnectionId); - if (connection == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (!?(Connections[request.ConnectionId], request.RequestId, out var result)) - { - return result; - } - return connection.?(request); - } - - [Obsolete("Use CancelOrder(IOrder order) instead")] - public TradingOperationResult CancelOrder(Order order, string sendingSource = null) - { - if (order == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - CancelOrderRequestParameters request = new CancelOrderRequestParameters - { - Order = order, - SendingSource = sendingSource - }; - return CancelOrder(request); - } - - public TradingOperationResult CancelOrder(IOrder order, string sendingSource = null) - { - if (order == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - CancelOrderRequestParameters request = new CancelOrderRequestParameters - { - Order = order, - SendingSource = sendingSource - }; - return CancelOrder(request); - } - - /// - /// Cancels with given request parameters - /// - /// - /// - public TradingOperationResult CancelOrder(CancelOrderRequestParameters request) - { - if (request == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (LocalOrders.TryHandleTradingOperationRequest(request, out var result)) - { - return result; - } - Connection connection = Connections.All.FirstOrDefault((Connection P_0) => P_0.Id == request.ConnectionId); - if (connection == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (!?(connection, request.RequestId, out result)) - { - return result; - } - return connection.?(request); - } - - /// - /// Returns with given request parameters from open connection - /// - /// - /// - public Report GetReport(ReportRequestParameters requestParameters) - { - Connection connection = requestParameters.ReportType.Connection; - if (connection == null) - { - Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Error); - return null; - } - if (!connection.Connected) - { - Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Error); - return null; - } - return connection.?(requestParameters); - } - - internal void ?(DeliveredAsset P_0) - { - ??.InvokeSafely(P_0); - } - - internal void ?(DeliveredAsset P_0) - { - ??.InvokeSafely(P_0); - } - - internal void ?(DealTicket P_0) - { - ??.InvokeSafely(P_0); - } - - [NotPublished] - public void PushDealTicket(string header, string description, DealTicketType type) - { - ??.InvokeSafely(new DealTicket(header, description, type)); - } - - [NotPublished] - public void PushDealTicket(DealTicket dealTicket) - { - ??.InvokeSafely(dealTicket); - } - - /// - /// Sends custom request if connection with given Id is open - /// - /// - /// - public void SendCustomRequest(string connectionId, RequestParameters parameters) - { - Connections.Connected.FirstOrDefault((Connection P_0) => P_0.Id == connectionId)?.SendCustomRequest(parameters); - } - - /// - /// Subscribe on custom messages - /// - /// custom message handler - /// custom messages Id - public void SubscribeToCustomMessages(Action handler, params int[] messagesTypes) - { - CustomMessageProcessor.?(handler, messagesTypes); - } - - /// - /// Unsubscribe from custom messages - /// - /// custom message handler - /// custom messages Id - public void UnsubscribeFromCustomMessages(Action handler, params int[] messagesTypes) - { - CustomMessageProcessor.?(handler, messagesTypes); - } - - /// - /// Adds if given parameters are valid - /// - /// - /// - [NotPublished] - public void AddSymbolList(string symbolsListName, IEnumerable symbols) - { - if (string.IsNullOrEmpty(symbolsListName)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (symbols == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - SymbolListManager.?(symbolsListName, symbols); - } - - /// - /// Replaces exist list by new list in if given parameters are valid - /// - /// - /// - [NotPublished] - public void ReplaceSymbolList(string symbolsListName, IList symbols) - { - if (string.IsNullOrEmpty(symbolsListName)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (symbols == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - SymbolListManager.?(symbolsListName, symbols); - } - - /// - /// Removes with a given name - /// - /// - [NotPublished] - public void RemoveSymbolList(string symbolsListName) - { - if (string.IsNullOrEmpty(symbolsListName)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - SymbolListManager.?(symbolsListName); - } - - /// - /// Replaces list name by new given name in if given parameters are valid - /// - /// - /// - [NotPublished] - public void RenameSymbolList(string symbolsListName, string newSymbolsListName) - { - if (string.IsNullOrEmpty(symbolsListName)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (string.IsNullOrEmpty(newSymbolsListName)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - SymbolListManager.?(symbolsListName, newSymbolsListName); - } - - [NotPublished] - public void AddHistoricalSymbol(HistoricalSymbol historicalSymbol) - { - if (!??.Contains(historicalSymbol) && !??.Any((HistoricalSymbol P_0) => P_0.Id == historicalSymbol.Id)) - { - ??.Add(historicalSymbol); - historicalSymbol.Updated += ?; - ??.InvokeSafely(historicalSymbol); - } - } - - [NotPublished] - public void RemoveHistoricalSymbol(HistoricalSymbol historicalSymbol) - { - if (??.Contains(historicalSymbol)) - { - ??.Remove(historicalSymbol); - historicalSymbol.Updated -= ?; - ??.InvokeSafely(historicalSymbol); - historicalSymbol.Dispose(); - } - } - - private void ?(Symbol P_0) - { - if (P_0 is HistoricalSymbol historicalSymbol) - { - ??.InvokeSafely(historicalSymbol); - } - } - - /// - /// Adds given Synthetic to the list if it does not contain - /// - /// - [NotPublished] - public void AddSynthetic(Synthetic synthetic) - { - if (!Synthetics.Contains(synthetic)) - { - Synthetics.Add(synthetic); - synthetic.Reinitialized += ?; - ??.InvokeSafely(synthetic); - } - } - - private void ?(Synthetic P_0) - { - ??.InvokeSafely(P_0); - } - - /// - /// Removes given Synthetic from the list if it exists - /// - /// - [NotPublished] - public void RemoveSynthetic(Synthetic synthetic) - { - if (Synthetics.Contains(synthetic)) - { - Synthetics.Remove(synthetic); - synthetic.Reinitialized -= ?; - ??.InvokeSafely(synthetic); - synthetic.Dispose(); - } - } - - internal void ?(TradingSignal P_0, EntityLifecycle P_1) - { - ??.InvokeSafely(this, new TradingSignalEventArgs - { - TradingSignal = P_0, - Lifecycle = P_1 - }); - } - - public void Alert(string text, string symbolName, string connectionName, Action onConfirm, string alertName) - { - Alert(new Alert - { - Text = text, - SymbolName = symbolName, - ConnectionName = connectionName, - ActionOnConfirm = onConfirm, - Name = alertName - }); - } - - public void Alert(string text, string symbolName = "", string connectionName = "", Action onConfirm = null) - { - Alert(text, symbolName, connectionName, onConfirm, null); - } - - public void Alert(Alert alert) - { - ??.InvokeSafely(alert); - } - - public void RequestOTP(OTPHolder otpHolder, string title, string text) - { - ??.InvokeSafely(otpHolder, title, text); - } - - [SpecialName] - [CompilerGenerated] - internal void ?(Action P_0) - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value = (Action)Delegate.Combine(action2, P_0); - action = Interlocked.CompareExchange(ref ??, value, action2); - } - while ((object)action != action2); - } - - [SpecialName] - [CompilerGenerated] - internal void ?(Action P_0) - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value = (Action)Delegate.Remove(action2, P_0); - action = Interlocked.CompareExchange(ref ??, value, action2); - } - while ((object)action != action2); - } - - private void ?() - { - if (?? == null) - { - ?? = new Timer(?); - ??.Change(100, 100); - } - } - - private void ?(object P_0) - { - try - { - ?(); - ??.InvokeSafely(); - TradingProtection.?(); - } - catch (Exception ex) - { - Loggers.Log(ex); - } - } - - private void ?() - { - Position[] positions = Positions; - foreach (Position position in positions) - { - try - { - PnL pnL = CalculatePnL(new PnLRequestParameters - { - Symbol = position.Symbol, - Account = position.Account, - OpenPrice = position.OpenPrice, - ClosePrice = position.CurrentPrice, - Side = position.Side, - Quantity = position.Quantity, - PositionId = position.Id - }); - if (pnL != null) - { - position.?(pnL); - } - } - catch (Exception ex) - { - Instance.Loggers.Log(ex); - } - } - ClosedPosition[] closedPositions = ClosedPositions; - foreach (ClosedPosition closedPosition in closedPositions) - { - try - { - if (closedPosition.GrossPnL != null) - { - continue; - } - PnL pnL2 = CalculatePnL(new PnLRequestParameters - { - Symbol = closedPosition.Symbol, - Account = closedPosition.Account, - OpenPrice = closedPosition.OpenPrice, - ClosePrice = closedPosition.CurrentPrice, - Side = closedPosition.Side, - Quantity = 0.0, - PositionId = closedPosition.Id - }); - if (pnL2 != null) - { - closedPosition.?(pnL2); - ClosedPosition closedPosition2 = closedPosition; - if (closedPosition2.GrossPnL == null) - { - PnLItem pnLItem = (closedPosition2.GrossPnL = new PnLItem()); - } - } - } - catch (Exception ex2) - { - Instance.Loggers.Log(ex2); - } - } - } - - public void InitializeBrandingInformation() - { - IBrandingInformation brandingInformation = new ?(); - try - { - TypeWrapper typeWrapper = AssemblyLoader.LoadTypes(string.Empty, typeof(IBrandingInformation), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).FirstOrDefault(); - if (typeWrapper != null) - { - IBrandingInformation brandingInformation2 = (IBrandingInformation)Activator.CreateInstance(typeWrapper); - if (brandingInformation2 != null) - { - brandingInformation = brandingInformation2; - } - } - } - catch (Exception ex) - { - Instance.Loggers.Log(ex); - } - BrandingInformation = brandingInformation; - } - - public void ForceTimeSync() - { - TimeUtils.TimeSynchronizer.?(); - } - - private bool ?(Connection P_0, long P_1, out TradingOperationResult P_2) - { - P_2 = null; - bool flag; - if (P_0 != null) - { - string vendorName = P_0.VendorName; - if (vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - flag = true; - goto IL_003a; - } - } - flag = false; - goto IL_003a; - IL_003a: - if (flag) - { - return true; - } - if (TradingProtection.IsOperationAllowed()) - { - return true; - } - string text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - PushDealTicket(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), text, DealTicketType.Refuse); - Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), text, LoggingLevel.Error); - P_2 = TradingOperationResult.CreateError(P_1, text); - return false; - } - - private bool ?(Connection P_0, long P_1, out TradingOperationResult P_2) - { - P_2 = null; - bool flag; - if (P_0 != null) - { - string vendorName = P_0.VendorName; - if (vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - flag = true; - goto IL_003a; - } - } - flag = false; - goto IL_003a; - IL_003a: - if (flag) - { - return true; - } - if (!Instance.Connections.Connected.Any(delegate(Connection connection) - { - if (connection != null) - { - string vendorName2 = connection.VendorName; - if (vendorName2 == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName2 == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName2 == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - return true; - } - } - return false; - })) - { - return true; - } - bool flag2 = false; - if (?? != null) - { - flag2 = ??(Instance.Connections.Connected.FirstOrDefault(delegate(Connection connection) - { - if (connection != null) - { - string vendorName2 = connection.VendorName; - if (vendorName2 == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName2 == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName2 == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - return true; - } - } - return false; - }).Name, P_0.Name); - } - if (flag2) - { - return true; - } - string text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - PushDealTicket(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), text, DealTicketType.Refuse); - Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), text, LoggingLevel.Error); - P_2 = TradingOperationResult.CreateError(P_1, text); - return false; - } - - internal void ?(RequestParameters P_0, object P_1) - { - ???.InvokeSafely(this, new PerformedRequestEventArgs(P_0, P_1)); - } - - internal void ?(Connection P_0, RequestEventArgs P_1) - { - ???.InvokeSafely(P_0, P_1); - } - } - public class CustomHoliday : ICustomizable - { - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private DateTime ??; - - public bool IsActive - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DateTime Date - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IList Settings - { - get - { - return new List - { - new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsActive), - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name), - new SettingItemDateTime(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Date) - }; - } - set - { - IsActive = value.GetValueOrDefault(IsActive, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - Name = value.GetValueOrDefault(Name, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - Date = value.GetValueOrDefault(Date, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - } - public class CustomSession : ISession, ICustomizable - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal string ?(DayOfWeek P_0) - { - return P_0.ToString(); - } - } - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private SessionType ??; - - [CompilerGenerated] - private TimeSpan ??; - - [CompilerGenerated] - private TimeSpan ??; - - [CompilerGenerated] - private TimeSpan ??; - - [CompilerGenerated] - private TimeSpan ??; - - private bool ??; - - [CompilerGenerated] - private DayOfWeek[] ??; - - [CompilerGenerated] - private bool ??; - - public bool IsActive - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SessionType Type - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public TimeSpan OpenTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = timeSpan; - } - } - - public TimeSpan CloseTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = timeSpan; - } - } - - public TimeSpan OpenOffset - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public TimeSpan CloseOffset - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DayOfWeek[] Days - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool IsPrimary - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IList Settings - { - get - { - return new List - { - new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsActive), - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name), - new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)Type), - new SettingItemLong(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OpenOffset.Ticks), - new SettingItemLong(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CloseOffset.Ticks), - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), string.Join(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Days.Select((DayOfWeek P_0) => P_0.ToString()))) - }; - } - set - { - IsActive = value.GetValueOrDefault(IsActive, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - Name = value.GetValueOrDefault(Name, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - Type = (SessionType)value.GetValueOrDefault((int)Type, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (value.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value2)) - { - OpenOffset = TimeSpan.FromTicks(value2); - if (value.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value3)) - { - CloseOffset = TimeSpan.FromTicks(value3); - } - } - else - { - ?? = true; - if (value.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value4)) - { - OpenTime = TimeSpan.FromTicks(value4); - } - if (value.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value5)) - { - CloseTime = TimeSpan.FromTicks(value5); - } - } - if (!value.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value6)) - { - return; - } - string[] array = value6.Split(new string[1] { 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() }, StringSplitOptions.RemoveEmptyEntries); - List list = new List(); - string[] array2 = array; - for (int i = 0; i < array2.Length; i++) - { - if (Enum.TryParse(array2[i], ignoreCase: true, out var result)) - { - list.Add(result); - } - } - Days = list.ToArray(); - } - } - - public void RecalculateOpenCloseTime(TimeZoneInfo timeZoneInfo) - { - if (??) - { - OpenOffset = OpenTime.ConvertTimeZone(TimeZoneInfo.Utc, timeZoneInfo); - CloseOffset = CloseTime.ConvertTimeZone(TimeZoneInfo.Utc, timeZoneInfo); - } - else - { - OpenTime = OpenOffset.ConvertTimeZone(timeZoneInfo, TimeZoneInfo.Utc); - CloseTime = CloseOffset.ConvertTimeZone(timeZoneInfo, TimeZoneInfo.Utc); - } - } - } - public class CustomSessionEventArgs : EntityLifecycleEventArgs - { - [CompilerGenerated] - private readonly CustomSessionsAssignment ??; - - [CompilerGenerated] - private readonly CustomSessionsContainer ??; - - public CustomSessionsAssignment Assignment - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public CustomSessionsContainer Container - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - } - public sealed class CustomSessionsAssignment : IUniqueID, ICustomizable, IEquatable - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - public IList Settings - { - get - { - return new List - { - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), UniqueId), - new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsActive), - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ConnectionId), - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExchangeId), - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SymbolId), - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CustomSessionsContainerId) - }; - } - set - { - UniqueId = value.GetValueOrDefault(UniqueId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - IsActive = value.GetValueOrDefault(IsActive, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - ConnectionId = value.GetValueOrDefault(ConnectionId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - ExchangeId = value.GetValueOrDefault(ExchangeId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - SymbolId = value.GetValueOrDefault(SymbolId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - CustomSessionsContainerId = value.GetValueOrDefault(CustomSessionsContainerId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public string UniqueId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public bool IsActive - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string ConnectionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public string ExchangeId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public string SymbolId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public string CustomSessionsContainerId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - public ExchangeComplexIdentifier ExchangeComplexId => new ExchangeComplexIdentifier(ConnectionId, ExchangeId); - - public SymbolComplexIdentifier SymbolComplexId => new SymbolComplexIdentifier(ConnectionId, ExchangeId, SymbolId); - - public Connection Connection => Core.Instance.Connections[ConnectionId]; - - public Exchange Exchange => Core.Instance.Exchanges.FirstOrDefault(delegate(Exchange P_0) - { - ExchangeComplexIdentifier complexId = P_0.ComplexId; - ExchangeComplexIdentifier? obj = this?.ExchangeComplexId; - return complexId == obj; - }); - - public Symbol Symbol - { - get - { - try - { - if (string.IsNullOrEmpty(SymbolId)) - { - return null; - } - return Core.Instance.GetSymbol(new GetSymbolRequestParameters - { - SymbolId = SymbolId - }, ConnectionId); - } - catch - { - return null; - } - } - } - - public CustomSessionsContainer SessionsContainer => Core.Instance.CustomSessions[CustomSessionsContainerId]; - - public CustomSessionsAssignment(string containerId, string connectionId = null, string exchangeId = null, string symbolId = null) - : this() - { - IsActive = true; - CustomSessionsContainerId = containerId; - ConnectionId = connectionId; - ExchangeId = exchangeId; - SymbolId = symbolId; - } - - public CustomSessionsAssignment(CustomSessionsAssignment origin) - : this() - { - IsActive = origin.IsActive; - ConnectionId = origin.ConnectionId; - ExchangeId = origin.ExchangeId; - SymbolId = origin.SymbolId; - CustomSessionsContainerId = origin.CustomSessionsContainerId; - } - - internal CustomSessionsAssignment() - { - UniqueId = Guid.NewGuid().ToShortString(); - } - - internal void ?(CustomSessionsAssignment P_0) - { - IsActive = P_0.IsActive; - ConnectionId = P_0.ConnectionId; - ExchangeId = P_0.ExchangeId; - SymbolId = P_0.SymbolId; - CustomSessionsContainerId = P_0.CustomSessionsContainerId; - } - - public bool Equals(CustomSessionsAssignment other) - { - if (other == null) - { - return false; - } - if (this == other) - { - return true; - } - if (ConnectionId == other.ConnectionId && ExchangeId == other.ExchangeId && SymbolId == other.SymbolId) - { - return CustomSessionsContainerId == other.CustomSessionsContainerId; - } - return false; - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - if (this == obj) - { - return true; - } - if (obj.GetType() != GetType()) - { - return false; - } - return Equals((CustomSessionsAssignment)obj); - } - - public override int GetHashCode() - { - return (((((((ConnectionId != null) ? ConnectionId.GetHashCode() : 0) * 397) ^ ((ExchangeId != null) ? ExchangeId.GetHashCode() : 0)) * 397) ^ ((SymbolId != null) ? SymbolId.GetHashCode() : 0)) * 397) ^ ((CustomSessionsContainerId != null) ? CustomSessionsContainerId.GetHashCode() : 0); - } - - [CompilerGenerated] - private bool ?(Exchange P_0) - { - ExchangeComplexIdentifier complexId = P_0.ComplexId; - ExchangeComplexIdentifier? obj = this?.ExchangeComplexId; - return complexId == obj; - } - } - public class CustomSessionsAssignmentManager : IEnumerable, IEnumerable, ICustomizable - { - private class ? : IComparer - { - public int Compare(CustomSessionsAssignment x, CustomSessionsAssignment y) - { - if (x == null && y != null) - { - return 1; - } - if (x != null && y == null) - { - return -1; - } - if (x == y) - { - return 0; - } - if (!string.IsNullOrEmpty(x.SymbolId)) - { - return -1; - } - if (!string.IsNullOrEmpty(y.SymbolId)) - { - return 1; - } - if (!string.IsNullOrEmpty(x.ExchangeId)) - { - return -1; - } - if (!string.IsNullOrEmpty(y.ExchangeId)) - { - return 1; - } - return 0; - } - } - - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal SettingItemGroup ?(CustomSessionsAssignment P_0) - { - return new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Settings); - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - internal bool ?(CustomSessionsAssignment P_0) - { - if (P_0.IsActive) - { - if (!(P_0.SymbolComplexId == ??.ComplexId)) - { - if (string.IsNullOrEmpty(P_0.SymbolId)) - { - ExchangeComplexIdentifier exchangeComplexId = P_0.ExchangeComplexId; - ExchangeComplexIdentifier? obj = ??.Exchange?.ComplexId; - if (exchangeComplexId == obj) - { - goto IL_00ab; - } - } - if (!string.IsNullOrEmpty(P_0.ExchangeId) || !(P_0.ConnectionId == ??.ConnectionId)) - { - return string.IsNullOrEmpty(P_0.ConnectionId); - } - } - goto IL_00ab; - } - return false; - IL_00ab: - return true; - } - } - - [CompilerGenerated] - private EventHandler ??; - - private readonly IDictionary ??; - - private readonly ? ??; - - public IList Settings - { - get - { - return this.Select((CustomSessionsAssignment P_0) => new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Settings)).Cast().ToList(); - } - set - { - foreach (SettingItem item in value) - { - if (item.Value is IList settings) - { - CustomSessionsAssignment assignment = new CustomSessionsAssignment - { - Settings = settings - }; - Add(assignment); - } - } - } - } - - public event EventHandler Updated - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - public CustomSessionsAssignmentManager() - { - ?? = new Dictionary(); - ?? = new ?(); - } - - public void Add(CustomSessionsAssignment assignment) - { - ??.Add(assignment.UniqueId, assignment); - ?(assignment, EntityLifecycle.Created); - } - - public void Edit(string assignmentId, CustomSessionsAssignment newAssignment) - { - if (??.TryGetValue(assignmentId, out var value)) - { - value.?(newAssignment); - ?(value, EntityLifecycle.Changed); - } - } - - public void Delete(string assignmentId) - { - if (??.TryGetValue(assignmentId, out var value)) - { - ??.Remove(assignmentId); - ?(value, EntityLifecycle.Removed); - } - } - - public bool TryGetSessionsContainer(Symbol symbol, out CustomSessionsContainer container) - { - container = null; - List list = this.ToList(); - list.Sort(??); - container = list.FirstOrDefault(delegate(CustomSessionsAssignment P_0) - { - if (!P_0.IsActive) - { - return false; - } - if (!(P_0.SymbolComplexId == symbol.ComplexId)) - { - if (string.IsNullOrEmpty(P_0.SymbolId)) - { - ExchangeComplexIdentifier exchangeComplexId = P_0.ExchangeComplexId; - ExchangeComplexIdentifier? obj = symbol.Exchange?.ComplexId; - if (exchangeComplexId == obj) - { - goto IL_00ab; - } - } - if (!string.IsNullOrEmpty(P_0.ExchangeId) || !(P_0.ConnectionId == symbol.ConnectionId)) - { - return string.IsNullOrEmpty(P_0.ConnectionId); - } - } - goto IL_00ab; - IL_00ab: - return true; - })?.SessionsContainer; - return container != null; - } - - private void ?(CustomSessionsAssignment P_0, EntityLifecycle P_1) - { - ???.InvokeSafely(this, new CustomSessionEventArgs - { - Assignment = P_0, - Lifecycle = P_1 - }); - } - - public IEnumerator GetEnumerator() - { - return ??.Values.GetEnumerator(); - } - - private IEnumerator ?() - { - return GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(); - } - } - public class CustomSessionsContainer : ISessionsContainer, ICustomizable, IComparable, IComparable, IMessageBuilder - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func, SessionsSet> ??; - - internal bool ?(CustomSession P_0) - { - return P_0.IsActive; - } - - internal SettingItemGroup ?(CustomSession P_0) - { - return new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Settings); - } - - internal SettingItemGroup ?(CustomHoliday P_0) - { - return new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Settings); - } - - internal HolidayInfo ?(CustomHoliday P_0) - { - return new HolidayInfo - { - Name = P_0.Name, - Date = P_0.Date - }; - } - - internal int ?(CustomSession P_0) - { - return ((IStructuralEquatable)P_0.Days.Select((DayOfWeek result) => (int)result).ToArray()).GetHashCode((IEqualityComparer)EqualityComparer.Default); - } - - internal int ?(DayOfWeek P_0) - { - return (int)P_0; - } - - internal SessionsSet ?(IGrouping P_0) - { - return new SessionsSet - { - Days = P_0.FirstOrDefault().Days, - Sessions = P_0.Select((CustomSession customSession) => new Session(customSession.Name, customSession.OpenTime, customSession.CloseTime, customSession.Type)).ToArray() - }; - } - - internal Session ?(CustomSession P_0) - { - return new Session(P_0.Name, P_0.OpenTime, P_0.CloseTime, P_0.Type); - } - } - - [CompilerGenerated] - private sealed class ? - { - public DateTime ??; - - public DayOfWeek ??; - - internal bool ?(CustomHoliday P_0) - { - return P_0.Date.Date == ??.Date; - } - - internal bool ?(CustomSession P_0) - { - if (P_0.IsActive) - { - return P_0.Days.Contains(??); - } - return false; - } - } - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private TimeZone ??; - - [CompilerGenerated] - private CustomSession[] ??; - - [CompilerGenerated] - private CustomHoliday[] ??; - - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public TimeZone TimeZone - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = timeZone; - } - } - - public CustomSession[] Sessions - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = array; - } - } - - public ISession[] ActiveSessions => Sessions.Where((CustomSession P_0) => P_0.IsActive).Cast().ToArray(); - - public CustomHoliday[] Holidays - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = array; - } - } - - TimeZoneInfo ISessionsContainer.TimeZone - { - get - { - if (!TimeZone.IsEmpty) - { - return TimeZone.TimeZoneInfo; - } - return null; - } - } - - public IList Settings - { - get - { - List list = new List(); - list.AddRange(new SettingItem[4] - { - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id), - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name), - new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new List - { - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TimeZone.TimeZoneInfo.Id), - new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)TimeZone.Type) - }), - new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Sessions.Select((CustomSession P_0) => new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Settings)).Cast().ToList()) - }); - if (Holidays != null) - { - list.Add(new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Holidays?.Select((CustomHoliday P_0) => new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Settings)).Cast().ToList())); - } - return list; - } - set - { - Id = value.GetValueOrDefault(Id, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - Name = value.GetValueOrDefault(Name, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (value.TryGetValue>(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value2)) - { - TimeZoneType value3 = value2.GetValue(new string[1] { 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() }); - TimeZoneInfo timeZoneInfo = null; - if (value3 != TimeZoneType.Local) - { - timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(value2.GetValue(new string[1] { 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() })); - } - TimeZone = new TimeZone(value3, timeZoneInfo); - } - if (value.TryGetValue>(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value4)) - { - List list = new List(); - foreach (SettingItem item2 in value4) - { - if (item2.Value is IList settings) - { - CustomSession customSession = new CustomSession - { - Settings = settings - }; - customSession.RecalculateOpenCloseTime(TimeZone.TimeZoneInfo); - list.Add(customSession); - } - } - Sessions = list.ToArray(); - } - if (!value.TryGetValue>(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value5)) - { - return; - } - List list2 = new List(); - foreach (SettingItem item3 in value5) - { - if (item3.Value is IList settings2) - { - CustomHoliday item = new CustomHoliday - { - Settings = settings2 - }; - list2.Add(item); - } - } - Holidays = list2.ToArray(); - } - } - - internal CustomSessionsContainer() - { - } - - public CustomSessionsContainer(string name, TimeZone? timeZone = null, CustomSession[] sessions = null, CustomHoliday[] holidays = null) - { - Id = Guid.NewGuid().ToShortString(); - Name = name; - TimeZone = timeZone ?? Core.Instance.TimeUtils.SelectedTimeZone; - Sessions = sessions ?? Array.Empty(); - Holidays = holidays ?? Array.Empty(); - } - - internal void ?(CustomSessionsContainer P_0) - { - Name = P_0.Name; - TimeZone = P_0.TimeZone; - Sessions = P_0.Sessions ?? Array.Empty(); - Holidays = P_0.Holidays ?? Array.Empty(); - } - - public ISession[] GetSessionsForDate(DateTime dateTime) - { - DateTime ?? = TimeZoneInfo.ConvertTimeFromUtc(dateTime, TimeZone.TimeZoneInfo); - if (Holidays?.FirstOrDefault((CustomHoliday P_0) => P_0.Date.Date == ??.Date) != null) - { - return Array.Empty(); - } - DayOfWeek ?? = ??.DayOfWeek; - return Sessions.Where((CustomSession P_0) => P_0.IsActive && P_0.Days.Contains(??)).Cast().ToArray(); - } - - public int CompareTo(CustomSessionsContainer other) - { - return string.Compare(Name, other.Name, StringComparison.Ordinal); - } - - public int CompareTo(object obj) - { - if (!(obj is CustomSessionsContainer other)) - { - return 0; - } - return CompareTo(other); - } - - public override string ToString() - { - return Name; - } - - public MessageSessionsContainer BuildMessage() - { - return new MessageSessionsContainer - { - Id = Id, - Name = Name, - Description = string.Empty, - Holidays = Holidays?.Select((CustomHoliday P_0) => new HolidayInfo - { - Name = P_0.Name, - Date = P_0.Date - }).ToArray(), - SessionsSets = (from P_0 in Sessions?.GroupBy((CustomSession P_0) => ((IStructuralEquatable)P_0.Days.Select((DayOfWeek result) => (int)result).ToArray()).GetHashCode((IEqualityComparer)EqualityComparer.Default)) - select new SessionsSet - { - Days = P_0.FirstOrDefault().Days, - Sessions = P_0.Select((CustomSession customSession) => new Session(customSession.Name, customSession.OpenTime, customSession.CloseTime, customSession.Type)).ToArray() - }).ToArray() - }; - } - } - public class CustomSessionsManager : IEnumerable, IEnumerable, ICustomizable - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal SettingItemGroup ?(CustomSessionsContainer P_0) - { - return new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Settings); - } - } - - [CompilerGenerated] - private readonly CustomSessionsAssignmentManager ??; - - [CompilerGenerated] - private EventHandler ??; - - private readonly IDictionary ??; - - public CustomSessionsAssignmentManager Assignments - { - [CompilerGenerated] - get - { - return ??; - } - } - - public CustomSessionsContainer this[string id] - { - get - { - if (!string.IsNullOrEmpty(id) && ??.TryGetValue(id, out var value)) - { - return value; - } - return null; - } - } - - public IList Settings - { - get - { - return new List - { - new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), this.Select((CustomSessionsContainer P_0) => new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Settings)).Cast().ToList()), - new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Assignments.Settings) - }; - } - set - { - if (value.TryGetValue>(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value2)) - { - ??.Clear(); - foreach (SettingItem item in value2) - { - if (item.Value is IList settings) - { - CustomSessionsContainer customSessionsContainer = new CustomSessionsContainer - { - Settings = settings - }; - ??.Add(customSessionsContainer.Id, customSessionsContainer); - } - } - } - if (value.TryGetValue>(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value3)) - { - Assignments.Settings = value3; - } - } - } - - public event EventHandler Updated - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - internal CustomSessionsManager() - { - ?? = new CustomSessionsAssignmentManager(); - ?? = new Dictionary(); - } - - public void Add(CustomSessionsContainer container) - { - ??.Add(container.Id, container); - ?(container, EntityLifecycle.Created); - } - - public void Edit(string containerId, CustomSessionsContainer newContainer) - { - if (??.TryGetValue(containerId, out var value)) - { - value.?(newContainer); - ?(value, EntityLifecycle.Changed); - } - } - - public void Delete(string containerId) - { - if (??.TryGetValue(containerId, out var value)) - { - ??.Remove(containerId); - ?(value, EntityLifecycle.Removed); - } - } - - private void ?(CustomSessionsContainer P_0, EntityLifecycle P_1) - { - ???.InvokeSafely(this, new CustomSessionEventArgs - { - Container = P_0, - Lifecycle = P_1 - }); - } - - public IEnumerator GetEnumerator() - { - return ??.Values.GetEnumerator(); - } - - private IEnumerator ?() - { - return GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(); - } - } - public enum TimeScaleType - { - Linear, - NonLinear - } - public enum BarCreationBehavior - { - Realtime, - Deferred - } - [Published] - public abstract class HistoryAggregation : ICustomizable, ICloneable, IComparable, IEquatable - { - public const string TICK = "Tick"; - - public const string TICK_BARS = "Tick bars"; - - public const string TIME = "Time"; - - public const string RENKO = "Renko"; - - public const string HEIKIN_ASHI = "Heikin Ashi"; - - public const string RANGE_BARS = "Range bars"; - - public const string POINTS_AND_FIGURES = "Points & Figures"; - - public const string KAGI = "Kagi"; - - public const string LINE_BREAK = "Line Break"; - - public const string VOLUME = "Volume"; - - public const string REVERSAL = "Reversal"; - - public const string POWER_TRADES = "Power Trades"; - - public const string VWAP = "VWAP"; - - public const string LEVEL2 = "Level2"; - - public const string DOM_BY_TICKS_COUNT = "DOM by ticks count"; - - public const string DOM_BY_TIME = "DOM by time"; - - public const string DOM_AGGREGATED = "Aggregated DOM"; - - public const string DELTA_BARS = "Delta bars"; - - public const string TICK_LAST_AGGREGATED = "Aggregated ticks (Last)"; - - public const string PRICE_CHANGES_COUNT_BARS = "Price changes count bars"; - - public const string TIME_STATISTICS = "Time statistics"; - - public const string VOLUME_PROFILE = "Volume profile"; - - public const string SETTINGS_AGGREGATION_PERIOD = "Period"; - - public const string SETTINGS_AGGREGATION_HISTORY_TYPE = "History type"; - - [CompilerGenerated] - private Type ??; - - private static readonly ListEqualityComparer ?? = new ListEqualityComparer(EqualityComparer.Default); - - public abstract string Name { get; } - - public virtual string Title => Name; - - [NotPublished] - public virtual TimeScaleType TimeScaleType => TimeScaleType.NonLinear; - - [NotPublished] - public virtual BarCreationBehavior BarCreationBehavior => BarCreationBehavior.Realtime; - - public virtual bool IsWaitingFirstQuoteRequired => false; - - public virtual IList Settings - { - get - { - return new List(); - } - set - { - } - } - - internal Type HistoryProcessorType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = type; - } - } - - public virtual Period DefaultRange => Period.DAY1; - - [NotPublished] - [Obsolete("This property is retained for compatibility - will be removed in the future. Use casting to a specific type of aggregation and refer to the properties of the aggregation directly")] - public abstract Period GetPeriod { get; } - - [NotPublished] - [Obsolete("This property is retained for compatibility - will be removed in the future. Use casting to a specific type of aggregation and refer to the properties of the aggregation directly")] - public abstract HistoryType GetHistoryType { get; } - - protected HistoryAggregation() - { - } - - protected HistoryAggregation(HistoryAggregation _) - { - } - - [NotPublished] - public abstract object Clone(); - - [NotPublished] - public int CompareTo(object obj) - { - return (obj as HistoryAggregation).Name.CompareTo(Name); - } - - /// - /// Override to change string representation of aggregation - /// - [NotPublished] - public override string ToString() - { - return Name; - } - - [NotPublished] - public virtual string FormatTime(DateTime dt) - { - return Core.Instance.TimeUtils.GetFormatedDateTime(dt); - } - - public abstract HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata); - - public bool Equals(HistoryAggregation other) - { - if (other == null) - { - return false; - } - if (this == other) - { - return true; - } - if (Name == other.Name) - { - return ??.Equals(Settings, other.Settings); - } - return false; - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - if (this == obj) - { - return true; - } - if (obj.GetType() != GetType()) - { - return false; - } - return Equals((HistoryAggregation)obj); - } - - public override int GetHashCode() - { - return HashCode.Combine(Name, ??.GetHashCode(Settings)); - } - } - [Published] - public interface IHistoryAggregationHistoryTypeSupport - { - HistoryType HistoryType { get; set; } - } - public sealed class HistoryAggregationDeltaBars : HistoryAggregation - { - public const string SETTINGS_AGGREGATION_VOLUME_VALUE = "Delta value"; - - [CompilerGenerated] - private int ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public int DeltaValue - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public override IList Settings - { - get - { - return new List - { - new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), DeltaValue) - { - Minimum = 1, - Increment = 1, - SortIndex = 10 - } - }; - } - set - { - if (value == null) - { - return; - } - foreach (SettingItem item in value) - { - if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - DeltaValue = (int)item.Value; - } - } - } - } - - public override Period GetPeriod => Period.TICK1; - - public override HistoryType GetHistoryType => HistoryType.Last; - - [NotPublished] - public override Period DefaultRange => Period.HOUR1; - - public HistoryAggregationDeltaBars(int deltaValue) - { - DeltaValue = deltaValue; - } - - private HistoryAggregationDeltaBars(HistoryAggregationDeltaBars P_0) - : base(P_0) - { - DeltaValue = P_0.DeltaValue; - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 2); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(DeltaValue); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - [NotPublished] - public override object Clone() - { - return new HistoryAggregationDeltaBars(this); - } - - [NotPublished] - public override string FormatTime(DateTime dt) - { - return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dt); - } - - public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) - { - return new HistoryAggregationTick(HistoryType.Last); - } - } - public sealed class HistoryAggregationDomAggregated : HistoryAggregation - { - private const string ?? = "Price levels limit"; - - [CompilerGenerated] - private Period ??; - - [CompilerGenerated] - private int ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public Period Period - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = period; - } - } - - public int PriceLevelsLimit - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public override IList Settings - { - get - { - return new List - { - new SettingItemPeriod(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), Period) - { - SortIndex = 10, - Description = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }, - new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), PriceLevelsLimit) - { - SortIndex = 11, - Minimum = 0, - Maximum = 1000 - } - }; - } - set - { - if (value == null) - { - return; - } - foreach (SettingItem item in value) - { - string name = item.Name; - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())) - { - if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - PriceLevelsLimit = (int)item.Value; - } - } - else - { - Period = (Period)item.Value; - } - } - } - } - - [NotPublished] - public override Period GetPeriod => Period; - - [NotPublished] - public override HistoryType GetHistoryType - { - get - { - throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public HistoryAggregationDomAggregated(Period period) - { - Period = period; - } - - protected HistoryAggregationDomAggregated(HistoryAggregationDomAggregated aggregation) - : base(aggregation) - { - Period = aggregation.Period; - PriceLevelsLimit = aggregation.PriceLevelsLimit; - } - - [NotPublished] - public override object Clone() - { - return new HistoryAggregationDomAggregated(this); - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(13, 3); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Period.Format()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(PriceLevelsLimit); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) - { - if (!metadata.AllowedAggregations.Contains(Name)) - { - return null; - } - return this; - } - } - public sealed class HistoryAggregationDomByTime : HistoryAggregation - { - [CompilerGenerated] - private Period ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public Period Period - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = period; - } - } - - public override IList Settings - { - get - { - List list = new List(); - list.Add(new SettingItemPeriod(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), Period) - { - SortIndex = 10, - ExcludedPeriods = new BasePeriod[1], - Description = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }); - return list; - } - set - { - if (value == null) - { - return; - } - foreach (SettingItem item in value) - { - if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) - { - Period = (Period)item.Value; - } - } - } - } - - [NotPublished] - public override Period GetPeriod => Period; - - [NotPublished] - public override HistoryType GetHistoryType - { - get - { - throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public HistoryAggregationDomByTime(Period period) - { - Period = period; - } - - protected HistoryAggregationDomByTime(HistoryAggregationDomByTime aggregation) - : base(aggregation) - { - Period = aggregation.Period; - } - - [NotPublished] - public override object Clone() - { - return new HistoryAggregationDomByTime(this); - } - - [NotPublished] - public override string ToString() - { - return Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Period.Format(); - } - - public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) - { - if (!metadata.AllowedAggregations.Contains(Name)) - { - return null; - } - return this; - } - } - public sealed class HistoryAggregationDomByUpdatesCount : HistoryAggregation - { - private const string ?? = "Ticks count"; - - [CompilerGenerated] - private int ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public int TicksCount - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public override IList Settings - { - get - { - return new List - { - new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TicksCount) - { - Minimum = 1, - Increment = 1, - SortIndex = 10 - } - }; - } - set - { - if (value == null) - { - return; - } - foreach (SettingItem item in value) - { - if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - TicksCount = (int)item.Value; - } - } - } - } - - [NotPublished] - public override Period GetPeriod => new Period(BasePeriod.Tick, TicksCount); - - [NotPublished] - public override HistoryType GetHistoryType - { - get - { - throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public HistoryAggregationDomByUpdatesCount(int ticksCount) - { - TicksCount = ticksCount; - } - - private HistoryAggregationDomByUpdatesCount(HistoryAggregationDomByUpdatesCount P_0) - : base(P_0) - { - TicksCount = P_0.TicksCount; - } - - [NotPublished] - public override object Clone() - { - return new HistoryAggregationDomByUpdatesCount(this); - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 3); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(TicksCount); - defaultInterpolatedStringHandler.AppendFormatted(Period.BasePeriodToShortString(BasePeriod.Tick)); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) - { - if (!metadata.AllowedAggregations.Contains(Name)) - { - return null; - } - return this; - } - } - [Published] - public sealed class HistoryAggregationHeikenAshi : HistoryAggregation, IHistoryAggregationHistoryTypeSupport - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal SelectItem ?(HeikenAshiSource P_0) - { - return new SelectItem(P_0.ToString(), P_0); - } - } - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private HeikenAshiSource ??; - - [CompilerGenerated] - private HistoryType ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public int Value - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public HeikenAshiSource Source - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [NotPublished] - public override TimeScaleType TimeScaleType - { - get - { - HeikenAshiSource source = Source; - if (source == HeikenAshiSource.Tick || source == HeikenAshiSource.Volume) - { - return TimeScaleType.NonLinear; - } - return TimeScaleType.Linear; - } - } - - public HistoryType HistoryType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override IList Settings - { - get - { - List list = (from HeikenAshiSource P_0 in Enum.GetValues(typeof(HeikenAshiSource)) - select new SelectItem(P_0.ToString(), P_0)).ToList(); - List list2 = new List - { - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 5), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 2) - }; - return new List - { - new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Value) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - Minimum = 1 - }, - new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list.FirstOrDefault((SelectItem P_0) => P_0.Value.Equals(Source)), list) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - }, - new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list2.FirstOrDefault((SelectItem P_0) => (int)(object)P_0.Value == (int)HistoryType) ?? list2.FirstOrDefault(), list2) - { - SortIndex = 11 - } - }; - } - set - { - Value = value.GetValueOrDefault(Value, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - Source = value.GetValueOrDefault(Source, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - HistoryType = value.GetValueOrDefault(HistoryType, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - [NotPublished] - public override Period GetPeriod - { - get - { - if (Source != HeikenAshiSource.Volume) - { - return new Period((BasePeriod)Source, Value); - } - return Period.TICK1; - } - } - - [NotPublished] - public override HistoryType GetHistoryType => HistoryType; - - [NotPublished] - public override Period DefaultRange - { - get - { - if (Source == HeikenAshiSource.Volume || Source == HeikenAshiSource.Tick) - { - return Period.HOUR1; - } - if (Source <= HeikenAshiSource.Minute) - { - return Period.DAY1; - } - if (Source <= HeikenAshiSource.Day) - { - return Period.MONTH1; - } - return new Period(BasePeriod.Year, 10); - } - } - - public HistoryAggregationHeikenAshi(HeikenAshiSource source, int value, HistoryType historyType) - { - Source = source; - Value = value; - HistoryType = historyType; - } - - [NotPublished] - public override string FormatTime(DateTime dt) - { - return GetPeriod.Format(dt); - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 3); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Value); - defaultInterpolatedStringHandler.AppendFormatted((Source == HeikenAshiSource.Volume) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() : Period.BasePeriodToShortString((BasePeriod)Source)); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - protected HistoryAggregationHeikenAshi(HistoryAggregationHeikenAshi aggregation) - : base(aggregation) - { - Source = aggregation.Source; - Value = aggregation.Value; - HistoryType = aggregation.HistoryType; - } - - [NotPublished] - public override object Clone() - { - return new HistoryAggregationHeikenAshi(this); - } - - public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) - { - return (Source switch - { - HeikenAshiSource.Volume => new HistoryAggregationVolume(Value), - HeikenAshiSource.Tick => new HistoryAggregationTickBars(Value, HistoryType), - _ => new HistoryAggregationTime(new Period((BasePeriod)Source, Value), HistoryType), - }).GetAggregationToDirectDownload(metadata); - } - - [CompilerGenerated] - private bool ?(SelectItem P_0) - { - return P_0.Value.Equals(Source); - } - - [CompilerGenerated] - private bool ?(SelectItem P_0) - { - return (int)(object)P_0.Value == (int)HistoryType; - } - } - public enum HeikenAshiSource - { - [EnumMember] - Tick, - [EnumMember] - Second, - [EnumMember] - Minute, - [EnumMember] - Hour, - [EnumMember] - Day, - [EnumMember] - Week, - [EnumMember] - Month, - [EnumMember] - Year, - [EnumMember] - Volume - } - [Published] - public sealed class HistoryAggregationKagi : HistoryAggregationTime - { - public const string SETTINGS_AGGREGATION_REVERSAL = "Reversal"; - - [CompilerGenerated] - private int ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public int Reversal - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [NotPublished] - public override TimeScaleType TimeScaleType => TimeScaleType.NonLinear; - - [NotPublished] - public override BarCreationBehavior BarCreationBehavior => BarCreationBehavior.Deferred; - - public override IList Settings - { - get - { - IList settings = base.Settings; - if (settings.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) is SettingItemPeriod settingItemPeriod) - { - settingItemPeriod.ExcludedPeriods = new BasePeriod[2] - { - BasePeriod.Month, - BasePeriod.Year - }; - } - settings.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Reversal) - { - Minimum = 1, - SortIndex = 20 - }); - return settings; - } - set - { - if (value == null) - { - return; - } - base.Settings = value; - foreach (SettingItem item in value) - { - if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - Reversal = (int)item.Value; - } - } - } - } - - public HistoryAggregationKagi(Period period, HistoryType historyType, int reversal) - : base(period, historyType) - { - Reversal = reversal; - } - - private HistoryAggregationKagi(HistoryAggregationKagi P_0) - : base(P_0) - { - Reversal = P_0.Reversal; - } - - public override object Clone() - { - return new HistoryAggregationKagi(this); - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(7, 3); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Reversal); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.Period.Format()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - public sealed class HistoryAggregationLevel2 : HistoryAggregation - { - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - [NotPublished] - public override Period GetPeriod => Period.TICK1; - - [NotPublished] - public override HistoryType GetHistoryType - { - get - { - throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public HistoryAggregationLevel2() - { - } - - public override string FormatTime(DateTime dt) - { - return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dt); - } - - private HistoryAggregationLevel2(HistoryAggregationLevel2 P_0) - : base(P_0) - { - } - - [NotPublished] - public override object Clone() - { - return new HistoryAggregationLevel2(this); - } - - public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) - { - if (!metadata.AllowedAggregations.Contains(Name)) - { - return null; - } - return this; - } - } - [Published] - public sealed class HistoryAggregationLineBreak : HistoryAggregationTime - { - public const string SETTINGS_AGGREGATION_LINE_BREAK = "Line break"; - - [CompilerGenerated] - private int ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public int LineBreak - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [NotPublished] - public override TimeScaleType TimeScaleType => TimeScaleType.NonLinear; - - public override IList Settings - { - get - { - IList settings = base.Settings; - if (settings.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) is SettingItemPeriod settingItemPeriod) - { - settingItemPeriod.ExcludedPeriods = new BasePeriod[2] - { - BasePeriod.Month, - BasePeriod.Year - }; - } - SettingItemInteger item = new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LineBreak) - { - Minimum = 1, - Maximum = 100, - SortIndex = 20 - }; - settings.Add(item); - return settings; - } - set - { - if (value == null) - { - return; - } - base.Settings = value; - foreach (SettingItem item in value) - { - if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - LineBreak = (int)item.Value; - } - } - } - } - - public override Period GetPeriod => base.Period; - - public HistoryAggregationLineBreak(Period period, HistoryType historyType, int lineBreak) - : base(period, historyType) - { - LineBreak = lineBreak; - } - - private HistoryAggregationLineBreak(HistoryAggregationLineBreak P_0) - : base(P_0) - { - LineBreak = P_0.LineBreak; - } - - public override object Clone() - { - return new HistoryAggregationLineBreak(this); - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(11, 3); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(LineBreak); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.Period.Format()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - public sealed class HistoryAggregationManager - { - private const string ? = "HistoryProcessors"; - - private Dictionary ?; - - public HistoryAggregation[] All => ?.Values.ToArray(); - - public HistoryAggregation this[string aggregatorName] - { - get - { - if (?.TryGetValue(aggregatorName, out var value)) - { - return value; - } - return null; - } - } - - internal HistoryAggregationManager() - { - ? = new Dictionary(); - } - - internal void ?() - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), LoggingLevel.Verbose); - List list = AssemblyLoader.LoadTypes(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), typeof(IHistoryProcessor), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), SearchOption.AllDirectories); - if (list == null) - { - return; - } - foreach (TypeWrapper item in list) - { - Type type = item; - try - { - MethodInfo method = type.GetMethod(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), BindingFlags.Static | BindingFlags.Public); - if (method == null) - { - Core.Instance.Loggers.Log(type.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), LoggingLevel.Verbose); - continue; - } - if (!(method.Invoke(null, null) is HistoryAggregation historyAggregation)) - { - Core.Instance.Loggers.Log(type.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), LoggingLevel.Verbose); - continue; - } - if (?.ContainsKey(historyAggregation.Name)) - { - Core.Instance.Loggers.Log(type.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), LoggingLevel.Verbose); - continue; - } - historyAggregation.HistoryProcessorType = type; - ?.Add(historyAggregation.Name, historyAggregation); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), LoggingLevel.Verbose); - } - - public IHistoryProcessor CreateHistoryProcessor(HistoryRequestParameters parameter) - { - if (parameter == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - if (parameter.Aggregation == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - HistoryAggregation historyAggregation = this[parameter.Aggregation.Name]; - if (historyAggregation == null) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + parameter.Aggregation.Name); - } - try - { - IHistoryProcessor obj = Activator.CreateInstance(historyAggregation.HistoryProcessorType) as IHistoryProcessor; - obj?.Initialize(parameter.Copy); - return obj; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - return null; - } - - internal void ?() - { - if (? != null) - { - ?.Clear(); - ? = null; - } - } - } - [Published] - public sealed class HistoryAggregationPointsAndFigures : HistoryAggregationTime - { - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private PointsAndFiguresStyle ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public int BoxSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public int Reversal - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public PointsAndFiguresStyle Style - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = pointsAndFiguresStyle; - } - } - - public override IList Settings - { - get - { - List list = new List(); - SelectItem value = null; - foreach (PointsAndFiguresStyle value2 in Enum.GetValues(typeof(PointsAndFiguresStyle))) - { - SelectItem selectItem = new SelectItem(loc._(value2.GetDescription(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), (int)value2); - list.Add(selectItem); - if (Style == value2) - { - value = selectItem; - } - } - IList settings = base.Settings; - if (settings.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) is SettingItemPeriod settingItemPeriod) - { - settingItemPeriod.ExcludedPeriods = null; - } - settings.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), BoxSize, 10) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - Minimum = 1, - Maximum = int.MaxValue - }); - settings.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Reversal, 20) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - Minimum = 1, - Maximum = int.MaxValue - }); - settings.Add(new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value, list, 30) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - }); - return settings; - } - set - { - base.Settings = value; - SettingItem itemByName = value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (itemByName != null) - { - BoxSize = (int)itemByName.Value; - } - itemByName = value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (itemByName != null) - { - Reversal = (int)itemByName.Value; - } - if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value is SelectItem selectItem) - { - Style = (PointsAndFiguresStyle)(int)(object)selectItem.Value; - } - } - } - - [NotPublished] - public override TimeScaleType TimeScaleType => TimeScaleType.NonLinear; - - [NotPublished] - public override BarCreationBehavior BarCreationBehavior => BarCreationBehavior.Deferred; - - public HistoryAggregationPointsAndFigures(Period period, HistoryType historyType, int boxSize, int reversal, PointsAndFiguresStyle style) - : base(period, historyType) - { - BoxSize = boxSize; - Reversal = reversal; - Style = style; - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(9, 4); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Reversal); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(BoxSize); - defaultInterpolatedStringHandler.AppendFormatted((Style == PointsAndFiguresStyle.Classic) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.Period.Format()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - protected HistoryAggregationPointsAndFigures(HistoryAggregationPointsAndFigures aggregation) - : base(aggregation) - { - BoxSize = aggregation.BoxSize; - Reversal = aggregation.Reversal; - Style = aggregation.Style; - } - - [NotPublished] - public override object Clone() - { - return new HistoryAggregationPointsAndFigures(this); - } - } - public sealed class HistoryAggregationPowerTrades : HistoryAggregation - { - [CompilerGenerated] - private readonly HistoryAggregationPowerTradesParameters ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public HistoryAggregationPowerTradesParameters Parameters - { - [CompilerGenerated] - get - { - return ??; - } - } - - public override Period GetPeriod => Period.TICK1; - - public override HistoryType GetHistoryType => HistoryType.Last; - - [NotPublished] - public override Period DefaultRange => Period.HOUR1; - - public override IList Settings - { - get - { - return Parameters?.Settings ?? new List(); - } - set - { - if (Parameters != null) - { - Parameters.Settings = value; - } - } - } - - public HistoryAggregationPowerTrades() - { - ?? = new HistoryAggregationPowerTradesParameters(); - } - - public HistoryAggregationPowerTrades(HistoryAggregationPowerTradesParameters parameters) - : this() - { - ?? = parameters; - } - - protected HistoryAggregationPowerTrades(HistoryAggregationPowerTrades aggregation) - : base(aggregation) - { - ?? = aggregation.Parameters?.Clone() as HistoryAggregationPowerTradesParameters; - } - - [NotPublished] - public override object Clone() - { - return new HistoryAggregationPowerTrades(this); - } - - public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) - { - return new HistoryAggregationTick(HistoryType.Last); - } - } - public sealed class HistoryAggregationPriceChangesCountBars : HistoryAggregation, IHistoryAggregationHistoryTypeSupport - { - private const string ?? = "Ticks count"; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private HistoryType ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public int PriceChangesCount - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public HistoryType HistoryType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override IList Settings - { - get - { - List list = new List - { - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 5), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0) - }; - return new List - { - new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), PriceChangesCount) - { - Minimum = 1, - Increment = 1, - SortIndex = 10 - }, - new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list.FirstOrDefault((SelectItem P_0) => (int)(object)P_0.Value == (int)HistoryType) ?? list.FirstOrDefault(), list) - { - SortIndex = 11 - } - }; - } - set - { - if (value == null) - { - return; - } - foreach (SettingItem item in value) - { - string name = item.Name; - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - HistoryType = (HistoryType)(int)(object)((SelectItem)item.Value).Value; - } - } - else - { - PriceChangesCount = (int)item.Value; - } - } - } - } - - [NotPublished] - public override Period DefaultRange => Period.HOUR1; - - [NotPublished] - public override Period GetPeriod => Period.TICK1; - - [NotPublished] - public override HistoryType GetHistoryType => HistoryType; - - public HistoryAggregationPriceChangesCountBars(int priceChangesCount, HistoryType historyType) - { - PriceChangesCount = priceChangesCount; - HistoryType = historyType; - } - - public HistoryAggregationPriceChangesCountBars(HistoryAggregationPriceChangesCountBars aggregation) - : base(aggregation) - { - PriceChangesCount = aggregation.PriceChangesCount; - HistoryType = aggregation.HistoryType; - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 3); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(PriceChangesCount); - defaultInterpolatedStringHandler.AppendFormatted(Period.BasePeriodToShortString(BasePeriod.Tick)); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - [NotPublished] - public override string FormatTime(DateTime dt) - { - if (PriceChangesCount <= 1) - { - return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dt); - } - return Core.Instance.TimeUtils.GetFormatedDateTime(dt); - } - - [NotPublished] - public override object Clone() - { - return new HistoryAggregationPriceChangesCountBars(this); - } - - public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) - { - if (!metadata.AllowedAggregations.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - return null; - } - HistoryType value = ((HistoryType == HistoryType.Ask || HistoryType == HistoryType.Bid) ? HistoryType.BidAsk : HistoryType); - if (!metadata.AllowedHistoryTypesHistoryAggregationTick.Contains(value)) - { - return null; - } - return new HistoryAggregationTick(HistoryType); - } - - [CompilerGenerated] - private bool ?(SelectItem P_0) - { - return (int)(object)P_0.Value == (int)HistoryType; - } - } - [Published] - public sealed class HistoryAggregationRangeBars : HistoryAggregation, IHistoryAggregationHistoryTypeSupport - { - public const string SETTINGS_AGGREGATION_RANGE_BARS = "Range bars"; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private HistoryType ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public int RangeBars - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public HistoryType HistoryType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override IList Settings - { - get - { - List list = new List - { - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 5), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 2) - }; - return new List - { - new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), RangeBars) - { - Minimum = 1, - Increment = 1, - SortIndex = 10, - Text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }, - new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list.FirstOrDefault((SelectItem P_0) => (int)(object)P_0.Value == (int)HistoryType) ?? list.FirstOrDefault(), list) - { - SortIndex = 11 - } - }; - } - set - { - if (value == null) - { - return; - } - foreach (SettingItem item in value) - { - string name = item.Name; - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - HistoryType = (HistoryType)(int)(object)((SelectItem)item.Value).Value; - } - } - else - { - RangeBars = (int)item.Value; - } - } - } - } - - public override Period GetPeriod => Period.TICK1; - - [NotPublished] - public override HistoryType GetHistoryType => HistoryType; - - public HistoryAggregationRangeBars(int rangeBars, HistoryType historyType) - { - RangeBars = rangeBars; - HistoryType = historyType; - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 3); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(RangeBars); - defaultInterpolatedStringHandler.AppendFormatted(Period.BasePeriodToShortString(BasePeriod.Tick)); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - private HistoryAggregationRangeBars(HistoryAggregationRangeBars P_0) - : base(P_0) - { - RangeBars = P_0.RangeBars; - HistoryType = P_0.HistoryType; - } - - [NotPublished] - public override object Clone() - { - return new HistoryAggregationRangeBars(this); - } - - [NotPublished] - public override string FormatTime(DateTime dt) - { - return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dt); - } - - public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) - { - HistoryType historyType = ((HistoryType == HistoryType.Ask || HistoryType == HistoryType.Bid) ? HistoryType.BidAsk : HistoryType); - if (!metadata.AllowedHistoryTypesHistoryAggregationTick.Contains(historyType)) - { - return null; - } - return new HistoryAggregationTick(historyType); - } - - [CompilerGenerated] - private bool ?(SelectItem P_0) - { - return (int)(object)P_0.Value == (int)HistoryType; - } - } - [Published] - public sealed class HistoryAggregationRenko : HistoryAggregationTime - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - internal bool ?(SelectItem P_0) - { - return (int)(object)P_0.Value == 2; - } - - internal bool ?(SelectItem P_0) - { - return (int)(object)P_0.Value == 3; - } - } - - public const string SETTINGS_AGGREGATION_RENKO_BRICK_SIZE = "Brick size"; - - public const string SETTINGS_AGGREGATION_RENKO_STYLE = "Style"; - - public const string SETTINGS_AGGREGATION_RENKO_BUILD_CURRENT_BAR = "Build current bar"; - - public const string SETTINGS_AGGREGATION_RENKO_EXTENSION = "Extension, %"; - - public const string SETTINGS_AGGREGATION_RENKO_INVERSION = "Inversion, %"; - - public const string SETTINGS_AGGREGATION_RENKO_SHOW_WICKS = "Show wicks"; - - private const string ?? = "W"; - - private static readonly Dictionary ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private RenkoStyle ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public int BrickSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public RenkoStyle RenkoStyle - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = renkoStyle; - } - } - - public int Extension - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public int Inversion - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public bool ShowWicks - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = flag; - } - } - - public bool BuildCurrentBar - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = flag; - } - } - - private protected override IList SupportedHistoryTypes - { - get - { - IList supportedHistoryTypes = base.SupportedHistoryTypes; - supportedHistoryTypes.Add(HistoryType.BidAsk); - return supportedHistoryTypes; - } - } - - public override IList Settings - { - get - { - List list = new List - { - new SelectItem(RenkoStyle.Classic.ToString(), 0), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 2), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3) - }; - SettingItemRelationVisibility relation = new SettingItemRelationVisibility(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list.FirstOrDefault((SelectItem P_0) => (int)(object)P_0.Value == 2), list.FirstOrDefault((SelectItem P_0) => (int)(object)P_0.Value == 3)); - IList settings = base.Settings; - if (settings.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) is SettingItemPeriod settingItemPeriod) - { - settingItemPeriod.ExcludedPeriods = null; - } - settings.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), BrickSize) - { - SortIndex = 20, - Minimum = 1, - Maximum = int.MaxValue, - Increment = 1 - }); - settings.Add(new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list.GetItemByValue((int)RenkoStyle), list) - { - SortIndex = 30, - Description = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }); - settings.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Extension) - { - Minimum = 1, - Maximum = 1000, - SortIndex = 40, - Relation = relation - }); - settings.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Inversion) - { - Minimum = 1, - Maximum = 1000, - SortIndex = 50, - Relation = relation - }); - settings.Add(new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ShowWicks) - { - SortIndex = 60 - }); - settings.Add(new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), BuildCurrentBar) - { - SortIndex = 70 - }); - return settings; - } - set - { - if (value == null) - { - return; - } - foreach (SettingItem item in value) - { - if (item == null) - { - continue; - } - string name = item.Name; - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - ShowWicks = (bool)item.Value; - } - } - else - { - BuildCurrentBar = (bool)item.Value; - } - } - else - { - Inversion = (int)item.Value; - } - } - else - { - Extension = (int)item.Value; - } - } - else - { - RenkoStyle = (RenkoStyle)(int)(object)((SelectItem)item.Value).Value; - } - } - else - { - BrickSize = (int)item.Value; - } - } - base.Settings = value; - } - } - - [NotPublished] - public override TimeScaleType TimeScaleType => TimeScaleType.NonLinear; - - [NotPublished] - public override BarCreationBehavior BarCreationBehavior => BarCreationBehavior.Deferred; - - static HistoryAggregationRenko() - { - ?? = new Dictionary - { - { - RenkoStyle.Classic, - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }, - { - RenkoStyle.HighLow, - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }, - { - RenkoStyle.AdvancedClassic, - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }, - { - RenkoStyle.AdvancedHighLow, - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - } - }; - } - - public HistoryAggregationRenko(Period period, HistoryType historyType, int brickSize, RenkoStyle renkoStyle, int extension = 100, int inversion = 100, bool showWicks = false, bool buildCurrentBar = true) - : base(period, historyType) - { - BrickSize = brickSize; - RenkoStyle = renkoStyle; - Extension = extension; - Inversion = inversion; - ShowWicks = showWicks; - BuildCurrentBar = buildCurrentBar; - } - - public HistoryAggregation GetBaseAggregation() - { - if (base.Period.BasePeriod == BasePeriod.Tick) - { - if (base.Period.PeriodMultiplier == 1) - { - return new HistoryAggregationTick(base.HistoryType); - } - if (base.Period.PeriodMultiplier > 1) - { - return new HistoryAggregationTickBars(base.Period.PeriodMultiplier, base.HistoryType); - } - } - return new HistoryAggregationTime(base.Period, base.HistoryType); - } - - public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) - { - HistoryAggregation baseAggregation = GetBaseAggregation(); - if (baseAggregation is HistoryAggregationTime && !metadata.AllowedHistoryTypesHistoryAggregationTime.Contains(base.HistoryType)) - { - return null; - } - return baseAggregation.GetAggregationToDirectDownload(metadata); - } - - private HistoryAggregationRenko(HistoryAggregationRenko P_0) - : base(P_0) - { - BrickSize = P_0.BrickSize; - RenkoStyle = P_0.RenkoStyle; - ShowWicks = P_0.ShowWicks; - BuildCurrentBar = P_0.BuildCurrentBar; - Extension = P_0.Extension; - Inversion = P_0.Inversion; - } - - [NotPublished] - public override object Clone() - { - return new HistoryAggregationRenko(this); - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(5, 5); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(BrickSize); - defaultInterpolatedStringHandler.AppendFormatted(??[RenkoStyle]); - defaultInterpolatedStringHandler.AppendFormatted(ShowWicks ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : string.Empty); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.Period.Format()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - public sealed class HistoryAggregationReversal : HistoryAggregation - { - private const string ?? = "Length"; - - private const string ?? = "Reversal Length"; - - private const string ?? = "Calculation Type"; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private HistoryProcessorReversalCalculationType ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override IList Settings - { - get - { - return new List - { - new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Length) - { - Minimum = 0, - Increment = 1, - SortIndex = 10 - }, - new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ReversalLength) - { - Minimum = 1, - Increment = 1, - SortIndex = 10 - }, - new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)CalculationType, new List - { - new SelectItem(loc._(HistoryProcessorReversalCalculationType.PreviousBar.GetDescription(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), 0), - new SelectItem(loc._(HistoryProcessorReversalCalculationType.Independent.GetDescription(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), 1) - }) - { - SortIndex = 10 - } - }; - } - set - { - if (value == null) - { - return; - } - foreach (SettingItem item in value) - { - string name = item.Name; - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - ReversalLength = (int)item.Value; - } - } - else - { - Length = (int)item.Value; - } - } - CalculationType = (HistoryProcessorReversalCalculationType)value.GetValueOrDefault((int)CalculationType, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public int Length - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public int ReversalLength - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public HistoryProcessorReversalCalculationType CalculationType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = historyProcessorReversalCalculationType; - } - } - - public override Period GetPeriod => Period.TICK1; - - public override HistoryType GetHistoryType => HistoryType.Last; - - [NotPublished] - public override Period DefaultRange => Period.HOUR1; - - public HistoryAggregationReversal(int length, int reversalLength, HistoryProcessorReversalCalculationType calculationType) - { - Length = length; - ReversalLength = reversalLength; - CalculationType = calculationType; - } - - private HistoryAggregationReversal(HistoryAggregationReversal P_0) - : base(P_0) - { - Length = P_0.Length; - ReversalLength = P_0.ReversalLength; - CalculationType = P_0.CalculationType; - } - - public HistoryAggregationReversal(int length, int reversalLength) - : this(length, reversalLength, HistoryProcessorReversalCalculationType.PreviousBar) - { - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(9, 4); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Length); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(ReversalLength); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(CalculationType.GetDescription()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - [NotPublished] - public override object Clone() - { - return new HistoryAggregationReversal(this); - } - - [NotPublished] - public override string FormatTime(DateTime dt) - { - return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dt); - } - - public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) - { - return new HistoryAggregationTick(HistoryType.Last); - } - } - [Published] - public sealed class HistoryAggregationTick : HistoryAggregation, IHistoryAggregationHistoryTypeSupport - { - [CompilerGenerated] - private HistoryType ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public HistoryType HistoryType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override IList Settings - { - get - { - List list = new List - { - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 4), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 5) - }; - return new List - { - new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list.FirstOrDefault((SelectItem P_0) => (int)(object)P_0.Value == (int)HistoryType) ?? list.FirstOrDefault(), list) - { - SortIndex = 11 - } - }; - } - set - { - if (value == null) - { - return; - } - foreach (SettingItem item in value) - { - if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - HistoryType = (HistoryType)(int)(object)((SelectItem)item.Value).Value; - } - } - } - } - - [NotPublished] - public override Period DefaultRange => Period.HOUR1; - - [NotPublished] - public override Period GetPeriod => Period.TICK1; - - [NotPublished] - public override HistoryType GetHistoryType => HistoryType; - - public HistoryAggregationTick(HistoryType historyType) - { - HistoryType = historyType; - } - - public HistoryAggregationTick(HistoryAggregationTick aggregation) - : base(aggregation) - { - HistoryType = aggregation.HistoryType; - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 2); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(HistoryType); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - [NotPublished] - public override string FormatTime(DateTime dt) - { - return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dt); - } - - [NotPublished] - public override object Clone() - { - return new HistoryAggregationTick(this); - } - - public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) - { - if (!metadata.AllowedAggregations.Contains(Name)) - { - return null; - } - if (!metadata.AllowedHistoryTypesHistoryAggregationTick.Contains(HistoryType)) - { - return null; - } - return this; - } - - [CompilerGenerated] - private bool ?(SelectItem P_0) - { - return (int)(object)P_0.Value == (int)HistoryType; - } - } - public sealed class HistoryAggregationTickBars : HistoryAggregation, IHistoryAggregationHistoryTypeSupport - { - private const string ?? = "Ticks count"; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private HistoryType ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public int TicksCount - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public HistoryType HistoryType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override bool IsWaitingFirstQuoteRequired => true; - - public override IList Settings - { - get - { - List list = new List - { - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 5), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 2), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 4) - }; - return new List - { - new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TicksCount) - { - Minimum = 1, - Increment = 1, - SortIndex = 10 - }, - new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list.FirstOrDefault((SelectItem P_0) => (int)(object)P_0.Value == (int)HistoryType) ?? list.FirstOrDefault(), list) - { - SortIndex = 11 - } - }; - } - set - { - if (value == null) - { - return; - } - foreach (SettingItem item in value) - { - string name = item.Name; - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - HistoryType = (HistoryType)(int)(object)((SelectItem)item.Value).Value; - } - } - else - { - TicksCount = (int)item.Value; - } - } - } - } - - [NotPublished] - public override Period DefaultRange => Period.HOUR1; - - [NotPublished] - public override Period GetPeriod => new Period(BasePeriod.Tick, TicksCount); - - [NotPublished] - public override HistoryType GetHistoryType => HistoryType; - - public HistoryAggregationTickBars(int ticksCount, HistoryType historyType) - { - TicksCount = ticksCount; - HistoryType = historyType; - } - - public HistoryAggregationTickBars(HistoryAggregationTickBars aggregation) - : base(aggregation) - { - TicksCount = aggregation.TicksCount; - HistoryType = aggregation.HistoryType; - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 3); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(TicksCount); - defaultInterpolatedStringHandler.AppendFormatted(Period.BasePeriodToShortString(BasePeriod.Tick)); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - [NotPublished] - public override string FormatTime(DateTime dt) - { - if (TicksCount <= 1) - { - return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dt); - } - return Core.Instance.TimeUtils.GetFormatedDateTime(dt); - } - - [NotPublished] - public override object Clone() - { - return new HistoryAggregationTickBars(this); - } - - public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) - { - if (metadata.AllowedAggregations.Contains(Name)) - { - return this; - } - HistoryType historyType = HistoryType; - if (!metadata.AllowedHistoryTypesHistoryAggregationTick.Contains(historyType)) - { - return null; - } - return new HistoryAggregationTick(HistoryType); - } - - [CompilerGenerated] - private bool ?(SelectItem P_0) - { - return (int)(object)P_0.Value == (int)HistoryType; - } - } - public sealed class HistoryAggregationTickLastAggregated : HistoryAggregation - { - [CompilerGenerated] - private TimeSpan ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override Period GetPeriod => Period.TICK1; - - public override HistoryType GetHistoryType => HistoryType.Last; - - public TimeSpan TimeDelay - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override IList Settings - { - get - { - return new List - { - new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)TimeDelay.TotalMilliseconds) - { - SortIndex = 10, - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - Minimum = 1 - } - }; - } - set - { - if (value == null) - { - return; - } - foreach (SettingItem item in value) - { - if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - TimeDelay = TimeSpan.FromMilliseconds((int)item.Value); - } - } - } - } - - [NotPublished] - public override Period DefaultRange => Period.HOUR1; - - public HistoryAggregationTickLastAggregated() - { - TimeDelay = TimeSpan.FromMilliseconds(500.0); - } - - public HistoryAggregationTickLastAggregated(HistoryAggregationTickLastAggregated original) - { - TimeDelay = original.TimeDelay; - } - - public override object Clone() - { - return new HistoryAggregationTickLastAggregated(this); - } - - [NotPublished] - public override string FormatTime(DateTime dt) - { - return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dt); - } - - public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) - { - return new HistoryAggregationTick(HistoryType.Last); - } - } - [Published] - public class HistoryAggregationTime : HistoryAggregation, IHistoryAggregationHistoryTypeSupport - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal SelectItem ?(HistoryType P_0) - { - return new SelectItem(P_0.GetDescription(), (int)P_0); - } - } - - [CompilerGenerated] - private Period ??; - - [CompilerGenerated] - private HistoryType ??; - - [CompilerGenerated] - private bool ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public Period Period - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public HistoryType HistoryType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool UsePrevCloseAsOpenPriceBar - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - private protected virtual IList SupportedHistoryTypes => new List - { - HistoryType.Last, - HistoryType.Mark, - HistoryType.Bid, - HistoryType.Ask, - HistoryType.Midpoint - }; - - public override IList Settings - { - get - { - List list = SupportedHistoryTypes.Select((HistoryType P_0) => new SelectItem(P_0.GetDescription(), (int)P_0)).ToList(); - List list2 = new List(); - list2.Add(new SettingItemPeriod(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), Period) - { - SortIndex = 10, - ExcludedPeriods = new BasePeriod[1], - Description = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }); - list2.Add(new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list.FirstOrDefault((SelectItem P_0) => (int)(object)P_0.Value == (int)HistoryType) ?? list.FirstOrDefault(), list) - { - SortIndex = 11 - }); - return list2; - } - set - { - if (value == null) - { - return; - } - foreach (SettingItem item in value) - { - string name = item.Name; - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())) - { - if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - HistoryType = (HistoryType)(int)(object)((SelectItem)item.Value).Value; - } - } - else - { - Period = (Period)item.Value; - } - } - } - } - - [NotPublished] - public override Period GetPeriod => Period; - - [NotPublished] - public override HistoryType GetHistoryType => HistoryType; - - [NotPublished] - public override TimeScaleType TimeScaleType => TimeScaleType.Linear; - - [NotPublished] - public override Period DefaultRange - { - get - { - if (Period.Ticks < 600000000) - { - return Period.DAY1; - } - if (Period.Ticks == 600000000) - { - return new Period(BasePeriod.Day, 3); - } - if (Period.Ticks <= 864000000000L) - { - return Period.MONTH1; - } - return new Period(BasePeriod.Year, 10); - } - } - - public HistoryAggregationTime(Period period, HistoryType historyType) - { - Period = period; - HistoryType = historyType; - } - - [NotPublished] - public override string ToString() - { - return Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Period.Format(); - } - - protected HistoryAggregationTime(HistoryAggregationTime aggregation) - : base(aggregation) - { - Period = aggregation.Period; - HistoryType = aggregation.HistoryType; - } - - [NotPublished] - public override object Clone() - { - return new HistoryAggregationTime(this); - } - - [NotPublished] - public override string FormatTime(DateTime dt) - { - return Period.Format(dt); - } - - public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) - { - if (metadata.AllowedAggregations.Contains(Name) && metadata.AllowedHistoryTypesHistoryAggregationTime.Contains(HistoryType)) - { - if (metadata.AllowedPeriodsHistoryAggregationTime.Contains(Period)) - { - return this; - } - if (metadata.AllowedBasePeriodsHistoryAggregationTime.Contains(Period.BasePeriod)) - { - return new HistoryAggregationTime(Period, HistoryType); - } - Period period = metadata.AllowedPeriodsHistoryAggregationTime.FirstOrDefault((Period P_0) => Period.Ticks % P_0.Ticks == 0); - if (period != default(Period)) - { - return new HistoryAggregationTime(period, HistoryType); - } - } - if (!metadata.AllowedAggregations.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - return null; - } - HistoryType historyType = ((HistoryType == HistoryType.Ask || HistoryType == HistoryType.Bid) ? HistoryType.BidAsk : HistoryType); - if (!metadata.AllowedHistoryTypesHistoryAggregationTick.Contains(historyType)) - { - return null; - } - return new HistoryAggregationTick(historyType); - } - - [CompilerGenerated] - private bool ?(SelectItem P_0) - { - return (int)(object)P_0.Value == (int)HistoryType; - } - - [CompilerGenerated] - private bool ?(Period P_0) - { - return Period.Ticks % P_0.Ticks == 0; - } - } - public sealed class HistoryAggregationTimeStatistics : HistoryAggregation - { - [CompilerGenerated] - private Period ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public Period Period - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = period; - } - } - - public override IList Settings - { - get - { - List list = new List(); - list.Add(new SettingItemPeriod(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), Period) - { - SortIndex = 10, - ExcludedPeriods = new BasePeriod[1], - Description = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }); - return list; - } - set - { - if (value == null) - { - return; - } - foreach (SettingItem item in value) - { - if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) - { - Period = (Period)item.Value; - } - } - } - } - - [NotPublished] - public override Period GetPeriod => Period; - - [NotPublished] - public override HistoryType GetHistoryType => HistoryType.Last; - - public HistoryAggregationTimeStatistics(Period period) - { - Period = period; - } - - protected HistoryAggregationTimeStatistics(HistoryAggregationTimeStatistics aggregation) - : base(aggregation) - { - Period = aggregation.Period; - } - - [NotPublished] - public override object Clone() - { - return new HistoryAggregationTimeStatistics(this); - } - - [NotPublished] - public override string ToString() - { - return Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Period.Format(); - } - - public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) - { - if (metadata.AllowedAggregations.Contains(Name) && (metadata.AllowedBasePeriodsHistoryAggregationTimeStatistics.Contains(Period.BasePeriod) || metadata.AllowedPeriodsHistoryAggregationTimeStatistics.Contains(Period))) - { - return this; - } - if (metadata.AllowedAggregations.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) && (metadata.AllowedBasePeriodsHistoryAggregationTimeStatistics.Contains(Period.BasePeriod) || metadata.AllowedPeriodsHistoryAggregationTimeStatistics.Contains(Period))) - { - return new HistoryAggregationVolumeProfile(Period); - } - if (metadata.AllowedAggregations.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) && metadata.AllowedHistoryTypesHistoryAggregationTick.Contains(HistoryType.Last)) - { - return new HistoryAggregationTick(HistoryType.Last); - } - return null; - } - } - public sealed class HistoryAggregationVolume : HistoryAggregation - { - public const string SETTINGS_AGGREGATION_VOLUME_VALUE = "Volume value"; - - [CompilerGenerated] - private int ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); - - public int VolumeValue - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public override IList Settings - { - get - { - return new List - { - new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), VolumeValue) - { - Minimum = 1, - Increment = 1, - SortIndex = 10 - } - }; - } - set - { - if (value == null) - { - return; - } - foreach (SettingItem item in value) - { - if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - VolumeValue = (int)item.Value; - } - } - } - } - - public override Period GetPeriod => Period.TICK1; - - public override HistoryType GetHistoryType => HistoryType.Last; - - [NotPublished] - public override Period DefaultRange => Period.HOUR1; - - public HistoryAggregationVolume(int volumeValue) - { - VolumeValue = volumeValue; - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 2); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(VolumeValue); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - private HistoryAggregationVolume(HistoryAggregationVolume P_0) - : base(P_0) - { - VolumeValue = P_0.VolumeValue; - } - - [NotPublished] - public override object Clone() - { - return new HistoryAggregationVolume(this); - } - - [NotPublished] - public override string FormatTime(DateTime dt) - { - return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dt); - } - - public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) - { - return new HistoryAggregationTick(HistoryType.Last); - } - } - public sealed class HistoryAggregationVolumeProfile : HistoryAggregation - { - [CompilerGenerated] - private Period ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public Period Period - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = period; - } - } - - public override IList Settings - { - get - { - List list = new List(); - list.Add(new SettingItemPeriod(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), Period) - { - SortIndex = 10, - ExcludedPeriods = new BasePeriod[1], - Description = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }); - return list; - } - set - { - if (value == null) - { - return; - } - foreach (SettingItem item in value) - { - if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) - { - Period = (Period)item.Value; - } - } - } - } - - [NotPublished] - public override Period GetPeriod => Period; - - [NotPublished] - public override HistoryType GetHistoryType => HistoryType.Last; - - public HistoryAggregationVolumeProfile(Period period) - { - Period = period; - } - - protected HistoryAggregationVolumeProfile(HistoryAggregationVolumeProfile aggregation) - : base(aggregation) - { - Period = aggregation.Period; - } - - [NotPublished] - public override object Clone() - { - return new HistoryAggregationVolumeProfile(this); - } - - [NotPublished] - public override string ToString() - { - return Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Period.Format(); - } - - public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) - { - if (metadata.AllowedAggregations.Contains(Name) && metadata.AllowedPeriodsHistoryAggregationTime.Contains(Period)) - { - return this; - } - if (metadata.AllowedAggregations.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) && metadata.AllowedHistoryTypesHistoryAggregationTick.Contains(HistoryType.Last)) - { - return new HistoryAggregationTick(HistoryType.Last); - } - return null; - } - } - public sealed class HistoryAggregationVwap : HistoryAggregation - { - [CompilerGenerated] - private readonly HistoryAggregationVwapParameters ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public HistoryAggregationVwapParameters Parameters - { - [CompilerGenerated] - get - { - return ??; - } - } - - public override TimeScaleType TimeScaleType => Parameters.Aggregation.TimeScaleType; - - public override Period DefaultRange => Period.HOUR1; - - public override Period GetPeriod - { - get - { - if (Parameters.DataType == VwapDataType.Tick) - { - return Period.TICK1; - } - return Parameters.Aggregation.GetPeriod; - } - } - - public override HistoryType GetHistoryType => Parameters.Aggregation.GetHistoryType; - - public override IList Settings - { - get - { - return Parameters?.Settings ?? new List(); - } - set - { - if (Parameters != null) - { - Parameters.Settings = value; - } - } - } - - public HistoryAggregationVwap() - { - ?? = new HistoryAggregationVwapParameters(); - } - - public HistoryAggregationVwap(HistoryAggregationVwapParameters parameters) - : this() - { - ?? = new HistoryAggregationVwapParameters(parameters); - } - - protected HistoryAggregationVwap(HistoryAggregationVwap aggregation) - : base(aggregation) - { - ?? = new HistoryAggregationVwapParameters(aggregation.Parameters); - } - - [NotPublished] - public override object Clone() - { - return new HistoryAggregationVwap(this); - } - - public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) - { - if (Parameters.DataType == VwapDataType.Tick) - { - if (!metadata.AllowedHistoryTypesHistoryAggregationTick.Contains(HistoryType.Last)) - { - return null; - } - return new HistoryAggregationTick(HistoryType.Last); - } - return Parameters.Aggregation.GetAggregationToDirectDownload(metadata); - } - } - public abstract class HistoryProcessor : IHistoryProcessor, IDisposable - { - protected long sessionOffset; - - [CompilerGenerated] - private HistoryEventHandler ??; - - [CompilerGenerated] - private HistoryEventHandler ??; - - public virtual SubscribeQuoteType? GetSubscribeQuoteType => null; - - public event HistoryEventHandler NewHistoryItem - { - [CompilerGenerated] - add - { - HistoryEventHandler historyEventHandler = ??; - HistoryEventHandler historyEventHandler2; - do - { - historyEventHandler2 = historyEventHandler; - HistoryEventHandler value2 = (HistoryEventHandler)Delegate.Combine(historyEventHandler2, value); - historyEventHandler = Interlocked.CompareExchange(ref ??, value2, historyEventHandler2); - } - while ((object)historyEventHandler != historyEventHandler2); - } - [CompilerGenerated] - remove - { - HistoryEventHandler historyEventHandler = ??; - HistoryEventHandler historyEventHandler2; - do - { - historyEventHandler2 = historyEventHandler; - HistoryEventHandler value2 = (HistoryEventHandler)Delegate.Remove(historyEventHandler2, value); - historyEventHandler = Interlocked.CompareExchange(ref ??, value2, historyEventHandler2); - } - while ((object)historyEventHandler != historyEventHandler2); - } - } - - public event HistoryEventHandler HistoryItemUpdated - { - [CompilerGenerated] - add - { - HistoryEventHandler historyEventHandler = ??; - HistoryEventHandler historyEventHandler2; - do - { - historyEventHandler2 = historyEventHandler; - HistoryEventHandler value2 = (HistoryEventHandler)Delegate.Combine(historyEventHandler2, value); - historyEventHandler = Interlocked.CompareExchange(ref ??, value2, historyEventHandler2); - } - while ((object)historyEventHandler != historyEventHandler2); - } - [CompilerGenerated] - remove - { - HistoryEventHandler historyEventHandler = ??; - HistoryEventHandler historyEventHandler2; - do - { - historyEventHandler2 = historyEventHandler; - HistoryEventHandler value2 = (HistoryEventHandler)Delegate.Remove(historyEventHandler2, value); - historyEventHandler = Interlocked.CompareExchange(ref ??, value2, historyEventHandler2); - } - while ((object)historyEventHandler != historyEventHandler2); - } - } - - public HistoryProcessor() - { - } - - public virtual void Initialize(HistoryRequestParameters historyRequestParameters) - { - try - { - if (historyRequestParameters?.SessionsContainer != null) - { - sessionOffset = -historyRequestParameters.SessionsContainer.GetSessionOpenTime(Core.Instance.TimeUtils.SelectedTimeZone); - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - public virtual IList AggregateHistory(HistoryHolder historyHolder) - { - return historyHolder.History; - } - - public virtual void ProcessQuote(MessageQuote messageQuote) - { - } - - public virtual void CorrectHistoryRequestBorders(HistoryRequestParameters historyRequestParameters) - { - } - - public virtual string GetTimeToNextBar() - { - return null; - } - - public virtual void Dispose() - { - } - - protected void OnNewHistoryItem(HistoryEventArgs e) - { - ???.Invoke(this, e); - } - - protected void OnHistoryItemUpdated(HistoryEventArgs e) - { - ???.Invoke(this, e); - } - - public static bool IsDayOpeningNow(long barTime, long currentTime, long sessionOffset) - { - return (barTime + sessionOffset) / 864000000000L != (currentTime + sessionOffset) / 864000000000L; - } - } - public class HistoryProcessorEventArgs : EventArgs - { - [CompilerGenerated] - private UpdateReason ?; - - public new static HistoryProcessorEventArgs Empty => new HistoryProcessorEventArgs(); - - public UpdateReason IndicatorUpdateReason - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = updateReason; - } - } - - public HistoryProcessorEventArgs(UpdateReason updateReason = UpdateReason.Unknown) - { - IndicatorUpdateReason = updateReason; - } - } - public class HistoryProcessorItemUpdatedEventArgs : HistoryProcessorEventArgs - { - [CompilerGenerated] - private int ??; - - public int ItemOffset - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public HistoryProcessorItemUpdatedEventArgs(int itemOffset = 0) - { - ItemOffset = itemOffset; - } - } - public sealed class HistoricalDataCustom : HistoricalData - { - private Indicator ??; - - public double this[PriceType priceType, int offset = 0] - { - get - { - IHistoryItem historyItem = this[offset, SeekOriginHistory.End]; - switch (priceType) - { - case PriceType.Open: - return historyItem[PriceType.Open]; - case PriceType.High: - return historyItem[PriceType.High]; - case PriceType.Low: - return historyItem[PriceType.Low]; - case PriceType.Close: - return historyItem[PriceType.Close]; - default: - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(priceType); - throw new InvalidOperationException(defaultInterpolatedStringHandler.ToStringAndClear()); - } - } - } - set - { - IHistoryItem historyItem = this[offset, SeekOriginHistory.End]; - switch (priceType) - { - case PriceType.Open: - SetValue(value, historyItem[PriceType.High], historyItem[PriceType.Low], historyItem[PriceType.Close], offset); - return; - case PriceType.High: - SetValue(historyItem[PriceType.Open], value, historyItem[PriceType.Low], historyItem[PriceType.Close], offset); - return; - case PriceType.Low: - SetValue(historyItem[PriceType.Open], historyItem[PriceType.High], value, historyItem[PriceType.Close], offset); - return; - case PriceType.Close: - SetValue(historyItem[PriceType.Open], historyItem[PriceType.High], historyItem[PriceType.Low], value, offset); - return; - } - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(priceType); - throw new InvalidOperationException(defaultInterpolatedStringHandler.ToStringAndClear()); - } - } - - public HistoricalDataCustom(Indicator indicator = null) - { - Parameters = new HistoryRequestParameters(); - if (indicator != null) - { - ?? = indicator; - Parameters.Symbol = indicator.HistoricalData.Symbol; - Parameters.Aggregation = indicator.HistoricalData.Aggregation.Clone() as HistoryAggregation; - indicator.?(this); - } - else - { - Parameters.Aggregation = new HistoryAggregationTime(Period.MIN1, HistoryType.Bid); - } - } - - public void AddValue(double open, double high, double low, double close) - { - if (?? != null) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(153, 4); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(??.ShortName); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - throw new InvalidOperationException(defaultInterpolatedStringHandler.ToStringAndClear()); - } - AddNewItem(new HistoryItemCustom(open, high, low, close)); - } - - public void SetValue(double open, double high, double low, double close, int offset = 0) - { - if (!(this[offset, SeekOriginHistory.End] is HistoryItemCustom historyItemCustom)) - { - throw new IndexOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - Indicator[] all = Indicators.All; - if (all.Length != 0) - { - while (Count - all[0].Count > 1) - { - Indicators.Update(new UpdateArgs(UpdateReason.NewBar)); - } - } - bool isEmpty = historyItemCustom.IsEmpty; - historyItemCustom.Open = open; - historyItemCustom.High = high; - historyItemCustom.Low = low; - historyItemCustom.Close = close; - historyItemCustom.IsEmpty = false; - if (offset == 0) - { - Indicators.Update(new UpdateArgs(isEmpty ? UpdateReason.NewBar : UpdateReason.NewTick)); - } - } - - internal void ?() - { - AddNewItem(new HistoryItemCustom(double.NaN, double.NaN, double.NaN, double.NaN) - { - IsEmpty = true - }, updateIndicators: false); - } - - private protected override void ?(IHistoryItem P_0) - { - HistoryItemCustom obj = P_0 as HistoryItemCustom; - if (obj != null && !obj.IsEmpty) - { - base.?(P_0); - } - } - - private protected override void ?(HistoryEventArgs P_0 = null, IndicatorUpdateType? P_1 = null) - { - if (Count != 0 && !(base[0, SeekOriginHistory.End] as HistoryItemCustom).IsEmpty) - { - base.?(P_0, P_1); - } - } - - public override void Dispose() - { - base.Dispose(); - ?? = null; - } - - internal HistoricalDataCustom(HistoryRequestParameters P_0) - : base(P_0) - { - } - - private protected override void ?() - { - } - - protected override void SubscribeSymbol() - { - } - - protected override void UnSubscribeSymbol() - { - } - } - public sealed class HistoryItemCustom : HistoryItem - { - private const int ?? = 0; - - private const int ?? = 1; - - private const int ?? = 2; - - private const int ?? = 3; - - private double[] ??; - - [CompilerGenerated] - private bool ??; - - internal double Open - { - get - { - return ??[0]; - } - set - { - ??[0] = num; - } - } - - internal double High - { - get - { - return ??[1]; - } - set - { - ??[1] = num; - } - } - - internal double Low - { - get - { - return ??[2]; - } - set - { - ??[2] = num; - } - } - - internal double Close - { - get - { - return ??[3]; - } - set - { - ??[3] = num; - } - } - - public override double this[PriceType priceType] => priceType switch - { - PriceType.Open => Open, - PriceType.High => High, - PriceType.Low => Low, - PriceType.Close => Close, - _ => base[priceType], - }; - - internal bool IsEmpty - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = flag; - } - } - - internal HistoryItemCustom(double P_0, double P_1, double P_2, double P_3) - { - ?? = new double[4]; - Open = P_0; - High = P_1; - Low = P_2; - Close = P_3; - IsEmpty = double.IsNaN(P_0) && double.IsNaN(P_1) && double.IsNaN(P_2) && double.IsNaN(P_3); - } - - private HistoryItemCustom(HistoryItemCustom P_0) - : base(P_0) - { - ?? = new double[4]; - for (int i = 0; i < P_0.??.Length; i++) - { - ??[i] = P_0.??[i]; - } - } - - public override object Clone() - { - return new HistoryItemCustom(this); - } - } - public class Price - { - [CompilerGenerated] - private PriceType ?; - - [CompilerGenerated] - private double ?; - - public PriceType Type - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = priceType; - } - } - - public double Value - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = num; - } - } - - public Price(PriceType priceType) - { - Type = priceType; - Value = double.NaN; - } - - public Price(PriceType priceType, double value) - { - Type = priceType; - Value = value; - } - } - /// - /// Represent access to historical data information and indicators control. - /// - [Published] - public class HistoricalData : IDisposable, IIndicatorsCollection, IEnumerable, IEnumerable - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func, Period> ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func, Period> ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func, Period> ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - internal BasePeriod ?(Period P_0) - { - return P_0.BasePeriod; - } - - internal Period ?(IGrouping P_0) - { - return P_0.OrderByDescending((Period period) => period.PeriodMultiplier).Last(); - } - - internal int ?(Period P_0) - { - return P_0.PeriodMultiplier; - } - - internal Period ?(BasePeriod P_0) - { - return new Period(P_0, 1); - } - - internal long ?(Period P_0) - { - return P_0.Ticks; - } - - internal BasePeriod ?(Period P_0) - { - return P_0.BasePeriod; - } - - internal Period ?(IGrouping P_0) - { - return P_0.OrderByDescending((Period period) => period.PeriodMultiplier).Last(); - } - - internal int ?(Period P_0) - { - return P_0.PeriodMultiplier; - } - - internal Period ?(BasePeriod P_0) - { - return new Period(P_0, 1); - } - - internal long ?(Period P_0) - { - return P_0.Ticks; - } - - internal HistoryAggregationTimeStatistics ?(Period P_0) - { - return new HistoryAggregationTimeStatistics(P_0); - } - - internal BasePeriod ?(Period P_0) - { - return P_0.BasePeriod; - } - - internal Period ?(IGrouping P_0) - { - return P_0.OrderByDescending((Period period) => period.PeriodMultiplier).Last(); - } - - internal int ?(Period P_0) - { - return P_0.PeriodMultiplier; - } - - internal Period ?(BasePeriod P_0) - { - return new Period(P_0, 1); - } - - internal long ?(Period P_0) - { - return P_0.Ticks; - } - - internal HistoryAggregationVolumeProfile ?(Period P_0) - { - return new HistoryAggregationVolumeProfile(P_0); - } - } - - [CompilerGenerated] - private sealed class ? - { - public HistoryAggregationTime ??; - - public HistoryAggregationTimeStatistics ??; - - public HistoryAggregationVolumeProfile ??; - - internal bool ?(Period P_0) - { - return ??.Period.Ticks % P_0.Ticks == 0; - } - - internal bool ?(Period P_0) - { - return P_0.Ticks < ??.Period.Ticks; - } - - internal HistoryAggregationTime ?(Period P_0) - { - return new HistoryAggregationTime(P_0, ??.HistoryType); - } - - internal bool ?(Period P_0) - { - return ??.Period.Ticks % P_0.Ticks == 0; - } - - internal bool ?(Period P_0) - { - return P_0.Ticks < ??.Period.Ticks; - } - - internal bool ?(Period P_0) - { - return ??.Period.Ticks % P_0.Ticks == 0; - } - - internal bool ?(Period P_0) - { - return P_0.Ticks < ??.Period.Ticks; - } - } - - [StructLayout(LayoutKind.Auto)] - [CompilerGenerated] - private struct ? - { - public HistoricalData ??; - - public MessageQuote ??; - } - - [CompilerGenerated] - private HistoryEventHandler ??; - - [CompilerGenerated] - private HistoryEventHandler ??; - - [CompilerGenerated] - private HistoryEventHandler ??; - - private readonly List ??; - - protected readonly object itemsLocker; - - protected HistoryRequestParameters Parameters; - - private protected IHistoryProcessor ??; - - [CompilerGenerated] - private readonly BuiltInIndicators ??; - - private bool ??; - - private CancellationTokenSource ??; - - private HistoricalDataState ??; - - private readonly ConcurrentQueue ??; - - private readonly bool ??; - - private MessageQuote ??; - - private MessageQuote ??; - - private MessageQuote ??; - - private readonly ManualResetEventSlim ??; - - protected readonly IndicatorsCollection Indicators; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private IVolumeAnalysisCalculationProgress ??; - - /// - /// Gets HistoricalData symbol - /// - public Symbol Symbol => Parameters?.Symbol; - - /// - /// Gets HistoricalData aggregation - /// - public HistoryAggregation Aggregation => Parameters?.Aggregation; - - /// - /// Gets HistoricalData left time boundary - /// - public DateTime FromTime => Parameters.FromTime; - - /// - /// Gets HistoricalData right time boundary - /// - public DateTime ToTime => Parameters.ToTime; - - /// - /// Gets HistoricalData items amount - /// - public virtual int Count - { - get - { - lock (itemsLocker) - { - return ??.Count; - } - } - } - - /// - /// Retrieves HistoricalData item by indexing offset and direction to find. - /// - /// - /// - /// - public virtual IHistoryItem this[int offset, SeekOriginHistory origin = SeekOriginHistory.End] - { - get - { - if (origin == SeekOriginHistory.End) - { - return ??[Count - 1 - offset]; - } - return ??[offset]; - } - private set - { - lock (itemsLocker) - { - if (seekOriginHistory == SeekOriginHistory.End) - { - ??[Count - 1 - num] = value2; - } - else - { - ??[num] = value2; - } - } - } - } - - /// - /// Gets access to built-in indicators - /// - public BuiltInIndicators BuiltInIndicators - { - [CompilerGenerated] - get - { - return ??; - } - } - - protected virtual bool NeedSubscribe - { - get - { - if (!??) - { - return ToTime == default(DateTime); - } - return false; - } - } - - /// - /// Gets array of attached indicators - /// - public Indicator[] AttachedIndicators => Indicators.All; - - public IndicatorCalculationBehavior IndicatorCalculationBehavior - { - get - { - return Indicators.CalculationBehavior; - } - set - { - Indicators.CalculationBehavior = value; - } - } - - [NotPublished] - public IVolumeAnalysisCalculationProgress VolumeAnalysisCalculationProgress - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Will be triggered when new historical item created - /// - public event HistoryEventHandler NewHistoryItem - { - [CompilerGenerated] - add - { - HistoryEventHandler historyEventHandler = ??; - HistoryEventHandler historyEventHandler2; - do - { - historyEventHandler2 = historyEventHandler; - HistoryEventHandler value2 = (HistoryEventHandler)Delegate.Combine(historyEventHandler2, value); - historyEventHandler = Interlocked.CompareExchange(ref ??, value2, historyEventHandler2); - } - while ((object)historyEventHandler != historyEventHandler2); - } - [CompilerGenerated] - remove - { - HistoryEventHandler historyEventHandler = ??; - HistoryEventHandler historyEventHandler2; - do - { - historyEventHandler2 = historyEventHandler; - HistoryEventHandler value2 = (HistoryEventHandler)Delegate.Remove(historyEventHandler2, value); - historyEventHandler = Interlocked.CompareExchange(ref ??, value2, historyEventHandler2); - } - while ((object)historyEventHandler != historyEventHandler2); - } - } - - /// - /// Will be triggered when current historical item changed or updated - /// - public event HistoryEventHandler HistoryItemUpdated - { - [CompilerGenerated] - add - { - HistoryEventHandler historyEventHandler = ??; - HistoryEventHandler historyEventHandler2; - do - { - historyEventHandler2 = historyEventHandler; - HistoryEventHandler value2 = (HistoryEventHandler)Delegate.Combine(historyEventHandler2, value); - historyEventHandler = Interlocked.CompareExchange(ref ??, value2, historyEventHandler2); - } - while ((object)historyEventHandler != historyEventHandler2); - } - [CompilerGenerated] - remove - { - HistoryEventHandler historyEventHandler = ??; - HistoryEventHandler historyEventHandler2; - do - { - historyEventHandler2 = historyEventHandler; - HistoryEventHandler value2 = (HistoryEventHandler)Delegate.Remove(historyEventHandler2, value); - historyEventHandler = Interlocked.CompareExchange(ref ??, value2, historyEventHandler2); - } - while ((object)historyEventHandler != historyEventHandler2); - } - } - - /// - /// Will be triggered when volume analysis of current historical item changed or updated - /// - public event Action HistoryItemVolumeAnalysisUpdated - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - [SpecialName] - [CompilerGenerated] - internal void ?(HistoryEventHandler P_0) - { - HistoryEventHandler historyEventHandler = ??; - HistoryEventHandler historyEventHandler2; - do - { - historyEventHandler2 = historyEventHandler; - HistoryEventHandler value = (HistoryEventHandler)Delegate.Combine(historyEventHandler2, P_0); - historyEventHandler = Interlocked.CompareExchange(ref ??, value, historyEventHandler2); - } - while ((object)historyEventHandler != historyEventHandler2); - } - - [SpecialName] - [CompilerGenerated] - internal void ?(HistoryEventHandler P_0) - { - HistoryEventHandler historyEventHandler = ??; - HistoryEventHandler historyEventHandler2; - do - { - historyEventHandler2 = historyEventHandler; - HistoryEventHandler value = (HistoryEventHandler)Delegate.Remove(historyEventHandler2, P_0); - historyEventHandler = Interlocked.CompareExchange(ref ??, value, historyEventHandler2); - } - while ((object)historyEventHandler != historyEventHandler2); - } - - private protected HistoricalData() - { - ?? = new List(); - itemsLocker = new object(); - ?? = false; - Indicators = new IndicatorsCollection(this); - ?? = HistoricalDataState.Pending; - ?? = new ConcurrentQueue(); - ?? = new ManualResetEventSlim(); - } - - protected internal HistoricalData(HistoryRequestParameters historyRequestParameters) - : this() - { - Parameters = historyRequestParameters; - HistoryAggregation historyAggregation = Core.Instance.HistoryAggregations[Parameters.Aggregation.Name]; - if (historyAggregation == null) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Parameters.Aggregation.Name); - } - historyAggregation = historyAggregation.Clone() as HistoryAggregation; - if (historyAggregation != null) - { - historyAggregation.Settings = Parameters.Aggregation.Settings; - } - Parameters.Aggregation = historyAggregation; - ?? = historyRequestParameters.ForceReload; - ?? = new BuiltInIndicators(this); - } - - /// - /// Reloads entire HistoricalData - /// - public void Reload() - { - if (Symbol == null || Symbol.State == BusinessObjectState.Fake) - { - return; - } - try - { - ?? = HistoricalDataState.Loading; - ???.Cancel(); - if (Parameters.CancellationToken == CancellationToken.None) - { - ?? = new CancellationTokenSource(); - } - ?(); - ?(); - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - HistoryRequestParameters copy = Parameters.Copy; - copy.ToTime = ((ToTime == default(DateTime) || ToTime >= dateTimeUtcNow) ? dateTimeUtcNow : ToTime); - if (Symbol.QuoteDelay != default(TimeSpan) && copy.ToTime > dateTimeUtcNow - Symbol.QuoteDelay) - { - copy.ToTime = dateTimeUtcNow - Symbol.QuoteDelay; - } - copy.ForceReload = ??; - copy.CancellationToken = ???.Token ?? Parameters.CancellationToken; - copy.ProgressInfo = Parameters.ProgressInfo; - if (Core.Instance.SymbolsMapping.TryGetHistorySymbol(Symbol, copy.Aggregation.GetPeriod, out var historySymbol)) - { - copy.Symbol = historySymbol; - } - if (NeedSubscribe) - { - SubscribeSymbol(); - if (Aggregation.IsWaitingFirstQuoteRequired) - { - WaitHandle.WaitAny(new WaitHandle[3] - { - copy.CancellationToken.WaitHandle, - ??.WaitHandle, - new CancellationTokenSource(TimeSpan.FromSeconds(3.0)).Token.WaitHandle - }); - } - if (?? != null) - { - copy.ToTime = ??.Time.AddMilliseconds(1.0); - } - } - if (!(FromTime == ToTime) || !(ToTime == default(DateTime))) - { - IList list = ?(copy); - if (Parameters.ExcludeOutOfSession && list != null && list.Count > 0 && Parameters.SessionsContainer != null && Parameters.SessionsContainer.ActiveSessions.Any()) - { - HistoryAggregation aggregationToDirectDownload = Parameters.Aggregation.GetAggregationToDirectDownload(Parameters.Symbol.HistoryMetadata); - if (aggregationToDirectDownload == null || !(aggregationToDirectDownload is HistoryAggregationTime historyAggregationTime) || !(historyAggregationTime.Period >= Period.DAY1)) - { - list = list.Where((IHistoryItem P_0) => Parameters.SessionsContainer.ContainsDate(P_0.TicksLeft)).ToList(); - } - } - if (list != null) - { - lock (itemsLocker) - { - ??.AddRange(list); - } - } - } - Indicators.Refresh(); - ?(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - ?? = HistoricalDataState.Working; - } - } - - private protected virtual IList ?(HistoryRequestParameters P_0) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(49, 4); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.Symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.Aggregation); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.Interval); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - long num = 0L; - int num2 = 0; - List list = new List(); - if (P_0.Symbol.State == BusinessObjectState.Fake) - { - return list; - } - if (P_0.FromTime > P_0.ToTime) - { - return list; - } - Connection connection = Core.Instance.Connections[P_0.Symbol.ConnectionId]; - if (connection == null || !connection.Connected) - { - return list; - } - CancellationToken cancellationToken = P_0.CancellationToken; - HistoryRequestParameters copy = P_0.Copy; - copy.ProgressInfo = P_0.ProgressInfo; - HistoryAggregation aggregationToDirectDownload = copy.Aggregation.GetAggregationToDirectDownload(P_0.Symbol.HistoryMetadata); - if (aggregationToDirectDownload == null) - { - return list; - } - copy.Aggregation = aggregationToDirectDownload; - Interval[] array = copy.Interval.Split(P_0.Symbol.GetHistoryDownloadingStep(copy.Aggregation)).ToArray(); - if (!array.Any()) - { - return list; - } - long num3 = copy.FromTime.Ticks; - Interval[] array2 = array; - for (int i = 0; i < array2.Length; i++) - { - Interval interval = array2[i]; - if (cancellationToken.IsCancellationRequested) - { - return list; - } - int num4 = ++num2 * 100 / array.Length; - HistoryRequestParameters copy2 = copy.Copy; - copy2.FromTime = interval.From; - copy2.ToTime = interval.To; - LoggerManager loggers2 = Core.Instance.Loggers; - defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(35, 4); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(num2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(array.Length); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(copy2.Interval); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers2.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); - IList list2 = connection.HistoryLoadingManager.?(copy2); - IHistoryItem historyItem = list2.LastOrDefault(); - if (historyItem != null) - { - num3 = historyItem.TicksLeft + copy.Aggregation.GetPeriod.Ticks; - } - LoggerManager loggers3 = Core.Instance.Loggers; - defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(75, 4); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(num2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(array.Length); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(list2.Count); - loggers3.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); - if (cancellationToken.IsCancellationRequested) - { - return list; - } - num += list2.Count; - IList list4; - if (list2.Count <= 0) - { - IList list3 = new List(); - list4 = list3; - } - else - { - list4 = ??.AggregateHistory(new HistoryHolder(list2, copy, (P_0.Symbol.HistoryMetadata.BuildUncompletedBars && num4 == 100) ? 99 : num4)); - } - IList list5 = list4; - if (cancellationToken.IsCancellationRequested) - { - return list; - } - list.AddRange(list5); - LoggerManager loggers4 = Core.Instance.Loggers; - defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(76, 4); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(num2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(array.Length); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(list5.Count); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers4.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); - if (P_0.ProgressInfo != null && array.Length > 2) - { - P_0.ProgressInfo.Report((float)num4 / 100f); - } - LoggerManager loggers5 = Core.Instance.Loggers; - defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(40, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(num2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(array.Length); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers5.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); - if (!P_0.Symbol.HistoryMetadata.BuildUncompletedBars || num4 != 100) - { - continue; - } - HistoryAggregation aggregation = copy.Aggregation; - HistoryAggregationTime ?? = aggregation as HistoryAggregationTime; - if (?? == null) - { - if (!(aggregation is HistoryAggregationTickBars historyAggregationTickBars)) - { - HistoryAggregationTimeStatistics ?? = aggregation as HistoryAggregationTimeStatistics; - if (?? == null) - { - HistoryAggregationVolumeProfile ?? = aggregation as HistoryAggregationVolumeProfile; - if (?? == null) - { - continue; - } - HistoryAggregation[] array3 = (from period in (from period in P_0.Symbol.HistoryMetadata.AllowedPeriodsHistoryAggregationTimeStatistics - where ??.Period.Ticks % period.Ticks == 0 - group period by period.BasePeriod into source - select source.OrderByDescending((Period period) => period.PeriodMultiplier).Last()).Union(P_0.Symbol.HistoryMetadata.AllowedBasePeriodsHistoryAggregationTimeStatistics.Select((BasePeriod basePeriod) => new Period(basePeriod, 1))) - where period.Ticks < ??.Period.Ticks - orderby period.Ticks descending - select new HistoryAggregationVolumeProfile(period)).Union((!P_0.Symbol.HistoryMetadata.AllowedAggregations.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) ? ((IEnumerable)Array.Empty()) : ((IEnumerable)new HistoryAggregation[1] - { - new HistoryAggregationTick(HistoryType.Last) - })).ToArray(); - for (int num5 = 0; num5 < array3.Length; num5++) - { - HistoryAggregation historyAggregation = array3[num5]; - TimeSpan historyDownloadingStep = P_0.Symbol.GetHistoryDownloadingStep(historyAggregation); - if (copy.ToTime.Ticks - num3 > historyDownloadingStep.Ticks) - { - num3 = copy.ToTime.Ticks - historyDownloadingStep.Ticks; - } - HistoryRequestParameters historyRequestParameters = new HistoryRequestParameters(copy) - { - FromTime = new DateTime(num3, DateTimeKind.Utc), - Aggregation = historyAggregation - }; - IList list6 = connection.HistoryLoadingManager.?(historyRequestParameters); - historyItem = list6.LastOrDefault(); - if (historyItem != null && historyAggregation is HistoryAggregationVolumeProfile historyAggregationVolumeProfile) - { - num3 = historyItem.TicksLeft + historyAggregationVolumeProfile.Period.Ticks; - } - IList collection = ??.AggregateHistory(new HistoryHolder(list6, historyRequestParameters, (num5 == array3.Length - 1) ? 100 : 99)); - list.AddRange(collection); - } - continue; - } - HistoryAggregation[] array4 = (from period in (from period in P_0.Symbol.HistoryMetadata.AllowedPeriodsHistoryAggregationTimeStatistics - where ??.Period.Ticks % period.Ticks == 0 - group period by period.BasePeriod into source - select source.OrderByDescending((Period period) => period.PeriodMultiplier).Last()).Union(P_0.Symbol.HistoryMetadata.AllowedBasePeriodsHistoryAggregationTimeStatistics.Select((BasePeriod basePeriod) => new Period(basePeriod, 1))) - where period.Ticks < ??.Period.Ticks - orderby period.Ticks descending - select new HistoryAggregationTimeStatistics(period)).Union((!P_0.Symbol.HistoryMetadata.AllowedAggregations.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) ? ((IEnumerable)Array.Empty()) : ((IEnumerable)new HistoryAggregation[1] - { - new HistoryAggregationTick(HistoryType.Last) - })).ToArray(); - for (int num6 = 0; num6 < array4.Length; num6++) - { - HistoryAggregation historyAggregation2 = array4[num6]; - TimeSpan historyDownloadingStep2 = P_0.Symbol.GetHistoryDownloadingStep(historyAggregation2); - if (copy.ToTime.Ticks - num3 > historyDownloadingStep2.Ticks) - { - num3 = copy.ToTime.Ticks - historyDownloadingStep2.Ticks; - } - HistoryRequestParameters historyRequestParameters2 = new HistoryRequestParameters(copy) - { - FromTime = new DateTime(num3, DateTimeKind.Utc), - Aggregation = historyAggregation2 - }; - IList list7 = connection.HistoryLoadingManager.?(historyRequestParameters2); - historyItem = list7.LastOrDefault(); - if (historyItem != null && historyAggregation2 is HistoryAggregationTimeStatistics historyAggregationTimeStatistics) - { - num3 = historyItem.TicksLeft + historyAggregationTimeStatistics.Period.Ticks; - } - IList collection2 = ??.AggregateHistory(new HistoryHolder(list7, historyRequestParameters2, (num6 == array4.Length - 1) ? 100 : 99)); - list.AddRange(collection2); - } - } - else - { - if (!P_0.Symbol.HistoryMetadata.AllowedAggregations.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) || !P_0.Symbol.HistoryMetadata.AllowedHistoryTypesHistoryAggregationTick.Contains(historyAggregationTickBars.HistoryType)) - { - continue; - } - if (list.Any()) - { - IHistoryItem historyItem2 = list.Last(); - if (historyItem2.TicksRight == 0L) - { - list.RemoveAt(list.Count - 1); - num3 = historyItem2.TicksLeft; - } - else - { - num3 = historyItem2.TicksRight + 1; - } - } - TimeSpan downloadingStep_Tick = P_0.Symbol.HistoryMetadata.DownloadingStep_Tick; - if (copy.ToTime.Ticks - num3 > downloadingStep_Tick.Ticks) - { - num3 = copy.ToTime.Ticks - downloadingStep_Tick.Ticks; - } - HistoryRequestParameters historyRequestParameters3 = new HistoryRequestParameters(copy) - { - FromTime = new DateTime(num3, DateTimeKind.Utc), - Aggregation = new HistoryAggregationTick(historyAggregationTickBars.HistoryType) - }; - IList history = connection.HistoryLoadingManager.?(historyRequestParameters3); - IList collection3 = ??.AggregateHistory(new HistoryHolder(history, historyRequestParameters3)); - list.AddRange(collection3); - } - continue; - } - HistoryAggregation[] array5 = (from period in (from period in P_0.Symbol.HistoryMetadata.AllowedPeriodsHistoryAggregationTime - where ??.Period.Ticks % period.Ticks == 0 - group period by period.BasePeriod into source - select source.OrderByDescending((Period period) => period.PeriodMultiplier).Last()).Union(P_0.Symbol.HistoryMetadata.AllowedBasePeriodsHistoryAggregationTime.Select((BasePeriod basePeriod) => new Period(basePeriod, 1))) - where period.Ticks < ??.Period.Ticks - orderby period.Ticks descending - select new HistoryAggregationTime(period, ??.HistoryType)).Union((!P_0.Symbol.HistoryMetadata.AllowedAggregations.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) ? ((IEnumerable)Array.Empty()) : ((IEnumerable)new HistoryAggregation[1] - { - new HistoryAggregationTick((??.HistoryType == HistoryType.Bid || ??.HistoryType == HistoryType.Ask) ? HistoryType.BidAsk : ??.HistoryType) - })).ToArray(); - for (int num7 = 0; num7 < array5.Length; num7++) - { - HistoryAggregation historyAggregation3 = array5[num7]; - TimeSpan historyDownloadingStep3 = P_0.Symbol.GetHistoryDownloadingStep(historyAggregation3); - if (copy.ToTime.Ticks - num3 > historyDownloadingStep3.Ticks) - { - num3 = copy.ToTime.Ticks - historyDownloadingStep3.Ticks; - } - HistoryRequestParameters historyRequestParameters4 = new HistoryRequestParameters(copy) - { - FromTime = new DateTime(num3, DateTimeKind.Utc), - Aggregation = historyAggregation3, - HistoryRequestType = HistoryRequestType.BuildUncompleteBarLogic - }; - IList list8 = connection.HistoryLoadingManager.?(historyRequestParameters4); - historyItem = list8.LastOrDefault(); - if (historyItem != null && historyAggregation3 is HistoryAggregationTime historyAggregationTime) - { - num3 = historyItem.TicksLeft + historyAggregationTime.Period.Ticks; - } - IList collection4 = ??.AggregateHistory(new HistoryHolder(list8, historyRequestParameters4, (num7 == array5.Length - 1) ? 100 : 99)); - list.AddRange(collection4); - } - } - LoggerManager loggers6 = Core.Instance.Loggers; - defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(123, 4); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted((Core.Instance.TimeUtils.DateTimeUtcNow - dateTimeUtcNow).TotalSeconds, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(num); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(list.Count); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers6.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); - return list; - } - - /// - /// Gets index by time with counting on search direction - /// - public double GetIndexByTime(long time, SeekOriginHistory origin = SeekOriginHistory.End) - { - if (Count == 0) - { - return -1.0; - } - if (time > this[0, SeekOriginHistory.End].TicksRight) - { - return -1.0; - } - double num = -1.0; - int num2 = 0; - int num3 = Count - 1; - while (num2 <= num3) - { - int num4 = (num2 + num3) / 2; - if (num3 - num2 < 2) - { - num = ((time >= this[num2, SeekOriginHistory.Begin].TicksLeft) ? ((time >= this[num3, SeekOriginHistory.Begin].TicksLeft) ? ((double)num3) : ((double)num2)) : ((double)(--num2))); - break; - } - if (time < this[num4, SeekOriginHistory.Begin].TicksLeft) - { - num3 = num4 - 1; - } - else - { - num2 = num4 + 1; - } - } - if (origin == SeekOriginHistory.End && num != -1.0) - { - return (double)(Count - 1) - num; - } - return num; - } - - private void ?() - { - if (?? != null) - { - ??.NewHistoryItem -= ?; - ??.HistoryItemUpdated -= ?; - ??.Dispose(); - ?? = null; - } - ??.Clear(); - lock (itemsLocker) - { - ??.Clear(); - } - } - - [NotPublished] - public virtual void Dispose() - { - ???.Cancel(); - Indicators.Clear(); - UnSubscribeSymbol(); - ?(); - if (VolumeAnalysisCalculationProgress != null) - { - VolumeAnalysisCalculationProgress.AbortLoading(); - VolumeAnalysisCalculationProgress.Dispose(); - VolumeAnalysisCalculationProgress = null; - } - Parameters = null; - } - - protected virtual void SubscribeSymbol() - { - if (Symbol != null && ?? != null) - { - switch (??.GetSubscribeQuoteType) - { - case SubscribeQuoteType.Quote: - Symbol.NewQuote += Symbol_NewQuote; - break; - case SubscribeQuoteType.Level2: - Symbol.NewLevel2 += ?; - break; - case SubscribeQuoteType.Last: - Symbol.NewLast += Symbol_NewLast; - break; - case SubscribeQuoteType.Mark: - Symbol.NewMark += ?; - break; - } - Symbol.NewDayBar += ?; - ?? = true; - } - } - - protected virtual void UnSubscribeSymbol() - { - if (Symbol != null && ?? != null) - { - switch (??.GetSubscribeQuoteType) - { - case SubscribeQuoteType.Quote: - Symbol.NewQuote -= Symbol_NewQuote; - break; - case SubscribeQuoteType.Level2: - Symbol.NewLevel2 -= ?; - break; - case SubscribeQuoteType.Last: - Symbol.NewLast -= Symbol_NewLast; - break; - case SubscribeQuoteType.Mark: - Symbol.NewMark -= ?; - break; - } - Symbol.NewDayBar -= ?; - ?? = null; - ?? = null; - ??.Reset(); - } - } - - protected void Symbol_NewQuote(Symbol symbol, Quote quote) - { - if (!?(quote)) - { - ProcessQuote(quote); - } - } - - protected void Symbol_NewLast(Symbol symbol, Last last) - { - if (!?(last)) - { - ProcessLast(last); - } - } - - private void ?(Symbol P_0, Mark P_1) - { - if (!?(P_1)) - { - ProcessMark(P_1); - } - } - - private void ?(Symbol P_0, DayBar P_1) - { - if (!?((MessageQuote)P_1)) - { - ?(P_1); - } - } - - private void ?(Symbol P_0, Level2Quote P_1, DOMQuote P_2) - { - MessageQuote messageQuote = (MessageQuote)(((object)P_1) ?? ((object)P_2)); - if (!?(messageQuote)) - { - ProcessLevel2Qute(messageQuote); - } - } - - private bool ?(MessageQuote P_0) - { - ? ? = default(?); - ?.?? = this; - ?.?? = P_0; - if (?? != HistoricalDataState.Loading && ??.IsEmpty) - { - return false; - } - if (?? == null && ?(ref ?)) - { - ?? = ?.??; - ??.Set(); - } - ??.Enqueue(?.??); - return true; - } - - private void ?() - { - DateTime? dateTime = this.LastOrDefault()?.TimeLeft; - MessageQuote result; - while (??.TryDequeue(out result)) - { - if (result == null) - { - continue; - } - if (dateTime.HasValue) - { - DateTime time = result.Time; - DateTime? dateTime2 = dateTime; - if (time <= dateTime2) - { - continue; - } - } - if (!(result is Quote quote)) - { - if (!(result is Last last)) - { - if (result is Mark mark) - { - ProcessMark(mark); - } - } - else - { - ProcessLast(last); - } - } - else - { - ProcessQuote(quote); - } - } - } - - protected virtual void ProcessQuote(Quote quote) - { - ?? = quote; - ???.ProcessQuote(quote); - } - - protected virtual void ProcessLast(Last last) - { - ?? = last; - ???.ProcessQuote(last); - } - - protected virtual void ProcessMark(Mark mark) - { - ?? = mark; - ???.ProcessQuote(mark); - } - - private void ?(DayBar P_0) - { - ?? = P_0; - ???.ProcessQuote(P_0); - } - - protected virtual void ProcessLevel2Qute(MessageQuote quote) - { - ?? = quote; - ???.ProcessQuote(quote); - } - - /// - /// Creates indicator by it's name and if it successfully created adds it to the HistoricalData - /// - /// - /// - /// - public Indicator AddIndicator(string indicatorName, params SettingItem[] settings) - { - if (string.IsNullOrEmpty(indicatorName)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - Indicator indicator = Core.Instance.Indicators.CreateIndicator(indicatorName, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - if (indicator == null) - { - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - indicator.Settings = settings; - AddIndicator(indicator); - return indicator; - } - - /// - /// Adds indicator to the HistoricalData - /// - /// - public void AddIndicator(Indicator indicator) - { - Indicators.AddIndicator(indicator); - } - - /// - /// Removes indicator from the HistoricalData - /// - /// - public void RemoveIndicator(Indicator indicator) - { - Indicators.RemoveIndicator(indicator); - } - - [NotPublished] - [EditorBrowsable(EditorBrowsableState.Never)] - public bool TryGetIndicatorWrapper(Indicator indicator, out IndicatorWrapper indicatorWrapper) - { - return Indicators.TryGetWrapper(indicator, out indicatorWrapper); - } - - public IVolumeAnalysisCalculationProgress CalculateVolumeProfile(VolumeAnalysisCalculationParameters volumeAnalysisCalculationParameters) - { - return Core.Instance.VolumeAnalysis.CalculateProfile(this, volumeAnalysisCalculationParameters); - } - - public IEnumerator GetEnumerator() - { - return ??.GetEnumerator(); - } - - private IEnumerator ?() - { - return ??.GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(); - } - - protected virtual IHistoryProcessor CreateHistoryProcessor() - { - return Core.Instance.HistoryAggregations.CreateHistoryProcessor(Parameters); - } - - private protected virtual void ?() - { - ?? = CreateHistoryProcessor(); - if (?? == null) - { - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ??.CorrectHistoryRequestBorders(Parameters); - ??.NewHistoryItem += ?; - ??.HistoryItemUpdated += ?; - } - - private void ?(object P_0, HistoryEventArgs P_1) - { - if (P_1.HistoryItem != null && (!Parameters.ExcludeOutOfSession || Parameters.SessionsContainer == null || Parameters.SessionsContainer.ContainsDate(P_1.HistoryItem.TicksLeft))) - { - AddNewItem(P_1.HistoryItem, updateIndicators: true, P_1); - } - } - - private void ?(object P_0, HistoryEventArgs P_1) - { - if (P_1.HistoryItem == null || (Parameters.ExcludeOutOfSession && Parameters.SessionsContainer != null && !Parameters.SessionsContainer.ContainsDate(P_1.HistoryItem.TicksLeft))) - { - return; - } - if (P_1.ResetVolumeAnalysisRequired) - { - P_1.HistoryItem.VolumeAnalysisData = null; - } - else - { - IHistoryItem historyItem = P_1.HistoryItem; - if (historyItem.VolumeAnalysisData == null) - { - VolumeAnalysisData volumeAnalysisData = (historyItem.VolumeAnalysisData = this[0, SeekOriginHistory.End]?.VolumeAnalysisData); - } - } - this[0, SeekOriginHistory.End] = P_1.HistoryItem; - ?(P_1.HistoryItem); - Indicators.Update(new UpdateArgs(UpdateReason.NewTick), IndicatorUpdateType.OnTick); - ?(P_1); - } - - protected virtual void AddNewItem(IHistoryItem historyItem, bool updateIndicators = true, HistoryEventArgs e = null) - { - if (updateIndicators) - { - ?(e, IndicatorUpdateType.OnBarClose); - } - lock (itemsLocker) - { - ??.Add(historyItem); - } - ?(historyItem); - if (updateIndicators) - { - ?(e, IndicatorUpdateType.OnTick); - } - ?(historyItem); - } - - private protected virtual void ?(IHistoryItem P_0) - { - ??.InvokeSafely(this, new HistoryEventArgs - { - HistoryItem = P_0 - }); - } - - private void ?(HistoryEventArgs P_0) - { - ???.Invoke(this, P_0); - } - - private void ?(IHistoryItem P_0) - { - if (?? != ??) - { - ?? = ??; - ???.Invoke(this, new ? - { - HistoryItem = P_0, - MessageQuote = ?? - }); - } - } - - private protected virtual void ?(HistoryEventArgs P_0 = null, IndicatorUpdateType? P_1 = null) - { - Indicators.Update(new UpdateArgs(UpdateReason.NewBar), P_1); - } - - internal void ?() - { - ???.Invoke(); - } - - [NotPublished] - [EditorBrowsable(EditorBrowsableState.Never)] - public void CutItems(int count) - { - lock (itemsLocker) - { - count = Math.Min(??.Count, Math.Abs(count)); - ??.RemoveRange(0, count); - } - Parameters.FromTime = ((Count > 0) ? this[0, SeekOriginHistory.Begin].TimeLeft : Core.Instance.TimeUtils.DateTimeUtcNow); - } - - [NotPublished] - protected void InsertRange(int index, IList range) - { - lock (itemsLocker) - { - ??.InsertRange(index, range); - } - Indicators.Refresh(); - } - - public string GetTimeToNextBar() - { - return ??.GetTimeToNextBar(); - } - - [CompilerGenerated] - private bool ?(IHistoryItem P_0) - { - return Parameters.SessionsContainer.ContainsDate(P_0.TicksLeft); - } - - [CompilerGenerated] - private bool ?(ref ? P_0) - { - if (?? == null) - { - return false; - } - return ??.GetSubscribeQuoteType switch - { - SubscribeQuoteType.Quote => P_0.?? is Quote, - SubscribeQuoteType.Level2 => (P_0.?? is Level2Quote || P_0.?? is DOMQuote) ? true : false, - SubscribeQuoteType.Last => P_0.?? is Last, - SubscribeQuoteType.Mark => P_0.?? is Mark, - _ => false, - }; - } - } - /// - /// Period that can be used as a basis for history aggregations - /// - [DataContract(Name = "BasePeriod", Namespace = "TradingPlatform")] - [Published] - public enum BasePeriod - { - [EnumMember] - Tick, - [EnumMember] - Second, - [EnumMember] - Minute, - [EnumMember] - Hour, - [EnumMember] - Day, - [EnumMember] - Week, - [EnumMember] - Month, - [EnumMember] - Year - } - [Published] - public enum RenkoStyle - { - Classic, - HighLow, - AdvancedClassic, - AdvancedHighLow - } - [Published] - public enum PointsAndFiguresStyle - { - [Description("Classic")] - Classic, - [Description("High/Low")] - HighLow - } - [Published] - public enum PriceType - { - Open, - High, - Low, - Close, - Median, - Typical, - Weighted, - Bid, - BidSize, - Ask, - AskSize, - Last, - Volume, - Ticks, - AggressorFlag, - TickDirection, - BidTickDirection, - AskTickDirection, - OpenInterest, - Mark, - FundingRate, - QuoteAssetVolume - } - public enum SeekOriginHistory - { - Begin, - End - } - public enum HistoricalDataState - { - Pending, - Working, - Loading - } - public class HistoryEventArgs : EventArgs - { - [CompilerGenerated] - private IHistoryItem ?; - - [CompilerGenerated] - private bool ?; - - public IHistoryItem HistoryItem - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - public bool ResetVolumeAnalysisRequired - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - } - public delegate void HistoryEventHandler(object sender, HistoryEventArgs e); - public class HistoryHolder - { - [CompilerGenerated] - private readonly IList ?; - - [CompilerGenerated] - private readonly HistoryRequestParameters ?; - - [CompilerGenerated] - private int ?; - - public IList History - { - [CompilerGenerated] - get - { - return ?; - } - } - - public HistoryRequestParameters RequestParameters - { - [CompilerGenerated] - get - { - return ?; - } - } - - public int ProgressPercent - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = num; - } - } - - public HistoryHolder(IList history, HistoryRequestParameters requestParameters, int progressPercent = 100) - { - ? = history; - ? = requestParameters; - ProgressPercent = progressPercent; - } - - public HistoryInterval ToHistoryInterval() - { - return new HistoryInterval - { - Description = RequestParameters.ToDescription(), - Interval = RequestParameters.Interval, - History = History - }; - } - } - [ProtoContract] - [ProtoInclude(2, typeof(HistoryItemLast))] - [ProtoInclude(3, typeof(HistoryItemTick))] - [ProtoInclude(4, typeof(HistoryItemMark))] - [ProtoInclude(5, typeof(HistoryItemBar))] - [ProtoInclude(6, typeof(HistoryItemLevel2))] - [ProtoInclude(7, typeof(HistoryItemDom))] - [ProtoInclude(8, typeof(HistoryItemTimeStatistics))] - [DataContract] - public abstract class HistoryItem : IHistoryItem, ICloneable - { - public static class CustomFields - { - public static class Trend - { - public const string UP = "up"; - - public const string DOWN = "down"; - } - - public const string IS_TEMPORARY_BAR = "isTemporaryBar"; - - public const string TREND = "trend"; - - public const string ONE_STEP_BACK = "OneStepBack"; - } - - [CompilerGenerated] - private long ??; - - private Dictionary ??; - - [CompilerGenerated] - private VolumeAnalysisData ??; - - public DateTime TimeLeft => new DateTime(TicksLeft, DateTimeKind.Utc); - - [ProtoMember(1)] - [DataMember(Order = 1)] - public long TicksLeft - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public virtual long TicksRight - { - get - { - return TicksLeft; - } - set - { - } - } - - public virtual double this[PriceType priceType] => double.NaN; - - public VolumeAnalysisData VolumeAnalysisData - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - protected HistoryItem() - { - TicksLeft = 0L; - } - - public void SetData(string key, object value) - { - if (string.IsNullOrEmpty(key)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (value == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (?? == null) - { - ?? = new Dictionary(); - } - ??[key] = value; - } - - public bool TryGetData(string key, out TData data) - { - data = default(TData); - if (?? == null) - { - return false; - } - if (!??.TryGetValue(key, out var value) || !(value is TData)) - { - return false; - } - data = (TData)value; - return true; - } - - protected HistoryItem(MessageQuote message) - { - TicksLeft = message.Time.Ticks; - } - - protected HistoryItem(HistoryItem original) - { - TicksLeft = original.TicksLeft; - if (original.VolumeAnalysisData != null) - { - VolumeAnalysisData = new VolumeAnalysisData(original.VolumeAnalysisData); - } - if (original.?? == null) - { - return; - } - foreach (KeyValuePair item in original.??) - { - SetData(item.Key, item.Value); - } - } - - public abstract object Clone(); - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(1, 2); - defaultInterpolatedStringHandler.AppendFormatted(TicksLeft); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(TimeLeft); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - /// - /// Represents historical data bar item - /// - [Published] - [ProtoContract] - public class HistoryItemBar : HistoryItem - { - [CompilerGenerated] - private long ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private long ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - /// - /// Gets bar's right time border - /// - public DateTime TimeRight => new DateTime(TicksRight, DateTimeKind.Utc); - - /// - /// Defines bar's ticks count - /// - public override long TicksRight - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Defines Open price - /// - [ProtoMember(1)] - public double Open - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Defines High price - /// - [ProtoMember(2)] - public double High - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Defines Low price - /// - [ProtoMember(3)] - public double Low - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Defines Close price - /// - [ProtoMember(4)] - public double Close - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets Median (High+Low)/2 price - /// - public double Median => (High + Low) / 2.0; - - /// - /// Gets Typical (High+Low+Close)/3 price - /// - public double Typical => (High + Low + Close) / 3.0; - - /// - /// Gets Weighted (High+Low+Close+Close)/4 price - /// - public double Weighted => (High + Low + Close + Close) / 4.0; - - /// - /// Defines ticks amount - /// - [ProtoMember(5)] - public long Ticks - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Defines volume value - /// - [ProtoMember(6)] - public double Volume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(7)] - public double OpenInterest - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(8)] - public double FundingRate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(9)] - public double QuoteAssetVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets price by indexing - /// - /// - /// - public override double this[PriceType priceType] => priceType switch - { - PriceType.Open => Open, - PriceType.High => High, - PriceType.Low => Low, - PriceType.Close => Close, - PriceType.Median => Median, - PriceType.Typical => Typical, - PriceType.Weighted => Weighted, - PriceType.Ticks => Ticks, - PriceType.Volume => Volume, - PriceType.OpenInterest => OpenInterest, - PriceType.FundingRate => FundingRate, - PriceType.QuoteAssetVolume => QuoteAssetVolume, - _ => base[priceType], - }; - - /// - /// Creates HistoryItemBar instance with default OHLC price = - /// - public HistoryItemBar() - { - Open = double.NaN; - High = double.NaN; - Low = double.NaN; - Close = double.NaN; - } - - /// - /// Comparing by , OHLC, - /// - /// - /// - [NotPublished] - public override bool Equals(object obj) - { - HistoryItemBar historyItemBar = obj as HistoryItemBar; - if (historyItemBar == null) - { - return false; - } - if (base.TicksLeft == historyItemBar.TicksLeft && Open == historyItemBar.Open && High == historyItemBar.High && Low == historyItemBar.Low && Close == historyItemBar.Close && Ticks == historyItemBar.Ticks && Volume == historyItemBar.Volume) - { - return QuoteAssetVolume == historyItemBar.QuoteAssetVolume; - } - return false; - } - - [NotPublished] - public override int GetHashCode() - { - return base.TicksLeft.GetHashCode() ^ Open.GetHashCode() ^ High.GetHashCode() ^ Low.GetHashCode() ^ Close.GetHashCode() ^ Ticks.GetHashCode() ^ Volume.GetHashCode() ^ QuoteAssetVolume.GetHashCode(); - } - - [NotPublished] - public static bool operator ==(HistoryItemBar a, HistoryItemBar b) - { - if ((object)a == b) - { - return true; - } - if ((object)a == null || (object)b == null) - { - return false; - } - return a.Equals(b); - } - - [NotPublished] - public static bool operator !=(HistoryItemBar a, HistoryItemBar b) - { - return !(a == b); - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(39, 10); - defaultInterpolatedStringHandler.AppendFormatted(base.TicksLeft); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(TicksRight); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Ticks); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.TimeLeft); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(TimeRight); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Open); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(High); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Low); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Close); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted((Close > Open) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - private HistoryItemBar(HistoryItemBar P_0) - : base(P_0) - { - TicksRight = P_0.TicksRight; - Open = P_0.Open; - High = P_0.High; - Low = P_0.Low; - Close = P_0.Close; - Ticks = P_0.Ticks; - Volume = P_0.Volume; - OpenInterest = P_0.OpenInterest; - FundingRate = P_0.FundingRate; - QuoteAssetVolume = P_0.QuoteAssetVolume; - base.VolumeAnalysisData = P_0.VolumeAnalysisData; - } - - [NotPublished] - public override object Clone() - { - return new HistoryItemBar(this); - } - } - [ProtoContract] - public sealed class HistoryItemDom : HistoryItem - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - internal HistoryItemLevel2 ?(Level2Quote P_0) - { - return new HistoryItemLevel2(P_0); - } - - internal HistoryItemLevel2 ?(Level2Quote P_0) - { - return new HistoryItemLevel2(P_0); - } - - internal HistoryItemLevel2 ?(HistoryItemLevel2 P_0) - { - return new HistoryItemLevel2(P_0); - } - - internal HistoryItemLevel2 ?(HistoryItemLevel2 P_0) - { - return new HistoryItemLevel2(P_0); - } - } - - [CompilerGenerated] - private List ??; - - [CompilerGenerated] - private List ??; - - [ProtoMember(1)] - public List Asks - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(2)] - public List Bids - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Creates HistoryItemLast instance - /// - public HistoryItemDom() - { - Asks = new List(); - Bids = new List(); - } - - public HistoryItemDom(DOMQuote domQuote) - : base(domQuote) - { - Asks = domQuote.Asks.Select((Level2Quote P_0) => new HistoryItemLevel2(P_0)).ToList(); - Bids = domQuote.Bids.Select((Level2Quote P_0) => new HistoryItemLevel2(P_0)).ToList(); - } - - public HistoryItemDom(HistoryItemDom original) - : base(original) - { - Asks = original.Asks.Select((HistoryItemLevel2 P_0) => new HistoryItemLevel2(P_0)).ToList(); - Bids = original.Bids.Select((HistoryItemLevel2 P_0) => new HistoryItemLevel2(P_0)).ToList(); - } - - [NotPublished] - public override object Clone() - { - return new HistoryItemDom(this); - } - } - /// - /// Represents historical data trade item - /// - [Published] - [ProtoContract] - [DataContract] - public sealed class HistoryItemLast : HistoryItem, IVolumeTickData, IBuyerSellerData - { - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private AggressorFlag ??; - - [CompilerGenerated] - private TickDirection ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - /// - /// Defines price value - /// - [ProtoMember(1)] - [DataMember(Order = 2)] - public double Price - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Defines volume value - /// - [ProtoMember(2)] - [DataMember(Order = 3)] - public double Volume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Defines trade operation side as aggressor flag - /// - [ProtoMember(3)] - [DataMember(Order = 4)] - public AggressorFlag AggressorFlag - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(4)] - [DataMember(Order = 5)] - public TickDirection TickDirection - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(5)] - [DataMember(Order = 6)] - public double OpenInterest - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(6)] - [DataMember(Order = 7)] - public string Buyer - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(7)] - [DataMember(Order = 8)] - public string Seller - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(8)] - [DataMember(Order = 9)] - public double FundingRate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(9)] - [DataMember(Order = 10)] - public double QuoteAssetVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets price by indexing - /// - /// - /// - public override double this[PriceType priceType] => priceType switch - { - PriceType.Last => Price, - PriceType.Open => Price, - PriceType.High => Price, - PriceType.Low => Price, - PriceType.Close => Price, - PriceType.Median => Price, - PriceType.Weighted => Price, - PriceType.Typical => Price, - PriceType.Bid => Price, - PriceType.Ask => Price, - PriceType.Mark => Price, - PriceType.Volume => Volume, - PriceType.AggressorFlag => (double)AggressorFlag, - PriceType.TickDirection => (double)TickDirection, - PriceType.BidTickDirection => (double)TickDirection, - PriceType.AskTickDirection => (double)TickDirection, - PriceType.OpenInterest => OpenInterest, - PriceType.FundingRate => FundingRate, - PriceType.QuoteAssetVolume => QuoteAssetVolume, - _ => base[priceType], - }; - - VolumeTickDataType IVolumeTickData.VolumeTickDataType => VolumeTickDataType.Lasts; - - long IVolumeTickData.Time => base.TicksLeft; - - /// - /// Creates HistoryItemLast instance - /// - public HistoryItemLast() - { - Price = double.NaN; - Volume = double.NaN; - QuoteAssetVolume = double.NaN; - AggressorFlag = AggressorFlag.NotSet; - TickDirection = TickDirection.NotSet; - } - - public HistoryItemLast(Last last) - : base(last) - { - Price = last.Price; - Volume = last.Size; - AggressorFlag = last.AggressorFlag; - TickDirection = last.TickDirection; - OpenInterest = last.OpenInterest; - Buyer = last.Buyer; - Seller = last.Seller; - QuoteAssetVolume = last.QuoteAssetVolume; - } - - private HistoryItemLast(HistoryItemLast P_0) - : base(P_0) - { - Price = P_0.Price; - Volume = P_0.Volume; - AggressorFlag = P_0.AggressorFlag; - TickDirection = P_0.TickDirection; - OpenInterest = P_0.OpenInterest; - FundingRate = P_0.FundingRate; - Buyer = P_0.Buyer; - Seller = P_0.Seller; - QuoteAssetVolume = P_0.QuoteAssetVolume; - } - - [NotPublished] - public override object Clone() - { - return new HistoryItemLast(this); - } - - /// - /// Comparing by , OHLC, - /// - /// - /// - [NotPublished] - public override bool Equals(object obj) - { - HistoryItemLast historyItemLast = obj as HistoryItemLast; - if (historyItemLast == null) - { - return false; - } - if (base.TicksLeft == historyItemLast.TicksLeft && Price == historyItemLast.Price && Volume == historyItemLast.Volume && QuoteAssetVolume == historyItemLast.QuoteAssetVolume) - { - return AggressorFlag == historyItemLast.AggressorFlag; - } - return false; - } - - [NotPublished] - public override int GetHashCode() - { - return base.TicksLeft.GetHashCode() ^ Price.GetHashCode() ^ Volume.GetHashCode() ^ QuoteAssetVolume.GetHashCode() ^ AggressorFlag.GetHashCode(); - } - - [NotPublished] - public static bool operator ==(HistoryItemLast a, HistoryItemLast b) - { - if ((object)a == b) - { - return true; - } - if ((object)a == null || (object)b == null) - { - return false; - } - return a.Equals(b); - } - - [NotPublished] - public static bool operator !=(HistoryItemLast a, HistoryItemLast b) - { - return !(a == b); - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(22, 3); - defaultInterpolatedStringHandler.AppendFormatted(base.ToString()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Price); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Volume); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - [ProtoContract] - public sealed class HistoryItemLevel2 : HistoryItem - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private QuotePriceType ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private bool ??; - - [ProtoMember(1)] - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(2)] - public QuotePriceType PriceType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(3)] - public double Price - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(4)] - public double Size - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(5)] - public bool Closed - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Creates HistoryItemLast instance - /// - public HistoryItemLevel2() - { - Price = double.NaN; - Size = double.NaN; - } - - public HistoryItemLevel2(Level2Quote level2Quote) - : base(level2Quote) - { - Id = level2Quote.Id; - PriceType = level2Quote.PriceType; - Price = level2Quote.Price; - Size = level2Quote.Size; - Closed = level2Quote.Closed; - } - - public HistoryItemLevel2(HistoryItemLevel2 original) - : base(original) - { - Id = original.Id; - PriceType = original.PriceType; - Price = original.Price; - Size = original.Size; - Closed = original.Closed; - } - - [NotPublished] - public override object Clone() - { - return new HistoryItemLevel2(this); - } - } - [ProtoContract] - public class HistoryItemMark : HistoryItem - { - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [ProtoMember(1)] - public double Price - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(2)] - public double Volume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets price by indexing - /// - /// - /// - public override double this[PriceType priceType] - { - get - { - switch (priceType) - { - case PriceType.Open: - case PriceType.High: - case PriceType.Low: - case PriceType.Close: - case PriceType.Median: - case PriceType.Typical: - case PriceType.Weighted: - case PriceType.Bid: - case PriceType.Ask: - case PriceType.Last: - case PriceType.Mark: - return Price; - case PriceType.Volume: - return Volume; - default: - return base[priceType]; - } - } - } - - /// - /// Creates HistoryItemLast instance - /// - public HistoryItemMark() - { - Price = double.NaN; - Volume = double.NaN; - } - - private HistoryItemMark(HistoryItemMark P_0) - : base(P_0) - { - Price = P_0.Price; - Volume = P_0.Volume; - } - - [NotPublished] - public override object Clone() - { - return new HistoryItemMark(this); - } - } - /// - /// Represents historical data tick item - /// - [Published] - [ProtoContract] - public class HistoryItemTick : HistoryItem, IVolumeTickData - { - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private TickDirection ??; - - [CompilerGenerated] - private TickDirection ??; - - /// - /// Defines Bid price - /// - [ProtoMember(1)] - public double Bid - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Defines Bid size - /// - [ProtoMember(2)] - public double BidSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Defines Ask price - /// - [ProtoMember(3)] - public double Ask - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Defines Ask size - /// - [ProtoMember(4)] - public double AskSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(5)] - public TickDirection BidTickDirection - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(6)] - public TickDirection AskTickDirection - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets price by indexing - /// - /// - /// - public override double this[PriceType priceType] - { - get - { - switch (priceType) - { - case PriceType.Open: - case PriceType.High: - case PriceType.Low: - case PriceType.Close: - case PriceType.Median: - case PriceType.Typical: - case PriceType.Weighted: - case PriceType.Bid: - case PriceType.Last: - case PriceType.Mark: - return Bid; - case PriceType.BidSize: - return BidSize; - case PriceType.Ask: - return Ask; - case PriceType.AskSize: - return AskSize; - case PriceType.Volume: - return 0.0; - case PriceType.TickDirection: - case PriceType.BidTickDirection: - return (double)BidTickDirection; - case PriceType.AskTickDirection: - return (double)AskTickDirection; - default: - return base[priceType]; - } - } - } - - VolumeTickDataType IVolumeTickData.VolumeTickDataType => VolumeTickDataType.Ticks; - - long IVolumeTickData.Time => base.TicksLeft; - - double IVolumeTickData.Price => Bid; - - double IVolumeTickData.Volume => 1.0; - - TickDirection IVolumeTickData.TickDirection => BidTickDirection; - - AggressorFlag IVolumeTickData.AggressorFlag => Symbol.ConvertTickDirection(BidTickDirection); - - /// - /// Creates HistoryItemBar instance with default Ask/AskSize/Bid/BidSize = - /// - public HistoryItemTick() - { - Bid = double.NaN; - BidSize = double.NaN; - Ask = double.NaN; - AskSize = double.NaN; - BidTickDirection = TickDirection.NotSet; - AskTickDirection = TickDirection.NotSet; - } - - private HistoryItemTick(HistoryItemTick P_0) - : base(P_0) - { - Bid = P_0.Bid; - BidSize = P_0.BidSize; - Ask = P_0.Ask; - AskSize = P_0.AskSize; - } - - [NotPublished] - public override object Clone() - { - return new HistoryItemTick(this); - } - - /// - /// Comparing by , OHLC, , , , - /// - /// - /// - [NotPublished] - public override bool Equals(object obj) - { - HistoryItemTick historyItemTick = obj as HistoryItemTick; - if (historyItemTick == null) - { - return false; - } - if (base.TicksLeft == historyItemTick.TicksLeft && Ask == historyItemTick.Ask && AskSize == historyItemTick.AskSize && Bid == historyItemTick.Bid) - { - return BidSize == historyItemTick.BidSize; - } - return false; - } - - [NotPublished] - public override int GetHashCode() - { - return base.TicksLeft.GetHashCode() ^ Ask.GetHashCode() ^ AskSize.GetHashCode() ^ Bid.GetHashCode() ^ BidSize.GetHashCode(); - } - - [NotPublished] - public static bool operator ==(HistoryItemTick a, HistoryItemTick b) - { - if ((object)a == b) - { - return true; - } - if ((object)a == null || (object)b == null) - { - return false; - } - return a.Equals(b); - } - - [NotPublished] - public static bool operator !=(HistoryItemTick a, HistoryItemTick b) - { - return !(a == b); - } - } - public sealed class HistoryItemTimeStatistics : HistoryItem, IVolumeData - { - [CompilerGenerated] - private long ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private int ??; - - public override long TicksRight - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double Volume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int Trades - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double BuyVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int BuyTrades - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double SellVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int SellTrades - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public HistoryItemTimeStatistics() - { - } - - public HistoryItemTimeStatistics(HistoryItemTimeStatistics item) - : base(item) - { - TicksRight = item.TicksRight; - Volume = item.Volume; - BuyVolume = item.BuyVolume; - SellVolume = item.SellVolume; - Trades = item.Trades; - BuyTrades = item.BuyTrades; - SellTrades = item.SellTrades; - } - - public override object Clone() - { - return new HistoryItemTimeStatistics(this); - } - } - public sealed class HistoryItemVolumeProfile : HistoryItem - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func, double> ??; - - public static Func, VolumeDataItem> ??; - - internal double ?(KeyValuePair P_0) - { - return P_0.Key; - } - - internal VolumeDataItem ?(KeyValuePair P_0) - { - return new VolumeDataItem(P_0.Value); - } - } - - [CompilerGenerated] - private long ??; - - [CompilerGenerated] - private Dictionary ??; - - public override long TicksRight - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Dictionary PriceLevels - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public HistoryItemVolumeProfile() - { - } - - public HistoryItemVolumeProfile(HistoryItemVolumeProfile item) - : base(item) - { - TicksRight = item.TicksRight; - PriceLevels = item.PriceLevels.ToDictionary((KeyValuePair P_0) => P_0.Key, (KeyValuePair P_0) => new VolumeDataItem(P_0.Value)); - } - - public override object Clone() - { - return new HistoryItemVolumeProfile(this); - } - } - public interface IVolumeData - { - double Volume { get; set; } - - double BuyVolume { get; set; } - - double SellVolume { get; set; } - - int Trades { get; set; } - - int BuyTrades { get; set; } - - int SellTrades { get; set; } - } - public sealed class VolumeDataItem : IVolumeData - { - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private int ??; - - public double Volume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double BuyVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double SellVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int Trades - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int BuyTrades - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int SellTrades - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public VolumeDataItem() - { - } - - public VolumeDataItem(VolumeDataItem volumeData) - { - Volume = volumeData.Volume; - BuyVolume = volumeData.BuyVolume; - SellVolume = volumeData.SellVolume; - Trades = volumeData.Trades; - BuyTrades = volumeData.BuyTrades; - SellTrades = volumeData.SellTrades; - } - } - /// - /// Resolves a history request parameters per symbol - /// - [Published] - [ProtoContract] - public sealed class HistoryRequestParameters : RequestParameters - { - private Symbol ??; - - private string ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private HistoryAggregation ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private ISessionsContainer ??; - - [CompilerGenerated] - private IProgress ??; - - [CompilerGenerated] - private readonly HistoryRequestType ??; - - public override RequestType Type => RequestType.History; - - public Symbol Symbol - { - get - { - return ??; - } - set - { - ?? = value; - ?? = ???.Id; - } - } - - [ProtoMember(1)] - public string SymbolId - { - get - { - string id = ??; - if (id == null) - { - Symbol symbol = Symbol; - if (symbol == null) - { - return null; - } - id = symbol.Id; - } - return id; - } - set - { - ?? = value; - } - } - - [ProtoMember(2)] - public DateTime FromTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(3)] - public DateTime ToTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Interval Interval - { - get - { - return new Interval(FromTime, ToTime); - } - set - { - FromTime = value.From; - ToTime = value.To; - } - } - - public HistoryAggregation Aggregation - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool ForceReload - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool ExcludeOutOfSession - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public ISessionsContainer SessionsContainer - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IProgress ProgressInfo - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public HistoryRequestParameters Copy => new HistoryRequestParameters(this); - - public HistoryRequestType HistoryRequestType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public HistoryRequestParameters() - { - ProgressInfo = new PercentageProgress(); - ForceReload = false; - ExcludeOutOfSession = true; - } - - public HistoryRequestParameters(HistoryRequestParameters original) - { - Symbol = original.Symbol; - SymbolId = original.SymbolId; - Aggregation = original.Aggregation?.Clone() as HistoryAggregation; - FromTime = original.FromTime; - ToTime = original.ToTime; - ForceReload = original.ForceReload; - base.CancellationToken = original.CancellationToken; - SessionsContainer = original.SessionsContainer; - ExcludeOutOfSession = original.ExcludeOutOfSession; - HistoryRequestType = original.HistoryRequestType; - } - - public HistoryDescription ToDescription() - { - return new HistoryDescription(SymbolId, Aggregation); - } - } - public enum HistoryRequestType - { - General, - BuildUncompleteBarLogic - } - public class PercentageProgress : IProgress - { - [CompilerGenerated] - private float ?; - - public float ProgressValue - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = num; - } - } - - public void Report(float value) - { - ProgressValue = value; - } - - public override string ToString() - { - return ProgressValue.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), CultureInfo.DefaultThreadCurrentUICulture); - } - } - /// - /// Represents mechanism for supporting predefined and custom periods - /// - [Serializable] - [Published] - [DataContract(Name = "Period", Namespace = "TradingPlatform")] - [ProtoContract] - public struct Period : IComparable, IXElementSerialization - { - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private BasePeriod ??; - - /// - /// Gets period multiplier - /// - [DataMember(Name = "PeriodMultiplier")] - [ProtoMember(1)] - public int PeriodMultiplier - { - [CompilerGenerated] - readonly get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Gets base period type - /// - [DataMember(Name = "BasePeriod")] - [ProtoMember(2)] - public BasePeriod BasePeriod - { - [CompilerGenerated] - readonly get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = basePeriod; - } - } - - /// - /// Gets ticks value as an result of base period multiplicated by - /// - public long Ticks => TicksInBasePeriod(BasePeriod) * PeriodMultiplier; - - public TimeSpan Duration => TimeSpan.FromTicks(Ticks); - - /// - /// Predefined period - /// - public static Period TICK1 => new Period(BasePeriod.Tick, 1); - - /// - /// Predefined period - /// - public static Period SECOND1 => new Period(BasePeriod.Second, 1); - - /// - /// Predefined period - /// - public static Period SECOND5 => new Period(BasePeriod.Second, 5); - - /// - /// Predefined period - /// - public static Period SECOND10 => new Period(BasePeriod.Second, 10); - - /// - /// Predefined period - /// - public static Period SECOND15 => new Period(BasePeriod.Second, 15); - - /// - /// Predefined period - /// - public static Period SECOND30 => new Period(BasePeriod.Second, 30); - - /// - /// Predefined period - /// - public static Period MIN1 => new Period(BasePeriod.Minute, 1); - - /// - /// Predefined period - /// - public static Period MIN2 => new Period(BasePeriod.Minute, 2); - - /// - /// Predefined period - /// - public static Period MIN3 => new Period(BasePeriod.Minute, 3); - - /// - /// Predefined period - /// - public static Period MIN4 => new Period(BasePeriod.Minute, 4); - - /// - /// Predefined period - /// - public static Period MIN5 => new Period(BasePeriod.Minute, 5); - - /// - /// Predefined period - /// - public static Period MIN10 => new Period(BasePeriod.Minute, 10); - - /// - /// Predefined period - /// - public static Period MIN15 => new Period(BasePeriod.Minute, 15); - - /// - /// Predefined period - /// - public static Period MIN30 => new Period(BasePeriod.Minute, 30); - - /// - /// Predefined period - /// - public static Period HOUR1 => new Period(BasePeriod.Hour, 1); - - /// - /// Predefined period - /// - public static Period HOUR2 => new Period(BasePeriod.Hour, 2); - - /// - /// Predefined period - /// - public static Period HOUR3 => new Period(BasePeriod.Hour, 3); - - /// - /// Predefined period - /// - public static Period HOUR4 => new Period(BasePeriod.Hour, 4); - - /// - /// Predefined period - /// - public static Period HOUR6 => new Period(BasePeriod.Hour, 6); - - /// - /// Predefined period - /// - public static Period HOUR8 => new Period(BasePeriod.Hour, 8); - - /// - /// Predefined period - /// - public static Period HOUR12 => new Period(BasePeriod.Hour, 12); - - /// - /// Predefined period - /// - public static Period DAY1 => new Period(BasePeriod.Day, 1); - - /// - /// Predefined period - /// - public static Period WEEK1 => new Period(BasePeriod.Week, 1); - - /// - /// Predefined period - /// - public static Period MONTH1 => new Period(BasePeriod.Month, 1); - - /// - /// Predefined period - /// - public static Period YEAR1 => new Period(BasePeriod.Year, 1); - - /// - /// Creates Period instance with greater than 0 - /// - /// - /// - public Period(BasePeriod basePeriod, int periodMultiplier) - { - if (periodMultiplier <= 0) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - BasePeriod = basePeriod; - PeriodMultiplier = periodMultiplier; - } - - /// - /// True if their base paeriods and are respectively equal. - /// - /// - /// - /// - [NotPublished] - public static bool operator ==(Period period1, Period period2) - { - if (period1.BasePeriod == period2.BasePeriod) - { - return period1.PeriodMultiplier == period2.PeriodMultiplier; - } - return false; - } - - /// - /// True if any of their base paeriods and are respectively not equal. - /// - /// - /// - /// - [NotPublished] - public static bool operator !=(Period period1, Period period2) - { - if (period1.BasePeriod == period2.BasePeriod) - { - return period1.PeriodMultiplier != period2.PeriodMultiplier; - } - return true; - } - - /// - /// True if their ticks values are satisfying initial condition - /// - /// - /// - /// - [NotPublished] - public static bool operator <(Period period1, Period period2) - { - long ticks = period1.Ticks; - long ticks2 = period2.Ticks; - if (ticks < 0 && ticks2 < 0) - { - return ticks > ticks2; - } - return ticks < ticks2; - } - - /// - /// True if their ticks values are satisfying initial condition - /// - /// - /// - /// - [NotPublished] - public static bool operator >(Period period1, Period period2) - { - long ticks = period1.Ticks; - long ticks2 = period2.Ticks; - if (ticks < 0 && ticks2 < 0) - { - return ticks < ticks2; - } - return ticks > ticks2; - } - - /// - /// True if their ticks values are satisfying initial condition - /// - /// - /// - /// - [NotPublished] - public static bool operator <=(Period period1, Period period2) - { - long ticks = period1.Ticks; - long ticks2 = period2.Ticks; - if (ticks < 0 && ticks2 < 0) - { - return ticks >= ticks2; - } - return ticks <= ticks2; - } - - /// - /// True if their ticks values are satisfying initial condition - /// - /// - /// - /// - [NotPublished] - public static bool operator >=(Period period1, Period period2) - { - long ticks = period1.Ticks; - long ticks2 = period2.Ticks; - if (ticks < 0 && ticks2 < 0) - { - return ticks <= ticks2; - } - return ticks >= ticks2; - } - - /// - /// True if their base paeriods and are respectively equal. - /// - /// - /// - [NotPublished] - public override bool Equals(object obj) - { - if (obj is Period period) - { - if (BasePeriod == period.BasePeriod) - { - return PeriodMultiplier == period.PeriodMultiplier; - } - return false; - } - return false; - } - - [NotPublished] - public override int GetHashCode() - { - return PeriodMultiplier ^ (int)BasePeriod; - } - - /// - /// Formats given value to a specific user friendly string - /// - /// - /// - [NotPublished] - public string Format(DateTime dateTime) - { - switch (BasePeriod) - { - case BasePeriod.Tick: - if (PeriodMultiplier > 1) - { - return Core.Instance.TimeUtils.GetFormatedDateTime(dateTime); - } - return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dateTime); - case BasePeriod.Second: - return Core.Instance.TimeUtils.GetFormatedDateTime(dateTime); - case BasePeriod.Minute: - case BasePeriod.Hour: - return Core.Instance.TimeUtils.GetFormatedDateShortTime(dateTime); - case BasePeriod.Day: - case BasePeriod.Week: - return Core.Instance.TimeUtils.GetFormatedDate(dateTime); - case BasePeriod.Month: - case BasePeriod.Year: - return Core.Instance.TimeUtils.GetFormatedDate(dateTime); - default: - return Core.Instance.TimeUtils.GetFormatedDate(dateTime); - } - } - - [NotPublished] - public string Format() - { - return $"{PeriodMultiplier}{BasePeriodToShortString(BasePeriod)}"; - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 2); - defaultInterpolatedStringHandler.AppendFormatted(PeriodMultiplier); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(BasePeriod); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - /// - /// Returns value in ticks according to base period type - /// - /// - /// - public static long TicksInBasePeriod(BasePeriod basePeriod) - { - return basePeriod switch - { - BasePeriod.Tick => -1L, - BasePeriod.Second => 10000000L, - BasePeriod.Minute => 600000000L, - BasePeriod.Hour => 36000000000L, - BasePeriod.Day => 864000000000L, - BasePeriod.Week => 6048000000000L, - BasePeriod.Month => 25920000000000L, - BasePeriod.Year => 315360000000000L, - _ => throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - }; - } - - /// - /// Returns shorted string according to base period type - /// - /// - /// - public static string BasePeriodToShortString(BasePeriod basePeriod) - { - return basePeriod switch - { - BasePeriod.Tick => loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - BasePeriod.Second => loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - BasePeriod.Minute => loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - BasePeriod.Hour => loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - BasePeriod.Day => loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - BasePeriod.Week => loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - BasePeriod.Month => loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - BasePeriod.Year => loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - _ => string.Empty, - }; - } - - /// - /// Converts time gap into dates range - /// - /// - /// - public void ToDatesRange(out DateTime from, out DateTime to) - { - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - if (BasePeriod == BasePeriod.Day) - { - from = dateTimeUtcNow.AddDays(-PeriodMultiplier); - } - else if (BasePeriod == BasePeriod.Month) - { - from = dateTimeUtcNow.AddMonths(-PeriodMultiplier); - } - else if (BasePeriod == BasePeriod.Year) - { - from = dateTimeUtcNow.AddYears(-PeriodMultiplier); - } - else - { - from = dateTimeUtcNow.AddTicks(-Ticks); - } - to = dateTimeUtcNow; - } - - /// - /// Compares by - /// - /// - /// - [NotPublished] - public int CompareTo(object other) - { - return Ticks.CompareTo(((Period)other).Ticks); - } - - public static bool TryParse(string value, out Period period) - { - period = default(Period); - string[] array = value.Split('-'); - if (array.Length != 2) - { - return false; - } - if (!int.TryParse(array[0].Trim(), out var result)) - { - return false; - } - if (!Enum.TryParse(array[1].Trim(), ignoreCase: true, out var result2)) - { - return false; - } - period = new Period(result2, result); - return true; - } - - /// - /// Serialize into object - /// - /// - [NotPublished] - public XElement ToXElement() - { - return new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)BasePeriod).ToString()), new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), PeriodMultiplier.ToString())); - } - - /// - /// Deserialize from - /// - /// - /// - [NotPublished] - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - BasePeriod = (BasePeriod)xElement.ToInt(); - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - PeriodMultiplier = xElement2.ToInt(); - } - } - } -} -namespace ? -{ - internal class ? : HistoryEventArgs - { - [CompilerGenerated] - private MessageQuote ??; - - public MessageQuote MessageQuote - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = messageQuote; - } - } - } -} -namespace TradingPlatform.BusinessLayer -{ - /// - /// Represent access to DayBar quote, which contains summary information about instrument prices. - /// - [DataContract(Name = "DayBar", Namespace = "TradingPlatform")] - [ProtoContract] - [Published] - public class DayBar : MessageQuote, IXElementSerialization - { - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private long ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private long ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private bool ??; - - [NotPublished] - public override MessageType Type => MessageType.DayBar; - - /// - /// High price - /// - [DataMember(Name = "High")] - [ProtoMember(1)] - public double High - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Open price - /// - [DataMember(Name = "Open")] - [ProtoMember(2)] - public double Open - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Low price - /// - [DataMember(Name = "Low")] - [ProtoMember(3)] - public double Low - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Previous Close price - /// - [DataMember(Name = "PreviousClose")] - [ProtoMember(4)] - public double PreviousClose - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Ticks value - /// - [DataMember(Name = "Ticks")] - [ProtoMember(5)] - public long Ticks - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Volume value - /// - [DataMember(Name = "Volume")] - [ProtoMember(6)] - public double Volume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Volume value - /// - [DataMember(Name = "quoteAssetVolume")] - [ProtoMember(7)] - public double QuoteAssetVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Previous settlement price - /// - [DataMember(Name = "PrevSettlementPrice")] - [ProtoMember(8)] - public double PrevSettlementPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Bid price - /// - [DataMember(Name = "Bid")] - [ProtoMember(9)] - public double Bid - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Bid size - /// - [DataMember(Name = "BidSize")] - [ProtoMember(10)] - public double BidSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Ask price - /// - [DataMember(Name = "Ask")] - [ProtoMember(11)] - public double Ask - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Ask size - /// - [DataMember(Name = "AskSize")] - [ProtoMember(12)] - public double AskSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Last price - /// - [DataMember(Name = "Last")] - [ProtoMember(13)] - public double Last - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Last size - /// - [DataMember(Name = "LastSize")] - [ProtoMember(14)] - public double LastSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Trades value - /// - [DataMember(Name = "Trades")] - [ProtoMember(15)] - public long Trades - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Change value - /// - [DataMember(Name = "Change")] - [ProtoMember(16)] - public double Change - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Change value in percentage - /// - [DataMember(Name = "ChangePercentage")] - [ProtoMember(17)] - public double ChangePercentage - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// - /// - [DataMember(Name = "OpenInterest")] - [ProtoMember(18)] - public double OpenInterest - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "TopPriceLimit")] - [ProtoMember(19)] - public double TopPriceLimit - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "BottomPriceLimit")] - [ProtoMember(20)] - public double BottomPriceLimit - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "AverageTradedPrice")] - [ProtoMember(21)] - public double AverageTradedPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "TotalBuyQuantity")] - [ProtoMember(22)] - public double TotalBuyQuantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "TotalSellQuantity")] - [ProtoMember(23)] - public double TotalSellQuantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "IV")] - [ProtoMember(24)] - public double IV - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Delta")] - [ProtoMember(25)] - public double Delta - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Vega")] - [ProtoMember(26)] - public double Vega - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Gamma")] - [ProtoMember(27)] - public double Gamma - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Theta")] - [ProtoMember(28)] - public double Theta - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Rho")] - [ProtoMember(29)] - public double Rho - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Mark")] - [ProtoMember(30)] - public double Mark - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "MarkSize")] - [ProtoMember(31)] - public double MarkSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "FundingRate")] - [ProtoMember(32)] - public double FundingRate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "FundingTime")] - [ProtoMember(33)] - public DateTime FundingTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - internal bool FullRefresh - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = flag; - } - } - - private DayBar() - { - } - - [NotPublished] - public DayBar(string symbolId, DateTime time) - : base(symbolId, time) - { - High = double.NaN; - Open = double.NaN; - Low = double.NaN; - PreviousClose = double.NaN; - Ticks = -1L; - Volume = double.NaN; - QuoteAssetVolume = double.NaN; - PrevSettlementPrice = double.NaN; - Bid = double.NaN; - BidSize = double.NaN; - Ask = double.NaN; - AskSize = double.NaN; - Last = double.NaN; - LastSize = double.NaN; - Mark = double.NaN; - Trades = -1L; - Change = double.NaN; - ChangePercentage = double.NaN; - OpenInterest = double.NaN; - TopPriceLimit = double.NaN; - BottomPriceLimit = double.NaN; - AverageTradedPrice = double.NaN; - TotalBuyQuantity = double.NaN; - TotalSellQuantity = double.NaN; - IV = double.NaN; - Delta = double.NaN; - Vega = double.NaN; - Gamma = double.NaN; - Theta = double.NaN; - Rho = double.NaN; - FundingRate = double.NaN; - FundingTime = default(DateTime); - } - - [NotPublished] - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), base.SymbolId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Ask)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AskSize)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Bid)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), BidSize)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Last)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LastSize)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), Mark); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Open)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), High)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Low)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), PreviousClose)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Ticks)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Trades)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), Volume)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), QuoteAssetVolume)); - return xElement; - } - - [NotPublished] - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - base.SymbolId = xElement.Value; - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - Ask = xElement2.ToDouble(); - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - AskSize = xElement3.ToDouble(); - } - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - Bid = xElement4.ToDouble(); - } - XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement5 != null) - { - BidSize = xElement5.ToDouble(); - } - XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement6 != null) - { - Last = xElement6.ToDouble(); - } - XElement xElement7 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement7 != null) - { - LastSize = xElement7.ToDouble(); - } - XElement xElement8 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement8 != null) - { - Mark = xElement8.ToDouble(); - } - XElement xElement9 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement9 != null) - { - Open = xElement9.ToDouble(); - } - XElement xElement10 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement10 != null) - { - High = xElement10.ToDouble(); - } - XElement xElement11 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement11 != null) - { - Low = xElement11.ToDouble(); - } - XElement xElement12 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement12 != null) - { - PreviousClose = xElement12.ToDouble(); - } - XElement xElement13 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement13 != null) - { - Ticks = xElement13.ToLong(); - } - XElement xElement14 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement14 != null) - { - Trades = xElement14.ToLong(); - } - XElement xElement15 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - if (xElement15 != null) - { - Volume = xElement15.ToDouble(); - } - XElement xElement16 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement16 != null) - { - QuoteAssetVolume = xElement16.ToDouble(); - } - } - } - /// - /// Represent access to DOM2 quote, which contains Bids and Asks. - /// - [DataContract(Name = "DOMQuote", Namespace = "TradingPlatform")] - [ProtoContract] - [Published] - public class DOMQuote : MessageQuote - { - [CompilerGenerated] - private List ??; - - [CompilerGenerated] - private List ??; - - [NotPublished] - public override MessageType Type => MessageType.DOM; - - /// - /// Collection of Asks quotes - /// - [DataMember(Name = "Asks")] - [ProtoMember(1)] - public List Asks - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Collection of Bids quotes - /// - [DataMember(Name = "Bids")] - [ProtoMember(2)] - public List Bids - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - private DOMQuote() - { - } - - [NotPublished] - public DOMQuote(string symbolId, DateTime time) - : base(symbolId, time) - { - Asks = new List(); - Bids = new List(); - } - - [NotPublished] - public override string ToString() - { - StringBuilder stringBuilder = new StringBuilder(); - StringBuilder stringBuilder2 = stringBuilder; - StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(2, 1, stringBuilder2); - handler.AppendFormatted(base.ToString()); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - stringBuilder2.Append(ref handler); - foreach (Level2Quote ask in Asks) - { - stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - stringBuilder.Append(ask.ToString()); - } - foreach (Level2Quote bid in Bids) - { - stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - stringBuilder.Append(bid.ToString()); - } - return stringBuilder.ToString(); - } - } - /// - /// Represent access to trade information. - /// - [DataContract(Name = "Last", Namespace = "TradingPlatform")] - [ProtoContract] - [Published] - public class Last : MessageQuote, IVolumeTickData, IBuyerSellerData - { - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private AggressorFlag ??; - - [CompilerGenerated] - private TickDirection ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private double ??; - - [NotPublished] - public override MessageType Type => MessageType.Last; - - /// - /// Price at which trade occured - /// - [DataMember(Name = "Price")] - [ProtoMember(1)] - public double Price - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Size of the trade - /// - [DataMember(Name = "Size")] - [ProtoMember(2)] - public double Size - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Information about operation side of the trade - /// - [DataMember(Name = "AggressorFlag")] - [ProtoMember(3)] - public AggressorFlag AggressorFlag - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Shows the direction of price movement, comparing to previous value. - /// - [DataMember(Name = "TickDirection")] - [ProtoMember(4)] - public TickDirection TickDirection - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "OpenInterest")] - [ProtoMember(5)] - public double OpenInterest - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Buyer")] - [ProtoMember(6)] - public string Buyer - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Seller")] - [ProtoMember(7)] - public string Seller - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "TradeId")] - [ProtoMember(8)] - public string TradeId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "QuoteAssetVolume")] - [ProtoMember(9)] - public double QuoteAssetVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - VolumeTickDataType IVolumeTickData.VolumeTickDataType => VolumeTickDataType.Lasts; - - long IVolumeTickData.Time => base.Time.Ticks; - - double IVolumeTickData.Volume => Size; - - private Last() - { - } - - [NotPublished] - public Last(string symbol, double price, double size, DateTime time) - : base(symbol, time) - { - OpenInterest = double.NaN; - Price = price; - Size = size; - QuoteAssetVolume = double.NaN; - AggressorFlag = AggressorFlag.NotSet; - TickDirection = TickDirection.NotSet; - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(23, 4); - defaultInterpolatedStringHandler.AppendFormatted(base.ToString()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Price); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Size); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(TradeId); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - /// - /// Represent access to Level2 quote. - /// - [DataContract(Name = "Level2Quote", Namespace = "TradingPlatform")] - [ProtoContract] - [Published] - public class Level2Quote : MessageQuote - { - [CompilerGenerated] - private QuotePriceType ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private long ??; - - [CompilerGenerated] - private int ??; - - [NotPublished] - public override MessageType Type => MessageType.Level2; - - /// - /// Price type of Level2 quote: Bid or Ask - /// - [DataMember(Name = "PriceType")] - [ProtoMember(1)] - public QuotePriceType PriceType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = quotePriceType; - } - } - - /// - /// Price of Level2 quote - /// - [DataMember(Name = "Price")] - [ProtoMember(2)] - public double Price - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Size of Level2 quote - /// - [DataMember(Name = "Size")] - [ProtoMember(3)] - public double Size - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Unique ID of Level2 quote - /// - [DataMember(Name = "Id")] - [ProtoMember(4)] - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Shows, whether Level2 quote is using only for removing from depth - /// - [DataMember(Name = "Closed")] - [ProtoMember(5)] - public bool Closed - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Broker identifier that send level2 quote - /// - [DataMember(Name = "Broker")] - [ProtoMember(6)] - public string Broker - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// specifies the implied quantity associated with the price for the quote. Subtracting this amount from the Size yields the outright quantity for the price level. A value of zero indicates that the implied size is not available/defined or that it is actually zero. - /// - [DataMember(Name = "ImpliedSize")] - [ProtoMember(7)] - public double ImpliedSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Priority")] - [ProtoMember(8)] - public long Priority - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Number orders of Level2 quote - /// - [DataMember(Name = "NumberOrders")] - [ProtoMember(9)] - public int NumberOrders - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - private Level2Quote() - { - } - - [NotPublished] - public Level2Quote(QuotePriceType priceType, string symbolId, string id, double price, double size, DateTime time) - : base(symbolId, time) - { - PriceType = priceType; - Price = price; - Size = size; - Id = id; - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(33, 5); - defaultInterpolatedStringHandler.AppendFormatted(base.ToString()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Id); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Price); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Size); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Closed); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - [DataContract(Name = "Mark", Namespace = "TradingPlatform")] - [ProtoContract] - [Published] - public class Mark : MessageQuote - { - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [NotPublished] - public override MessageType Type => MessageType.Mark; - - [DataMember(Name = "Price")] - [ProtoMember(1)] - public double Price - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - [DataMember(Name = "Size")] - [ProtoMember(2)] - public double Size - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - private Mark() - { - } - - [NotPublished] - public Mark(string symbol, DateTime time, double price, double size = double.NaN) - : base(symbol, time) - { - Price = price; - Size = size; - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(17, 3); - defaultInterpolatedStringHandler.AppendFormatted(base.ToString()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Price); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Size); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - [Serializable] - [KnownType(typeof(Level2Quote))] - [KnownType(typeof(Last))] - [KnownType(typeof(Quote))] - [KnownType(typeof(DOMQuote))] - [KnownType(typeof(DayBar))] - [KnownType(typeof(Mark))] - [DataContract(Name = "MessageQuote", Namespace = "TradingPlatform")] - [ProtoContract] - [ProtoInclude(3, typeof(Quote))] - [ProtoInclude(4, typeof(Last))] - [ProtoInclude(5, typeof(Level2Quote))] - [ProtoInclude(6, typeof(DOMQuote))] - [ProtoInclude(7, typeof(DayBar))] - [ProtoInclude(8, typeof(Mark))] - public abstract class MessageQuote : Message - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private DateTime ??; - - [DataMember(Name = "Symbol")] - [ProtoMember(1)] - public string SymbolId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected internal set - { - ?? = value; - } - } - - /// - /// Time of the quote - /// - [DataMember(Name = "Time")] - [ProtoMember(2)] - public DateTime Time - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - private protected MessageQuote() - { - } - - protected MessageQuote(string symbolId, DateTime time) - { - SymbolId = symbolId; - Time = time; - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(5, 4); - defaultInterpolatedStringHandler.AppendFormatted(Time.Ticks); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Type); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Time); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(SymbolId); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - /// - /// Represent access to quote information. - /// - [DataContract(Name = "Quote", Namespace = "TradingPlatform")] - [ProtoContract] - [Published] - public class Quote : MessageQuote, IVolumeTickData - { - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private TickDirection ??; - - [CompilerGenerated] - private TickDirection ??; - - [NotPublished] - public override MessageType Type => MessageType.Quote; - - /// - /// Bid price - /// - [DataMember(Name = "Bid")] - [ProtoMember(1)] - public double Bid - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Bid size - /// - [DataMember(Name = "BidSize")] - [ProtoMember(2)] - public double BidSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Ask price - /// - [DataMember(Name = "Ask")] - [ProtoMember(3)] - public double Ask - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Ask size - /// - [DataMember(Name = "AskSize")] - [ProtoMember(4)] - public double AskSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Shows the direction of bid price movement, comparing to previous value. - /// - [DataMember(Name = "BidTickDirection")] - [ProtoMember(5)] - public TickDirection BidTickDirection - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = tickDirection; - } - } - - /// - /// Shows the direction of ask price movement, comparing to previous value. - /// - [DataMember(Name = "AskTickDirection")] - [ProtoMember(6)] - public TickDirection AskTickDirection - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = tickDirection; - } - } - - VolumeTickDataType IVolumeTickData.VolumeTickDataType => VolumeTickDataType.Ticks; - - long IVolumeTickData.Time => base.Time.Ticks; - - double IVolumeTickData.Price => Bid; - - double IVolumeTickData.Volume => 1.0; - - TickDirection IVolumeTickData.TickDirection => BidTickDirection; - - AggressorFlag IVolumeTickData.AggressorFlag => Symbol.ConvertTickDirection(BidTickDirection); - - private Quote() - { - } - - [NotPublished] - public Quote(string symbol, double bid, double bidSize, double ask, double askSize, DateTime time) - : base(symbol, time) - { - Bid = bid; - BidSize = bidSize; - Ask = ask; - AskSize = askSize; - BidTickDirection = TickDirection.NotSet; - AskTickDirection = TickDirection.NotSet; - } - - [NotPublished] - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(36, 5); - defaultInterpolatedStringHandler.AppendFormatted(base.ToString()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Bid); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Ask); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(BidSize); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(AskSize); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - /// - /// Specifies the reason of price data updating. - /// - public enum UpdateReason - { - Unknown, - /// - /// Indicates the processing of new historical bar. - /// - HistoricalBar, - /// - /// Indicates the coming of new real-time tick. - /// - NewTick, - /// - /// Indicates a start of new real-time bar. - /// - NewBar - } - /// - /// Specifies the type of events when indicator should recalculate itself. - /// - public enum IndicatorUpdateType - { - OnTick, - OnBarClose - } - /// - /// Specifies the style of indicator line. - /// - [Published] - public enum LineStyle - { - [Description("Solid")] - Solid, - [Description("Dash")] - Dash, - [Description("Dot")] - Dot, - [Description("Dash dot")] - DashDot, - [Description("Histogramm")] - Histogramm, - [Description("Points")] - Points, - [Description("Columns")] - Columns, - [Description("Step line")] - StepLine - } - [Published] - public enum StrategyState - { - Created = 10, - Working = 20, - Stopped = 30, - Removed = 40, - WaitingForConnection = 50 - } - [Published] - public enum StrategyLoggingLevel - { - Info, - Trading, - Error - } - /// - /// Moving average mode - /// - [Published] - public enum MaMode - { - /// - /// Simple Moving Average - /// - SMA, - /// - /// Exponential Moving Average - /// - EMA, - /// - /// Smoothed Moving Average - /// - SMMA, - /// - /// Linearly Weighted Moving Average - /// - LWMA - } - public enum AfirmaMode - { - Hanning, - Hamming, - Blackman, - BlackmanHarris - } - public enum RSIMode - { - Simple, - Exponential - } - public enum AMATrendType - { - Fixed, - Average - } - /// - /// - /// - public enum HVSheduleMode - { - /// - /// Displays HV schedule and percentile value. - /// - HV, - /// - /// Displays the percentile schedule only. - /// - Percentile - } - public enum ScriptCreationType - { - [Description("Default")] - [EnumMember(Value = "Default")] - Default, - [Description("Custom")] - [EnumMember(Value = "Custom")] - Custom - } - [NotPublished] - public enum TemplateType - { - Indicator, - DrawingTool - } - [NotPublished] - public enum IndicatorCalculationType - { - ByPeriod, - AllAvailableData - } - public abstract class ExecutionEntity : IDisposable, ICustomizable - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - internal bool ?(FieldInfo P_0) - { - return Attribute.IsDefined(P_0, typeof(InputParameterAttribute)); - } - - internal bool ?(PropertyInfo P_0) - { - return Attribute.IsDefined(P_0, typeof(InputParameterAttribute)); - } - - internal bool ?(FieldInfo P_0) - { - if (??.IsAssignableFrom(P_0.FieldType)) - { - return !Attribute.IsDefined(P_0, typeof(InputParameterAttribute)); - } - return false; - } - - internal bool ?(PropertyInfo P_0) - { - if (??.IsAssignableFrom(P_0.PropertyType)) - { - return !Attribute.IsDefined(P_0, typeof(InputParameterAttribute)); - } - return false; - } - - internal bool ?(FieldInfo P_0) - { - return Attribute.IsDefined(P_0, typeof(InputParameterAttribute)); - } - - internal bool ?(PropertyInfo P_0) - { - return Attribute.IsDefined(P_0, typeof(InputParameterAttribute)); - } - - internal bool ?(FieldInfo P_0) - { - if (??.IsAssignableFrom(P_0.FieldType)) - { - return !Attribute.IsDefined(P_0, typeof(InputParameterAttribute)); - } - return false; - } - - internal bool ?(PropertyInfo P_0) - { - if (??.IsAssignableFrom(P_0.PropertyType)) - { - return !Attribute.IsDefined(P_0, typeof(InputParameterAttribute)); - } - return false; - } - } - - [CompilerGenerated] - private sealed class ? - { - public SettingItem ??; - - internal bool ?(SettingItem P_0) - { - return P_0.Name == ??.Name; - } - } - - [CompilerGenerated] - private sealed class ? - { - public SettingItem ??; - - internal bool ?(SettingItem P_0) - { - return P_0.Name == ??.Name; - } - } - - private static readonly Type ??; - - private static readonly Dictionary ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private ScriptKey ??; - - [CompilerGenerated] - private readonly Version ??; - - [CompilerGenerated] - private Action ??; - - private readonly Type ??; - - [CompilerGenerated] - private bool ??; - - protected static Core Core => Core.Instance; - - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected set - { - ?? = value; - } - } - - public string Description - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected set - { - ?? = value; - } - } - - public ScriptKey Key - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = scriptKey; - } - } - - public Version Version - { - [CompilerGenerated] - get - { - return ??; - } - } - - public virtual IList Settings - { - get - { - List list = new List(); - SettingItemSeparatorGroup separatorGroup = new SettingItemSeparatorGroup(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), -1000) - { - Key = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }; - foreach (FieldInfo item in from P_0 in ??.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) - where Attribute.IsDefined(P_0, typeof(InputParameterAttribute)) - select P_0) - { - InputParameterAttribute customAttribute = item.GetCustomAttribute(inherit: true); - object value = item.GetValue(this); - SettingItem ?? = ?(customAttribute, item.FieldType, item.Name, value); - if (?? != null) - { - if (list.Any((SettingItem P_0) => P_0.Name == ??.Name)) - { - Core.Loggers.Log(Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ??.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - else - { - list.Add(??); - } - } - } - foreach (PropertyInfo item2 in from P_0 in ??.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) - where Attribute.IsDefined(P_0, typeof(InputParameterAttribute)) - select P_0) - { - InputParameterAttribute customAttribute2 = item2.GetCustomAttribute(inherit: true); - object value2 = item2.GetValue(this); - SettingItem ?? = ?(customAttribute2, item2.PropertyType, item2.Name, value2); - if (?? != null) - { - if (list.Any((SettingItem P_0) => P_0.Name == ??.Name)) - { - Core.Loggers.Log(Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ??.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - else - { - list.Add(??); - } - } - } - foreach (FieldInfo item3 in from P_0 in ??.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) - where ??.IsAssignableFrom(P_0.FieldType) && !Attribute.IsDefined(P_0, typeof(InputParameterAttribute)) - select P_0) - { - if (item3.GetValue(this) is SettingItem settingItem) - { - list.Add(settingItem.GetCopy()); - } - } - foreach (PropertyInfo item4 in from P_0 in ??.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) - where ??.IsAssignableFrom(P_0.PropertyType) && !Attribute.IsDefined(P_0, typeof(InputParameterAttribute)) - select P_0) - { - if (item4.GetValue(this) is SettingItem settingItem2) - { - list.Add(settingItem2.GetCopy()); - } - } - list.Add(new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Key.ToString()) - { - VisibilityMode = VisibilityMode.Hidden - }); - for (int num = 0; num < list.Count; num++) - { - list[num].SeparatorGroup = separatorGroup; - } - return list; - } - set - { - if (value == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - bool flag = false; - Dictionary dictionary = null; - Dictionary dictionary2 = null; - IEnumerable enumerable = from P_0 in ??.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) - where Attribute.IsDefined(P_0, typeof(InputParameterAttribute)) - select P_0; - IEnumerable enumerable2 = from P_0 in ??.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) - where Attribute.IsDefined(P_0, typeof(InputParameterAttribute)) - select P_0; - if (enumerable.Count() > 0) - { - dictionary = new Dictionary(); - foreach (FieldInfo item in enumerable) - { - InputParameterAttribute customAttribute = item.GetCustomAttribute(inherit: true); - string key = (string.IsNullOrEmpty(customAttribute.Name) ? item.Name : customAttribute.Name); - dictionary.TryAdd(key, item); - } - } - if (enumerable2.Count() > 0) - { - dictionary2 = new Dictionary(); - foreach (PropertyInfo item2 in enumerable2) - { - InputParameterAttribute customAttribute2 = item2.GetCustomAttribute(inherit: true); - string key2 = (string.IsNullOrEmpty(customAttribute2.Name) ? item2.Name : customAttribute2.Name); - dictionary2.TryAdd(key2, item2); - } - } - foreach (SettingItem item3 in value) - { - object value2; - if (item3.Type == SettingItemType.SelectorLocalized) - { - if (!(item3.Value is SelectItem selectItem)) - { - continue; - } - value2 = selectItem.Value; - } - else - { - value2 = item3.Value; - } - FieldInfo value3 = null; - if (dictionary != null && dictionary.TryGetValue(item3.Name, out value3)) - { - value3.SetValue(this, value2); - flag = true; - continue; - } - PropertyInfo value4 = null; - if (dictionary2 != null && dictionary2.TryGetValue(item3.Name, out value4)) - { - value4.SetValue(this, value2); - flag = true; - } - } - foreach (FieldInfo item4 in from P_0 in ??.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) - where ??.IsAssignableFrom(P_0.FieldType) && !Attribute.IsDefined(P_0, typeof(InputParameterAttribute)) - select P_0) - { - if (item4.GetValue(this) is SettingItem settingItem) - { - flag |= settingItem.?(value); - } - } - foreach (PropertyInfo item5 in from P_0 in ??.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) - where ??.IsAssignableFrom(P_0.PropertyType) && !Attribute.IsDefined(P_0, typeof(InputParameterAttribute)) - select P_0) - { - if (item5.GetValue(this) is SettingItem settingItem2) - { - flag |= settingItem2.?(value); - } - } - if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemString settingItemString && !string.IsNullOrEmpty(settingItemString.Value as string)) - { - Key = ScriptKey.CreateScriptKeyFromString(settingItemString.Value.ToString()); - } - if (flag) - { - OnSettingsUpdated(); - } - } - } - - private protected bool Disposed - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = flag; - } - } - - public event Action OnDispose - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - static ExecutionEntity() - { - ?? = typeof(SettingItem); - ?? = new Dictionary - { - { - typeof(bool), - SettingItemType.Boolean - }, - { - typeof(int), - SettingItemType.Integer - }, - { - typeof(string), - SettingItemType.String - }, - { - typeof(long), - SettingItemType.Integer - }, - { - typeof(double), - SettingItemType.Double - }, - { - typeof(decimal), - SettingItemType.Double - }, - { - typeof(DateTime), - SettingItemType.DateTime - }, - { - typeof(Period), - SettingItemType.Period - }, - { - typeof(Account), - SettingItemType.Account - }, - { - typeof(Symbol), - SettingItemType.Symbol - }, - { - typeof(Color), - SettingItemType.Color - }, - { - typeof(PairColor), - SettingItemType.PairColor - }, - { - typeof(LineOptions), - SettingItemType.LineOptions - } - }; - } - - protected ExecutionEntity() - { - ?? = GetType(); - string text = ??.Assembly.?(); - ?? = (string.IsNullOrEmpty(text) ? null : new Version(text)); - } - - public virtual void Dispose() - { - Disposed = true; - ???.Invoke(this); - } - - protected virtual void OnSettingsUpdated() - { - } - - protected void CheckDisposed() - { - if (Disposed) - { - throw new ObjectDisposedException(Name); - } - } - - private static SettingItem ?(InputParameterAttribute P_0, Type P_1, string P_2, object P_3) - { - string name = (string.IsNullOrEmpty(P_0.Name) ? P_2 : P_0.Name); - int sortIndex = P_0.SortIndex; - double minimum = P_0.Minimum; - double maximum = P_0.Maximum; - double increment = P_0.Increment; - int decimalPlaces = P_0.DecimalPlaces; - SettingItem result = null; - SettingItemType value2; - if (P_0.Variants != null) - { - if (P_0.Variants.Length % 2 != 0) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - IComparable comparable = P_3 as IComparable; - if (comparable == null) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - List list = new List(); - SelectItem value = null; - for (int i = 0; i < P_0.Variants.Length; i += 2) - { - IComparable comparable2 = P_0.Variants[i + 1]; - if (comparable2 == null) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (comparable2.GetType() != P_1) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(70, 2); - defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_1); - throw new ArgumentException(defaultInterpolatedStringHandler.ToStringAndClear()); - } - if (comparable2 is Enum) - { - comparable2 = (int)(object)comparable2; - comparable = (int)(object)comparable; - } - SelectItem selectItem = new SelectItem(P_0.Variants[i].ToString(), comparable2); - list.Add(selectItem); - if (comparable2.CompareTo(comparable) == 0) - { - value = selectItem; - } - } - result = new SettingItemSelectorLocalized(name, value, list, sortIndex); - } - else if (??.TryGetValue(P_1, out value2)) - { - SettingItem settingItem; - switch (value2) - { - case SettingItemType.Boolean: - settingItem = new SettingItemBoolean(name, P_3 != null && (bool)P_3, sortIndex); - break; - case SettingItemType.Integer: - settingItem = new SettingItemInteger(name, (P_3 != null) ? ((int)P_3) : 0, sortIndex) - { - Minimum = (int)minimum, - Maximum = (int)maximum, - Increment = Math.Max((int)increment, 1) - }; - break; - case SettingItemType.String: - settingItem = new SettingItemString(name, (P_3 == null) ? null : ((string)P_3), sortIndex); - break; - case SettingItemType.Double: - settingItem = new SettingItemDouble(name, (P_3 == null) ? 0.0 : ((double)P_3), sortIndex) - { - Minimum = minimum, - Maximum = maximum, - Increment = increment, - DecimalPlaces = decimalPlaces - }; - break; - case SettingItemType.DateTime: - settingItem = new SettingItemDateTime(name, (P_3 == null) ? default(DateTime) : ((DateTime)P_3), sortIndex); - break; - case SettingItemType.Period: - settingItem = new SettingItemPeriod(name, (P_3 == null) ? default(Period) : ((Period)P_3), sortIndex); - break; - case SettingItemType.Account: - settingItem = new SettingItemAccount(name, (P_3 == null) ? null : ((Account)P_3), sortIndex); - break; - case SettingItemType.Symbol: - settingItem = new SettingItemSymbol(name, (P_3 == null) ? null : ((Symbol)P_3), sortIndex); - break; - case SettingItemType.Color: - settingItem = new SettingItemColor(name, (P_3 == null) ? default(Color) : ((Color)P_3), sortIndex); - break; - case SettingItemType.PairColor: - settingItem = new SettingItemPairColor(name, (P_3 == null) ? null : ((PairColor)P_3), sortIndex); - break; - case SettingItemType.LineOptions: - settingItem = new SettingItemLineOptions(name, (P_3 == null) ? null : ((LineOptions)P_3), sortIndex); - break; - default: - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(37, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_3.GetType()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - throw new ArgumentException(defaultInterpolatedStringHandler.ToStringAndClear()); - } - } - result = settingItem; - } - return result; - } - } - [Published] - public sealed class BuiltInIndicators - { - private readonly IIndicatorsCollection ?; - - internal BuiltInIndicators(IIndicatorsCollection P_0 = null) - { - ? = P_0; - } - - private void ?(Indicator P_0) - { - ??.AddIndicator(P_0); - } - - /// - /// Returns an instance of the Exponential Moving Average (EMA) indicator. - /// EMA provides a weighted price calculation for the last N periods. - /// - /// Period of Exponential Moving Average - /// Sources prices for MA - /// Calculation type - public Indicator EMA(int maPeriod, PriceType priceType, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), maPeriod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the Linearly Weighted Moving Average - /// Linear Weighted Moving Average makes the most recent bar more important unlike SMA. - /// - /// Moving average period - /// Type of the price - /// - public Indicator LWMA(int maPeriod, PriceType priceType) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), maPeriod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the SMA(Simple Moving Average) indicator. - /// The 'SMA' indicator provides an average price for the last N periods. - /// - /// Period of simple moving average. - /// Sources prices for MA. - /// - public Indicator SMA(int period, PriceType priceType) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Returns an instance of the Smoothed Moving Average (SMMA) indicator. - /// SMMA indicator provides a smoothed average price for the last N periods. - /// - /// Moving average period - /// Type of the price - /// Calculation type - /// - public Indicator SMMA(int period, PriceType priceType, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the PPMA(Pivot Point Moving Average) indicator. - /// The 'PPMA' indicator uses the pivot point calculation as the input a simple moving average. - /// - /// Period of PPMA indicator - /// - /// - public Indicator PPMA(int period) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the MAS3 (3MASignal) indicator. - /// The 'MAS3' indicator offers buy and sell signals according to intersections of three moving averages. - /// - /// Short moving average period. - /// Middle moving average period. - /// Long moving average period. - /// The count of bars. The trend will be determined on this interval. - /// - /// - public Indicator MAS3(int shortPeriod, int middlePeriod, int longPeriod, int barsInterval) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), shortPeriod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), middlePeriod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), longPeriod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), barsInterval); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the specific MA indicator, according to selected 'MaMode'. - /// - /// Period of moving average. - /// Type of price. - /// MA mode. - /// Calculation type - /// - /// - public Indicator MA(int period, PriceType priceType, MaMode maMode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - return maMode switch - { - MaMode.SMA => SMA(period, priceType), - MaMode.EMA => EMA(period, priceType, calculationType), - MaMode.SMMA => SMMA(period, priceType, calculationType), - MaMode.LWMA => LWMA(period, priceType), - _ => null, - }; - } - - /// - /// Gets the BB(Bollinger Bands) indicator. - /// The 'BB' indicator provides a relative definition of high and low based on standard deviation and a simple moving average. - /// - /// Period of MA for envelopes. - /// Value of confidence interval. - /// Sources prices for MA. - /// Type of moving average. - /// Calculation type - /// - public Indicator BB(int period, double coefficient, PriceType priceType, MaMode maMode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), coefficient); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(maMode.ToString(), (int)maMode)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the Commodity Channel Index. - /// Measures the position of price in relation to its moving average. - /// - /// Period for CCI MA - /// Sources prices for CCI - /// MA mode for CCI - /// Calculation type - /// - public Indicator CCI(int maPeriod, PriceType priceType, MaMode maMode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), maPeriod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(maMode.ToString(), (int)maMode)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Returns an instance of the Modified Moving Average (MMA) indicator. - /// MMA comprises a sloping factor to help it overtake with the growing or declining value of the trading price of the currency. - /// - /// Period of Modified Moving Average - /// Sources prices for MA - /// - public Indicator MMA(int maPeriod, PriceType priceType) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), maPeriod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the Regression indicator - /// The Linear Regression Indicator plots the ending value of a Linear Regression Line for a specified number of bars; showing, statistically, where the price is expected to be. - /// - /// Moving average period - /// Type of the price - /// - public Indicator Regression(int period, PriceType priceType) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the Channel (Price Channel) indicator. - /// The 'Channel' indicator is based on measurement of min and max prices for the definite number of periods. - /// - /// Period of price channel - /// - /// - public Indicator Channel(int period) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the AFIRMA indicator - /// Autoregressive finite impulse response moving average. A digital filter accurately shows the price movement as powered with least square method to minimise time lag - /// - /// Moving average period - /// Type of the price - /// Afirma mode - /// with least squares method overlapping if true - /// - public Indicator AFIRMA(int period, PriceType priceType, AfirmaMode afirmaMode, bool least_squares_method) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(afirmaMode.ToString(), (int)afirmaMode)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), least_squares_method); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the RSI indicator. - /// Relative Strength Index (RSI) is a momentum oscillator that measures the speed and change of price movements. - /// - /// RSI Period - /// Price Type - /// RSI Mode (Simple or Exponential) - /// MA Mode for smooth data - /// MA period for smooth data - /// Calculation type - /// - public Indicator RSI(int period, PriceType priceType, RSIMode rsiMode, MaMode maMode, int maperiod, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(rsiMode.ToString(), (int)rsiMode)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(maMode.ToString(), (int)maMode)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), maperiod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Returns an instance of the McGinley Dynamic indicator. - /// McGinley Dynamic avoids of most whipsaws and it rapidly moves up or down according to a quickly changing market. It needs no adjusting because it is dynamic and it adjusts itself. - /// - /// Period of exponential moving average - /// Dynamic tracking factor - /// Source price type - /// Calculation type - /// - public Indicator MD(int period, int trackingFactor, PriceType priceType, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), trackingFactor); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the MAE (Moving Average Envelope) indicator. - /// The 'MAE' indicator demonstrates a range of the prices discrepancy from a Moving Average. - /// - /// Period of MA for envelopes. - /// Sources prices for MA. - /// Type of moving average. - /// Upband deviation in %. - /// Downband deviation in %. - /// Calculation type - /// - public Indicator MAE(int period, PriceType priceType, MaMode maMode, double upShift, double downShift, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(maMode.ToString(), (int)maMode)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), upShift); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), downShift); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Returns an instance of the Parabolic Time/Price System (SAR) indicator. - /// SAR indicator helps to define the direction of the prevailing trend and the moment to close positions opened during the reversal. - /// - /// Step of parabolic SAR system - /// Maximum value for the acceleration factor - /// - /// - public Indicator SAR(double step, double maximum) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), step); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), maximum); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the AO (Awesome Oscillator) indicator. - /// The 'AO' indicator determines market momentum. - /// - /// - public Indicator AO() - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - ?(indicator); - return indicator; - } - - /// - /// Gets the CMO (Chande Momentum Oscillator) indicator. - /// The CMO calculates the dividing of difference between the sum of all recent gains and the sum of all recent losses by the sum of all price movement over the period. - /// - /// Period of MA for envelopes. - /// Sources prices for MA. - /// - /// - public Indicator CMO(int period, PriceType priceType) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Returns an instance of the ZigZag indicator. - /// ZigZag is a trend following indicator that is used to predict when a given symbol's momentum is reversing. - /// - /// Percent Deviation - /// - /// - public Indicator ZZ(double deviation) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), deviation); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the Aroon indicator. - /// Reveals the beginning of a new trend and determines how strong it is - /// - /// Aroons period - /// - /// - public Indicator AROON(int period) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Returns an instance of the Standart Deviation (SD) indicator. - /// The SD shows the difference of the volatility value from the average one. - /// - /// Period of indicator - /// Sources prices for MA - /// Type of Moving Average - /// Calculation type - /// - public Indicator SD(int period, PriceType priceType, MaMode mode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(mode.ToString(), (int)mode)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the MACD (Moving Average Convergence/Divergence) indicator. - /// The MACD is a trend-following momentum indicator that shows the relationship between two moving averages of prices. - /// - /// Period of fast EMA. - /// Period of slow EMA. - /// Period of signal EMA. - /// Calculation type - /// - public Indicator MACD(int fastEMA, int slowEMA, int signalEMA, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), fastEMA); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), slowEMA); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), signalEMA); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Returns an instance of the Kairi Relative Index (KRI) indicator. - /// KRI calculates deviation of the current price from its simple moving average as a percent of the moving average. - /// - /// - /// - /// - public Indicator KRI(int period) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Returns an instance of the Bollinger Bands Flat (BBF) indicator. - /// The BBF provides the same data as BB, but drawn in separate field and easier to recognize whether price is in or out of the band. - /// - /// Period - /// Deviation - /// Sources prices for MA - /// Type of Moving Average - /// Calculation type - /// - public Indicator BBF(int period, double deviation, PriceType priceType, MaMode mode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), deviation); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(mode.ToString(), (int)mode)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the ROC (Rate of Change) indicator. - /// The ROC shows the speed at which price is changing. - /// - /// Period of momentum. - /// - /// - public Indicator ROC(int period) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the Momentum indicator. - /// Momentum compares where the current price is in relation to where the price was in the past. - /// - /// Period for Momentum - /// Sources prices for Momentum - /// - /// - public Indicator Momentum(int period, PriceType priceType) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the %R Larry Williams. - /// Uses Stochastic to determine overbought and oversold levels. - /// - /// Period for Momentum - /// - /// - public Indicator RLW(int period) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Returns an instance of the Price Oscillator (PO) indicator. - /// PO calculates the variation between price moving averages. - /// - /// Period of MA1 - /// Period of MA2 - /// Sources prices for MA - /// Type of Moving Average - /// Calculation type - /// - public Indicator PO(int period1, int period2, PriceType priceType, MaMode mode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period1); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period2); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(mode.ToString(), (int)mode)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the OsMA (Moving Average of Oscillator) indicator. - /// The OsMA reflects the difference between an oscillator (MACD) and its moving average (signal line). - /// - /// Period of fast EMA. - /// Period of slow EMA. - /// Period of signal EMA. - /// Calculation type - /// - public Indicator OsMA(int fastEMA, int slowEMA, int signalEMA, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), fastEMA); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), slowEMA); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), signalEMA); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets On Balance Volume. - /// On Balance Volume (OBV) measures buying and selling pressure as a cumulative indicator that adds volume on up days and subtracts volume on down days. - /// - /// Sources prices for OBV - /// - /// - public Indicator OBV(PriceType priceType) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Returns an instance of the Positive Volume Index (PVI) indicator. - /// The PVI value changes on the periods in which value of volume has increased in comparison with the previous period. - /// - /// - /// - /// - public Indicator PVI(PriceType priceType) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Returns an instance of the Volume indicator. - /// Volume allows to confirm the strength of a trend or to suggest about it's weakness. - /// - /// - /// - public Indicator Volume() - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - ?(indicator); - return indicator; - } - - /// - /// Gets the MFI(Money Flow Index) indicator. - /// The MFI(Money Flow Index) is an oscillator that uses both price and volume to measure buying and selling pressure. - /// - /// Period of MFI. - /// - /// - public Indicator MFI(int period) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), period); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Returns an instance of the Acceleration/Deceleration Oscillator (AC). - /// AC measures the acceleration and deceleration of the current momentum. - /// - /// - /// - public Indicator AC() - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - ?(indicator); - return indicator; - } - - /// - /// Gets the Average True Range (ATR) indicator. - /// The ATR measures of market volatility. - /// - /// - /// Period of Moving Average. - /// Type of Moving Average - /// Calculation type - /// - public Indicator ATR(int period, MaMode mode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), period); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(mode.ToString(), (int)mode)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Returns an instance of the Kaufman Adaptive Moving Average (KAMA) indicator. - /// KAMA is an exponential style average with a smoothing that varies according to recent data. - /// - /// Period - /// Fast factor - /// Slow factor - /// Sources prices for MA - /// - /// - public Indicator KAMA(int period, double fast, double slow, PriceType priceType) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), fast); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), slow); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Returns an instance of the Qstick indicator. - /// The Qstick is a moving average that shows the difference between the prices at which an issue opens and closes. - /// - /// - /// - /// Calculation type - /// - public Indicator Qstick(int period, MaMode mode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(mode.ToString(), (int)mode)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Get the Swing Index (SI) indicator. - /// The SI is used to confirm trend line breakouts on price charts. - /// - /// The divider. - /// - /// - public Indicator SI(double divider) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), divider); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Get the True Strength Index (TSI) indicator. - /// - /// The TSI is a variation of the Relative Strength Indicator which uses a doubly-smoothed - /// EMA of price momentum to eliminate choppy price changes and spot trend changes. - /// - /// - /// First MA period. - /// Second MA period. - /// Calculation type - /// - public Indicator TSI(int firstPeriod, int secondPeriod, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), firstPeriod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), secondPeriod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Returns an instance of the Average Directional Index (ADX) indicator. - /// The ADX determines the strength of a prevailing trend. - /// - /// Period - /// Type of Moving Average - /// Calculation type - /// - public Indicator ADX(int period, MaMode mode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(mode.ToString(), (int)mode)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Returns an instance of the Keltner Channel indicator. - /// Keltner Channels are volatility-based envelopes set above and below an exponential moving average. - /// - /// Period of MA for Keltner's Channel - /// Coefficient of channel's width - /// Sources prices for MA - /// Type of Moving Average - /// Calculation type - /// - public Indicator Keltner(int period, double offset, PriceType priceType, MaMode mode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), period); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), offset); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(mode.ToString(), (int)mode)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Returns an instance of the Percentage Price Oscillator (PPO). - /// Percentage Price Oscillator is a momentum indicator. Signal line is EMA of PPO. Formula: (FastEMA-SlowEMA)/SlowEMA. - /// - /// Fast EMA Period - /// Slow EMA Period - /// Signal EMA Period - /// Calculation type - /// - public Indicator PPO(int fastPeriod, int slowPeriod, int signalPeriod, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), fastPeriod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), slowPeriod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), signalPeriod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the Stochastic Slow. - /// Shows the location of the current close relative to the high/low range over a set number of periods (Slow). - /// - /// Period - /// Smoothing - /// Double smoothing - /// Moving type - /// Calculation type - /// - public Indicator Stochastic(int period, int smooth, int doubleSmooth, MaMode MaType, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), smooth); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), doubleSmooth); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new SelectItem(MaType.ToString(), (int)MaType)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the Stochastic x Relative Strength Index. - /// StochRSI is an oscillator that measures the level of RSI relative to its range. - /// - /// Period - /// Smoothing - /// Double smoothing - /// - /// - public Indicator StochasticxRSI(int rsiPeriod, int kPeriod, int dPeriod) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), rsiPeriod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), kPeriod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), dPeriod); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the Ichimoku. - /// Enables to quickly discern and filter 'at a glance' the low-probability trading setups from those of higher probability. - /// - /// Tenkan Period - /// Kijun Period - /// Senkou Span B - /// - /// - public Indicator ICH(int TenkanPeriod, int KijunPeriod, int SenkouSpanB) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TenkanPeriod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), KijunPeriod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SenkouSpanB); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the Directional Movement Index(DMI) indicator. - /// The DMI ?dentifies whether there is a definable trend in the market. - /// - /// Period of Moving Average. - /// Type of Moving Average. - /// Calculation type - /// - public Indicator DMI(int period, MaMode mode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), period); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(mode.ToString(), (int)mode)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - /// - /// Gets the Alligator. - /// Three moving averages with different colors, periods and calculation methods. - /// - /// Type of Jaw Moving Average. - /// SourcePrice of Jaw Moving Average. - /// Period of Jaw Moving Average. - /// Shift of Jaw Moving Average. - /// Period of Moving Average. - /// Type of Moving Average. - /// Period of Moving Average. - /// Type of Moving Average. - /// Period of Moving Average. - /// Type of Moving Average. - /// Period of Moving Average. - /// Type of Moving Average. - /// - /// - public Indicator Alligator(MaMode JawMAType, PriceType JawSourcePrice, int JawMAPeiod, int JawMAShift, MaMode TeethMAType, PriceType TeethSourcePrice, int TeethMAPeiod, int TeethMAShift, MaMode LipsMAType, PriceType LipsSourcePrice, int LipsMAPeiod, int LipsMAShift) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new SelectItem(JawMAType.ToString(), (int)JawMAType)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new SelectItem(JawSourcePrice.ToString(), (int)JawSourcePrice)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), JawMAPeiod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), JawMAShift); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new SelectItem(TeethMAType.ToString(), (int)TeethMAType)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new SelectItem(TeethSourcePrice.ToString(), (int)TeethSourcePrice)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TeethMAPeiod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TeethMAShift); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new SelectItem(LipsMAType.ToString(), (int)LipsMAType)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new SelectItem(LipsSourcePrice.ToString(), (int)LipsSourcePrice)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LipsMAPeiod); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LipsMAShift); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - - public Indicator HV(int stdPeriod, int volatilityPeriod, PriceType priceType, HVSheduleMode hvMode) - { - return ?(stdPeriod, volatilityPeriod, priceType, hvMode, true, 0); - } - - public Indicator HV(int stdPeriod, int volatilityPeriod, PriceType priceType, HVSheduleMode hvMode, int percentilePeriod) - { - return ?(stdPeriod, volatilityPeriod, priceType, hvMode, false, percentilePeriod); - } - - private Indicator ?(int P_0, int P_1, PriceType P_2, HVSheduleMode P_3, bool P_4, int P_5) - { - Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); - IList settings = indicator.Settings; - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_1); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new SelectItem(P_2.ToString(), (int)P_2)); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_4); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_5); - settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new SelectItem(P_3.ToString(), (int)P_3)); - indicator.Settings = settings; - ?(indicator); - return indicator; - } - } - /// - /// Base class for all indicators. - /// - [Published] - public abstract class Indicator : ExecutionEntity, IIndicatorsCollection - { - private class ? - { - [CompilerGenerated] - private Color? ??; - - [CompilerGenerated] - private Color? ??; - - public Color? BeginColor - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = color; - } - } - - public Color? EndColor - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = color; - } - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(15, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(BeginColor); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(EndColor); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - - [NotPublished] - public const string EMA = "Exponential Moving Average"; - - [NotPublished] - public const string LWMA = "Linearly Weighted Moving Average"; - - [NotPublished] - public const string SMA = "Simple Moving Average"; - - [NotPublished] - public const string SMMA = "Smoothed Moving Average"; - - [NotPublished] - public const string PPMA = "Pivot Point Moving Average"; - - [NotPublished] - public const string CCI = "Commodity Channel Index"; - - [NotPublished] - public const string MAS3 = "3MASignal"; - - [NotPublished] - public const string MMA = "Modified Moving Average"; - - [NotPublished] - public const string Regression = "Regression Line"; - - [NotPublished] - public const string BB = "Bollinger Bands"; - - [NotPublished] - public const string Channel = "Price Channel"; - - [NotPublished] - public const string AFIRMA = "Autoregressive Finite Impulse Response Moving Average"; - - [NotPublished] - public const string RSI = "Relative Strength Index"; - - [NotPublished] - public const string MD = "McGinley Dynamic"; - - [NotPublished] - public const string MAE = "Moving Average Envelope"; - - [NotPublished] - public const string SAR = "Parabolic SAR"; - - [NotPublished] - public const string AO = "Awesome Oscillator"; - - [NotPublished] - public const string CMO = "Chande Momentum Oscillator"; - - [NotPublished] - public const string ZZ = "ZigZag"; - - [NotPublished] - public const string AROON = "Aroon"; - - [NotPublished] - public const string MACD = "Moving Average Convergence/Divergence"; - - [NotPublished] - public const string SD = "Standard Deviation"; - - [NotPublished] - public const string KRI = "Kairi Relative Index"; - - [NotPublished] - public const string BBF = "Bollinger Bands Flat"; - - [NotPublished] - public const string ROC = "Rate of Change"; - - [NotPublished] - public const string Momentum = "Momentum"; - - [NotPublished] - public const string RLW = "%R Larry Williams"; - - [NotPublished] - public const string PO = "Price Oscillator"; - - [NotPublished] - public const string OBV = "On Balance Volume"; - - [NotPublished] - public const string OsMA = "Moving Average of Oscillator"; - - [NotPublished] - public const string PVI = "Positive Volume Index"; - - [NotPublished] - public const string VOLUME = "Volume"; - - [NotPublished] - public const string MFI = "Money Flow Index"; - - [NotPublished] - public const string AC = "Acceleration Oscillator"; - - [NotPublished] - public const string ATR = "Average True Range"; - - [NotPublished] - public const string KAMA = "Kaufman Adaptive Moving Average"; - - [NotPublished] - public const string Stochastic = "Stochastic Slow"; - - [NotPublished] - public const string StochasticxRSI = "Stochastic x Relative Strength Index"; - - [NotPublished] - public const string Qstick = "Qstick"; - - [NotPublished] - public const string SI = "Swing Index"; - - [NotPublished] - public const string ADX = "Average Directional Index"; - - [NotPublished] - public const string Keltner = "Keltner Channel"; - - [NotPublished] - public const string PPO = "Percentage Price Oscillator"; - - [NotPublished] - public const string TSI = "True Strength Index"; - - [NotPublished] - public const string DMI = "Directional Movement Index"; - - [NotPublished] - public const string ICH = "Ichimoku"; - - [NotPublished] - public const string Alligator = "Alligator"; - - [NotPublished] - public const string HV = "Historical Volatility"; - - [NotPublished] - public const string PAZ = "Price Action Zones"; - - [NotPublished] - public const string OSCILLATOR_GROUP = "Oscillators"; - - [NotPublished] - public const string MOVING_AVERAGE_GROUP = "Moving averages"; - - [NotPublished] - public const string TREND_GROUP = "Trend"; - - [NotPublished] - public const string VOLATILITY_GROUP = "Volatility"; - - [NotPublished] - public const string CHANNEL_GROUP = "Channels"; - - [NotPublished] - public const string VOLUME_GROUP = "Volume"; - - [NotPublished] - public const string HIDDEN_GROUP = "Hidden"; - - [NotPublished] - protected internal const IndicatorCalculationType DEFAULT_CALCULATION_TYPE = IndicatorCalculationType.AllAvailableData; - - private string ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private HistoricalData ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ?? = true; - - [CompilerGenerated] - private int ?? = -1; - - [CompilerGenerated] - private TimeFrameConfig ?? = new TimeFrameConfig(); - - [CompilerGenerated] - private IndicatorUpdateType ??; - - [CompilerGenerated] - private bool ?? = true; - - private const string ?? = "Line_"; - - private const string ?? = "Level_"; - - [CompilerGenerated] - private IChart ??; - - private readonly List ??; - - private readonly List ??; - - private readonly object ??; - - private readonly List ??; - - private readonly object ??; - - private readonly List ??; - - private readonly object ??; - - [EditorBrowsable(EditorBrowsableState.Never)] - [Obfuscation(Exclude = true)] - private bool debugMode; - - private bool ??; - - private readonly IDictionary> ??; - - private readonly object ??; - - private readonly List ??; - - [CompilerGenerated] - private ? ??; - - /// - /// Short name of indicator - /// - public virtual string ShortName - { - get - { - if (string.IsNullOrEmpty(??)) - { - return base.Name; - } - return ??; - } - [Obsolete("Override getter")] - protected set - { - ?? = value; - } - } - - /// - /// Access to current Symbol of indicator - /// - public Symbol Symbol => HistoricalData?.Symbol; - - /// - /// Amount of items in internal buffers - /// - public int Count - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Represent access to current used historical data. - /// - public HistoricalData HistoricalData - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = historicalData; - } - } - - /// - /// Represent access indicator series - /// - public LineSeries[] LinesSeries => ??.ToArray(); - - /// - /// - /// - public LineLevel[] LinesLevels => ??.ToArray(); - - /// - /// Specified, whether indicator should use main or additional window on the chart - /// - public bool SeparateWindow - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Specified, whether indicator should draw on chart background by default. - /// - public bool OnBackGround - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Specified, whether indicator should participate into price auto scale system. - /// - public bool AllowFitAuto - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Precision amount for formatting price (the count of digits after decimal point); By default = -1, which means to use precision from indicator's symbol - /// - public int Digits - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public TimeFrameConfig TFConfig - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = timeFrameConfig; - } - } - - public IndicatorUpdateType UpdateType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - protected bool IsUpdateTypesSupported - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Indicator's settings - /// - public override IList Settings - { - get - { - IList settings = base.Settings; - if (?? != null) - { - for (int i = 0; i < ??.Count; i++) - { - int num = i + 1; - LineSeries lineSeries = ??[i]; - string text = string.Format(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), num); - SettingItemSeparatorGroup separatorGroup = new SettingItemSeparatorGroup((string.IsNullOrEmpty(lineSeries.Name) || lineSeries.Name.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) ? text : string.Format(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), lineSeries.Name), num); - IList settings2 = lineSeries.Settings; - foreach (SettingItem item in settings2) - { - item.SeparatorGroup = separatorGroup; - } - settings.Add(new SettingItemGroup($"{3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()}{i}", settings2) - { - Text = text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }); - } - if (?? != null) - { - for (int j = 0; j < ??.Count; j++) - { - int num2 = ??.Count + j; - LineLevel lineLevel = ??[j]; - string text2 = string.Format(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), j + 1); - SettingItemSeparatorGroup separatorGroup2 = new SettingItemSeparatorGroup((string.IsNullOrEmpty(lineLevel.Name) || lineLevel.Name.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) ? text2 : string.Format(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), lineLevel.Name), num2 + 1); - IList settings3 = lineLevel.Settings; - foreach (SettingItem item2 in settings3) - { - item2.SeparatorGroup = separatorGroup2; - } - settings.Add(new SettingItemGroup($"{3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()}{num2}", settings3) - { - Text = text2 + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }); - } - } - } - if (HistoricalData != null && (TFConfig.DefaultAggregation == null || (HistoricalData.Aggregation != null && !HistoricalData.Aggregation.Equals(TFConfig.DefaultAggregation)))) - { - TFConfig.DefaultAggregation = HistoricalData.Aggregation; - } - settings.Add(new SettingItemTimeFrameConfig(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TFConfig) - { - SeparatorGroup = new SettingItemSeparatorGroup(string.Empty, 1000) - }); - List list = new List - { - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0), - new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1) - }; - if (IsUpdateTypesSupported) - { - settings.Add(new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list.GetItemByValue((int)UpdateType), list) - { - SeparatorGroup = new SettingItemSeparatorGroup(string.Empty, 1100) - }); - } - return settings; - } - set - { - base.Settings = value; - foreach (SettingItem item in value) - { - if (!(item is SettingItemGroup { Value: IList value2 }) || !value2.Any() || value2[0].Group == null || !int.TryParse(value2[0].Group.Name.Replace(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()), out var result)) - { - continue; - } - if (result < ??.Count) - { - ??[result].Settings = value2; - continue; - } - int num = result - ??.Count; - if (num < ??.Count) - { - ??[num].Settings = value2; - } - } - bool flag = false; - if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemTimeFrameConfig settingItemTimeFrameConfig) - { - TFConfig = (TimeFrameConfig)settingItemTimeFrameConfig.Value; - } - if (IsUpdateTypesSupported && value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemSelectorLocalized settingItemSelectorLocalized) - { - UpdateType = (IndicatorUpdateType)(int)(object)((SelectItem)settingItemSelectorLocalized.Value).Value; - flag = settingItemSelectorLocalized.ValueChangingReason == SettingItemValueChangingReason.Manually; - } - if (flag) - { - OnSettingsUpdated(); - } - } - } - - /// - /// Represent access to the chart, that created indicator - /// - public IChart CurrentChart - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public virtual string HelpLink => string.Empty; - - public virtual string SourceCodeLink => string.Empty; - - internal int ChildIndicatorsCount - { - get - { - lock (??) - { - return ??.Count; - } - } - } - - internal ? Refresher - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = ?; - } - } - - protected virtual void OnInit() - { - } - - protected virtual void OnUpdate(UpdateArgs args) - { - } - - protected virtual void OnClear() - { - } - - public LineSeries AddLineSeries(string lineName = "", Color lineColor = default(Color), int lineWidth = 1, LineStyle lineStyle = LineStyle.Solid) - { - if (string.IsNullOrEmpty(lineName)) - { - lineName = $"{3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()}{??.Count + 1}"; - } - if (lineColor == default(Color)) - { - lineColor = Color.Blue; - } - LineSeries lineSeries = new LineSeries(lineName, lineColor, lineWidth, lineStyle); - AddLineSeries(lineSeries); - return lineSeries; - } - - public void AddLineSeries(LineSeries lineSeries) - { - if (lineSeries == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - lock (??) - { - ??.Add(lineSeries); - } - } - - public LineLevel AddLineLevel(double level, string lineName = "", Color lineColor = default(Color), int lineWidth = 1, LineStyle lineStyle = LineStyle.Solid) - { - if (string.IsNullOrEmpty(lineName)) - { - lineName = $"{3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()}{level}"; - } - if (lineColor == default(Color)) - { - lineColor = Color.Blue; - } - LineLevel lineLevel = new LineLevel(level, lineName, lineColor, lineWidth, lineStyle); - AddLineLevel(lineLevel); - return lineLevel; - } - - public void AddLineLevel(LineLevel lineLevel) - { - if (lineLevel == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ??.Add(lineLevel); - } - - /// - /// Recalculate indicator - /// - public void Refresh() - { - Refresher?.?(this); - } - - /// - /// - /// - /// - public void AddIndicator(Indicator indicator) - { - if (indicator == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - lock (??) - { - if (??.Contains(indicator)) - { - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - indicator.HistoricalData = HistoricalData; - indicator.Init(); - for (int i = 0; i < Count; i++) - { - indicator.Update(new UpdateArgs(UpdateReason.HistoricalBar)); - } - ??.Add(indicator); - } - } - - public void RemoveIndicator(Indicator indicator) - { - if (indicator == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - lock (??) - { - ??.Remove(indicator); - } - indicator.Clear(); - indicator.Dispose(); - } - - /// - /// Sets the value of indicator into internal buffer - /// - /// Value - /// Index of indicator line - /// Offset value - public void SetValue(double value, int lineIndex = 0, int offset = 0) - { - ??[lineIndex].SetValue(value, offset); - } - - /// - /// Gets the value of indicator from internal buffer - /// - /// Offset value - /// Index of indicator line - /// Offset start point - /// - public double GetValue(int offset = 0, int lineIndex = 0, SeekOriginHistory origin = SeekOriginHistory.End) - { - double result = double.NaN; - if (lineIndex < 0 || lineIndex >= ??.Count) - { - return result; - } - return ??[lineIndex].GetValue(offset, origin); - } - - /// - /// Set line break point. - /// - /// Offset value - /// Index of indicator line - /// Offset start point - public void SetLineBreak(int offset = 0, int lineIndex = 0, SeekOriginHistory origin = SeekOriginHistory.End) - { - if (lineIndex < 0 || lineIndex >= ??.Count) - { - throw new ArgumentOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - int lineBreak = ((origin == SeekOriginHistory.End) ? offset : (Count - offset - 1)); - LinesSeries[lineIndex].SetLineBreak(lineBreak); - } - - /// - /// Remove line break point. - /// - /// Offset value - /// Index of indicator line - /// Offset start point - public void RemoveLineBreak(int offset = 0, int lineIndex = 0, SeekOriginHistory origin = SeekOriginHistory.End) - { - if (lineIndex < 0 || lineIndex >= ??.Count) - { - throw new ArgumentOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - int offset2 = ((origin == SeekOriginHistory.End) ? offset : (Count - offset - 1)); - LinesSeries[lineIndex].RemoveLineBreak(offset2); - } - - /// - /// Check if the point is a break point. - /// - /// Offset value - /// Index of indicator line - /// Offset start point - public bool GetLineBreak(int offset = 0, int lineIndex = 0, SeekOriginHistory origin = SeekOriginHistory.End) - { - if (lineIndex < 0 || lineIndex >= ??.Count) - { - throw new ArgumentOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - int offset2 = ((origin == SeekOriginHistory.End) ? offset : (Count - offset - 1)); - return LinesSeries[lineIndex].GetLineBreak(offset2); - } - - /// - /// Gets the price from historical data - /// - /// - /// - /// - protected double GetPrice(PriceType priceType, int offset = 0) - { - return HistoricalData[Count - 1 - offset, SeekOriginHistory.Begin][priceType]; - } - - protected VolumeAnalysisData GetVolumeAnalysisData(int offset = 0) - { - return HistoricalData[Count - 1 - offset, SeekOriginHistory.Begin].VolumeAnalysisData; - } - - /// - /// Get Bid price - /// - /// Offset value - /// - protected double Bid(int offset = 0) - { - return GetPrice(PriceType.Bid, offset); - } - - /// - /// Get Ask price - /// - /// Offset value - /// - protected double Ask(int offset = 0) - { - return GetPrice(PriceType.Ask, offset); - } - - /// - /// Get Last price - /// - /// Offset value - /// - protected double Last(int offset = 0) - { - return GetPrice(PriceType.Last, offset); - } - - /// - /// Get Open price - /// - /// Offset value - /// - protected double Open(int offset = 0) - { - return GetPrice(PriceType.Open, offset); - } - - /// - /// Get High price - /// - /// Offset value - /// - protected double High(int offset = 0) - { - return GetPrice(PriceType.High, offset); - } - - /// - /// Get Low price - /// - /// Offset value - /// - protected double Low(int offset = 0) - { - return GetPrice(PriceType.Low, offset); - } - - /// - /// Get Close price - /// - /// Offset value - /// - protected double Close(int offset = 0) - { - return GetPrice(PriceType.Close, offset); - } - - /// - /// Get Median price - /// - /// Offset value - /// - protected double Median(int offset = 0) - { - return GetPrice(PriceType.Median, offset); - } - - /// - /// Get Typical price - /// - /// Offset value - /// - protected double Typical(int offset = 0) - { - return GetPrice(PriceType.Typical, offset); - } - - /// - /// Get Weighted price - /// - /// Offset value - /// - protected double Weighted(int offset = 0) - { - return GetPrice(PriceType.Weighted, offset); - } - - /// - /// Get Volume - /// - /// Offset value - /// - protected double Volume(int offset = 0) - { - return GetPrice(PriceType.Volume, offset); - } - - /// - /// Get Volume in quoting asset - /// - /// Offset value - /// - protected double QuoteAssetVolume(int offset = 0) - { - return GetPrice(PriceType.QuoteAssetVolume, offset); - } - - /// - /// Get Ticks - /// - /// Offset value - /// - protected double Ticks(int offset = 0) - { - return GetPrice(PriceType.Ticks, offset); - } - - /// - /// Get Open interest - /// - /// Offset value - /// - protected double OpenInterest(int offset = 0) - { - return GetPrice(PriceType.OpenInterest, offset); - } - - /// - /// Get Funding rate - /// - /// Offset value - /// - protected double FundingRate(int offset = 0) - { - return GetPrice(PriceType.FundingRate, offset); - } - - /// - /// Get Time - /// - /// Offset value - /// - protected DateTime Time(int offset = 0) - { - return new DateTime(HistoricalData[Count - 1 - offset, SeekOriginHistory.Begin].TicksLeft, DateTimeKind.Utc); - } - - /// - /// Formatting price, using precision from assigned symbol or Digits value if specified - /// - /// Price value - /// - public string FormatPrice(double price) - { - if (Digits != -1) - { - return price.Format(Digits); - } - if (Symbol != null) - { - return Symbol.FormatPrice(price); - } - return price.ToString(); - } - - [NotPublished] - public override void Dispose() - { - base.Dispose(); - HistoricalData = null; - } - - public virtual void OnPaintChart(PaintChartEventArgs args) - { - } - - public void Calculate(HistoricalData historicalData) - { - if (historicalData == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - HistoricalData?.RemoveIndicator(this); - historicalData.AddIndicator(this); - } - - /// - /// Marks cloud begin between two line series with specific color - /// - /// First line series index - /// Second line series index - /// Cloud color - /// Offset - protected void BeginCloud(int line1Index, int line2Index, Color color, int offset = 0) - { - IndicatorCloudKey indicatorCloudKey = new IndicatorCloudKey(line1Index, line2Index); - int num = Count - 1 - offset; - ? ? = this.?(indicatorCloudKey, num); - if (?.EndColor == color) - { - ?.EndColor = null; - } - else - { - ?.BeginColor = color; - } - } - - /// - /// Marks cloud end between two line series with specific color - /// - /// First line series index - /// Second line series index - /// Cloud color - /// Offset - protected void EndCloud(int line1Index, int line2Index, Color color, int offset = 0) - { - IndicatorCloudKey indicatorCloudKey = new IndicatorCloudKey(line1Index, line2Index); - int num = Count - 1 - offset; - ? ? = this.?(indicatorCloudKey, num); - if (?.BeginColor == color) - { - ?.BeginColor = null; - } - else - { - ?.EndColor = color; - } - } - - private ? ?(IndicatorCloudKey P_0, int P_1) - { - lock (??) - { - if (!??.TryGetValue(P_0, out var value)) - { - value = (??[P_0] = new List()); - for (int i = 0; i < Count; i++) - { - value.Add(new ?()); - } - } - ? ? = value[P_1]; - if (? == null) - { - ? = (value[P_1] = new ?()); - } - return ?; - } - } - - [NotPublished] - public IDictionary AnalyzeClouds() - { - IDictionary> dictionary; - lock (??) - { - if (??.Count == 0) - { - return null; - } - dictionary = new Dictionary>(??); - } - Dictionary dictionary2 = new Dictionary(); - foreach (KeyValuePair> item in dictionary) - { - IndicatorCloudKey key = item.Key; - List value = item.Value; - List list = new List(); - IndicatorCloud indicatorCloud = null; - for (int i = 0; i < value.Count; i++) - { - ? ? = value[i]; - if (?.EndColor.HasValue && indicatorCloud != null) - { - indicatorCloud.ToIndex = i; - if (indicatorCloud.ToIndex - indicatorCloud.FromIndex > 0) - { - indicatorCloud.ToIndex--; - } - list.Add(indicatorCloud); - indicatorCloud = null; - } - if (?.BeginColor.HasValue) - { - indicatorCloud = new IndicatorCloud - { - Color = ?.BeginColor.Value, - FromIndex = i - }; - } - } - if (indicatorCloud != null) - { - if (indicatorCloud.ToIndex == -1) - { - indicatorCloud.ToIndex = Count - 1; - } - list.Add(indicatorCloud); - } - dictionary2.Add(key, list.ToArray()); - } - return dictionary2; - } - - public void SetBarColor(Color? color = null, int offset = 0) - { - int index = ??.Count - 1 - offset; - if (!color.HasValue) - { - ??[index] = null; - return; - } - ??[index] = new IndicatorBarAppearance - { - BarColor = color.Value - }; - } - - public IndicatorBarAppearance GetBarAppearance(int offset = 0) - { - int num = ??.Count - 1 - offset; - if (num < 0) - { - return null; - } - return ??[num]; - } - - public void SetBarAppearance(IndicatorBarAppearance barAppearance, int offset = 0) - { - int index = ??.Count - 1 - offset; - ??[index] = barAppearance; - } - - protected virtual bool OnTryGetMinMax(int fromOffset, int toOffset, out double min, out double max) - { - min = double.NaN; - max = double.NaN; - return false; - } - - protected Indicator() - { - ?? = new object(); - ?? = new List(); - ?? = new List(); - ?? = new List(); - ?? = new object(); - ?? = new List(); - ?? = new object(); - ?? = new Dictionary>(); - ?? = new object(); - ?? = new List(); - } - - public void Init() - { - try - { - OnInit(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public void Update(UpdateArgs args) - { - if (debugMode) - { - while (!base.Disposed) - { - Thread.Sleep(100); - if (??) - { - break; - } - } - } - bool num = ?(args.Reason); - ?(args); - if (num) - { - Count++; - ?(); - ?(); - } - try - { - OnUpdate(args); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ?? = false; - } - - public void Clear() - { - ?(); - ?(); - Count = 0; - if (?? == null) - { - return; - } - lock (??) - { - foreach (LineSeries item in ??) - { - item.Clear(); - } - } - lock (??) - { - ??.Clear(); - } - ??.Clear(); - try - { - OnClear(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public bool TryGetMinMax(int fromOffset, int toOffset, out double min, out double max) - { - min = double.NaN; - max = double.NaN; - try - { - return OnTryGetMinMax(fromOffset, toOffset, out min, out max); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return false; - } - - public void PaintChart(PaintChartEventArgs ev) - { - try - { - OnPaintChart(ev); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - ?? = true; - } - - private bool ?(UpdateReason P_0) - { - switch (P_0) - { - case UpdateReason.HistoricalBar: - return true; - case UpdateReason.NewBar: - return true; - case UpdateReason.NewTick: - if (HistoricalData.Aggregation == null) - { - return false; - } - if (HistoricalData.Aggregation.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() && HistoricalData.Aggregation.GetPeriod == Period.TICK1) - { - return true; - } - break; - } - return false; - } - - private void ?() - { - lock (??) - { - foreach (LineSeries item in ??) - { - item.?(); - } - } - lock (??) - { - foreach (KeyValuePair> item2 in ??) - { - item2.Value.Add(new ?()); - } - } - ??.Add(null); - } - - private void ?(UpdateArgs P_0) - { - lock (??) - { - foreach (Indicator item in ??) - { - item.Update(P_0); - } - } - } - - private void ?() - { - lock (??) - { - foreach (Indicator item in ??) - { - item.Clear(); - item.Dispose(); - } - ??.Clear(); - } - } - - internal void ?(HistoricalDataCustom P_0) - { - if (P_0 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - lock (??) - { - if (??.Contains(P_0)) - { - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - for (int i = 0; i < Count; i++) - { - P_0.?(); - } - ??.Add(P_0); - } - } - - private void ?() - { - lock (??) - { - foreach (HistoricalDataCustom item in ??) - { - item.?(); - } - } - } - - private void ?() - { - lock (??) - { - foreach (HistoricalDataCustom item in ??) - { - item.Dispose(); - } - ??.Clear(); - } - } - - protected override void OnSettingsUpdated() - { - Refresh(); - } - } - public class IndicatorBarAppearance - { - [CompilerGenerated] - private Color ?; - - [CompilerGenerated] - private Color ?; - - [CompilerGenerated] - private Color ?; - - public Color BarColor - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - public Color BorderColor - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - public Color WickColor - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - } - public enum IndicatorCalculationBehavior - { - Synchronous, - Asynchronous - } - public class IndicatorCloud : IComparable - { - [CompilerGenerated] - private int ?; - - [CompilerGenerated] - private int ?; - - private Color ?; - - [CompilerGenerated] - private SolidBrush ?; - - internal const int ? = -1; - - public int FromIndex - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - public int ToIndex - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - public Interval Interval => new Interval(FromIndex, ToIndex); - - public Color Color - { - get - { - return ?; - } - set - { - ? = value; - Brush = new SolidBrush(?); - } - } - - public SolidBrush Brush - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = solidBrush; - } - } - - public IndicatorCloud() - { - FromIndex = -1; - ToIndex = -1; - } - - public int CompareTo(IndicatorCloud other) - { - if (this == other) - { - return 0; - } - if (other == null) - { - return 1; - } - return FromIndex.CompareTo(other.FromIndex); - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 3); - defaultInterpolatedStringHandler.AppendFormatted(FromIndex); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(ToIndex); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Color.Name); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - public readonly struct IndicatorCloudKey : IEquatable - { - [CompilerGenerated] - private readonly int ?; - - [CompilerGenerated] - private readonly int ?; - - public int Line1Index - { - [CompilerGenerated] - get - { - return ?; - } - } - - public int Line2Index - { - [CompilerGenerated] - get - { - return ?; - } - } - - public IndicatorCloudKey(int line1Index, int line2Index) - { - ? = line1Index; - ? = line2Index; - } - - public bool Equals(IndicatorCloudKey other) - { - if (Line1Index == other.Line1Index) - { - return Line2Index == other.Line2Index; - } - return false; - } - - public override bool Equals(object obj) - { - if (obj is IndicatorCloudKey other) - { - return Equals(other); - } - return false; - } - - public override int GetHashCode() - { - return (Line1Index * 397) ^ Line2Index; - } - } - public class IndicatorInfo : ScriptInfo - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private string ??; - - public string Group - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public bool IsAvailableInWatchlist - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = flag; - } - } - - public string ShortName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - internal IndicatorInfo(ConstructorInfo P_0, ScriptCreationType P_1, string P_2, string P_3) - : base(P_0, P_1, P_2, P_3) - { - } - - protected override void Initialize(string relativePath, string assemblyName) - { - using Indicator indicator = ctor.Invoke(null) as Indicator; - base.Name = indicator.Name; - ShortName = ?(indicator); - base.Description = indicator.Description; - base.Version = indicator.Version; - base.Key = new ScriptKey(base.ScriptCreationType, relativePath, assemblyName, base.Name); - indicator.Key = base.Key; - base.Settings = indicator.Settings as List; - IsAvailableInWatchlist = indicator is IWatchlistIndicator; - } - - internal Indicator ?() - { - Indicator indicator = ctor?.Invoke(null) as Indicator; - if (indicator != null) - { - indicator.Key = base.Key; - } - return indicator; - } - - public override string ToString() - { - return base.Name; - } - - private string ?(Indicator P_0) - { - if (string.IsNullOrEmpty(P_0.ShortName)) - { - return string.Empty; - } - int num = P_0.ShortName.IndexOf('('); - if (num == -1) - { - return P_0.ShortName; - } - return P_0.ShortName.Substring(0, num).TrimEnd(); - } - } - public sealed class IndicatorManager : ScriptManager - { - [CompilerGenerated] - private BuiltInIndicators ?; - - public BuiltInIndicators BuiltIn - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = builtInIndicators; - } - } - - protected override string DefaultScriptsPath => Const.DEFAULT_INDICATORS_RELATIVE_PATH; - - public override string CustomScriptsPath => Const.CUSTOM_INDICATORS_PATH; - - internal IndicatorManager() - { - BuiltIn = new BuiltInIndicators(); - } - - internal override void ?() - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - try - { - base.?(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - } - - public Indicator CreateIndicator(string indicatorName, string assemblyName = "", string relativePath = "", ScriptCreationType scriptCreationType = ScriptCreationType.Custom) - { - if (string.IsNullOrEmpty(indicatorName)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ScriptKey scriptKey = SearchScriptKey(indicatorName, assemblyName, relativePath, scriptCreationType); - return CreateIndicator(scriptKey); - } - - public Indicator CreateIndicator(ScriptKey scriptKey) - { - if (scriptsInfoCache.TryGetValue(scriptKey, out var value)) - { - return CreateIndicator(value); - } - return null; - } - - public Indicator CreateIndicator(IndicatorInfo indicatorInfo) - { - return indicatorInfo.?(); - } - - protected override string GetScriptsFolderPath(ScriptCreationType scriptCreationType) - { - if (scriptCreationType != ScriptCreationType.Default) - { - return Const.CUSTOM_INDICATORS_PATH; - } - return Path.Combine(Const.EXECUTING_FOLDER, Const.DEFAULT_INDICATORS_RELATIVE_PATH); - } - - protected override IndicatorInfo CreateScriptInfo(ConstructorInfo ctor, ScriptCreationType scriptCreationType, string relativePath, string assemblyName) - { - return new IndicatorInfo(ctor, scriptCreationType, relativePath, assemblyName); - } - } - /// - /// Using IndicatorLineMarker class you can mark by color or icon any point of your indicator's line. - /// - public class IndicatorLineMarker - { - [CompilerGenerated] - private Color ? = Color.Empty; - - [CompilerGenerated] - private IndicatorLineMarkerIconType ?; - - [CompilerGenerated] - private IndicatorLineMarkerIconType ?; - - /// - /// Color of the marker - /// - public Color Color - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - /// - /// Icon that will be drawn above the indicator line - /// - public IndicatorLineMarkerIconType UpperIcon - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - /// - /// Icon that will be drawn beyond the indicator line - /// - public IndicatorLineMarkerIconType BottomIcon - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - /// - /// Constructor for IndicatorLineMarker - /// - /// - /// - /// - public IndicatorLineMarker(Color color, IndicatorLineMarkerIconType upperIcon = IndicatorLineMarkerIconType.None, IndicatorLineMarkerIconType bottomIcon = IndicatorLineMarkerIconType.None) - { - Color = color; - UpperIcon = upperIcon; - BottomIcon = bottomIcon; - } - - /// - /// Constructor for IndicatorLineMarker - /// - public IndicatorLineMarker() - { - } - } - /// - /// Different type of icons for Indicator marker - /// - public enum IndicatorLineMarkerIconType - { - None, - UpArrow, - DownArrow, - Flag, - FillCircle - } - public class IndicatorsCollection : IIndicatorsCollection, ?, ITaskSchedulerProvider - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal Indicator ?(IndicatorWrapper P_0) - { - return P_0.Indicator; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Indicator ??; - - internal bool ?(IndicatorWrapper P_0) - { - return object.Equals(P_0.Indicator, ??); - } - } - - [CompilerGenerated] - private sealed class ? - { - public Indicator ??; - - internal bool ?(IndicatorWrapper P_0) - { - return object.Equals(P_0.Indicator, ??); - } - } - - [CompilerGenerated] - private sealed class ? - { - public Indicator ??; - - internal bool ?(IndicatorWrapper P_0) - { - return object.Equals(P_0.Indicator, ??); - } - } - - private IndicatorCalculationBehavior ??; - - private readonly HistoricalData ??; - - private readonly List ??; - - private readonly object ??; - - private TaskScheduler ??; - - public Indicator[] All - { - get - { - lock (??) - { - return ??.Select((IndicatorWrapper P_0) => P_0.Indicator).ToArray(); - } - } - } - - public IndicatorCalculationBehavior CalculationBehavior - { - get - { - return ??; - } - set - { - if (?? != value) - { - ?? = value; - ?? = ((?? == IndicatorCalculationBehavior.Synchronous) ? null : new DegreeOfParallelismTaskScheduler(3)); - } - } - } - - TaskScheduler ITaskSchedulerProvider.TaskScheduler => ??; - - public IndicatorsCollection(HistoricalData historicalData) - { - ?? = historicalData; - ?? = new List(); - ?? = new object(); - CalculationBehavior = IndicatorCalculationBehavior.Synchronous; - } - - public void AddIndicator(Indicator indicator) - { - if (indicator == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - lock (??) - { - if (??.Any((IndicatorWrapper P_0) => object.Equals(P_0.Indicator, indicator))) - { - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - IndicatorWrapper indicatorWrapper = new IndicatorWrapper(indicator, this); - ??.Add(indicatorWrapper); - indicator.HistoricalData = ??; - indicator.Refresher = this; - indicatorWrapper.?(??.Count, false); - } - } - - public void RemoveIndicator(Indicator indicator) - { - if (indicator == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - IndicatorWrapper indicatorWrapper; - lock (??) - { - indicatorWrapper = ??.FirstOrDefault((IndicatorWrapper P_0) => object.Equals(P_0.Indicator, indicator)); - if (indicatorWrapper != null) - { - ??.Remove(indicatorWrapper); - } - } - indicatorWrapper?.Dispose(); - } - - public void Update(UpdateArgs args, IndicatorUpdateType? updateType = null) - { - lock (??) - { - foreach (IndicatorWrapper item in ??) - { - item.?(args, updateType); - } - } - } - - public void Refresh() - { - lock (??) - { - int count = ??.Count; - foreach (IndicatorWrapper item in ??) - { - item.?(count, true); - } - } - } - - private void ?(Indicator P_0) - { - if (TryGetWrapper(P_0, out var wrapper)) - { - wrapper.?(??.Count, true); - } - } - - void global::?.?.?(Indicator P_0) - { - //ILSpy generated this explicit interface implementation from .override directive in ? - this.?(P_0); - } - - public bool TryGetWrapper(Indicator indicator, out IndicatorWrapper wrapper) - { - lock (??) - { - wrapper = ??.FirstOrDefault((IndicatorWrapper P_0) => object.Equals(P_0.Indicator, indicator)); - } - return wrapper != null; - } - - public void Clear() - { - lock (??) - { - foreach (IndicatorWrapper item in ??) - { - item.Dispose(); - } - ??.Clear(); - } - } - } - public enum IndicatorStatus - { - Pending, - Loading, - Working - } - public class IndicatorWrapper : IDisposable - { - [CompilerGenerated] - private sealed class ? - { - public IndicatorWrapper ??; - - public int ??; - - public bool ??; - - public CancellationToken ??; - - internal void ?() - { - ??.?(??, ??, ??); - } - - internal void ?(Task P_0) - { - ??.?(??, ??); - } - } - - [CompilerGenerated] - private IndicatorStatus ?; - - [CompilerGenerated] - private readonly Indicator ?; - - [CompilerGenerated] - private IProgress ?; - - private readonly ITaskSchedulerProvider ?; - - private CancellationTokenSource ?; - - private readonly Queue ?; - - private SpinLock ?; - - private Task ?; - - private readonly object ?; - - private bool ?; - - private readonly ManualResetEventSlim ?; - - public IndicatorStatus Status - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = indicatorStatus; - } - } - - public Indicator Indicator - { - [CompilerGenerated] - get - { - return ?; - } - } - - public IProgress CalculatingProgress - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - private set - { - ? = progress; - } - } - - public IndicatorWrapper(Indicator indicator, ITaskSchedulerProvider taskSchedulerProvider) - { - ? = taskSchedulerProvider; - ? = indicator; - Status = IndicatorStatus.Pending; - ? = new Queue(); - ? = default(SpinLock); - ? = Task.CompletedTask; - ? = new object(); - ? = new ManualResetEventSlim(); - } - - internal void ?(int P_0, bool P_1) - { - Status = IndicatorStatus.Pending; - CancellationToken cancellationToken = ?(); - if (Indicator.UpdateType == IndicatorUpdateType.OnBarClose) - { - P_0--; - } - if (?.TaskScheduler != null) - { - lock (?) - { - if (!?.IsCompleted) - { - ? = true; - } - else - { - ?(P_0, P_1, cancellationToken); - } - return; - } - } - ?(P_0, P_1, cancellationToken); - } - - private void ?(int P_0, bool P_1, CancellationToken P_2) - { - try - { - CalculatingProgress = new PercentageProgress(); - Status = IndicatorStatus.Loading; - ?.Reset(); - if (P_1) - { - Indicator.Clear(); - } - Indicator.Init(); - float num = P_0; - for (int i = 0; i < P_0; i++) - { - if (P_2.IsCancellationRequested) - { - return; - } - Indicator.Update(new UpdateArgs(UpdateReason.HistoricalBar)); - CalculatingProgress.Report((float)i / num); - } - while (!P_2.IsCancellationRequested) - { - bool lockTaken = false; - UpdateArgs updateArgs; - try - { - ?.Enter(ref lockTaken); - if (?.Count == 0) - { - Status = IndicatorStatus.Working; - break; - } - updateArgs = ?.Dequeue(); - } - finally - { - if (lockTaken) - { - ?.Exit(); - } - } - if (updateArgs != null) - { - Indicator.Update(updateArgs); - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - ?.Set(); - } - } - - internal void ?(UpdateArgs P_0, IndicatorUpdateType? P_1 = null) - { - if (P_1.HasValue && P_1.Value != Indicator.UpdateType) - { - return; - } - bool lockTaken = false; - try - { - ?.Enter(ref lockTaken); - IndicatorStatus status = Status; - bool flag = (uint)status <= 1u; - if (flag || ?.Count > 0) - { - ?.Enqueue(P_0.?()); - return; - } - } - finally - { - if (lockTaken) - { - ?.Exit(); - } - } - Indicator.Update(P_0.?()); - } - - public void CallVolumeAnalysisLoaded() - { - if (Indicator is IVolumeAnalysisIndicator volumeAnalysisIndicator) - { - ?.Wait(); - volumeAnalysisIndicator.VolumeAnalysisData_Loaded(); - } - } - - public void Dispose() - { - ??.Cancel(); - ??.Dispose(); - Indicator?.Clear(); - Indicator?.Dispose(); - } - - private void ?(int P_0, bool P_1) - { - lock (?) - { - if (?) - { - ? = false; - ?(P_0, P_1, ?.Token); - } - } - } - - private void ?(int P_0, bool P_1, CancellationToken P_2) - { - ? = Task.Factory.StartNew(delegate - { - ?(P_0, P_1, P_2); - }, P_2, TaskCreationOptions.None, ?.TaskScheduler).ContinueWith(delegate - { - ?(P_0, P_1); - }, CancellationToken.None, TaskContinuationOptions.None, ?.TaskScheduler); - } - - private CancellationToken ?() - { - lock (?) - { - ??.Cancel(); - ? = new CancellationTokenSource(); - return ?.Token; - } - } - } - public abstract class Line : ICustomizable - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private Color ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private LineStyle ??; - - [CompilerGenerated] - private bool ??; - - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Color Color - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int Width - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public LineStyle Style - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool Visible - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public virtual IList Settings - { - get - { - return new List - { - new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Visible) - { - SortIndex = 0 - }, - new SettingItemLineOptions(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new LineOptions - { - WithCheckBox = false, - Color = Color, - Width = Width, - LineStyle = Style - }) - { - SortIndex = 1 - } - }; - } - set - { - SettingItem itemByName = value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (itemByName != null && itemByName.Value is bool visible) - { - Visible = visible; - } - itemByName = value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (itemByName != null && itemByName.Value is LineOptions lineOptions) - { - Color = lineOptions.Color; - Width = lineOptions.Width; - Style = lineOptions.LineStyle; - } - } - } - - protected Line(string name, Color color, int width, LineStyle style) - { - Name = name; - Color = color; - Width = width; - Style = style; - Visible = true; - } - } - public sealed class LineLevel : Line - { - [CompilerGenerated] - private double ??; - - public double Level - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override IList Settings - { - get - { - IList settings = base.Settings; - settings.Add(new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Level) - { - SortIndex = 2 - }); - return settings; - } - set - { - SettingItem itemByName = value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (itemByName != null && itemByName.Value is double level) - { - Level = level; - } - base.Settings = value; - } - } - - public LineLevel(double level, string name, Color color, int width, LineStyle style) - : base(name, color, width, style) - { - Level = level; - } - } - public sealed class LineSeries : Line - { - internal List ??; - - [CompilerGenerated] - private int ??; - - private static int ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private bool ?? = true; - - private readonly List ??; - - private readonly List ?? = new List(); - - internal int LineSeriesId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - internal int Count => ??.Count; - - /// - /// Sets the bar number (from the data beginning) from which the drawing of the given indicator line must start; - /// - public int DrawBegin - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Time shift of indicator's line - /// - public int TimeShift - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool ShowLineMarker - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double this[int offset = 0, SeekOriginHistory origin = SeekOriginHistory.End] - { - get - { - return GetValue(offset, origin); - } - set - { - SetValue(value, offset); - } - } - - public override IList Settings - { - get - { - IList settings = base.Settings; - settings.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TimeShift) - { - SortIndex = 3 - }); - settings.Add(new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ShowLineMarker) - { - SortIndex = 4 - }); - settings.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LineSeriesId) - { - VisibilityMode = VisibilityMode.Hidden - }); - return settings; - } - set - { - base.Settings = value; - SettingItem itemByName = value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (itemByName != null && itemByName.Value is int timeShift) - { - TimeShift = timeShift; - } - itemByName = value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (itemByName != null && itemByName.Value is bool showLineMarker) - { - ShowLineMarker = showLineMarker; - } - } - } - - public LineSeries(string name, Color color, int width, LineStyle style) - : base(name, color, width, style) - { - LineSeriesId = ??++; - ?? = new List(); - ?? = new List(); - } - - public double GetValue(int offset = 0, SeekOriginHistory origin = SeekOriginHistory.End) - { - double result = double.NaN; - int num = ?(offset, origin); - if (num >= 0 && num < Count) - { - result = ??[num]; - } - return result; - } - - public void SetValue(double value, int offset = 0, SeekOriginHistory origin = SeekOriginHistory.End) - { - int index = ?(offset, origin); - ??[index] = value; - } - - internal void ?() - { - ??.Add(double.NaN); - ??.Add(null); - ??.Add(item: false); - } - - public void Clear() - { - ??.Clear(); - ClearMarkers(); - ??.Clear(); - } - - /// - /// Redraws parts of indicator's line within the interval set by offset - /// - public void SetMarker(int offset, Color color) - { - SetMarker(offset, new IndicatorLineMarker - { - Color = color - }); - } - - public void SetMarker(int offset, IndicatorLineMarker indicatorMarker) - { - if (offset < 0 || offset >= ??.Count) - { - throw new ArgumentOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ??[??.Count - 1 - offset] = indicatorMarker; - } - - /// - /// Removes redrawn parts of indicator's line within the interval set by offset - /// - public void RemoveMarker(int offset) - { - if (offset < 0 || offset >= ??.Count) - { - throw new ArgumentOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ??[??.Count - 1 - offset] = null; - } - - /// - /// - /// - public IndicatorLineMarker GetMarker(int offset) - { - if (offset < 0 || offset >= ??.Count) - { - return null; - } - return ??[??.Count - 1 - offset]; - } - - /// - /// Fully clears markers from line - /// - public void ClearMarkers() - { - for (int i = 0; i < ??.Count; i++) - { - ??[i] = null; - } - } - - public void SetLineBreak(int offset) - { - if (offset < 0 || offset >= ??.Count) - { - throw new ArgumentOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ??[??.Count - 1 - offset] = true; - } - - public void RemoveLineBreak(int offset) - { - if (offset < 0 || offset >= ??.Count) - { - throw new ArgumentOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ??[??.Count - 1 - offset] = false; - } - - public bool GetLineBreak(int offset) - { - if (offset < 0 || offset >= ??.Count) - { - throw new ArgumentOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return ??[??.Count - 1 - offset]; - } - - private int ?(int P_0, SeekOriginHistory P_1) - { - int result = P_0; - if (P_1 == SeekOriginHistory.End) - { - result = Count - 1 - P_0; - } - return result; - } - } - [Published] - public class PaintChartEventArgs - { - [CompilerGenerated] - private Graphics ?; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private Rectangle ??; - - [CompilerGenerated] - private Point ??; - - [CompilerGenerated] - private int ??; - - public Graphics Graphics - { - [CompilerGenerated] - get - { - return ?; - } - [CompilerGenerated] - set - { - ? = value; - } - } - - public bool DrawBackground - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Rectangle Rectangle - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Point MousePosition - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int WindowIndex - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public PaintChartEventArgs(Graphics graphics, Rectangle rectangle, Point mousePosition, int windowIndex) - { - Graphics = graphics; - Rectangle = rectangle; - MousePosition = mousePosition; - WindowIndex = windowIndex; - } - } - /// - /// Use this attribute to mark input parameters of your script. You will see them in the settings screen on adding - /// - [Published] - [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] - public class InputParameterAttribute : Attribute - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private IComparable[] ??; - - /// - /// Displayed name of input parameter - /// - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Sort index for input paramter - /// - public int SortIndex - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Minimal value for numeric input parameters - /// - public double Minimum - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Maximal value for numeric input parameters - /// - public double Maximum - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Increment value for numeric input parameters - /// - public double Increment - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// Decimal palces for numeric input parameters - /// - public int DecimalPlaces - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - /// - /// List of predefined values - /// - public IComparable[] Variants - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = array; - } - } - - public InputParameterAttribute(string name = "", int sortIndex = 0, double minimum = -2147483648.0, double maximum = 2147483647.0, double increment = 0.01, int decimalPlaces = 2, object[] variants = null) - { - Name = name; - SortIndex = sortIndex; - Minimum = minimum; - Maximum = maximum; - Increment = increment; - DecimalPlaces = decimalPlaces; - Variants = variants?.Cast()?.ToArray(); - } - } - public sealed class OrderPlacingStrategiesManager : ScriptManager - { - private readonly List ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - public OrderPlacingStrategy[] Created => ??.ToArray(); - - public override string CustomScriptsPath => Const.CUSTOM_PLACE_ORDER_STRATEGIES_PATH; - - protected override string DefaultScriptsPath => Const.DEFAULT_PLACE_ORDER_STRATEGIES_RELATIVE_PATH; - - public event Action StrategyCreated - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public event Action StrategyRemoved - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public OrderPlacingStrategiesManager() - { - ?? = new List(); - } - - internal override void ?() - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - try - { - base.?(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - } - - protected override OrderPlacingStrategyInfo CreateScriptInfo(ConstructorInfo ctor, ScriptCreationType scriptCreationType, string relativePath, string assemblyName) - { - return new OrderPlacingStrategyInfo(ctor, scriptCreationType, relativePath, assemblyName); - } - - protected override string GetScriptsFolderPath(ScriptCreationType scriptCreationType) - { - if (scriptCreationType != ScriptCreationType.Default) - { - return Const.CUSTOM_PLACE_ORDER_STRATEGIES_PATH; - } - return Path.Combine(Const.EXECUTING_FOLDER, Const.DEFAULT_PLACE_ORDER_STRATEGIES_RELATIVE_PATH); - } - - public OrderPlacingStrategy CreateStrategy(OrderPlacingStrategyInfo orderPlacingStrategyInfo) - { - OrderPlacingStrategy orderPlacingStrategy = orderPlacingStrategyInfo.?(); - ??.Add(orderPlacingStrategy); - ???.Invoke(orderPlacingStrategy); - return orderPlacingStrategy; - } - - internal void ?(OrderPlacingStrategy P_0) - { - if (??.Remove(P_0)) - { - P_0.Dispose(); - ???.Invoke(P_0); - } - } - } - public abstract class ScriptInfo - { - [CompilerGenerated] - private ScriptKey ??; - - [CompilerGenerated] - private ScriptCreationType ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private Version ??; - - [CompilerGenerated] - private List ??; - - protected ConstructorInfo ctor; - - public ScriptKey Key - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected set - { - ?? = value; - } - } - - public ScriptCreationType ScriptCreationType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = scriptCreationType; - } - } - - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected set - { - ?? = value; - } - } - - public string Description - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected set - { - ?? = value; - } - } - - public Version Version - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected set - { - ?? = value; - } - } - - public List Settings - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - protected set - { - ?? = value; - } - } - - protected ScriptInfo(ConstructorInfo ctor, ScriptCreationType scriptCreationType, string relativePath, string assemblyName) - { - this.ctor = ctor; - ScriptCreationType = scriptCreationType; - try - { - Initialize(relativePath, assemblyName); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + assemblyName + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - protected abstract void Initialize(string relativePath, string assemblyName); - } - public class ScriptInfoEventArgs : EventArgs - { - } - public struct ScriptKey - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal string ?(DescriptionAttribute P_0) - { - return P_0.Description; - } - } - - [CompilerGenerated] - private string[] ??; - - [CompilerGenerated] - private ScriptCreationType ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - private const string ?? = "|"; - - public string[] FoldersHierarchy - { - [CompilerGenerated] - readonly get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = array; - } - } - - internal ScriptCreationType ScriptCreationType - { - [CompilerGenerated] - readonly get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = scriptCreationType; - } - } - - internal string RelativePath - { - [CompilerGenerated] - readonly get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - internal string AssemblyName - { - [CompilerGenerated] - readonly get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - internal string ScriptName - { - [CompilerGenerated] - readonly get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public ScriptKey(ScriptCreationType scriptCreationType, string relativePath, string assemblyName, string scriptName) - { - this = default(ScriptKey); - ScriptCreationType = scriptCreationType; - RelativePath = relativePath; - AssemblyName = assemblyName; - ScriptName = scriptName; - FoldersHierarchy = relativePath.Split(new char[1] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries); - } - - public override bool Equals(object obj) - { - ScriptKey scriptKey = (ScriptKey)obj; - if (ScriptName != scriptKey.ScriptName) - { - return false; - } - if (AssemblyName != scriptKey.AssemblyName) - { - return false; - } - if (RelativePath != scriptKey.RelativePath) - { - return false; - } - if (ScriptCreationType != scriptKey.ScriptCreationType) - { - return false; - } - return true; - } - - public override int GetHashCode() - { - return ((((((0x50C5D1F ^ ScriptCreationType.GetHashCode()) * 16777619) ^ (RelativePath ?? string.Empty).GetHashCode()) * 16777619) ^ (AssemblyName ?? string.Empty).GetHashCode()) * 16777619) ^ (ScriptName ?? string.Empty).GetHashCode(); - } - - public static bool operator !=(ScriptKey key1, ScriptKey key2) - { - return !key1.Equals(key2); - } - - public static bool operator ==(ScriptKey key1, ScriptKey key2) - { - return key1.Equals(key2); - } - - public static ScriptKey CreateScriptKeyFromString(string stringKey) - { - string[] array = stringKey.Split(new string[1] { 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() }, StringSplitOptions.None); - if (array.Length != 4 || !array[0].TryParseEnum((DescriptionAttribute P_0) => P_0.Description, out var enumValue)) - { - return default(ScriptKey); - } - return new ScriptKey(enumValue, array[1], array[2], array[3]); - } - - public override string ToString() - { - return $"{ScriptCreationType.GetDescription()}{3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()}{RelativePath}{3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()}{AssemblyName}{3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()}{ScriptName}"; - } - } - public abstract class ScriptManager : IDisposable where TScriptInfo : ScriptInfo where TScript : ExecutionEntity - { - [CompilerGenerated] - private sealed class ? - { - public ScriptCreationType ??; - - public string ??; - - public string ??; - - internal bool ?(ScriptKey P_0) - { - return P_0.ScriptCreationType == ??; - } - - internal bool ?(ScriptKey P_0) - { - return P_0.RelativePath == ??; - } - - internal bool ?(ScriptKey P_0) - { - return P_0.AssemblyName == ??; - } - } - - [CompilerGenerated] - private sealed class ? - { - public ScriptManager ??; - - public FileSystemEventArgs ??; - - internal void ?(Task P_0) - { - ??.?(??.FullPath); - } - } - - [CompilerGenerated] - private sealed class ? - { - public ScriptManager ??; - - public FileSystemEventArgs ??; - - internal void ?(Task P_0) - { - ??.?(??.FullPath); - } - } - - [CompilerGenerated] - private sealed class ? - { - public ScriptManager ??; - - public List ??; - - internal void ?(string P_0) - { - ??.??.Add(P_0); - } - - internal void ?(Task P_0) - { - foreach (string item in ??) - { - if (!??.??.Contains(item)) - { - break; - } - ??.??.Remove(item); - if (!??.??.TryGetValue(item, out var value)) - { - continue; - } - foreach (TScriptInfo item2 in new List(value)) - { - ??.?(item2, item); - ??.?(item2); - } - } - } - } - - [CompilerGenerated] - private sealed class ? - { - public string ??; - - internal bool ?(string P_0) - { - return P_0.Contains(??); - } - } - - [CompilerGenerated] - private ScriptInfoEventHandler ??; - - [CompilerGenerated] - private ScriptInfoEventHandler ??; - - [CompilerGenerated] - private ScriptInfoEventHandler ??; - - protected Dictionary scriptsInfoCache; - - private readonly Dictionary> ??; - - private readonly Dictionary> ??; - - private readonly FileSystemWatcher ??; - - private readonly HashSet ??; - - private readonly Dictionary ??; - - private readonly object ??; - - protected abstract string DefaultScriptsPath { get; } - - public abstract string CustomScriptsPath { get; } - - public TScriptInfo[] All => scriptsInfoCache.Values.ToArray(); - - public event ScriptInfoEventHandler ScriptAdded - { - [CompilerGenerated] - add - { - ScriptInfoEventHandler scriptInfoEventHandler = ??; - ScriptInfoEventHandler scriptInfoEventHandler2; - do - { - scriptInfoEventHandler2 = scriptInfoEventHandler; - ScriptInfoEventHandler value2 = (ScriptInfoEventHandler)Delegate.Combine(scriptInfoEventHandler2, value); - scriptInfoEventHandler = Interlocked.CompareExchange(ref ??, value2, scriptInfoEventHandler2); - } - while ((object)scriptInfoEventHandler != scriptInfoEventHandler2); - } - [CompilerGenerated] - remove - { - ScriptInfoEventHandler scriptInfoEventHandler = ??; - ScriptInfoEventHandler scriptInfoEventHandler2; - do - { - scriptInfoEventHandler2 = scriptInfoEventHandler; - ScriptInfoEventHandler value2 = (ScriptInfoEventHandler)Delegate.Remove(scriptInfoEventHandler2, value); - scriptInfoEventHandler = Interlocked.CompareExchange(ref ??, value2, scriptInfoEventHandler2); - } - while ((object)scriptInfoEventHandler != scriptInfoEventHandler2); - } - } - - public event ScriptInfoEventHandler ScriptUpdated - { - [CompilerGenerated] - add - { - ScriptInfoEventHandler scriptInfoEventHandler = ??; - ScriptInfoEventHandler scriptInfoEventHandler2; - do - { - scriptInfoEventHandler2 = scriptInfoEventHandler; - ScriptInfoEventHandler value2 = (ScriptInfoEventHandler)Delegate.Combine(scriptInfoEventHandler2, value); - scriptInfoEventHandler = Interlocked.CompareExchange(ref ??, value2, scriptInfoEventHandler2); - } - while ((object)scriptInfoEventHandler != scriptInfoEventHandler2); - } - [CompilerGenerated] - remove - { - ScriptInfoEventHandler scriptInfoEventHandler = ??; - ScriptInfoEventHandler scriptInfoEventHandler2; - do - { - scriptInfoEventHandler2 = scriptInfoEventHandler; - ScriptInfoEventHandler value2 = (ScriptInfoEventHandler)Delegate.Remove(scriptInfoEventHandler2, value); - scriptInfoEventHandler = Interlocked.CompareExchange(ref ??, value2, scriptInfoEventHandler2); - } - while ((object)scriptInfoEventHandler != scriptInfoEventHandler2); - } - } - - public event ScriptInfoEventHandler ScriptDeleted - { - [CompilerGenerated] - add - { - ScriptInfoEventHandler scriptInfoEventHandler = ??; - ScriptInfoEventHandler scriptInfoEventHandler2; - do - { - scriptInfoEventHandler2 = scriptInfoEventHandler; - ScriptInfoEventHandler value2 = (ScriptInfoEventHandler)Delegate.Combine(scriptInfoEventHandler2, value); - scriptInfoEventHandler = Interlocked.CompareExchange(ref ??, value2, scriptInfoEventHandler2); - } - while ((object)scriptInfoEventHandler != scriptInfoEventHandler2); - } - [CompilerGenerated] - remove - { - ScriptInfoEventHandler scriptInfoEventHandler = ??; - ScriptInfoEventHandler scriptInfoEventHandler2; - do - { - scriptInfoEventHandler2 = scriptInfoEventHandler; - ScriptInfoEventHandler value2 = (ScriptInfoEventHandler)Delegate.Remove(scriptInfoEventHandler2, value); - scriptInfoEventHandler = Interlocked.CompareExchange(ref ??, value2, scriptInfoEventHandler2); - } - while ((object)scriptInfoEventHandler != scriptInfoEventHandler2); - } - } - - protected ScriptManager() - { - scriptsInfoCache = new Dictionary(); - ?? = new Dictionary>(); - ?? = new Dictionary>(); - ?? = new FileSystemWatcher(); - ?? = new HashSet(); - ?? = new Dictionary(); - ?? = new object(); - } - - internal virtual void ?() - { - string customScriptsPath = CustomScriptsPath; - if (!Directory.Exists(customScriptsPath)) - { - Directory.CreateDirectory(customScriptsPath); - } - List list = AssemblyLoader.LoadTypes(DefaultScriptsPath, typeof(TScript), null, SearchOption.AllDirectories, loadInMemory: true); - ?(list, ScriptCreationType.Default); - List list2 = AssemblyLoader.LoadTypes(customScriptsPath, typeof(TScript), null, SearchOption.AllDirectories, loadInMemory: true, allowLoadingReferences: true); - ?(list2, ScriptCreationType.Custom); - ??.Path = customScriptsPath; - ??.NotifyFilter = NotifyFilters.FileName | NotifyFilters.DirectoryName | NotifyFilters.Size; - ??.IncludeSubdirectories = true; - ??.Created += ?; - ??.Changed += ?; - ??.Deleted += ?; - ??.EnableRaisingEvents = true; - } - - private void ?(List P_0, ScriptCreationType P_1) - { - if (P_0 == null) - { - return; - } - string scriptsFolderPath = GetScriptsFolderPath(P_1); - foreach (TypeWrapper item in P_0) - { - try - { - ConstructorInfo constructor = item.Type.GetConstructor(Array.Empty()); - string directoryName = Path.GetDirectoryName(?(item.AssemblyLocation, scriptsFolderPath)); - TScriptInfo val = CreateScriptInfo(constructor, P_1, directoryName, item.Type.Assembly.GetName().Name); - if (!(val.Key == default(ScriptKey))) - { - ?(val, item.AssemblyLocation); - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - } - - protected abstract string GetScriptsFolderPath(ScriptCreationType scriptCreationType); - - protected abstract TScriptInfo CreateScriptInfo(ConstructorInfo ctor, ScriptCreationType scriptCreationType, string relativePath, string assemblyName); - - protected ScriptKey SearchScriptKey(string scriptName, string assemblyName, string relativePath, ScriptCreationType scriptCreationType = ScriptCreationType.Default) - { - if (!??.TryGetValue(scriptName, out var value)) - { - return default(ScriptKey); - } - if (!value.Any()) - { - return default(ScriptKey); - } - List source = new List(value); - source = source.Where((ScriptKey P_0) => P_0.ScriptCreationType == scriptCreationType).ToList(); - if (!string.IsNullOrEmpty(relativePath)) - { - source = source.Where((ScriptKey P_0) => P_0.RelativePath == relativePath).ToList(); - } - if (!string.IsNullOrEmpty(assemblyName)) - { - source = source.Where((ScriptKey P_0) => P_0.AssemblyName == assemblyName).ToList(); - } - return source.FirstOrDefault(); - } - - private static string ?(string P_0, string P_1) - { - Uri uri = new Uri(P_0); - if (!P_1.EndsWith(Path.DirectorySeparatorChar.ToString())) - { - P_1 += Path.DirectorySeparatorChar; - } - return Uri.UnescapeDataString(new Uri(P_1).MakeRelativeUri(uri).ToString().Replace('/', Path.DirectorySeparatorChar)); - } - - public virtual void Dispose() - { - ??.Created -= ?; - ??.Changed -= ?; - ??.Deleted -= ?; - ??.EnableRaisingEvents = false; - ??.Dispose(); - scriptsInfoCache?.Clear(); - ???.Clear(); - } - - private void ?(object P_0, FileSystemEventArgs P_1) - { - if (!?(P_1.FullPath)) - { - ??.Remove(P_1.FullPath); - Task.Delay(1000).ContinueWith(delegate - { - ?(P_1.FullPath); - }); - } - } - - private void ?(object P_0, FileSystemEventArgs P_1) - { - if (!?(P_1.FullPath)) - { - Task.Delay(1000).ContinueWith(delegate - { - ?(P_1.FullPath); - }); - } - } - - private void ?(object P_0, FileSystemEventArgs P_1) - { - List ?? = new List(); - if (!Path.HasExtension(P_1.FullPath)) - { - string ?? = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + MakeRelativePath(CustomScriptsPath, P_1.FullPath) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - ??.AddRange(??.Keys.Where((string text) => text.Contains(??))); - } - else if (Path.GetExtension(P_1.FullPath) == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - ??.Add(P_1.FullPath); - } - if (??.Count == 0) - { - return; - } - ??.ForEach(delegate(string item) - { - ??.Add(item); - }); - Task.Delay(2000).ContinueWith(delegate - { - foreach (string item in ??) - { - if (!??.Contains(item)) - { - break; - } - ??.Remove(item); - if (??.TryGetValue(item, out var value)) - { - foreach (TScriptInfo item2 in new List(value)) - { - ?(item2, item); - ?(item2); - } - } - } - }); - } - - private void ?(ScriptInfo P_0) - { - ???.Invoke(P_0, new ScriptInfoEventArgs()); - } - - protected virtual void OnScriptUpdated(ScriptInfo scriptInfo) - { - ???.Invoke(scriptInfo, new ScriptInfoEventArgs()); - } - - private void ?(ScriptInfo P_0) - { - ???.Invoke(P_0, new ScriptInfoEventArgs()); - } - - private void ?(TScriptInfo P_0, string P_1) - { - ScriptKey key = P_0.Key; - scriptsInfoCache.Add(key, P_0); - if (!??.TryGetValue(key.ScriptName, out var value)) - { - value = new List(); - ??.Add(key.ScriptName, value); - } - value.Add(key); - if (!??.TryGetValue(P_1, out var value2)) - { - value2 = new List(); - ??.Add(P_1, value2); - } - value2.Add(P_0); - } - - private void ?(TScriptInfo P_0, string P_1) - { - ScriptKey key = P_0.Key; - scriptsInfoCache.Remove(key); - if (??.TryGetValue(key.ScriptName, out var value)) - { - value.Remove(key); - } - if (??.TryGetValue(P_1, out var value2)) - { - value2.Remove(P_0); - } - if (!value2.Any()) - { - ??.Remove(P_1); - } - } - - private bool ?(string P_0, DateTime P_1) - { - if (??.TryGetValue(P_0, out var value)) - { - return value == P_1; - } - return false; - } - - private void ?(string P_0) - { - try - { - lock (??) - { - DateTime lastWriteTimeUtc = File.GetLastWriteTimeUtc(P_0); - bool num = ?(P_0, lastWriteTimeUtc); - ??[P_0] = lastWriteTimeUtc; - if (num) - { - return; - } - } - string scriptsFolderPath = GetScriptsFolderPath(ScriptCreationType.Custom); - foreach (TypeWrapper item in AssemblyLoader.?(P_0, typeof(TScript), true, true)) - { - try - { - ConstructorInfo constructor = item.Type.GetConstructor(Array.Empty()); - string directoryName = Path.GetDirectoryName(?(item.AssemblyLocation, scriptsFolderPath)); - TScriptInfo val = CreateScriptInfo(constructor, ScriptCreationType.Custom, directoryName, item.Type.Assembly.GetName().Name); - if (!(val.Key == default(ScriptKey))) - { - ScriptKey key = val.Key; - if (scriptsInfoCache.ContainsKey(key)) - { - scriptsInfoCache[key] = val; - OnScriptUpdated(val); - } - else - { - ?(val, P_0); - ?(val); - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - } - catch (Exception ex2) - { - Core.Instance.Loggers.Log(ex2); - } - } - - private static bool ?(string P_0) - { - if (!Path.HasExtension(P_0)) - { - return true; - } - if (Path.GetExtension(P_0) != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - return true; - } - return false; - } - - public static string MakeRelativePath(string fromPath, string toPath) - { - if (string.IsNullOrEmpty(fromPath)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (string.IsNullOrEmpty(toPath)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - Uri uri = new Uri(fromPath); - Uri uri2 = new Uri(toPath); - if (uri.Scheme != uri2.Scheme) - { - return toPath; - } - string text = Uri.UnescapeDataString(uri.MakeRelativeUri(uri2).ToString()); - if (uri2.Scheme.Equals(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), StringComparison.InvariantCultureIgnoreCase)) - { - text = text.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); - } - return text; - } - } - public delegate void ScriptInfoEventHandler(ScriptInfo scriptInfo, ScriptInfoEventArgs e); - /// - /// The base class for strategies - /// - [Published] - public abstract class Strategy : ExecutionEntity, IXElementSerialization, IConnectionStateDependent - { - [CompilerGenerated] - private string ??; - - private StrategyState ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private StrategyEventHandler ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private bool ??; - - private ILogger ??; - - private DateTime ??; - - private DateTime ??; - - private Meter ??; - - private readonly ConnectionStateObserver ??; - - private StrategyState? ??; - - /// - /// Unique ID of the strategy - /// - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - /// - /// The current state of the strategy - /// - public StrategyState State - { - get - { - return ??; - } - internal set - { - StrategyState strategyState = ??; - ?? = strategyState2; - Core.Instance.Strategies.?(this, ??, strategyState); - } - } - - public string InstanceName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override IList Settings - { - get - { - IList settings = base.Settings; - settings.Add(new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), InstanceName) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - SeparatorGroup = new SettingItemSeparatorGroup(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), -1100) - }); - return settings; - } - set - { - if (value.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value2)) - { - InstanceName = value2; - } - if (State == StrategyState.Working) - { - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - base.Settings = value; - ???.Invoke(this); - } - } - - public bool NewVersionAvailable - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = flag; - } - } - - public virtual string[] MonitoringConnectionsIds => new string[0]; - - private string DataFolderName => base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + Id + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); - - internal string DataFolderPath => Path.Combine(Const.SCRIPTS_DATA_PATH, DataFolderName); - - /// - /// Event occured when strategy write a new log - /// - public event StrategyEventHandler NewLog - { - [CompilerGenerated] - add - { - StrategyEventHandler strategyEventHandler = ??; - StrategyEventHandler strategyEventHandler2; - do - { - strategyEventHandler2 = strategyEventHandler; - StrategyEventHandler value2 = (StrategyEventHandler)Delegate.Combine(strategyEventHandler2, value); - strategyEventHandler = Interlocked.CompareExchange(ref ??, value2, strategyEventHandler2); - } - while ((object)strategyEventHandler != strategyEventHandler2); - } - [CompilerGenerated] - remove - { - StrategyEventHandler strategyEventHandler = ??; - StrategyEventHandler strategyEventHandler2; - do - { - strategyEventHandler2 = strategyEventHandler; - StrategyEventHandler value2 = (StrategyEventHandler)Delegate.Remove(strategyEventHandler2, value); - strategyEventHandler = Interlocked.CompareExchange(ref ??, value2, strategyEventHandler2); - } - while ((object)strategyEventHandler != strategyEventHandler2); - } - } - - /// - /// Event occured if any of strategy settings was changed - /// - public event Action SettingsChanged - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - internal void ?() - { - CheckDisposed(); - string dataFolderPath = DataFolderPath; - if (!Directory.Exists(dataFolderPath)) - { - Directory.CreateDirectory(dataFolderPath); - } - ?? = Core.Instance.Loggers.GetLogger(new LoggerConfig - { - LoggerName = DataFolderName, - OutputFolderPath = Path.Combine(DataFolderPath, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - Scope = LoggerScope.General - }); - try - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(2, 3); - defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.Key); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Id); - ?? = new Meter(defaultInterpolatedStringHandler.ToStringAndClear(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - OnInitializeMetrics(??); - } - catch (Exception ex) - { - Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + (ex.InnerException?.Message ?? ex.Message), StrategyLoggingLevel.Error); - Core.Instance.Loggers.Log(ex, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - State = StrategyState.Created; - try - { - OnCreated(); - Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - catch (Exception ex2) - { - Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + (ex2.InnerException?.Message ?? ex2.Message), StrategyLoggingLevel.Error); - Core.Instance.Loggers.Log(ex2, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - /// - /// Run strategy - /// - public void Run() - { - CheckDisposed(); - if (State == StrategyState.Working) - { - return; - } - string[] monitoringConnectionsIds = MonitoringConnectionsIds; - if (monitoringConnectionsIds != null) - { - string[] array = monitoringConnectionsIds; - foreach (string text in array) - { - if (text != null) - { - Connection connection = Core.Instance.Connections[text]; - if (connection == null || connection.State != ConnectionState.Connected) - { - State = StrategyState.WaitingForConnection; - return; - } - } - } - } - State = StrategyState.Working; - ?? = Core.Instance.TimeUtils.DateTimeUtcNow; - try - { - OnRun(); - Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - catch (Exception ex) - { - Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + (ex.InnerException?.Message ?? ex.Message), StrategyLoggingLevel.Error); - Core.Instance.Loggers.Log(ex, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - /// - /// Stop strategy - /// - public void Stop() - { - CheckDisposed(); - if (State != StrategyState.Working && State != StrategyState.WaitingForConnection) - { - return; - } - bool num = State != StrategyState.WaitingForConnection; - State = StrategyState.Stopped; - ?? = Core.Instance.TimeUtils.DateTimeUtcNow; - if (!num) - { - return; - } - try - { - OnStop(); - Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - catch (Exception ex) - { - Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + (ex.InnerException?.Message ?? ex.Message), StrategyLoggingLevel.Error); - Core.Instance.Loggers.Log(ex, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - /// - /// Remove the strategy - /// - public void Remove() - { - CheckDisposed(); - if (State == StrategyState.Removed) - { - return; - } - if (State == StrategyState.Working) - { - Stop(); - } - try - { - string dataFolderPath = DataFolderPath; - if (Directory.Exists(dataFolderPath)) - { - Directory.Delete(dataFolderPath, recursive: true); - } - } - catch (Exception ex) - { - Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ex.GetFullMessageRecursive(), StrategyLoggingLevel.Error); - Core.Instance.Loggers.Log(ex, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - State = StrategyState.Removed; - try - { - OnRemove(); - Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - catch (Exception ex2) - { - Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + (ex2.InnerException?.Message ?? ex2.Message), StrategyLoggingLevel.Error); - Core.Instance.Loggers.Log(ex2, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - finally - { - ???.Dispose(); - ?? = null; - } - } - - /// - /// Get current metrics from the strategy - /// - /// - public List GetMetrics() - { - CheckDisposed(); - List result = null; - try - { - result = OnGetMetrics(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return result; - } - - /// - /// Get logs from the strategy for specified date range - /// - /// - /// - /// - public LoggerEvent[] GetLogs(DateTime from, DateTime to) - { - return ???.GetHistory(from, to)?.OfType().ToArray() ?? Array.Empty(); - } - - protected virtual void OnCreated() - { - } - - protected virtual void OnRun() - { - } - - protected virtual void OnStop() - { - } - - protected virtual void OnRemove() - { - } - - [Obsolete("Use OnInitializeMetrics() method to initialize System.Diagnostics.Metrics")] - protected virtual List OnGetMetrics() - { - return new List - { - { - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - (?? == default(DateTime)) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() : Core.Instance.TimeUtils.GetFormatedDateTime(Core.Instance.TimeUtils.ConvertFromUTCToSelectedTimeZone(??)) - }, - { - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - (?? == default(DateTime)) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() : ((State == StrategyState.Working) ? (Core.Instance.TimeUtils.GetFormatedLongTime(Core.Instance.TimeUtils.DateTimeUtcNow) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Core.Instance.TimeUtils.GetFormatedLongTime(??)) : (Core.Instance.TimeUtils.GetFormatedLongTime(??) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Core.Instance.TimeUtils.GetFormatedLongTime(??))) - } - }; - } - - protected virtual void OnInitializeMetrics(Meter meter) - { - } - - /// - /// Write log message - /// - /// - /// - protected internal void Log(string message, StrategyLoggingLevel level = StrategyLoggingLevel.Info) - { - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - LoggingLevel loggingLevel = level switch - { - StrategyLoggingLevel.Trading => LoggingLevel.Trading, - StrategyLoggingLevel.Error => LoggingLevel.Error, - _ => LoggingLevel.System, - }; - ???.Log(message, dateTimeUtcNow, loggingLevel); - if (?? != null) - { - LoggerEvent loggerEvent = new LoggerEvent - { - Date = dateTimeUtcNow, - Event = message, - Type = loggingLevel - }; - ?(loggerEvent); - } - } - - [NotPublished] - public override void Dispose() - { - ??.Dispose(); - ???.Dispose(); - if (State == StrategyState.Working) - { - Stop(); - } - base.Dispose(); - } - - protected Strategy() - { - Id = Guid.NewGuid().ToString(); - ?? = new ConnectionStateObserver(this, ConnectionStateObserverPriority.Normal, ConnectionState.Connected, ConnectionState.Disconnected, ConnectionState.ConnectionLost); - } - - private void ?(LoggerEvent P_0) - { - ???.Invoke(this, new StrategyEventArgs(State, P_0)); - } - - [NotPublished] - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), base.Key.ToString())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), base.Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)State)); - XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (SettingItem setting in Settings) - { - xElement2.Add(setting.ToXElement()); - } - xElement.Add(xElement2); - return xElement; - } - - [NotPublished] - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - string stringKey = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value; - base.Key = ScriptKey.CreateScriptKeyFromString(stringKey); - Id = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value; - base.Name = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value; - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - List settings = Serializer.DeserializeXML(xElement, deserializationInfo).OfType().ToList(); - Settings = settings; - } - ?? = (StrategyState)(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToInt() ?? 10); - } - - internal void ?() - { - bool flag; - switch (??) - { - case StrategyState.Working: - case StrategyState.WaitingForConnection: - flag = true; - break; - default: - flag = false; - break; - } - if (flag) - { - Task.Factory.StartNew(Run); - } - ?? = null; - } - - public ConnectionDependency GetConnectionStateDependency() - { - return new ConnectionDependency - { - Behavior = ConnectionDependencyBehavior.PartialDependency, - DependentConnectionsIds = MonitoringConnectionsIds - }; - } - - private void ?(Connection P_0, ConnectionStateChangedEventArgs P_1) - { - if (P_1.NewState == ConnectionState.Connected) - { - if (State == StrategyState.WaitingForConnection) - { - Task.Factory.StartNew(Run); - } - } - else if (State == StrategyState.Working) - { - Task.Factory.StartNew(Stop).ContinueWith((Task task) => State = StrategyState.WaitingForConnection); - } - } - - void IConnectionStateDependent.OnConnectionStateChanged(Connection P_0, ConnectionStateChangedEventArgs P_1) - { - //ILSpy generated this explicit interface implementation from .override directive in ? - this.?(P_0, P_1); - } - - [CompilerGenerated] - private StrategyState ?(Task P_0) - { - return State = StrategyState.WaitingForConnection; - } - } - public class StrategyEventArgs : EventArgs - { - [CompilerGenerated] - private StrategyState ??; - - [CompilerGenerated] - private StrategyState ??; - - [CompilerGenerated] - private LoggerEvent ??; - - public StrategyState StrategyState - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = strategyState; - } - } - - public StrategyState StrategyPreviousState - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = strategyState; - } - } - - public LoggerEvent LoggerEvent - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = loggerEvent; - } - } - - public StrategyEventArgs(StrategyState strategyState, LoggerEvent loggerEvent = null) - { - StrategyState = strategyState; - LoggerEvent = loggerEvent; - } - } - public class StrategyInfo : ScriptInfo - { - internal StrategyInfo(ConstructorInfo P_0, ScriptCreationType P_1, string P_2, string P_3) - : base(P_0, P_1, P_2, P_3) - { - } - - protected override void Initialize(string relativePath, string assemblyName) - { - using Strategy strategy = ctor.Invoke(null) as Strategy; - base.Name = strategy.Name; - base.Description = strategy.Description; - base.Version = strategy.Version; - base.Key = new ScriptKey(base.ScriptCreationType, relativePath, assemblyName, base.Name); - strategy.Key = base.Key; - base.Settings = strategy.Settings as List; - } - - internal Strategy ?() - { - Strategy strategy = ctor?.Invoke(null) as Strategy; - if (strategy != null) - { - strategy.Key = base.Key; - } - return strategy; - } - - public override string ToString() - { - return base.Name; - } - } - public sealed class StrategyManager : ScriptManager - { - [CompilerGenerated] - private new sealed class ? - { - public Strategy ??; - - public StrategyManager ??; - - internal void ?() - { - ??.?(??); - } - } - - private readonly List ??; - - [CompilerGenerated] - private StrategyEventHandler ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private bool ??; - - public Strategy[] Created => ??.ToArray(); - - protected override string DefaultScriptsPath => Const.DEFAULT_STRATEGIES_RELATIVE_PATH; - - public override string CustomScriptsPath => Const.CUSTOM_STRATEGIES_PATH; - - public bool RestoreStateAfterShutdown - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public event StrategyEventHandler StrategyStateChanged - { - [CompilerGenerated] - add - { - StrategyEventHandler strategyEventHandler = ??; - StrategyEventHandler strategyEventHandler2; - do - { - strategyEventHandler2 = strategyEventHandler; - StrategyEventHandler value2 = (StrategyEventHandler)Delegate.Combine(strategyEventHandler2, value); - strategyEventHandler = Interlocked.CompareExchange(ref ??, value2, strategyEventHandler2); - } - while ((object)strategyEventHandler != strategyEventHandler2); - } - [CompilerGenerated] - remove - { - StrategyEventHandler strategyEventHandler = ??; - StrategyEventHandler strategyEventHandler2; - do - { - strategyEventHandler2 = strategyEventHandler; - StrategyEventHandler value2 = (StrategyEventHandler)Delegate.Remove(strategyEventHandler2, value); - strategyEventHandler = Interlocked.CompareExchange(ref ??, value2, strategyEventHandler2); - } - while ((object)strategyEventHandler != strategyEventHandler2); - } - } - - public event Action StrategyCreated - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public event Action StrategyRemoved - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - internal StrategyManager() - { - ?? = new List(); - RestoreStateAfterShutdown = false; - } - - internal override void ?() - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - try - { - base.?(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - } - - public Strategy CreateStrategy(string strategyName, string assemblyName = "", string relativePath = "", ScriptCreationType scriptCreationType = ScriptCreationType.Default) - { - if (string.IsNullOrEmpty(strategyName)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ScriptKey scriptKey = SearchScriptKey(strategyName, assemblyName, relativePath, scriptCreationType); - return CreateStrategy(scriptKey); - } - - public Strategy CreateStrategy(ScriptKey scriptKey) - { - if (scriptsInfoCache.TryGetValue(scriptKey, out var value)) - { - return CreateStrategy(value); - } - return null; - } - - public Strategy CreateStrategy(StrategyInfo strategyInfo) - { - Strategy strategy = strategyInfo.?(); - ?(strategy); - return strategy; - } - - private void ?(Strategy P_0) - { - P_0.?(); - ??.Add(P_0); - ???.Invoke(P_0); - } - - public void DeleteStrategy(Strategy strategy) - { - if (strategy == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ??.Remove(strategy); - strategy.Remove(); - strategy.Dispose(); - ???.Invoke(strategy); - } - - public void OnSettingsLoaded() - { - if (RestoreStateAfterShutdown) - { - ?(); - } - } - - public void SaveStrategies() - { - if (?? == null) - { - return; - } - foreach (Strategy item in ??) - { - try - { - Serializer.SerializeXML(Path.Combine(item.DataFolderPath, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), new List { item }); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - } - - public void LoadStrategies() - { - if (!Directory.Exists(Const.SCRIPTS_DATA_PATH)) - { - return; - } - foreach (string item in Directory.EnumerateFiles(Const.SCRIPTS_DATA_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SearchOption.AllDirectories)) - { - try - { - double version; - Strategy ?? = Serializer.DeserializeXML(item, out version, ?).FirstOrDefault() as Strategy; - if (?? != null) - { - Task.Run(delegate - { - ?(??); - }); - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - } - - private void ?() - { - Strategy[] created = Created; - for (int i = 0; i < created.Length; i++) - { - created[i].?(); - } - } - - protected override string GetScriptsFolderPath(ScriptCreationType scriptCreationType) - { - if (scriptCreationType != ScriptCreationType.Default) - { - return Const.CUSTOM_STRATEGIES_PATH; - } - return Path.Combine(Const.EXECUTING_FOLDER, Const.DEFAULT_STRATEGIES_RELATIVE_PATH); - } - - protected override StrategyInfo CreateScriptInfo(ConstructorInfo ctor, ScriptCreationType scriptCreationType, string relativePath, string assemblyName) - { - return new StrategyInfo(ctor, scriptCreationType, relativePath, assemblyName); - } - - public override void Dispose() - { - if (?? != null) - { - foreach (Strategy item in ??) - { - item.Stop(); - item.Dispose(); - } - ??.Clear(); - } - base.Dispose(); - } - - internal void ?(Strategy P_0, StrategyState P_1, StrategyState P_2) - { - ???.Invoke(P_0, new StrategyEventArgs(P_1) - { - StrategyPreviousState = P_2 - }); - } - - protected override void OnScriptUpdated(ScriptInfo scriptInfo) - { - Strategy[] created = Created; - foreach (Strategy strategy in created) - { - if (!(strategy.Key != scriptInfo.Key)) - { - strategy.NewVersionAvailable = true; - } - } - base.OnScriptUpdated(scriptInfo); - } - - private IXElementSerialization ?(XElement P_0) - { - if (P_0 == null) - { - return null; - } - string text = P_0.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value; - if (string.IsNullOrEmpty(text)) - { - return SettingItem.DesserrializationFabric(P_0); - } - ScriptKey key = ScriptKey.CreateScriptKeyFromString(text); - if (!scriptsInfoCache.TryGetValue(key, out var value)) - { - return null; - } - return value.?(); - } - } - public delegate void StrategyEventHandler(Strategy strategy, StrategyEventArgs e); - [ProtoContract] - [Published] - public class StrategyMetric : IXElementSerialization - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [ProtoMember(1)] - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(2)] - public string FormattedValue - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - Name = xElement.Value; - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - FormattedValue = xElement2.Value; - } - } - - public XElement ToXElement() - { - XElement xElement = new XElement(GetType().Name); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), FormattedValue)); - return xElement; - } - } - public class UpdateArgs - { - [CompilerGenerated] - private UpdateReason ??; - - [CompilerGenerated] - private MessageQuote ??; - - public UpdateReason Reason - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = updateReason; - } - } - - public MessageQuote MessageQuote - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = messageQuote; - } - } - - internal UpdateArgs(UpdateReason P_0, MessageQuote P_1 = null) - { - Reason = P_0; - MessageQuote = P_1; - } - - internal UpdateArgs ?() - { - return new UpdateArgs(Reason, MessageQuote); - } - } - public abstract class CachedRequestParameters : RequestParameters - { - public abstract int GetCacheKey(); - - protected CachedRequestParameters() - { - } - - protected CachedRequestParameters(CachedRequestParameters origin) - : base(origin) - { - } - } - [ProtoContract] - public class GetFutureContractsRequestParameters : CachedRequestParameters - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - public override RequestType Type => RequestType.FutureContracts; - - public string ConnectionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(1)] - public string Root - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(2)] - public string ExchangeId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(3)] - public string UnderlierId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public GetFutureContractsRequestParameters() - { - } - - public GetFutureContractsRequestParameters(GetFutureContractsRequestParameters origin) - : base(origin) - { - ConnectionId = origin.ConnectionId; - Root = origin.Root; - ExchangeId = origin.ExchangeId; - UnderlierId = origin.UnderlierId; - } - - public override int GetCacheKey() - { - if (!string.IsNullOrEmpty(UnderlierId)) - { - return UnderlierId.GetHashCode(); - } - HashCode hashCode = default(HashCode); - if (Root != null) - { - hashCode.Add(Root); - } - if (ExchangeId != null) - { - hashCode.Add(ExchangeId); - } - if (UnderlierId != null) - { - hashCode.Add(UnderlierId); - } - return hashCode.ToHashCode(); - } - } - [Published] - [ProtoContract] - public class GetSymbolRequestParameters : CachedRequestParameters - { - [CompilerGenerated] - private string ??; - - public override RequestType Type => RequestType.Symbol; - - [ProtoMember(1)] - public string SymbolId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override int GetCacheKey() - { - return SymbolId.GetHashCode(); - } - - public GetSymbolRequestParameters() - { - } - - public GetSymbolRequestParameters(GetSymbolRequestParameters origin) - : base(origin) - { - SymbolId = origin.SymbolId; - } - } - public sealed class GetNewsArticleContentRequestParameters : RequestParameters - { - [CompilerGenerated] - private string ??; - - public override RequestType Type - { - get - { - throw new NotImplementedException(); - } - } - - public string ArticleId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public GetNewsArticleContentRequestParameters() - { - } - - public GetNewsArticleContentRequestParameters(GetNewsArticleContentRequestParameters original) - : base(original) - { - ArticleId = original.ArticleId; - } - } - public abstract class NewsRequestParametersBase : RequestParameters - { - [CompilerGenerated] - private IEnumerable ??; - - public IEnumerable AdditionalParameters - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public NewsRequestParametersBase() - { - } - - public NewsRequestParametersBase(NewsRequestParametersBase original) - : base(original) - { - AdditionalParameters = original.AdditionalParameters; - } - } - public sealed class GetNewsRequestParameters : NewsRequestParametersBase - { - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private DateTime ??; - - public override RequestType Type - { - get - { - throw new NotImplementedException(); - } - } - - public DateTime From - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DateTime To - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public GetNewsRequestParameters() - { - } - - public GetNewsRequestParameters(GetNewsRequestParameters original) - : base(original) - { - From = original.From; - To = original.To; - } - } - public sealed class SubscribeNewsRequestParameters : NewsRequestParametersBase - { - [CompilerGenerated] - private string ??; - - public override RequestType Type - { - get - { - throw new NotImplementedException(); - } - } - - public string SubscribeId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SubscribeNewsRequestParameters() - { - } - - public SubscribeNewsRequestParameters(SubscribeNewsRequestParameters original) - : base(original) - { - SubscribeId = original.SubscribeId; - } - } - [ProtoContract] - public class GetOptionSeriesRequestParameters : CachedRequestParameters - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - public override RequestType Type => RequestType.OptionSeries; - - public string ConnectionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(1)] - public string UnderlierId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(2)] - public string ExchangeId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public GetOptionSeriesRequestParameters() - { - } - - public GetOptionSeriesRequestParameters(GetOptionSeriesRequestParameters origin) - : base(origin) - { - ConnectionId = origin.ConnectionId; - UnderlierId = origin.UnderlierId; - ExchangeId = origin.ExchangeId; - } - - internal GetOptionSeriesRequestParameters(Symbol P_0) - { - ConnectionId = P_0.ConnectionId; - UnderlierId = P_0.Id; - ExchangeId = P_0.ExchangeId; - } - - public override int GetCacheKey() - { - HashCode hashCode = default(HashCode); - if (UnderlierId != null) - { - hashCode.Add(UnderlierId); - } - if (ExchangeId != null) - { - hashCode.Add(ExchangeId); - } - return hashCode.ToHashCode(); - } - } - [ProtoContract] - public class GetStrikesRequestParameters : CachedRequestParameters - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private DateTime ??; - - public override RequestType Type => RequestType.Strikes; - - public string ConnectionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(1)] - public string UnderlierId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(2)] - public string SerieId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(3)] - public DateTime ExpirationDate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public GetStrikesRequestParameters() - { - } - - public GetStrikesRequestParameters(GetStrikesRequestParameters origin) - : base(origin) - { - ConnectionId = origin.ConnectionId; - UnderlierId = origin.UnderlierId; - SerieId = origin.SerieId; - ExpirationDate = origin.ExpirationDate; - } - - internal GetStrikesRequestParameters(OptionSerie P_0) - { - ConnectionId = P_0.ConnectionId; - UnderlierId = P_0.UnderlierId; - SerieId = P_0.Id; - ExpirationDate = P_0.ExpirationDate; - } - - public override int GetCacheKey() - { - HashCode hashCode = default(HashCode); - if (UnderlierId != null) - { - hashCode.Add(UnderlierId); - } - if (SerieId != null) - { - hashCode.Add(SerieId); - } - hashCode.Add(ExpirationDate); - return hashCode.ToHashCode(); - } - } - [Published] - [ProtoContract] - public class OrdersHistoryRequestParameters : ProgressRequestParameters, IXElementSerialization - { - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private DateTime ??; - - public override RequestType Type => RequestType.OrdersHistory; - - [ProtoMember(1)] - public DateTime From - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(2)] - public DateTime To - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), From)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), To)); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - From = xElement.ToDateTime(toUTC: true); - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - From = xElement2.ToDateTime(toUTC: true); - } - } - } - [Published] - public class PnLRequestParameters : RequestParameters - { - [CompilerGenerated] - private Symbol ??; - - [CompilerGenerated] - private Account ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private Side ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private string ??; - - public override RequestType Type => RequestType.PnL; - - public Symbol Symbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Account Account - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double OpenPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double ClosePrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Side Side - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double Quantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string PositionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public PnLRequestParameters() - { - OpenPrice = double.NaN; - ClosePrice = double.NaN; - Quantity = double.NaN; - } - - public PnLRequestParameters(PnLRequestParameters original) - { - Symbol = original.Symbol; - Account = original.Account; - OpenPrice = original.OpenPrice; - ClosePrice = original.ClosePrice; - Side = original.Side; - Quantity = original.Quantity; - PositionId = original.PositionId; - } - } - public abstract class ProgressRequestParameters : RequestParameters - { - [CompilerGenerated] - private IProgress ??; - - public IProgress Progress - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public ProgressRequestParameters() - { - Progress = new Progress(); - } - - protected ProgressRequestParameters(ProgressRequestParameters origin) - : base(origin) - { - Progress = origin.Progress; - } - } - [Published] - public class ReportRequestParameters : ProgressRequestParameters - { - [CompilerGenerated] - private ReportType ??; - - public override RequestType Type => RequestType.Report; - - public ReportType ReportType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public ReportRequestParameters() - { - } - - public ReportRequestParameters(ReportRequestParameters origin) - : base((ProgressRequestParameters)origin) - { - ReportType = origin.ReportType.?(); - } - } - [Published] - public abstract class RequestParameters : IEquatable - { - [CompilerGenerated] - private CancellationToken ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private readonly long ??; - - private static long ??; - - public abstract RequestType Type { get; } - - public CancellationToken CancellationToken - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string SendingSource - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public long RequestId - { - [CompilerGenerated] - get - { - return ??; - } - } - - protected RequestParameters() - { - ?? = Interlocked.Increment(ref ??); - } - - protected RequestParameters(RequestParameters origin) - { - CancellationToken = origin.CancellationToken; - SendingSource = origin.SendingSource; - ?? = origin.RequestId; - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(41, 3); - defaultInterpolatedStringHandler.AppendFormatted(Type); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(RequestId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(SendingSource); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public bool Equals(RequestParameters other) - { - if (other == null) - { - return false; - } - if (this == other) - { - return true; - } - return RequestId == other.RequestId; - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - if (this == obj) - { - return true; - } - if (obj.GetType() != GetType()) - { - return false; - } - return Equals((RequestParameters)obj); - } - - public override int GetHashCode() - { - return RequestId.GetHashCode(); - } - } - [ProtoContract] - public class SearchSymbolsRequestParameters : CachedRequestParameters - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private IList ?? = new List(); - - [CompilerGenerated] - private IList ?? = new List(); - - [CompilerGenerated] - private Func ??; - - public override RequestType Type => RequestType.SearchSymbol; - - public string ConnectionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(1)] - public string FilterName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(2)] - public IList ExchangeIds - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(3)] - public IList SymbolTypes - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Func GetSynonyms - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SearchSymbolsRequestParameters() - { - } - - public SearchSymbolsRequestParameters(SearchSymbolsRequestParameters origin) - : base(origin) - { - ConnectionId = origin.ConnectionId; - FilterName = origin.FilterName; - ExchangeIds = new List(origin.ExchangeIds); - SymbolTypes = new List(origin.SymbolTypes); - GetSynonyms = origin.GetSynonyms; - } - - public override int GetCacheKey() - { - HashCode hashCode = default(HashCode); - hashCode.Add(FilterName ?? string.Empty); - hashCode.Add(((IStructuralEquatable)ExchangeIds.ToArray()).GetHashCode((IEqualityComparer)EqualityComparer.Default)); - hashCode.Add(((IStructuralEquatable)SymbolTypes.Cast().ToArray()).GetHashCode((IEqualityComparer)EqualityComparer.Default)); - return hashCode.ToHashCode(); - } - } - /// - /// Defines quote parameters for subscribtion - /// - [ProtoContract] - public class SubscribeQuotesParameters : RequestParameters - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private SubscribeQuoteType ??; - - public override RequestType Type => RequestType.QuoteSubscribe; - - /// - /// Symbol Id - /// - [ProtoMember(1)] - public string SymbolId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - /// - /// Quote type - /// - [ProtoMember(2)] - public SubscribeQuoteType SubscribeType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = subscribeQuoteType; - } - } - - /// - /// SubscribeQuotesParameters constructor - /// - public SubscribeQuotesParameters(string symbolId, SubscribeQuoteType subscribeQuoteType) - { - SymbolId = symbolId; - SubscribeType = subscribeQuoteType; - } - - internal SubscribeQuotesParameters() - { - } - } - [Published] - [ProtoContract] - public class TradesHistoryRequestParameters : ProgressRequestParameters, IXElementSerialization - { - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private bool ??; - - public override RequestType Type => RequestType.TradesHistory; - - public Interval Interval => new Interval(From, To); - - [ProtoMember(1)] - public DateTime From - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(2)] - public DateTime To - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(3)] - public string SymbolId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(4)] - public bool ForceReload - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), From)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), To)); - if (!string.IsNullOrEmpty(SymbolId)) - { - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SymbolId)); - } - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ForceReload)); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - From = xElement.ToDateTime(toUTC: true); - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - From = xElement2.ToDateTime(toUTC: true); - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - SymbolId = xElement3.ToString(); - } - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - ForceReload = xElement4.ToBool(); - } - } - - public TradesHistoryRequestParameters() - { - } - - public TradesHistoryRequestParameters(TradesHistoryRequestParameters origin) - : base((ProgressRequestParameters)origin) - { - From = origin.From; - To = origin.To; - SymbolId = origin.SymbolId; - ForceReload = origin.ForceReload; - } - } - [Published] - public sealed class CancelOrderRequestParameters : TradingRequestParameters, ILoggable - { - [CompilerGenerated] - private IOrder ??; - - private string ??; - - public override RequestType Type => RequestType.CancelOrder; - - public IOrder Order - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string OrderId - { - get - { - string id = ??; - if (id == null) - { - IOrder order = Order; - if (order == null) - { - return null; - } - id = order.Id; - } - return id; - } - set - { - ?? = value; - } - } - - public override string ConnectionId => Order.Symbol?.ConnectionId; - - public override string Event - { - get - { - try - { - return OrderType.Format(Order) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Order.OrderTypeId; - } - } - - public override string Message - { - get - { - StringBuilder stringBuilder = new StringBuilder(); - StringBuilder stringBuilder2; - StringBuilder.AppendInterpolatedStringHandler handler; - if (Order is Order order) - { - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder3 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(14, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(order.Connection.Name); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder3.Append(ref handler); - } - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder4 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(10, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(Order.Symbol.Name); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder4.Append(ref handler); - string text = Core.Instance.CustomAccountPropertiesProvider.GetProperty(Order.Account, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) as string; - string value = (string.IsNullOrEmpty(text) ? Order.Account.Name : (Order.Account.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())); - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder5 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(11, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(value); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder5.Append(ref handler); - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder6 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(12, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(Order.Symbol.FormatQuantity(Order.RemainingQuantity)); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder6.Append(ref handler); - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder7 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(12, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(Order.Id); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder7.Append(ref handler); - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder8 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(8, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(Order.Side); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder8.Append(ref handler); - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder9 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(14, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(OrderType.Format(Order)); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder9.Append(ref handler); - string orderTypeId = Order.OrderTypeId; - if (!(orderTypeId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) && !(orderTypeId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (!(orderTypeId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (orderTypeId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder10 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(17, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(Order.Symbol.FormatOffset(Order.TrailOffset, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - stringBuilder10.Append(ref handler); - } - } - else - { - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder11 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(17, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(Order.Symbol.FormatPrice(Order.TriggerPrice)); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder11.Append(ref handler); - } - } - else - { - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder12 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(9, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - handler.AppendFormatted(Order.Symbol.FormatPrice(Order.Price)); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder12.Append(ref handler); - } - if (Order.StopLoss != null) - { - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder13 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(11, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(Order.StopLoss.Format(Order.Symbol)); - stringBuilder13.Append(ref handler); - } - if (Order.TakeProfit != null) - { - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder14 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(13, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(Order.TakeProfit.Format(Order.Symbol)); - stringBuilder14.Append(ref handler); - } - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder15 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(13, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(Core.Instance.TimeUtils.DateTimeUtcNow); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder15.Append(ref handler); - if (!string.IsNullOrEmpty(base.SendingSource)) - { - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder16 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(8, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(base.SendingSource); - stringBuilder16.Append(ref handler); - } - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder17 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(13, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(base.RequestId); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder17.Append(ref handler); - return stringBuilder.ToString(); - } - } - - public CancelOrderRequestParameters() - { - } - - public CancelOrderRequestParameters(CancelOrderRequestParameters original) - : base(original) - { - OrderId = original.OrderId; - Order = original.Order; - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 2); - defaultInterpolatedStringHandler.AppendFormatted(base.ToString()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Order); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - protected override Account GetAccount() - { - return Order?.Account; - } - } - [Published] - public class ClosePositionRequestParameters : TradingRequestParameters, ILoggable - { - [CompilerGenerated] - private Position ??; - - [CompilerGenerated] - private double ??; - - public override RequestType Type => RequestType.ClosePosition; - - public Position Position - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double CloseQuantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override string ConnectionId => Position?.Symbol?.ConnectionId; - - public override string Event => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override string Message - { - get - { - StringBuilder stringBuilder = new StringBuilder(); - StringBuilder stringBuilder2 = stringBuilder; - StringBuilder stringBuilder3 = stringBuilder2; - StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(14, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(Position.Connection.Name); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder3.Append(ref handler); - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder4 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(10, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(Position.Symbol.Name); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder4.Append(ref handler); - string text = Core.Instance.CustomAccountPropertiesProvider.GetProperty(Position.Account, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) as string; - string value = (string.IsNullOrEmpty(text) ? Position.Account.Name : (Position.Account.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())); - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder5 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(11, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(value); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder5.Append(ref handler); - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder6 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(12, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(Position.Symbol.FormatQuantity(Position.Quantity)); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder6.Append(ref handler); - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder7 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(15, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(Position.Id); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder7.Append(ref handler); - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder8 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(8, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(Position.Side); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder8.Append(ref handler); - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder9 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(9, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - handler.AppendFormatted(Position.Symbol.FormatPrice(Position.CurrentPrice)); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder9.Append(ref handler); - Order stopLoss = Position.StopLoss; - if (stopLoss != null) - { - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder10 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(11, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted((stopLoss.OrderTypeId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ? Position.Symbol.FormatOffset(stopLoss.TrailOffset, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) : Position.Symbol.FormatPrice(stopLoss.Price)); - stringBuilder10.Append(ref handler); - } - Order takeProfit = Position.TakeProfit; - if (takeProfit != null) - { - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder11 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(13, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(Position.Symbol.FormatPrice(takeProfit.Price)); - stringBuilder11.Append(ref handler); - } - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder12 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(13, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(Core.Instance.TimeUtils.DateTimeUtcNow.ToString()); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder12.Append(ref handler); - if (!string.IsNullOrEmpty(base.SendingSource)) - { - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder13 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(8, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(base.SendingSource); - stringBuilder13.Append(ref handler); - } - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder14 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(13, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(base.RequestId); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder14.Append(ref handler); - return stringBuilder.ToString(); - } - } - - public ClosePositionRequestParameters() - { - } - - public ClosePositionRequestParameters(ClosePositionRequestParameters origin) - : base(origin) - { - Position = origin.Position; - CloseQuantity = origin.CloseQuantity; - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(13, 3); - defaultInterpolatedStringHandler.AppendFormatted(base.ToString()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(CloseQuantity); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Position); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - protected override Account GetAccount() - { - return Position?.Account; - } - } - public class ConvertPositionRequestParameters : ClosePositionRequestParameters - { - [CompilerGenerated] - private string ??; - - public override RequestType Type => RequestType.ConvertPosition; - - public string ProductCode - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - } - public class LinkOCORequestParameters : TradingRequestParameters - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal string ?(IOrder P_0) - { - return P_0.Id; - } - } - - [CompilerGenerated] - private List ??; - - public override RequestType Type => RequestType.Custom; - - public override string Event => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override string Message - { - get - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(21, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.RequestId); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - - public override string ConnectionId => OrdersToLink?.FirstOrDefault()?.ConnectionId; - - public List OrdersToLink - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - protected override Account GetAccount() - { - return OrdersToLink.FirstOrDefault()?.Account; - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(1, 2); - defaultInterpolatedStringHandler.AppendFormatted(base.ToString()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrdersToLink?.Select((IOrder P_0) => P_0.Id).ToArray()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - [Published] - public class ModifyOrderRequestParameters : OrderRequestParameters - { - [CompilerGenerated] - private string ??; - - public override RequestType Type => RequestType.ModifyOrder; - - public override string Event - { - get - { - if (base.OrderType == null) - { - return string.Empty; - } - return base.OrderType.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - } - - /// - /// Id of the order - /// - public string OrderId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [NotPublished] - public ModifyOrderRequestParameters() - { - } - - public ModifyOrderRequestParameters(IOrder order) - : base(order) - { - OrderId = order.Id; - base.Quantity = order.RemainingQuantity; - } - - public ModifyOrderRequestParameters(ModifyOrderRequestParameters original) - : base(original) - { - OrderId = original.OrderId; - } - - public override object Clone() - { - return new ModifyOrderRequestParameters(this); - } - - public override string ToString() - { - return OrderId + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + base.ToString() + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); - } - } - [Published] - public abstract class OrderRequestParameters : TradingRequestParameters, ICloneable, IXElementSerialization, IEquatable - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal int ?(DealTicketItem P_0) - { - return P_0.SortIndex; - } - } - - private string ??; - - private Symbol ??; - - private string ??; - - [CompilerGenerated] - private Account ??; - - [CompilerGenerated] - private Side ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private string ??; - - private string ??; - - private OrderType ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private TimeInForce ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private List ??; - - [CompilerGenerated] - private List ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - private List ??; - - private readonly LocalOrder ??; - - private static readonly ListEqualityComparer ?? = new ListEqualityComparer(EqualityComparer.Default); - - private static readonly ListEqualityComparer ?? = new ListEqualityComparer(EqualityComparer.Default); - - public override string ConnectionId => Symbol?.ConnectionId; - - public string SymbolId - { - get - { - return Symbol?.Id ?? ??; - } - set - { - ?? = value; - } - } - - public Symbol Symbol - { - get - { - return ??; - } - set - { - ?? = value; - ?? = null; - } - } - - public string AccountId - { - get - { - return Account?.Id ?? ??; - } - set - { - ?? = value; - } - } - - public Account Account - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Side Side - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double Quantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double Total - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string QuantityDefinitionSettingName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string OrderTypeId - { - get - { - return ??; - } - set - { - ?? = value; - ?? = null; - } - } - - public OrderType OrderType - { - get - { - if (?? != null) - { - return ??.OrderType; - } - if (?? == null && Symbol != null && !string.IsNullOrEmpty(OrderTypeId)) - { - ?? = Symbol.GetAlowedOrderTypes(null)?.FirstOrDefault((OrderType P_0) => P_0.Id == OrderTypeId); - } - return ??; - } - } - - public double Price - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double TriggerPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double TrailOffset - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public TimeInForce TimeInForce - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DateTime ExpirationTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int Slippage - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string PositionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SlTpHolder StopLoss - { - get - { - return StopLossItems.FirstOrDefault(); - } - set - { - StopLossItems.Clear(); - if (value != null) - { - StopLossItems.Add(value); - } - } - } - - public SlTpHolder TakeProfit - { - get - { - return TakeProfitItems.FirstOrDefault(); - } - set - { - TakeProfitItems.Clear(); - if (value != null) - { - TakeProfitItems.Add(value); - } - } - } - - public List StopLossItems - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = list; - } - } - - public List TakeProfitItems - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = list; - } - } - - public string GroupId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Comment - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IList AdditionalParameters - { - get - { - List list = new List(??); - if (TimeInForce != TimeInForce.Default) - { - list.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)TimeInForce, force: true); - } - if (ExpirationTime != default(DateTime)) - { - list.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExpirationTime, force: true); - } - list.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)Side, force: true); - if (!double.IsNaN(Quantity)) - { - list.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Quantity, force: true); - } - if (!double.IsNaN(Total)) - { - list.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Total, force: true); - } - if (!double.IsNaN(Price)) - { - list.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Price, force: true); - } - if (!double.IsNaN(TriggerPrice)) - { - list.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TriggerPrice, force: true); - } - if (!double.IsNaN(TrailOffset)) - { - list.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)TrailOffset, force: true); - } - if (!string.IsNullOrEmpty(Comment)) - { - list.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Comment, force: true); - } - return list; - } - set - { - if (value == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ??.Clear(); - foreach (SettingItem item in value) - { - string name = item.Name; - if (name != null) - { - switch (name.Length) - { - case 5: - switch (name[0]) - { - case 'T': - if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - Total = (double)item.Value; - } - break; - case 'P': - if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - Price = (double)item.Value; - } - break; - } - break; - case 13: - if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() && item.Value is SelectItem selectItem) - { - TimeInForce = (TimeInForce)(object)selectItem.Value; - } - break; - case 10: - if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - ExpirationTime = (DateTime)item.Value; - } - break; - case 4: - if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() && item.Value is SelectItem selectItem2) - { - Side = (Side)(object)selectItem2.Value; - } - break; - case 8: - if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - Quantity = (double)item.Value; - } - break; - case 12: - if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - TriggerPrice = (double)item.Value; - } - break; - case 11: - if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - TrailOffset = (int)item.Value; - } - break; - case 7: - if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - Comment = item.Value?.ToString(); - } - break; - } - } - ??.Add(item.GetCopy()); - } - } - } - - public override string Message - { - get - { - IOrderedEnumerable orderedEnumerable = OrderType?.GetDealTicketItems(this)?.OrderBy((DealTicketItem P_0) => P_0.SortIndex); - if (orderedEnumerable == null) - { - return string.Empty; - } - StringBuilder stringBuilder = new StringBuilder(); - StringBuilder stringBuilder2; - StringBuilder.AppendInterpolatedStringHandler handler; - foreach (DealTicketItem item in orderedEnumerable) - { - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder3 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(4, 2, stringBuilder2); - handler.AppendFormatted(item.Key); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(item.FormattedValue); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder3.Append(ref handler); - } - stringBuilder2 = stringBuilder; - StringBuilder stringBuilder4 = stringBuilder2; - handler = new StringBuilder.AppendInterpolatedStringHandler(13, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(base.RequestId); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - stringBuilder4.Append(ref handler); - return stringBuilder.ToString(); - } - } - - protected OrderRequestParameters() - { - ?(); - } - - protected OrderRequestParameters(IOrder order) - : this() - { - Symbol = order.Symbol; - Account = order.Account; - Side = order.Side; - Quantity = order.TotalQuantity; - OrderTypeId = order.OrderTypeId; - ?? = order as LocalOrder; - Price = order.Price; - TriggerPrice = order.TriggerPrice; - TrailOffset = order.TrailOffset; - TimeInForce = order.TimeInForce; - ExpirationTime = order.ExpirationTime; - PositionId = order.PositionId; - GroupId = order.GroupId; - Comment = order.Comment; - SlTpHolder[] stopLossItems = order.StopLossItems; - foreach (SlTpHolder slTpHolder in stopLossItems) - { - StopLossItems.Add(slTpHolder.Clone() as SlTpHolder); - } - stopLossItems = order.TakeProfitItems; - foreach (SlTpHolder slTpHolder2 in stopLossItems) - { - TakeProfitItems.Add(slTpHolder2.Clone() as SlTpHolder); - } - try - { - if (OrderType == null) - { - return; - } - IList orderSettings = OrderType.GetOrderSettings(this, new FormatSettings - { - DisplayQuantityInLots = true - }); - orderSettings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)TimeInForce); - orderSettings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExpirationTime); - orderSettings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)Side); - orderSettings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Quantity); - orderSettings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Price); - orderSettings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TriggerPrice); - if (!double.IsNaN(TrailOffset)) - { - orderSettings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)TrailOffset); - } - orderSettings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Comment); - if (order.AdditionalInfo != null) - { - foreach (AdditionalInfoItem item in order.AdditionalInfo) - { - orderSettings.UpdateItemValue(item.Id, item.Value); - } - } - AdditionalParameters = orderSettings; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - protected OrderRequestParameters(OrderRequestParameters origin) - : base(origin) - { - ?(); - UpdateFrom(origin); - } - - private void ?() - { - ?? = new List(); - Price = double.NaN; - TriggerPrice = double.NaN; - TrailOffset = double.NaN; - StopLossItems = new List(); - TakeProfitItems = new List(); - } - - protected override Account GetAccount() - { - return Account; - } - - public abstract object Clone(); - - public void UpdateFrom(OrderRequestParameters origin) - { - if (origin == null) - { - return; - } - Symbol = origin.Symbol; - Account = origin.Account; - Side = origin.Side; - Quantity = origin.Quantity; - Total = origin.Total; - OrderTypeId = origin.OrderTypeId; - Price = origin.Price; - TriggerPrice = origin.TriggerPrice; - TrailOffset = origin.TrailOffset; - TimeInForce = origin.TimeInForce; - ExpirationTime = origin.ExpirationTime; - Slippage = origin.Slippage; - PositionId = origin.PositionId; - GroupId = origin.GroupId; - Comment = origin.Comment; - AdditionalParameters = origin.AdditionalParameters; - base.SendingSource = origin.SendingSource; - QuantityDefinitionSettingName = origin.QuantityDefinitionSettingName; - base.CancellationToken = origin.CancellationToken; - foreach (SlTpHolder stopLossItem in origin.StopLossItems) - { - StopLossItems.Add(stopLossItem.Clone() as SlTpHolder); - } - foreach (SlTpHolder takeProfitItem in origin.TakeProfitItems) - { - TakeProfitItems.Add(takeProfitItem.Clone() as SlTpHolder); - } - } - - public void ApplyValuesFrom(OrderRequestParameters other) - { - if (other != null) - { - if (other.Symbol != null) - { - Symbol = other.Symbol; - } - if (other.Account != null) - { - Account = other.Account; - } - if (!string.IsNullOrEmpty(other.OrderTypeId)) - { - OrderTypeId = other.OrderTypeId; - } - if (other.Slippage != 0) - { - Slippage = other.Slippage; - } - if (!string.IsNullOrEmpty(other.PositionId)) - { - PositionId = other.PositionId; - } - if (!string.IsNullOrEmpty(other.GroupId)) - { - GroupId = other.GroupId; - } - if (!string.IsNullOrEmpty(other.SendingSource)) - { - base.SendingSource = other.SendingSource; - } - if (!string.IsNullOrEmpty(other.QuantityDefinitionSettingName)) - { - QuantityDefinitionSettingName = other.QuantityDefinitionSettingName; - } - if (other.CancellationToken != CancellationToken.None) - { - base.CancellationToken = other.CancellationToken; - } - if (other.StopLossItems.Any()) - { - StopLossItems = other.StopLossItems; - } - if (other.TakeProfitItems.Any()) - { - TakeProfitItems = other.TakeProfitItems; - } - IList additionalParameters = AdditionalParameters; - IList additionalParameters2 = other.AdditionalParameters; - additionalParameters.MergeWith(additionalParameters2); - AdditionalParameters = additionalParameters; - } - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(6, 7); - defaultInterpolatedStringHandler.AppendFormatted(base.ToString()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderTypeId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Quantity); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Account); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderType?.GetFillPrice(this)); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (Symbol != null) - { - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Symbol.CreateInfo().ToXElement())); - } - if (Account != null) - { - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Account.CreateInfo().ToXElement())); - } - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)Side).ToString())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Quantity)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Total)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), QuantityDefinitionSettingName)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OrderTypeId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Price)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TriggerPrice)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TrailOffset)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)TimeInForce).ToString())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExpirationTime)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Slippage)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), PositionId)); - if (StopLossItems.Count > 0) - { - XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (SlTpHolder stopLossItem in StopLossItems) - { - xElement2.Add(stopLossItem.ToXElement()); - } - xElement.Add(xElement2); - } - if (TakeProfitItems.Count > 0) - { - XElement xElement3 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (SlTpHolder takeProfitItem in TakeProfitItems) - { - xElement3.Add(takeProfitItem.ToXElement()); - } - xElement.Add(xElement3); - } - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GroupId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Comment)); - if (AdditionalParameters != null) - { - XElement xElement4 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (SettingItem additionalParameter in AdditionalParameters) - { - xElement4.Add(additionalParameter.ToXElement()); - } - xElement.Add(xElement4); - } - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement == null) - { - return; - } - XElement xElement2 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - XElement xElement3 = xElement2.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - SymbolInfo symbolInfo = new SymbolInfo(); - symbolInfo.FromXElement(xElement3, deserializationInfo); - Symbol = Core.Instance.GetSymbol(symbolInfo); - } - } - XElement xElement4 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - XElement xElement5 = xElement4.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement5 != null) - { - ? ? = new ?(); - ?.FromXElement(xElement5, deserializationInfo); - Account = Core.Instance.GetAccount(?); - } - } - XElement xElement6 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement6 != null) - { - Side = (Side)xElement6.ToInt(); - } - XElement xElement7 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement7 != null) - { - Quantity = xElement7.ToDouble(); - } - XElement xElement8 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement8 != null) - { - Total = xElement8.ToDouble(); - } - XElement xElement9 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement9 != null) - { - QuantityDefinitionSettingName = xElement9.ToString(); - } - XElement xElement10 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement10 != null) - { - OrderTypeId = xElement10.Value; - } - XElement xElement11 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement11 != null) - { - Price = xElement11.ToDouble(); - } - XElement xElement12 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement12 != null) - { - TriggerPrice = xElement12.ToDouble(); - } - XElement xElement13 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement13 != null) - { - TrailOffset = xElement13.ToDouble(); - } - XElement xElement14 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement14 != null) - { - TimeInForce = (TimeInForce)xElement14.ToInt(); - } - XElement xElement15 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement15 != null) - { - ExpirationTime = xElement15.ToDateTime(); - } - XElement xElement16 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement16 != null) - { - Slippage = xElement16.ToInt(); - } - XElement xElement17 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement17 != null) - { - PositionId = xElement17.Value; - } - XElement xElement18 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement18 != null) - { - foreach (XElement item2 in xElement18.Elements()) - { - SlTpHolder slTpHolder = new SlTpHolder(); - slTpHolder.FromXElement(item2, deserializationInfo); - StopLossItems.Add(slTpHolder); - } - } - XElement xElement19 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement19 != null) - { - foreach (XElement item3 in xElement19.Elements()) - { - SlTpHolder slTpHolder2 = new SlTpHolder(); - slTpHolder2.FromXElement(item3, deserializationInfo); - TakeProfitItems.Add(slTpHolder2); - } - } - XElement xElement20 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement20 == null) - { - return; - } - List list = new List(); - foreach (XElement item4 in xElement20.Elements()) - { - if (Serializer.DeserializeNode(item4, deserializationInfo) is SettingItem item) - { - list.Add(item); - } - } - AdditionalParameters = list; - } - - public bool Equals(OrderRequestParameters other) - { - if (other == null) - { - return false; - } - if (this == other) - { - return true; - } - if (?? == other.?? && object.Equals(??, other.??) && object.Equals(Account, other.Account) && Side == other.Side && Quantity.Equals(other.Quantity) && Total.Equals(other.Total) && QuantityDefinitionSettingName == other.QuantityDefinitionSettingName && Price.Equals(other.Price) && TriggerPrice.Equals(other.TriggerPrice) && TrailOffset.Equals(other.TrailOffset) && TimeInForce == other.TimeInForce && ExpirationTime.Equals(other.ExpirationTime) && Slippage == other.Slippage && PositionId == other.PositionId && GroupId == other.GroupId && Comment == other.Comment && ??.Equals(StopLossItems, other.StopLossItems) && ??.Equals(TakeProfitItems, other.TakeProfitItems)) - { - return ??.Equals(??, other.??); - } - return false; - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - if (this == obj) - { - return true; - } - if (obj.GetType() != GetType()) - { - return false; - } - return Equals((OrderRequestParameters)obj); - } - - public override int GetHashCode() - { - HashCode hashCode = default(HashCode); - hashCode.Add(??); - hashCode.Add(??); - hashCode.Add(??); - hashCode.Add(Account); - hashCode.Add((int)Side); - hashCode.Add(Quantity); - hashCode.Add(Total); - hashCode.Add(QuantityDefinitionSettingName); - hashCode.Add(Price); - hashCode.Add(TriggerPrice); - hashCode.Add(TrailOffset); - hashCode.Add((int)TimeInForce); - hashCode.Add(ExpirationTime); - hashCode.Add(Slippage); - hashCode.Add(PositionId); - hashCode.Add(StopLossItems); - hashCode.Add(TakeProfitItems); - hashCode.Add(GroupId); - hashCode.Add(Comment); - return hashCode.ToHashCode(); - } - - [CompilerGenerated] - private bool ?(OrderType P_0) - { - return P_0.Id == OrderTypeId; - } - } - public class PaperRequest : PlaceOrderRequestParameters - { - public PaperRequest() - { - } - - public PaperRequest(PaperRequest request) - : base(request) - { - } - } - public class PlaceMultiOrderOrderRequestParameters : TradingRequestParameters - { - [CompilerGenerated] - private PlaceOrderRequestParameters[] ??; - - [CompilerGenerated] - private GroupOrderType ??; - - public override string ConnectionId => OrderParameters?.FirstOrDefault()?.Symbol?.ConnectionId; - - public override string Event => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override string Message - { - get - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(25, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.RequestId); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - - public override RequestType Type => RequestType.PlaceMultiOrderOrder; - - public PlaceOrderRequestParameters[] OrderParameters - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public GroupOrderType GroupOrderType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - protected override Account GetAccount() - { - return null; - } - - public PlaceMultiOrderOrderRequestParameters() - { - } - - public PlaceMultiOrderOrderRequestParameters(PlaceMultiOrderOrderRequestParameters original) - : base(original) - { - OrderParameters = original.OrderParameters; - GroupOrderType = original.GroupOrderType; - } - } - [Published] - public class PlaceOrderRequestParameters : OrderRequestParameters - { - public override RequestType Type => RequestType.PlaceOrder; - - public override string Event => (base.OrderType?.Name ?? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public PlaceOrderRequestParameters() - { - } - - public PlaceOrderRequestParameters(IOrder order) - : base(order) - { - } - - public PlaceOrderRequestParameters(OrderRequestParameters original) - : base(original) - { - } - - public override object Clone() - { - return new PlaceOrderRequestParameters(this); - } - } - public class TradingOperationParameters - { - [CompilerGenerated] - private Account ??; - - [CompilerGenerated] - private Symbol ??; - - [CompilerGenerated] - private IOrder ??; - - [CompilerGenerated] - private Position ??; - - public Account Account - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Symbol Symbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IOrder Order - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Position Position - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - } - [Published] - public abstract class TradingRequestParameters : RequestParameters, IConnectionBindedObject, ILoggable, ICurrentAccount, ISubTradingOperation - { - [CompilerGenerated] - private readonly GroupTradingOperation ??; - - public abstract string ConnectionId { get; } - - public abstract string Event { get; } - - public abstract string Message { get; } - - public GroupTradingOperation ParentOperation - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - Account ICurrentAccount.CurrentAccount - { - get - { - return GetAccount(); - } - set - { - } - } - - protected abstract Account GetAccount(); - - public TradingRequestParameters() - { - } - - public TradingRequestParameters(TradingRequestParameters origin) - : base(origin) - { - ParentOperation = origin.ParentOperation; - } - } - /// - /// SettingItem cast type - /// - public enum SettingItemType - { - Undefined, - String, - Boolean, - BooleanSwitcher, - Integer, - Double, - Selector, - SelectorLocalized, - DateTime, - Account, - Symbol, - Password, - Period, - File, - Group, - RadioLocalized, - Action, - Font, - TimeZone, - Rss, - HotkeyList, - Object, - ConditionSet, - Alignment, - PairColor, - Color, - Sound, - LineOptions, - TimeZoneManager, - FibonacciLevelOptions, - RangeSelector, - DrawingPoints, - TimeFrameConfig, - BooleanLocalized, - OAuth, - Label, - ClusterColoringLevels, - ArbitageSymbols, - TextArea, - OrderRequestParameters, - IconedAction, - PnlAlertsContainer, - TimeInTradeContainer, - SymbolsList, - Slider, - DoubleWithLink, - Custom, - Long, - MinotauroFibonacciLevelOptions, - OTP, - Condition, - BigTextArea - } - /// - /// SettingItem state - /// - public enum VisibilityMode - { - Visible, - Hidden - } - public enum MultipleRelationCondition - { - IfAny, - IfAll - } - /// - /// Specifies the DatePicker time format. - /// - public enum DatePickerFormat - { - /// - /// Date only - /// - Date, - /// - /// Date and time - /// - DateTime, - /// - /// Time only - /// - Time, - /// - /// Time with seconds - /// - LongTime, - /// - /// - /// - LongDateTime - } - public enum SettingItemValueChangingBehavior - { - Default, - WithConfirmation - } - public enum SettingItemValueChangingReason - { - Unknown, - Manually, - Programmatically - } - public enum IconType - { - Plus, - Trash, - Duplicate - } - public enum IconDisplayType - { - Visible, - VisibleOnHover - } - public class GroupActionInfo - { - [CompilerGenerated] - private Func ??; - - [CompilerGenerated] - private IconType ??; - - [CompilerGenerated] - private object ?? = new object(); - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private ManualChangesApplyingType ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - public Func Action - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = func; - } - } - - public IconType IconType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public object Tag - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool NeedActionConfirmation - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public ManualChangesApplyingType ManualChangesApplyingType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string ConfirmationText - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Marker - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Tooltip - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public GroupActionInfo(Func action) - { - Action = action; - } - } - public enum ManualChangesApplyingType - { - Discard, - Apply, - Confirm - } - public interface ISettingsGroup - { - string Text { get; } - - int SortIndex { get; } - - ISettingsGroup ParentGroup { get; } - - IList ChildGroups { get; } - - GroupActionInfo FirstActionInfo { get; } - - GroupActionInfo SecondActionInfo { get; } - } - public interface ISettingsGroupCollapseBehaviour - { - SettingsGroupCollapseBehaviour CollapseBehaviour { get; set; } - } - public enum SettingsGroupCollapseBehaviour - { - Normal, - AlwaysExpanded - } - /// - /// Typecasts setting as TabControl item - /// - [Serializable] - [Published] - [DataContract] - public sealed class SettingItemGroup : SettingItemList, ISettingsGroup - { - public bool AllowCreateEmptyGroup; - - [CompilerGenerated] - private GroupActionInfo ??; - - [CompilerGenerated] - private GroupActionInfo ??; - - public override SettingItemType Type => SettingItemType.Group; - - public GroupActionInfo FirstActionInfo - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public GroupActionInfo SecondActionInfo - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - string ISettingsGroup.Text => Text; - - int ISettingsGroup.SortIndex => base.SortIndex; - - ISettingsGroup ISettingsGroup.ParentGroup => base.Group; - - IList ISettingsGroup.ChildGroups => (Value as IList)?.OfType().ToList() ?? new List(); - - protected override List Items - { - get - { - return base.Items; - } - set - { - if (value != null) - { - foreach (SettingItem item in value) - { - item.Group = this; - } - } - base.Items = value; - } - } - - public SettingItemGroup() - : base(string.Empty, new List()) - { - } - - public SettingItemGroup(string name, IList items, int sortIndex = 0) - : base(name, items, sortIndex) - { - foreach (SettingItem item in items) - { - ?(item); - } - } - - [NotPublished] - public override SettingItem GetCopy() - { - return new SettingItemGroup(base.Name, CopyItems(), base.SortIndex) - { - Text = Text - }; - } - - public void AddItem(SettingItem item) - { - Items.Add(item); - ?(item); - } - - public override int GetHashCode() - { - return SettingItemVisualGroup.?(this); - } - - private void ?(SettingItem P_0) - { - P_0.Group = this; - } - - [NotPublished] - public override XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), base.Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); - for (int i = 0; i < Items.Count; i++) - { - try - { - xElement.Add(Items[i].ToXElement()); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - return xElement; - } - - [NotPublished] - public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - base.Name = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; - Items.Clear(); - foreach (XElement item in element.Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (Serializer.DeserializeNode(item, deserializationInfo) is SettingItem settingItem) - { - settingItem.Group = this; - Items.Add(settingItem); - } - } - } - } - [Serializable] - [DataContract] - public abstract class SettingItemList : SettingItem - { - private static readonly ListEqualityComparer ?? = new ListEqualityComparer(EqualityComparer.Default); - - [DataMember(Name = "Items")] - protected virtual List Items - { - get - { - return Value as List; - } - set - { - Value = value; - } - } - - protected SettingItemList(string name, IList items, int sortIndex = 0) - : base(name, items, sortIndex) - { - if (items == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public SettingItemList() - { - } - - protected SettingItemList(SettingItemList settingItem) - : base(settingItem) - { - Items = settingItem.CopyItems() as List; - } - - protected override bool IsValueTypeValid(object value) - { - return value is IList; - } - - protected IList CopyItems() - { - List list = new List(); - if (Value is IList list2) - { - foreach (SettingItem item in list2) - { - list.Add(item.GetCopy()); - } - } - return list; - } - - protected override bool ValueEquals(object other) - { - return ??.Equals(Items, other as IList); - } - } - [Serializable] - [DataContract] - public class SettingItemSymbolsList : SettingItemList - { - public override SettingItemType Type => SettingItemType.SymbolsList; - - [DataMember(Name = "Items")] - protected override List Items - { - get - { - List list = new List(); - foreach (SettingItemSymbol item in Value as List) - { - if (item.Value is Symbol) - { - list.Add(item); - } - } - return list; - } - set - { - Value = ?(value); - } - } - - public SettingItemSymbolsList(string name, IList items, int sortIndex = 0) - : base(name, new List(), sortIndex) - { - Value = ?(items); - } - - public SettingItemSymbolsList() - { - } - - protected SettingItemSymbolsList(SettingItemSymbolsList settingItem) - : base(settingItem) - { - } - - public override SettingItem GetCopy() - { - return new SettingItemSymbolsList(this); - } - - private new IList ?(IList P_0) - { - List list = new List(); - foreach (SettingItem item in P_0) - { - if (item.Value is Symbol) - { - list.Add(item); - } - } - return list; - } - - protected override XElement ValueToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (SettingItem item in Items) - { - xElement.Add(item.ToXElement()); - } - return xElement; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - List list = new List(); - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - foreach (XElement item in xElement.Elements()) - { - SettingItemSymbol settingItemSymbol = new SettingItemSymbol(); - settingItemSymbol.FromXElement(item, deserializationInfo); - list.Add(settingItemSymbol); - } - } - Items = list; - } - } - /// - /// Typecasts setting as GroupBox item - /// - [Published] - public sealed class SettingItemSeparatorGroup : SettingItemVisualGroup - { - private string ??; - - public string Key - { - get - { - if (string.IsNullOrEmpty(??)) - { - return base.Text; - } - return ??; - } - set - { - ?? = value; - } - } - - public SettingItemSeparatorGroup(string text = "", int sortIndex = 0) - : base(text, sortIndex) - { - } - } - public class SettingItemVisualGroup : ISettingsGroup, ISettingsGroupCollapseBehaviour - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private ISettingsGroup ??; - - [CompilerGenerated] - private GroupActionInfo ??; - - [CompilerGenerated] - private GroupActionInfo ??; - - [CompilerGenerated] - private IList ??; - - [CompilerGenerated] - private SettingsGroupCollapseBehaviour ??; - - public string Text - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public int SortIndex - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public ISettingsGroup ParentGroup - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = settingsGroup; - } - } - - public GroupActionInfo FirstActionInfo - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public GroupActionInfo SecondActionInfo - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IList ChildGroups - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = list; - } - } - - public SettingsGroupCollapseBehaviour CollapseBehaviour - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SettingItemVisualGroup(string text, int sortIndex = 0, ISettingsGroup parentGroup = null) - { - Text = text; - SortIndex = sortIndex; - ParentGroup = parentGroup; - ChildGroups = new List(); - if (ParentGroup != null) - { - ParentGroup.ChildGroups.Add(this); - } - } - - public override bool Equals(object obj) - { - return GetHashCode() == obj.GetHashCode(); - } - - public override int GetHashCode() - { - return ?(this); - } - - public override string ToString() - { - return Text; - } - - internal static int ?(ISettingsGroup P_0) - { - int num = 17; - num = num * 23 + P_0.Text.GetHashCode(); - num = num * 23 + P_0.SortIndex.GetHashCode(); - foreach (ISettingsGroup childGroup in P_0.ChildGroups) - { - num = num * 23 + childGroup.GetHashCode(); - } - return num; - } - } - [Serializable] - [DataContract] - public class OAuthResult : IXElementSerialization, ICloneable - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private bool ??; - - public string AccessToken - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - internal string RefreshToken - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - internal string IdentityToken - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - internal LoginResult RequestTokenResult - { - set - { - AccessToken = loginResult.AccessToken; - RefreshToken = loginResult.RefreshToken; - IdentityToken = loginResult.IdentityToken; - } - } - - internal RefreshTokenResult RequestRefreshResult - { - set - { - AccessToken = refreshTokenResult.AccessToken; - RefreshToken = refreshTokenResult.RefreshToken; - IdentityToken = refreshTokenResult.IdentityToken; - } - } - - internal TokenResponse TokenResponce - { - set - { - AccessToken = tokenResponse.AccessToken; - RefreshToken = tokenResponse.RefreshToken; - IdentityToken = tokenResponse.IdentityToken; - } - } - - public bool UseSavedTokens - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "EncryptedRefreshToken")] - private string EncryptedRefreshToken - { - get - { - if (!UseSavedTokens) - { - return string.Empty; - } - return Encryptor.?(RefreshToken); - } - set - { - RefreshToken = Encryptor.?(text); - } - } - - public OAuthResult() - { - AccessToken = string.Empty; - UseSavedTokens = true; - } - - public OAuthResult(string accessToken) - { - AccessToken = accessToken; - UseSavedTokens = true; - } - - internal OAuthResult(string P_0, string P_1) - { - AccessToken = P_0; - RefreshToken = P_1; - UseSavedTokens = true; - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), EncryptedRefreshToken)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), UseSavedTokens)); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - EncryptedRefreshToken = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; - UseSavedTokens = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); - } - - public object Clone() - { - return new OAuthResult - { - UseSavedTokens = UseSavedTokens, - AccessToken = AccessToken, - RefreshToken = RefreshToken, - IdentityToken = IdentityToken - }; - } - } - [DataContract] - public class SettingItemOAuth : SettingItem - { - [CompilerGenerated] - private readonly OidcClientOptions ??; - - [CompilerGenerated] - private readonly UpdateAuthorityUrlDelegate ??; - - [CompilerGenerated] - private readonly bool ??; - - [CompilerGenerated] - private readonly Parameters ??; - - public override SettingItemType Type => SettingItemType.OAuth; - - [DataMember(Name = "Value")] - private OAuthResult OAuthResultHolder - { - get - { - return (OAuthResult)Value; - } - set - { - Value = oAuthResult; - } - } - - public OidcClientOptions OidcOptions - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal UpdateAuthorityUrlDelegate UpdateIdentityAuthorityUrl - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal bool AllowOpenNewWindow - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal Parameters BackChannelExtraParameters - { - [CompilerGenerated] - get - { - return ??; - } - } - - public SettingItemOAuth() - { - } - - public SettingItemOAuth(string name, OAuthResult passwordHolder, OidcClientOptions oidcClientOptions, int sortIndex = 0, UpdateAuthorityUrlDelegate updateIdentityAuthorityUrl = null, bool allowOpenNewWindow = false, Parameters backChannelExtraParameters = null) - : base(name, passwordHolder, sortIndex) - { - ?? = oidcClientOptions; - ?? = updateIdentityAuthorityUrl; - ?? = allowOpenNewWindow; - ?? = backChannelExtraParameters; - } - - protected SettingItemOAuth(SettingItemOAuth settingItem) - : base(settingItem) - { - ?? = settingItem.OidcOptions; - ?? = settingItem.UpdateIdentityAuthorityUrl; - ?? = settingItem.AllowOpenNewWindow; - ?? = settingItem.BackChannelExtraParameters; - } - - public override SettingItem GetCopy() - { - return new SettingItemOAuth(this); - } - - protected override bool IsValueTypeValid(object value) - { - return value is OAuthResult; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - OAuthResult oAuthResult = new OAuthResult(); - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - oAuthResult.FromXElement(xElement, deserializationInfo); - OAuthResultHolder = oAuthResult; - } - } - } - public delegate string UpdateAuthorityUrlDelegate(IEnumerable settings, CancellationToken token); - public class SettingItemMultipleRelation : SettingItemRelation - { - [Serializable] - [CompilerGenerated] - private new sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func>>> ??; - - public static Func>, string> ??; - - public static Func>, IEnumerable> ??; - - internal IEnumerable>> ?(SettingItemRelation P_0) - { - return P_0.??; - } - - internal string ?(KeyValuePair> P_0) - { - return P_0.Key; - } - - internal IEnumerable ?(KeyValuePair> P_0) - { - return P_0.Value; - } - } - - private readonly List ??; - - public SettingItemMultipleRelation(params SettingItemRelation[] relations) - : base(relations.SelectMany((SettingItemRelation P_0) => P_0.??).ToDictionary((KeyValuePair> P_0) => P_0.Key, (KeyValuePair> P_0) => P_0.Value)) - { - ?? = relations.ToList(); - } - - public void AddRelation(SettingItemRelation relation) - { - foreach (KeyValuePair> item in relation.??) - { - ??.Add(item.Key, item.Value); - } - ??.Add(relation); - } - - public void InsertRelation(int index, SettingItemRelation relation) - { - foreach (KeyValuePair> item in relation.??) - { - ??.Add(item.Key, item.Value); - } - ??.Insert(0, relation); - } - - public override bool CheckRelation(SettingItem dependentItem, SettingItem changedItem, bool isPopulating, params SettingItem[] parentItems) - { - bool flag = false; - foreach (SettingItemRelation item in ??) - { - flag = ((base.MultipleRelationCondition != MultipleRelationCondition.IfAll) ? (flag | item.CheckRelation(dependentItem, changedItem, isPopulating, parentItems)) : (flag & item.CheckRelation(dependentItem, changedItem, isPopulating, parentItems))); - } - return flag; - } - } - public class SettingItemRelation - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func>, bool> ??; - - internal bool ?(KeyValuePair> P_0) - { - ? ? = new ? - { - ?? = P_0.Key - }; - IEnumerable value = P_0.Value; - if (!?.??.Visible) - { - return false; - } - return value.Any(?.?); - } - } - - [CompilerGenerated] - private sealed class ? - { - public SettingItem ??; - - internal bool ?(object P_0) - { - if (P_0 != null) - { - return SettingItemRelation.?(P_0, ??.Value); - } - return false; - } - } - - [CompilerGenerated] - private MultipleRelationCondition ??; - - internal readonly IDictionary> ??; - - protected SettingItemRelationDelegate RelationDelegate; - - public string[] ParentSettingsNames => ??.Keys.ToArray(); - - public MultipleRelationCondition MultipleRelationCondition - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SettingItemRelation(IDictionary> relationValuesByParentItemName, SettingItemRelationDelegate relationDelegate = null) - { - if (relationValuesByParentItemName.Keys.Count == 0) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - RelationDelegate = relationDelegate; - ?? = relationValuesByParentItemName; - MultipleRelationCondition = MultipleRelationCondition.IfAny; - } - - public virtual bool CheckRelation(SettingItem dependentItem, SettingItem changedItem, bool isPopulating, params SettingItem[] parentItems) - { - if (dependentItem == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (parentItems.Length == 0) - { - throw new AggregateException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - SettingItemRelationParameters settingItemRelationParameters = new SettingItemRelationParameters - { - DependentItem = dependentItem, - ChangedItem = changedItem, - RelationValuesByParentItem = new Dictionary>(), - MultipleRelationCondition = MultipleRelationCondition, - IsPopulating = isPopulating - }; - foreach (SettingItem settingItem in parentItems) - { - if (??.TryGetValue(settingItem.Name, out var value) && !settingItemRelationParameters.RelationValuesByParentItem.ContainsKey(settingItem)) - { - settingItemRelationParameters.RelationValuesByParentItem.Add(settingItem, value); - } - } - return RelationDelegate(settingItemRelationParameters); - } - - protected static bool CheckEnabilityRelation(SettingItemRelationParameters relationParameters) - { - SettingItem dependentItem = relationParameters.DependentItem; - bool flag = CheckValues(relationParameters.RelationValuesByParentItem, relationParameters.MultipleRelationCondition); - bool result = dependentItem.Enabled != flag; - dependentItem.Enabled = flag; - return result; - } - - protected static bool CheckVisibilityRelation(SettingItemRelationParameters relationParameters) - { - SettingItem dependentItem = relationParameters.DependentItem; - bool flag = CheckValues(relationParameters.RelationValuesByParentItem, relationParameters.MultipleRelationCondition); - bool result = dependentItem.Visible != flag; - dependentItem.Visible = flag; - return result; - } - - protected static bool CheckValues(IDictionary> relationValuesByParentItem, MultipleRelationCondition condition) - { - Func>, bool> predicate = delegate(KeyValuePair> P_0) - { - ? ? = new ?(); - ?.?? = P_0.Key; - IEnumerable value = P_0.Value; - return ?.??.Visible && value.Any(?.?); - }; - if (condition == MultipleRelationCondition.IfAny) - { - return relationValuesByParentItem.Any(predicate); - } - return relationValuesByParentItem.All(predicate); - } - - [CompilerGenerated] - internal static bool ?(object P_0, object P_1) - { - if (P_0.Equals(P_1) || P_0 == P_1) - { - return true; - } - if (P_1 is SelectItem selectItem) - { - return ?(P_0, selectItem.Value); - } - return false; - } - } - public delegate bool SettingItemRelationDelegate(SettingItemRelationParameters relationParameters); - public class SettingItemRelationAction : SettingItemRelation - { - [Serializable] - [CompilerGenerated] - private new sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func, string> ??; - - public static Func, IEnumerable> ??; - - internal string ?(KeyValuePair P_0) - { - return P_0.Key; - } - - internal IEnumerable ?(KeyValuePair P_0) - { - return Enumerable.Empty(); - } - } - - private readonly IDictionary ??; - - public SettingItemRelationAction(IDictionary callbacks) - : base(callbacks.ToDictionary((KeyValuePair P_0) => P_0.Key, (KeyValuePair P_0) => Enumerable.Empty())) - { - ?? = callbacks; - RelationDelegate = ?; - } - - private bool ?(SettingItemRelationParameters P_0) - { - if (!??.TryGetValue(P_0.ChangedItem.Name, out var value)) - { - return false; - } - try - { - return value(P_0.ChangedItem, P_0.DependentItem); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - return false; - } - } - public delegate bool SettingItemRelationCallback(SettingItem changedItem, SettingItem dependentItem); - public class SettingItemRelationEnability : SettingItemRelation - { - [CompilerGenerated] - private new static class ? - { - public static SettingItemRelationDelegate ??; - } - - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal string ?(string P_0) - { - return P_0; - } - } - - [CompilerGenerated] - private sealed class ? - { - public object ??; - - internal IEnumerable ?(string P_0) - { - return new List { ?? }; - } - } - - public SettingItemRelationEnability(string parentSettingsName, params object[] relationValues) - : base(new Dictionary> { - { - parentSettingsName, - new List(relationValues) - } }, SettingItemRelation.CheckEnabilityRelation) - { - } - - public SettingItemRelationEnability(string[] parentSettingsNames, object relationValue) - : base(((IEnumerable)parentSettingsNames).ToDictionary((Func)((string P_0) => P_0), (Func>)((string P_0) => new List { relationValue })), SettingItemRelation.CheckEnabilityRelation) - { - } - - public SettingItemRelationEnability(IDictionary> relationValuesByParentItemName) - : base(relationValuesByParentItemName, SettingItemRelation.CheckEnabilityRelation) - { - } - } - public class SettingItemRelationParameters - { - [CompilerGenerated] - private SettingItem ??; - - [CompilerGenerated] - private SettingItem ??; - - [CompilerGenerated] - private IDictionary> ??; - - [CompilerGenerated] - private MultipleRelationCondition ??; - - [CompilerGenerated] - private bool ??; - - public SettingItem DependentItem - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SettingItem ChangedItem - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IDictionary> RelationValuesByParentItem - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public MultipleRelationCondition MultipleRelationCondition - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool IsPopulating - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - } - public class SettingItemRelationVisibility : SettingItemRelation - { - [CompilerGenerated] - private new static class ? - { - public static SettingItemRelationDelegate ??; - } - - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal string ?(string P_0) - { - return P_0; - } - } - - [CompilerGenerated] - private sealed class ? - { - public object ??; - - internal IEnumerable ?(string P_0) - { - return new List { ?? }; - } - } - - public SettingItemRelationVisibility(string parentSettingsName, params object[] relationValues) - : base(new Dictionary> { - { - parentSettingsName, - new List(relationValues) - } }, SettingItemRelation.CheckVisibilityRelation) - { - } - - public SettingItemRelationVisibility(string[] parentSettingsNames, object relationValue) - : base(((IEnumerable)parentSettingsNames).ToDictionary((Func)((string P_0) => P_0), (Func>)((string P_0) => new List { relationValue })), SettingItemRelation.CheckVisibilityRelation) - { - } - - public SettingItemRelationVisibility(IDictionary> relationValuesByParentItemName) - : base(relationValuesByParentItemName, SettingItemRelation.CheckVisibilityRelation) - { - } - } - [Serializable] - [DataContract] - [KnownType(typeof(SettingItemAccount))] - [KnownType(typeof(SettingItemBoolean))] - [KnownType(typeof(SettingItemBooleanSwitcher))] - [KnownType(typeof(SettingItemDateTime))] - [KnownType(typeof(SettingItemSymbol))] - [KnownType(typeof(SettingItemPassword))] - [KnownType(typeof(SettingItemPeriod))] - [KnownType(typeof(SettingItemSelector))] - [KnownType(typeof(SettingItemSelectorLocalized))] - [KnownType(typeof(SettingItemString))] - [KnownType(typeof(SettingItemFile))] - [KnownType(typeof(SettingItemGroup))] - [KnownType(typeof(SettingItemRadioLocalized))] - [KnownType(typeof(SettingItemAction))] - [KnownType(typeof(SettingItemFont))] - [KnownType(typeof(SettingItemTimeZone))] - [KnownType(typeof(SettingItemRss))] - [KnownType(typeof(SettingItemAlignment))] - [KnownType(typeof(SettingItemPairColor))] - [KnownType(typeof(SettingItemColor))] - [KnownType(typeof(SettingItemSound))] - [KnownType(typeof(SettingItemLineOptions))] - [KnownType(typeof(SettingItemTimeZoneManager))] - [KnownType(typeof(SettingItemAlert))] - [KnownType(typeof(SettingItemFibonacciLevelOptions))] - [KnownType(typeof(SettingItemMinotauroFibonacciLevelOptions))] - [KnownType(typeof(SettingItemRangeSelector))] - [KnownType(typeof(SettingitemPoints))] - [KnownType(typeof(SettingItemTimeFrameConfig))] - [KnownType(typeof(SettingItemBooleanLocalized))] - [KnownType(typeof(SettingItemNumber))] - [KnownType(typeof(SettingItemNumber))] - [KnownType(typeof(SettingItemNumber))] - [KnownType(typeof(SettingItemClusterColoringLevel))] - [KnownType(typeof(SettingItemOrderRequestParameters))] - [KnownType(typeof(SettingItemIconedAction))] - [KnownType(typeof(SettingItemSlider))] - [KnownType(typeof(SettingItemDoubleWithLink))] - [KnownType(typeof(SettingItemCondition))] - [ProtoContract] - [ProtoInclude(2, typeof(SettingItemAccount))] - [ProtoInclude(3, typeof(SettingItemBoolean))] - [ProtoInclude(4, typeof(SettingItemBooleanSwitcher))] - [ProtoInclude(5, typeof(SettingItemDateTime))] - [ProtoInclude(6, typeof(SettingItemNumber))] - [ProtoInclude(7, typeof(SettingItemSymbol))] - [ProtoInclude(8, typeof(SettingItemNumber))] - [ProtoInclude(9, typeof(SettingItemPassword))] - [ProtoInclude(10, typeof(SettingItemPeriod))] - [ProtoInclude(11, typeof(SettingItemSelector))] - [ProtoInclude(12, typeof(SettingItemSelectorLocalized))] - [ProtoInclude(13, typeof(SettingItemString))] - [ProtoInclude(14, typeof(SettingItemFile))] - [ProtoInclude(15, typeof(SettingItemGroup))] - [ProtoInclude(16, typeof(SettingItemRadioLocalized))] - [ProtoInclude(17, typeof(SettingItemAction))] - [ProtoInclude(18, typeof(SettingItemFont))] - [ProtoInclude(19, typeof(SettingItemTimeZone))] - [ProtoInclude(20, typeof(SettingItemRss))] - [ProtoInclude(21, typeof(SettingItemAlignment))] - [ProtoInclude(22, typeof(SettingItemPairColor))] - [ProtoInclude(23, typeof(SettingItemColor))] - [ProtoInclude(24, typeof(SettingItemSound))] - [ProtoInclude(25, typeof(SettingItemLineOptions))] - [ProtoInclude(26, typeof(SettingItemTimeZoneManager))] - [ProtoInclude(27, typeof(SettingItemAlert))] - [ProtoInclude(28, typeof(SettingItemFibonacciLevelOptions))] - [ProtoInclude(29, typeof(SettingItemRangeSelector))] - [ProtoInclude(30, typeof(SettingitemPoints))] - [ProtoInclude(31, typeof(SettingItemTimeFrameConfig))] - [ProtoInclude(32, typeof(SettingItemBooleanLocalized))] - [ProtoInclude(33, typeof(SettingItemClusterColoringLevel))] - [ProtoInclude(34, typeof(SettingItemArbitageSymbols))] - [ProtoInclude(36, typeof(SettingItemOrderRequestParameters))] - [ProtoInclude(38, typeof(SettingItemIconedAction))] - [ProtoInclude(39, typeof(SettingItemSlider))] - [ProtoInclude(40, typeof(SettingItemDoubleWithLink))] - [ProtoInclude(41, typeof(SettingItemNumber))] - [ProtoInclude(42, typeof(SettingItemCondition))] - public abstract class SettingItem : BindableEntity, IComparable, IEquatable, IXElementSerialization - { - [CompilerGenerated] - private string ??; - - private string ??; - - protected object value; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private VisibilityMode ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private SettingItemGroup ??; - - [CompilerGenerated] - private SettingItemSeparatorGroup ??; - - [CompilerGenerated] - private ISettingsGroup ??; - - private bool ??; - - [CompilerGenerated] - private SettingItemValueChangingBehavior ??; - - [CompilerGenerated] - private SettingItemValueChangingReason ??; - - private bool ??; - - [CompilerGenerated] - private SettingItemEventHandler ??; - - [CompilerGenerated] - private SettingItemRelation ??; - - [CompilerGenerated] - private bool ??; - - public abstract SettingItemType Type { get; } - - [DataMember(Name = "Name")] - [ProtoMember(1)] - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [Bindable("text")] - public virtual string Text - { - get - { - if (string.IsNullOrEmpty(??)) - { - return Name; - } - return ??; - } - set - { - SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - [Bindable("value")] - public virtual object Value - { - get - { - return value; - } - set - { - if (this.value == value) - { - return; - } - if (value == null) - { - SetValue(ref this.value, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return; - } - if (IsValueTypeValid(value)) - { - SetValue(ref this.value, ValidateValue(value), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return; - } - throw new InvalidCastException(); - } - } - - public int SortIndex - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public VisibilityMode VisibilityMode - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Description - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SettingItemGroup Group - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SettingItemSeparatorGroup SeparatorGroup - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public ISettingsGroup VisualGroup - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [Bindable("enabled")] - public bool Enabled - { - get - { - return ??; - } - set - { - SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public SettingItemValueChangingBehavior ValueChangingBehavior - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SettingItemValueChangingReason ValueChangingReason - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [Bindable("visible")] - public bool Visible - { - get - { - return ??; - } - set - { - SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public bool IsVisualizationAllowed - { - get - { - if (VisibilityMode == VisibilityMode.Hidden) - { - return false; - } - if (Group != null) - { - return Group.IsVisualizationAllowed; - } - return true; - } - } - - public SettingItemRelation Relation - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool UseEnabilityToggler - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public event SettingItemEventHandler Updated - { - [CompilerGenerated] - add - { - SettingItemEventHandler settingItemEventHandler = ??; - SettingItemEventHandler settingItemEventHandler2; - do - { - settingItemEventHandler2 = settingItemEventHandler; - SettingItemEventHandler settingItemEventHandler3 = (SettingItemEventHandler)Delegate.Combine(settingItemEventHandler2, value); - settingItemEventHandler = Interlocked.CompareExchange(ref ??, settingItemEventHandler3, settingItemEventHandler2); - } - while ((object)settingItemEventHandler != settingItemEventHandler2); - } - [CompilerGenerated] - remove - { - SettingItemEventHandler settingItemEventHandler = ??; - SettingItemEventHandler settingItemEventHandler2; - do - { - settingItemEventHandler2 = settingItemEventHandler; - SettingItemEventHandler settingItemEventHandler3 = (SettingItemEventHandler)Delegate.Remove(settingItemEventHandler2, value); - settingItemEventHandler = Interlocked.CompareExchange(ref ??, settingItemEventHandler3, settingItemEventHandler2); - } - while ((object)settingItemEventHandler != settingItemEventHandler2); - } - } - - public static IXElementSerialization DesserrializationFabric(XElement node) - { - string text = node?.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value; - if (text != null) - { - switch (text.Length) - { - case 18: - switch (text[11]) - { - case 'A': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemAccount(); - case 'B': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemBoolean(); - case 'I': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemInteger(); - } - break; - case 26: - switch (text[15]) - { - case 'e': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemBooleanSwitcher(); - case 'Z': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemTimeZoneManager(); - case 'F': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemTimeFrameConfig(); - } - break; - case 19: - switch (text[13]) - { - case 't': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemDateTime(); - case 's': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemPassword(); - case 'l': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemSelector(); - case 'm': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemTimeZone(); - case 'x': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemTextArea(); - } - break; - case 17: - switch (text[16]) - { - case 'l': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemSymbol(); - case 'd': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemPeriod(); - case 'g': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemString(); - case 'n': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemAction(); - case 's': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingitemPoints(); - case 'e': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemDouble(); - case 'r': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemSlider(); - } - break; - case 15: - switch (text[14]) - { - case 'e': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemFile(); - case 't': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemFont(); - case 'g': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemLong(); - } - break; - case 16: - switch (text[11]) - { - case 'G': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemGroup(); - case 'C': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemColor(); - case 'S': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemSound(); - case 'A': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemAlert(); - case 'O': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemOAuth(); - } - break; - case 25: - switch (text[11]) - { - case 'R': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemRadioLocalized(); - case 'D': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemDoubleWithLink(); - } - break; - case 20: - switch (text[11]) - { - case 'A': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemAlignment(); - case 'P': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemPairColor(); - case 'C': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemCondition(); - } - break; - case 22: - switch (text[11]) - { - case 'L': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemLineOptions(); - case 'B': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemBigTextArea(); - } - break; - case 28: - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemSelectorLocalized(); - case 14: - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemRss(); - case 32: - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemFibonacciLevelOptions(); - case 41: - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemMinotauroFibonacciLevelOptions(); - case 24: - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemRangeSelector(); - case 27: - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemBooleanLocalized(); - case 31: - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemClusterColoringLevel(); - case 33: - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemOrderRequestParameters(); - case 23: - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new SettingItemIconedAction(); - } - } - return null; - } - - public void Update() - { - ???.Invoke(this, SettingItemEventArgs.Empty); - } - - protected SettingItem(string name, object value, int sortIndex = 0) - : this() - { - Name = name; - this.value = value; - SortIndex = sortIndex; - VisibilityMode = VisibilityMode.Visible; - ValueChangingBehavior = SettingItemValueChangingBehavior.Default; - Enabled = true; - Visible = true; - } - - protected SettingItem() - { - ValueChangingReason = SettingItemValueChangingReason.Unknown; - } - - protected SettingItem(SettingItem settingItem) - : this() - { - Name = settingItem.Name; - SortIndex = settingItem.SortIndex; - Text = settingItem.Text; - Description = settingItem.Description; - Enabled = settingItem.Enabled; - Group = settingItem.Group; - Relation = settingItem.Relation; - SeparatorGroup = settingItem.SeparatorGroup; - VisibilityMode = settingItem.VisibilityMode; - Visible = settingItem.Visible; - VisualGroup = settingItem.VisualGroup; - if (settingItem.value is ICloneable cloneable) - { - value = cloneable.Clone(); - } - else - { - value = settingItem.Value; - } - ValueChangingBehavior = settingItem.ValueChangingBehavior; - UseEnabilityToggler = settingItem.UseEnabilityToggler; - } - - public abstract SettingItem GetCopy(); - - protected abstract bool IsValueTypeValid(object value); - - protected virtual object ValidateValue(object value) - { - return value; - } - - internal bool ?(IList P_0) - { - if (P_0 == null) - { - return false; - } - SettingItem itemByName = P_0.GetItemByName(Name); - if (itemByName != null) - { - Value = itemByName.Value; - return true; - } - return false; - } - - internal virtual void ?(object P_0, bool P_1 = false) - { - if (P_1) - { - SetValue(ref value, P_0, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - else - { - Value = P_0; - } - } - - internal virtual void ?(SettingItem P_0) - { - ?(P_0.Value); - VisibilityMode = P_0.VisibilityMode; - SortIndex = P_0.SortIndex; - } - - public int CompareTo(SettingItem other) - { - return SortIndex.CompareTo(other.SortIndex); - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Value); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public virtual XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); - if (UseEnabilityToggler) - { - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Enabled)); - } - xElement.Add(ValueToXElement()); - return xElement; - } - - protected virtual XElement ValueToXElement() - { - if (Value is IXElementSerialization iXElementSerialization) - { - return iXElementSerialization.ToXElement(); - } - return new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Value); - } - - public virtual void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - Name = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; - UseEnabilityToggler = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) != null; - Enabled = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToBool() ?? false; - ValueFromXElement(element, deserializationInfo); - } - - protected virtual void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - Value = xElement.Value; - } - } - - public virtual bool Equals(SettingItem other) - { - if (other == null) - { - return false; - } - if (this == other) - { - return true; - } - if (Text == other.Text && ValueEquals(other.Value) && Enabled == other.Enabled && Visible == other.Visible && Type == other.Type && Name == other.Name && SortIndex == other.SortIndex && VisibilityMode == other.VisibilityMode && Description == other.Description && object.Equals(SeparatorGroup, other.SeparatorGroup) && object.Equals(VisualGroup, other.VisualGroup) && ValueChangingReason == other.ValueChangingReason && ValueChangingBehavior == other.ValueChangingBehavior) - { - return UseEnabilityToggler == other.UseEnabilityToggler; - } - return false; - } - - protected virtual bool ValueEquals(object other) - { - return object.Equals(Value, other); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - if (this == obj) - { - return true; - } - if (obj.GetType() != GetType()) - { - return false; - } - return Equals((SettingItem)obj); - } - - public override int GetHashCode() - { - HashCode hashCode = default(HashCode); - hashCode.Add(Text); - hashCode.Add(Value); - hashCode.Add(Enabled); - hashCode.Add(Visible); - hashCode.Add((int)Type); - hashCode.Add(Name); - hashCode.Add(SortIndex); - hashCode.Add((int)VisibilityMode); - hashCode.Add(Description); - hashCode.Add(SeparatorGroup); - hashCode.Add(VisualGroup); - hashCode.Add(ValueChangingReason); - hashCode.Add((int)ValueChangingBehavior); - hashCode.Add(UseEnabilityToggler); - return hashCode.ToHashCode(); - } - } - /// - /// Typecasts setting as AccountLookup item - /// - [Serializable] - [DataContract] - public sealed class SettingItemAccount : SettingItem - { - public override SettingItemType Type => SettingItemType.Account; - - [DataMember(Name = "Value")] - private BusinessObjectInfo ValueInfo - { - get - { - return (Value as Account)?.CreateInfo() ?? BusinessObjectInfo.Empty; - } - set - { - Value = Core.Instance.GetAccount(accountInfo); - } - } - - public SettingItemAccount() - { - } - - public SettingItemAccount(string name, Account value = null, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemAccount(SettingItemAccount P_0) - : base(P_0) - { - } - - public override SettingItem GetCopy() - { - return new SettingItemAccount(this); - } - - public static implicit operator Account(SettingItemAccount item) - { - return item.Value as Account; - } - - protected override bool IsValueTypeValid(object value) - { - return value is Account; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - ? ? = new ?(); - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - ?.FromXElement(xElement, deserializationInfo); - if (!string.IsNullOrEmpty(?.Id)) - { - ValueInfo = ?; - } - } - } - - protected override XElement ValueToXElement() - { - return ValueInfo.ToXElement(); - } - } - /// - /// Typecasts setting as Button item - /// - [Serializable] - [Published] - [DataContract] - public sealed class SettingItemAction : SettingItem - { - [CompilerGenerated] - private string ??; - - public override SettingItemType Type => SettingItemType.Action; - - public string LabelText - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SettingItemAction() - { - } - - public SettingItemAction(string name, SettingItemActionDelegate value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - public SettingItemAction(SettingItemAction settingItem) - : base(settingItem) - { - LabelText = settingItem.LabelText; - } - - [NotPublished] - public override SettingItem GetCopy() - { - return new SettingItemAction(this); - } - - [NotPublished] - public static implicit operator SettingItemActionDelegate(SettingItemAction item) - { - return item.Value as SettingItemActionDelegate; - } - - [NotPublished] - protected override bool IsValueTypeValid(object value) - { - return value is SettingItemActionDelegate; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - } - } - public delegate object SettingItemActionDelegate(object args = null); - [Serializable] - [DataContract] - public class SettingItemAlert : SettingItem - { - public override SettingItemType Type => SettingItemType.ConditionSet; - - [DataMember(Name = "Value")] - private AlertData ValueAlert - { - get - { - return Value as AlertData; - } - set - { - Value = alertData; - } - } - - public SettingItemAlert() - { - } - - public SettingItemAlert(string name, object value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemAlert(SettingItemAlert P_0) - : base(P_0) - { - } - - public override SettingItem GetCopy() - { - return new SettingItemAlert(this); - } - - protected override bool IsValueTypeValid(object value) - { - return value is AlertData; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - AlertData alertData = new AlertData(); - alertData.FromXElement(element, deserializationInfo); - value = alertData; - } - } - [Serializable] - [DataContract] - public class SettingItemAlignment : SettingItem - { - public override SettingItemType Type => SettingItemType.Alignment; - - [DataMember(Name = "Value")] - private NativeAlignment ValueAlignment - { - get - { - return (NativeAlignment)Value; - } - set - { - Value = nativeAlignment; - } - } - - public SettingItemAlignment() - { - } - - public SettingItemAlignment(string name, NativeAlignment value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemAlignment(SettingItemAlignment P_0) - : base(P_0) - { - } - - public override SettingItem GetCopy() - { - return new SettingItemAlignment(this); - } - - protected override bool IsValueTypeValid(object value) - { - return value is NativeAlignment; - } - - protected override XElement ValueToXElement() - { - return new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)ValueAlignment); - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - ValueAlignment = (NativeAlignment)xElement.ToInt(); - } - } - } - [Serializable] - [DataContract] - public class SettingItemArbitageSymbols : SettingItem - { - [CompilerGenerated] - private ArbitrageSymbol ??; - - [CompilerGenerated] - private decimal ??; - - [CompilerGenerated] - private decimal ??; - - [CompilerGenerated] - private ArbitrageSymbol ??; - - [CompilerGenerated] - private ArbitrageSymbol ??; - - [CompilerGenerated] - private ArbitrageSymbol ??; - - [DataMember(Name = "Value")] - private List ArbitrageSymbols - { - get - { - return Value as List; - } - set - { - Value = list; - } - } - - public override SettingItemType Type => SettingItemType.ArbitageSymbols; - - public ArbitrageSymbol FirstArbitrageSymbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public decimal BaseMaxTradingQuantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public decimal QuotingMaxTradingQuantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public ArbitrageSymbol AddedSymbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public ArbitrageSymbol RemovedSymbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public ArbitrageSymbol ModifiedSymbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SettingItemArbitageSymbols() - { - } - - public SettingItemArbitageSymbols(string name, List symbols, int sortIndex = 0) - : base(name, symbols, sortIndex) - { - BaseMaxTradingQuantity = 0m; - QuotingMaxTradingQuantity = 0m; - } - - private SettingItemArbitageSymbols(SettingItemArbitageSymbols P_0) - : base(P_0) - { - BaseMaxTradingQuantity = P_0.BaseMaxTradingQuantity; - QuotingMaxTradingQuantity = P_0.QuotingMaxTradingQuantity; - } - - public override SettingItem GetCopy() - { - return new SettingItemArbitageSymbols(this); - } - - protected override bool IsValueTypeValid(object value) - { - return value is List; - } - - public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - BaseMaxTradingQuantity = xElement.ToDecimal(); - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - QuotingMaxTradingQuantity = xElement2.ToDecimal(); - } - base.FromXElement(element, deserializationInfo); - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - List list = new List(); - IEnumerable enumerable = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Elements(); - if (enumerable != null) - { - foreach (XElement item in enumerable) - { - ArbitrageSymbol arbitrageSymbol = new ArbitrageSymbol(); - arbitrageSymbol.FromXElement(item, deserializationInfo); - list.Add(arbitrageSymbol); - } - } - Value = list; - base.ValueFromXElement(element, deserializationInfo); - } - - public override XElement ToXElement() - { - XElement xElement = base.ToXElement(); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), BaseMaxTradingQuantity)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), QuotingMaxTradingQuantity)); - return xElement; - } - - protected override XElement ValueToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (ArbitrageSymbol arbitrageSymbol in ArbitrageSymbols) - { - xElement.Add(arbitrageSymbol.ToXElement()); - } - return xElement; - } - } - /// - /// Typecasts setting as TextBox item - /// - [Serializable] - [DataContract] - [ProtoContract] - public sealed class SettingItemBigTextArea : SettingItem - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - public override SettingItemType Type => SettingItemType.BigTextArea; - - public string HelpLink - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string HelpLinkTitle - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Value")] - [ProtoMember(1)] - private string ValueString - { - get - { - return Value as string; - } - set - { - Value = text; - } - } - - public SettingItemBigTextArea() - { - } - - public SettingItemBigTextArea(string name, string value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemBigTextArea(SettingItemBigTextArea P_0) - : base(P_0) - { - } - - public override SettingItem GetCopy() - { - return new SettingItemBigTextArea(this); - } - - public static implicit operator string(SettingItemBigTextArea item) - { - return item.Value as string; - } - - protected override bool IsValueTypeValid(object value) - { - return value is string; - } - } - /// - /// Typecasts setting as CheckBox item - /// - [Serializable] - [Published] - [DataContract] - public sealed class SettingItemBoolean : SettingItem - { - public override SettingItemType Type => SettingItemType.Boolean; - - [DataMember(Name = "Value")] - [ProtoMember(1, IsRequired = true)] - private bool ValueBool - { - get - { - return (bool)value; - } - set - { - value = flag; - } - } - - public SettingItemBoolean() - { - } - - public SettingItemBoolean(string name, bool value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemBoolean(SettingItemBoolean P_0) - : base(P_0) - { - } - - [NotPublished] - public override SettingItem GetCopy() - { - return new SettingItemBoolean(this); - } - - [NotPublished] - public static implicit operator bool(SettingItemBoolean item) - { - return (bool)item.Value; - } - - [NotPublished] - protected override bool IsValueTypeValid(object value) - { - return value is bool; - } - - [NotPublished] - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - ValueBool = xElement.ToBool(); - } - } - } - [Serializable] - [DataContract] - public class SettingItemBooleanLocalized : SettingItemList - { - [Serializable] - [CompilerGenerated] - private new sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Predicate ??; - - internal bool ?(SettingItem P_0) - { - return P_0 is SettingItemBoolean; - } - } - - public override SettingItemType Type => SettingItemType.BooleanLocalized; - - public SettingItemBooleanLocalized() - { - } - - public SettingItemBooleanLocalized(string name, IList items, int sortIndex = 0) - : base(name, items, sortIndex) - { - } - - private SettingItemBooleanLocalized(SettingItemBooleanLocalized P_0) - : base(P_0) - { - } - - public override SettingItem GetCopy() - { - return new SettingItemBooleanLocalized(this); - } - - protected override bool IsValueTypeValid(object value) - { - if (value is List list) - { - return list.TrueForAll((SettingItem P_0) => P_0 is SettingItemBoolean); - } - return false; - } - - protected override XElement ValueToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - List items = Items; - for (int i = 0; i < items.Count; i++) - { - xElement.Add(items[i].ToXElement()); - } - return xElement; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - List list = new List(); - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (XElement item in xElement.Elements()) - { - SettingItemBoolean settingItemBoolean = new SettingItemBoolean(); - settingItemBoolean.FromXElement(item, deserializationInfo); - list.Add(settingItemBoolean); - } - Items = list; - } - } - /// - /// Typecasts setting as CheckBox item - /// - [Serializable] - [DataContract] - public sealed class SettingItemBooleanSwitcher : SettingItem - { - public override SettingItemType Type => SettingItemType.BooleanSwitcher; - - [DataMember(Name = "Value")] - [ProtoMember(1)] - private bool ValueBool - { - get - { - return (bool)value; - } - set - { - value = flag; - } - } - - public SettingItemBooleanSwitcher() - { - } - - public SettingItemBooleanSwitcher(string name, bool value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemBooleanSwitcher(SettingItemBooleanSwitcher P_0) - : base(P_0) - { - } - - public override SettingItem GetCopy() - { - return new SettingItemBooleanSwitcher(this); - } - - public static implicit operator bool(SettingItemBooleanSwitcher item) - { - return (bool)item.Value; - } - - protected override bool IsValueTypeValid(object value) - { - return value is bool; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - ValueBool = xElement.ToBool(); - } - } - } - [Serializable] - [DataContract] - public class SettingItemClusterColoringLevel : SettingItem - { - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private decimal ?? = 1m; - - [CompilerGenerated] - private decimal ?? = decimal.MinValue; - - [CompilerGenerated] - private decimal ?? = decimal.MaxValue; - - [CompilerGenerated] - private bool ?? = true; - - public int NumericPrecision - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public decimal Increment - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public decimal Minimum - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public decimal Maximum - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool WithRightColor - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override SettingItemType Type => SettingItemType.ClusterColoringLevels; - - [DataMember(Name = "Value")] - private ClusterCustomColoringLevel Level - { - get - { - return Value as ClusterCustomColoringLevel; - } - set - { - Value = clusterCustomColoringLevel; - } - } - - public SettingItemClusterColoringLevel() - { - } - - public SettingItemClusterColoringLevel(string name, ClusterCustomColoringLevel level, int sortIndex = 0) - : base(name, level, sortIndex) - { - NumericPrecision = 0; - } - - public SettingItemClusterColoringLevel(SettingItemClusterColoringLevel settingItem) - : base(settingItem) - { - NumericPrecision = settingItem.NumericPrecision; - Increment = settingItem.Increment; - Minimum = settingItem.Minimum; - Maximum = settingItem.Maximum; - } - - public override SettingItem GetCopy() - { - return new SettingItemClusterColoringLevel(this); - } - - protected override bool IsValueTypeValid(object value) - { - return value is ClusterCustomColoringLevel; - } - - protected override XElement ValueToXElement() - { - return Level.ToXElement(); - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - ClusterCustomColoringLevel clusterCustomColoringLevel = new ClusterCustomColoringLevel(); - clusterCustomColoringLevel.FromXElement(element, deserializationInfo); - Value = clusterCustomColoringLevel; - } - } - /// - /// Typecasts setting as Color item - /// - [Serializable] - [Published] - [DataContract] - public sealed class SettingItemColor : SettingItem - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - public override SettingItemType Type => SettingItemType.Color; - - public string ColorText - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool Checked - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool WithCheckBox - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool AllowDisableColor - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Value")] - private Color ValueColor - { - get - { - return (Color)Value; - } - set - { - Value = color; - } - } - - public SettingItemColor() - { - } - - public SettingItemColor(string name, Color value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemColor(SettingItemColor P_0) - : base(P_0) - { - ColorText = P_0.ColorText; - Checked = P_0.Checked; - WithCheckBox = P_0.WithCheckBox; - AllowDisableColor = P_0.AllowDisableColor; - } - - [NotPublished] - public override SettingItem GetCopy() - { - return new SettingItemColor(this); - } - - [NotPublished] - public static implicit operator Color(SettingItemColor item) - { - return (Color)item.Value; - } - - [NotPublished] - protected override bool IsValueTypeValid(object value) - { - return value is Color; - } - - [NotPublished] - protected override XElement ValueToXElement() - { - return ValueColor.ToXElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - - [NotPublished] - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - ValueColor = xElement.ToColor(); - } - } - - [NotPublished] - public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - base.FromXElement(element, deserializationInfo); - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - WithCheckBox = xElement.ToBool(); - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - Checked = xElement2.ToBool(); - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - AllowDisableColor = xElement3.ToBool(); - } - } - - [NotPublished] - public override XElement ToXElement() - { - XElement xElement = base.ToXElement(); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Checked)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), WithCheckBox)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AllowDisableColor)); - return xElement; - } - } - /// - /// Typecasts setting as DateTimePicker item - /// - [Serializable] - [DataContract] - public sealed class SettingItemDateTime : SettingItem - { - private const string ?? = "ddMMyyyy HH:mm:ss.ffffff"; - - [CompilerGenerated] - private bool ??; - - private DatePickerFormat ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private DateTime ??; - - public override SettingItemType Type => SettingItemType.DateTime; - - public bool ApplyOnEachInput - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [Bindable("format")] - public DatePickerFormat Format - { - get - { - return ??; - } - set - { - SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public DateTime MinDate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DateTime MaxDate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Value")] - [ProtoMember(1)] - private DateTime ValueDateTime - { - get - { - return (DateTime)Value; - } - set - { - Value = dateTime; - } - } - - public SettingItemDateTime() - { - } - - public SettingItemDateTime(string name, DateTime value = default(DateTime), int sortIndex = 0) - : base(name, value, sortIndex) - { - Format = DatePickerFormat.DateTime; - ApplyOnEachInput = false; - MinDate = DateTime.MinValue; - MaxDate = DateTime.MaxValue; - } - - private SettingItemDateTime(SettingItemDateTime P_0) - : base(P_0) - { - Format = P_0.Format; - ApplyOnEachInput = P_0.ApplyOnEachInput; - MinDate = P_0.MinDate; - MaxDate = P_0.MaxDate; - } - - public override SettingItem GetCopy() - { - return new SettingItemDateTime(this); - } - - public static implicit operator DateTime(SettingItemDateTime item) - { - return (DateTime)item.Value; - } - - protected override bool IsValueTypeValid(object value) - { - return value is DateTime; - } - - protected override XElement ValueToXElement() - { - return new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ValueDateTime.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo.InvariantCulture)); - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement == null) - { - return; - } - if (deserializationInfo.Version < 1.3) - { - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null && xElement2.Value == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - ValueDateTime = xElement.ToDateTime(toUTC: true); - } - else - { - ValueDateTime = xElement.ToDateTime(); - } - } - else - { - ValueDateTime = xElement.ToDateTime(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - } - /// - /// Typecasts setting as NumericUpDown item - /// - [Serializable] - [Published] - [DataContract] - [ProtoContract] - public class SettingItemDouble : SettingItemNumber - { - private int ??; - - public override SettingItemType Type => SettingItemType.Double; - - [Bindable("decimalPlaces")] - public int DecimalPlaces - { - get - { - return ??; - } - set - { - SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - [DataMember(Name = "Value")] - [ProtoMember(1)] - private double ValueDouble - { - get - { - return (double)value; - } - set - { - value = num; - } - } - - public SettingItemDouble() - { - } - - public SettingItemDouble(string name, double value, int sortIndex = 0) - : base(name, value, sortIndex) - { - base.Maximum = 2147483647.0; - base.Minimum = -2147483648.0; - DecimalPlaces = 0; - base.Increment = 1.0; - } - - private protected SettingItemDouble(SettingItemDouble P_0) - : base((SettingItemNumber)P_0) - { - DecimalPlaces = P_0.DecimalPlaces; - } - - [NotPublished] - public override SettingItem GetCopy() - { - return new SettingItemDouble(this); - } - - [NotPublished] - public static implicit operator double(SettingItemDouble item) - { - return (double)item.Value; - } - - [NotPublished] - protected override bool IsValueTypeValid(object value) - { - return value is double; - } - - [NotPublished] - protected override object ValidateValue(object value) - { - value = base.ValidateValue(value); - double num = (double)value; - if (double.IsNaN(num)) - { - num = 0.0; - } - else if (num > base.Maximum) - { - num = base.Maximum; - } - else if (num < base.Minimum) - { - num = base.Minimum; - } - else if (base.Increment != 0.0) - { - num -= (double)((decimal)num % (decimal)base.Increment); - } - return num; - } - - [NotPublished] - protected override XElement ValueToXElement() - { - return new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ValueDouble.ToString(CultureInfo.InvariantCulture)); - } - - [NotPublished] - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - ValueDouble = xElement.ToDouble(); - } - } - - public override bool Equals(SettingItem other) - { - if (!base.Equals(other)) - { - return false; - } - if (!(other is SettingItemDouble settingItemDouble)) - { - return false; - } - return DecimalPlaces == settingItemDouble.DecimalPlaces; - } - - public override int GetHashCode() - { - HashCode hashCode = default(HashCode); - hashCode.Add(base.GetHashCode()); - hashCode.Add(DecimalPlaces); - return hashCode.ToHashCode(); - } - } - public class SettingItemDoubleWithLink : SettingItemDouble - { - private string ??; - - [CompilerGenerated] - private Action ??; - - public override SettingItemType Type => SettingItemType.DoubleWithLink; - - [Bindable("linkText")] - public string LinkText - { - get - { - return ??; - } - set - { - SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public Action LinkAction - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SettingItemDoubleWithLink() - { - } - - public SettingItemDoubleWithLink(string name, double value, Action linkAction, int sortIndex = 0) - : base(name, value, sortIndex) - { - LinkAction = linkAction; - } - - private SettingItemDoubleWithLink(SettingItemDoubleWithLink P_0) - : base(P_0) - { - LinkText = P_0.LinkText; - LinkAction = P_0.LinkAction; - } - - public override SettingItem GetCopy() - { - return new SettingItemDoubleWithLink(this); - } - } - public class SettingItemFibonacciLevelOptions : SettingItem - { - [CompilerGenerated] - private Font ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private decimal ??; - - public override SettingItemType Type => SettingItemType.FibonacciLevelOptions; - - public Font DefaultFont - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int DecimalPlaces - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public decimal Increment - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Value")] - private List ValuelevelOptions - { - get - { - return Value as List; - } - set - { - Value = list; - } - } - - public SettingItemFibonacciLevelOptions() - { - ?(); - } - - public SettingItemFibonacciLevelOptions(string name, List value, int sortIndex = 0) - : base(name, value, sortIndex) - { - ?(); - } - - protected SettingItemFibonacciLevelOptions(SettingItemFibonacciLevelOptions settingItem) - : base(settingItem) - { - ?(); - } - - private void ?() - { - DecimalPlaces = 2; - Increment = 0.01m; - } - - public override SettingItem GetCopy() - { - return new SettingItemFibonacciLevelOptions(this); - } - - protected override bool IsValueTypeValid(object value) - { - return value is List; - } - - protected override XElement ValueToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (FibonacciLevelOptions valuelevelOption in ValuelevelOptions) - { - xElement.Add(valuelevelOption.ToXElement()); - } - return xElement; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - List list = new List(); - foreach (XElement item in element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Elements()) - { - FibonacciLevelOptions fibonacciLevelOptions = CreateFibonaccilevel(); - fibonacciLevelOptions.FromXElement(item, deserializationInfo); - list.Add(fibonacciLevelOptions); - } - Value = list; - } - - protected virtual FibonacciLevelOptions CreateFibonaccilevel() - { - return new FibonacciLevelOptions(); - } - } - [Serializable] - [DataContract] - public class SettingItemFile : SettingItem - { - public string Filter; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private string ??; - - public override SettingItemType Type => SettingItemType.File; - - public bool Checked - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool WithCheckBox - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string DefaultFolder - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Value")] - private string ValueString - { - get - { - return Value as string; - } - set - { - Value = text; - } - } - - public SettingItemFile() - { - } - - public SettingItemFile(string name, string value, string filter, int sortIndex = 0) - : base(name, value, sortIndex) - { - Filter = filter; - } - - private SettingItemFile(SettingItemFile P_0) - : base(P_0) - { - Filter = P_0.Filter; - } - - public override SettingItem GetCopy() - { - return new SettingItemFile(this); - } - - public static implicit operator string(SettingItemFile item) - { - return item.Value as string; - } - - protected override bool IsValueTypeValid(object value) - { - return value is string; - } - - public override XElement ToXElement() - { - XElement xElement = base.ToXElement(); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Checked)); - return xElement; - } - - public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - base.FromXElement(element, deserializationInfo); - Checked = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToBool() ?? false; - } - } - [Serializable] - [DataContract] - [KnownType(typeof(FontStyle))] - [KnownType(typeof(GraphicsUnit))] - public sealed class SettingItemFont : SettingItem - { - public bool UseGeneral; - - public override SettingItemType Type => SettingItemType.Font; - - [DataMember(Name = "Value")] - private Font ValueFont - { - get - { - return Value as Font; - } - set - { - if (font != null) - { - Value = font; - } - } - } - - public SettingItemFont() - { - } - - public SettingItemFont(string name, Font value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemFont(SettingItemFont P_0) - : base(P_0) - { - } - - public override SettingItem GetCopy() - { - return new SettingItemFont(this); - } - - public static implicit operator Font(SettingItemFont item) - { - return item.Value as Font; - } - - protected override bool IsValueTypeValid(object value) - { - if (!(value is Font)) - { - return value == null; - } - return true; - } - - protected override XElement ValueToXElement() - { - return ValueFont.ToXElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - ValueFont = xElement.ToFont(); - } - } - } - [Serializable] - [DataContract] - public sealed class SettingItemIconedAction : SettingItem - { - [CompilerGenerated] - private SettingItemIconedActionType ??; - - public override SettingItemType Type => SettingItemType.IconedAction; - - public SettingItemIconedActionType IconType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SettingItemIconedAction() - { - } - - public SettingItemIconedAction(string name, SettingItemActionDelegate value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemIconedAction(SettingItemIconedAction P_0) - : base(P_0) - { - } - - public override SettingItem GetCopy() - { - return new SettingItemIconedAction(this); - } - - protected override bool IsValueTypeValid(object value) - { - return value is SettingItemActionDelegate; - } - - public static implicit operator SettingItemActionDelegate(SettingItemIconedAction item) - { - return item.Value as SettingItemActionDelegate; - } - } - public enum SettingItemIconedActionType - { - Setting, - Trash - } - /// - /// Typecasts setting as NumericUpDown item - /// - [Serializable] - [Published] - [DataContract] - [ProtoContract] - public sealed class SettingItemInteger : SettingItemNumber - { - public override SettingItemType Type => SettingItemType.Integer; - - [DataMember(Name = "Value")] - [ProtoMember(1)] - private int ValueInt - { - get - { - return (int)value; - } - set - { - value = num; - } - } - - public SettingItemInteger() - { - } - - public SettingItemInteger(string name, int value, int sortIndex = 0) - : base(name, value, sortIndex) - { - base.Maximum = int.MaxValue; - base.Minimum = int.MinValue; - base.Increment = 1; - } - - private SettingItemInteger(SettingItemInteger P_0) - : base((SettingItemNumber)P_0) - { - } - - [NotPublished] - public override SettingItem GetCopy() - { - return new SettingItemInteger(this); - } - - [NotPublished] - public static implicit operator int(SettingItemInteger item) - { - return (int)item.Value; - } - - [NotPublished] - protected override bool IsValueTypeValid(object value) - { - return value is int; - } - - [NotPublished] - protected override object ValidateValue(object value) - { - value = base.ValidateValue(value); - int num = (int)value; - if (num > base.Maximum) - { - num = base.Maximum; - } - else if (num < base.Minimum) - { - num = base.Minimum; - } - else if (base.Increment != 0) - { - num -= num % base.Increment; - } - return num; - } - - [NotPublished] - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - ValueInt = xElement.ToInt(); - } - } - } - public class SettingItemLabel : SettingItem - { - public override SettingItemType Type => SettingItemType.Label; - - [DataMember(Name = "Value")] - private string ValueString - { - get - { - return Value as string; - } - set - { - Value = text; - } - } - - public SettingItemLabel() - { - } - - public SettingItemLabel(string name, string value = null, int sortIndex = 0) - : base(name, value ?? string.Empty, sortIndex) - { - } - - private SettingItemLabel(SettingItemLabel P_0) - : base(P_0) - { - } - - public override SettingItem GetCopy() - { - return new SettingItemLabel(this); - } - - protected override bool IsValueTypeValid(object value) - { - return value is string; - } - } - [Serializable] - [DataContract] - public class SettingItemLineOptions : SettingItem - { - [CompilerGenerated] - private LineStyle[] ??; - - public override SettingItemType Type => SettingItemType.LineOptions; - - public LineStyle[] ExcludedStyles - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Value")] - private LineOptions ValueColor - { - get - { - return (LineOptions)Value; - } - set - { - Value = lineOptions; - } - } - - public SettingItemLineOptions() - { - } - - public SettingItemLineOptions(string name, LineOptions value, int sortIndex = 0) - : base(name, value?.Clone(), sortIndex) - { - } - - private SettingItemLineOptions(SettingItemLineOptions P_0) - : base(P_0) - { - if (P_0.Value is ICloneable cloneable) - { - value = cloneable.Clone() as LineOptions; - } - ExcludedStyles = P_0.ExcludedStyles; - } - - public override SettingItem GetCopy() - { - return new SettingItemLineOptions(this); - } - - protected override bool IsValueTypeValid(object value) - { - return value is LineOptions; - } - - protected override object ValidateValue(object value) - { - LineOptions lineOptions = (LineOptions)value; - LineStyle[] excludedStyles = ExcludedStyles; - if (excludedStyles != null && excludedStyles.Contains(lineOptions.LineStyle)) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return base.ValidateValue(value); - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - LineOptions lineOptions = new LineOptions(); - XElement element2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - lineOptions.FromXElement(element2, deserializationInfo); - ValueColor = lineOptions; - } - } - [Serializable] - [Published] - [DataContract] - [ProtoContract] - public sealed class SettingItemLong : SettingItemNumber - { - public override SettingItemType Type => SettingItemType.Long; - - [DataMember(Name = "Value")] - [ProtoMember(1)] - private long ValueLong - { - get - { - return (long)value; - } - set - { - value = num; - } - } - - public SettingItemLong() - { - } - - public SettingItemLong(string name, long value, int sortIndex = 0) - : base(name, value, sortIndex) - { - base.Maximum = long.MaxValue; - base.Minimum = long.MinValue; - base.Increment = 1L; - } - - private SettingItemLong(SettingItemLong P_0) - : base((SettingItemNumber)P_0) - { - } - - [NotPublished] - public override SettingItem GetCopy() - { - return new SettingItemLong(this); - } - - [NotPublished] - public static implicit operator long(SettingItemLong item) - { - return (long)item.Value; - } - - [NotPublished] - protected override bool IsValueTypeValid(object value) - { - return value is long; - } - - [NotPublished] - protected override object ValidateValue(object value) - { - value = base.ValidateValue(value); - long num = (long)value; - if (num > base.Maximum) - { - num = base.Maximum; - } - else if (num < base.Minimum) - { - num = base.Minimum; - } - else if (base.Increment != 0L) - { - num -= num % base.Increment; - } - return num; - } - - [NotPublished] - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - ValueLong = xElement.ToLong(); - } - } - } - public class SettingItemMinotauroFibonacciLevelOptions : SettingItemFibonacciLevelOptions - { - public override SettingItemType Type => SettingItemType.MinotauroFibonacciLevelOptions; - - protected override FibonacciLevelOptions CreateFibonaccilevel() - { - return new MinotauroFibonacciLevelOptions(); - } - - private SettingItemMinotauroFibonacciLevelOptions(SettingItemFibonacciLevelOptions P_0) - : base(P_0) - { - } - - public override SettingItem GetCopy() - { - return new SettingItemMinotauroFibonacciLevelOptions(this); - } - - public SettingItemMinotauroFibonacciLevelOptions() - { - } - - public SettingItemMinotauroFibonacciLevelOptions(string name, List value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - } - [Serializable] - [KnownType(typeof(SettingItemDouble))] - [KnownType(typeof(SettingItemInteger))] - [KnownType(typeof(SettingItemLong))] - [ProtoInclude(1, typeof(SettingItemDouble))] - [ProtoInclude(2, typeof(SettingItemInteger))] - [ProtoInclude(3, typeof(SettingItemLong))] - [DataContract] - [ProtoContract] - public abstract class SettingItemNumber : SettingItem where T : struct - { - private T ??; - - private T ??; - - private T ??; - - private string ??; - - [CompilerGenerated] - private bool ??; - - [Bindable("maximum")] - public T Maximum - { - get - { - return ??; - } - set - { - SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - [Bindable("minimum")] - public T Minimum - { - get - { - return ??; - } - set - { - SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - [Bindable("increment")] - public T Increment - { - get - { - return ??; - } - set - { - SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - [Bindable("dimension")] - public string Dimension - { - get - { - return ??; - } - set - { - SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public bool UseTradingNumeric - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SettingItemNumber() - { - } - - public SettingItemNumber(string name, T value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - protected SettingItemNumber(SettingItemNumber settingItem) - : base(settingItem) - { - Maximum = settingItem.Maximum; - Minimum = settingItem.Minimum; - Increment = settingItem.Increment; - Dimension = settingItem.Dimension; - UseTradingNumeric = settingItem.UseTradingNumeric; - } - - public override bool Equals(SettingItem other) - { - if (!base.Equals(other)) - { - return false; - } - if (!(other is SettingItemNumber settingItemNumber)) - { - return false; - } - if (EqualityComparer.Default.Equals(Maximum, settingItemNumber.Maximum) && EqualityComparer.Default.Equals(Minimum, settingItemNumber.Minimum) && EqualityComparer.Default.Equals(Increment, settingItemNumber.Increment) && Dimension == settingItemNumber.Dimension) - { - return UseTradingNumeric == settingItemNumber.UseTradingNumeric; - } - return false; - } - - public override int GetHashCode() - { - HashCode hashCode = default(HashCode); - hashCode.Add(base.GetHashCode()); - hashCode.Add(Maximum); - hashCode.Add(Minimum); - hashCode.Add(Increment); - hashCode.Add(Dimension); - hashCode.Add(UseTradingNumeric); - return hashCode.ToHashCode(); - } - } - /// - /// Typecasts setting as AccountLookup item - /// - [Serializable] - [DataContract] - public sealed class SettingItemObject : SettingItem - { - public override SettingItemType Type => SettingItemType.Object; - - public SettingItemObject() - { - } - - public SettingItemObject(string name, object value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemObject(SettingItemObject P_0) - : base(P_0) - { - } - - public override SettingItem GetCopy() - { - return new SettingItemObject(this); - } - - protected override bool IsValueTypeValid(object value) - { - return true; - } - } - [Serializable] - [DataContract] - public class SettingItemOrderRequestParameters : SettingItem - { - public override SettingItemType Type => SettingItemType.OrderRequestParameters; - - [DataMember(Name = "Value")] - private OrderRequestParameters ValueInfo - { - get - { - return Value as OrderRequestParameters; - } - set - { - Value = orderRequestParameters; - } - } - - public SettingItemOrderRequestParameters() - { - } - - public SettingItemOrderRequestParameters(string name, OrderRequestParameters value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemOrderRequestParameters(SettingItemOrderRequestParameters P_0) - : base(P_0) - { - } - - public override SettingItem GetCopy() - { - return new SettingItemOrderRequestParameters(this); - } - - protected override bool IsValueTypeValid(object value) - { - return value is OrderRequestParameters; - } - - protected override XElement ValueToXElement() - { - return ValueInfo.ToXElement(); - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - PlaceOrderRequestParameters placeOrderRequestParameters = new PlaceOrderRequestParameters(); - placeOrderRequestParameters.FromXElement(element, deserializationInfo); - value = placeOrderRequestParameters; - } - } - [Serializable] - [DataContract] - public sealed class SettingItemPairColor : SettingItem - { - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - public override SettingItemType Type => SettingItemType.PairColor; - - public bool Checked - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool WithCheckBox - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool AllowDisableColor1 - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool AllowDisableColor2 - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Value")] - private PairColor ValueColor - { - get - { - return (PairColor)Value; - } - set - { - Value = pairColor; - } - } - - public SettingItemPairColor() - { - } - - public SettingItemPairColor(string name, PairColor value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemPairColor(SettingItemPairColor P_0) - : base(P_0) - { - Checked = P_0.Checked; - WithCheckBox = P_0.WithCheckBox; - AllowDisableColor1 = P_0.AllowDisableColor1; - AllowDisableColor2 = P_0.AllowDisableColor2; - } - - public override SettingItem GetCopy() - { - return new SettingItemPairColor(this); - } - - public static implicit operator PairColor(SettingItemPairColor item) - { - return (PairColor)item.Value; - } - - protected override bool IsValueTypeValid(object value) - { - return value is PairColor; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - value = new PairColor(); - ValueColor.FromXElement(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), deserializationInfo); - } - - public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - base.FromXElement(element, deserializationInfo); - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - WithCheckBox = xElement.ToBool(); - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - Checked = xElement2.ToBool(); - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - AllowDisableColor1 = xElement3.ToBool(); - } - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - AllowDisableColor2 = xElement4.ToBool(); - } - } - - public override XElement ToXElement() - { - XElement xElement = base.ToXElement(); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Checked)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), WithCheckBox)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AllowDisableColor1)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AllowDisableColor2)); - return xElement; - } - } - /// - /// Typecasts setting as Password item - /// - [Serializable] - [DataContract] - public sealed class SettingItemPassword : SettingItem - { - public override SettingItemType Type => SettingItemType.Password; - - [DataMember(Name = "Value")] - private PasswordHolder PasswordHolder - { - get - { - return (PasswordHolder)Value; - } - set - { - Value = passwordHolder; - } - } - - public SettingItemPassword() - { - } - - public SettingItemPassword(string name, PasswordHolder passwordHolder, int sortIndex = 0) - : base(name, passwordHolder, sortIndex) - { - } - - private SettingItemPassword(SettingItemPassword P_0) - : base(P_0) - { - } - - public override SettingItem GetCopy() - { - return new SettingItemPassword(this); - } - - public static implicit operator PasswordHolder(SettingItemPassword item) - { - return (PasswordHolder)item.Value; - } - - protected override bool IsValueTypeValid(object value) - { - return value is PasswordHolder; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - PasswordHolder passwordHolder = new PasswordHolder(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), SavePassword: true, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - passwordHolder.FromXElement(xElement, deserializationInfo); - PasswordHolder = passwordHolder; - } - } - - internal override void ?(object P_0, bool P_1 = false) - { - PasswordHolder passwordHolder = this; - base.?(P_0, P_1); - ((PasswordHolder)Value).RecoverUrl = passwordHolder.RecoverUrl; - } - } - [Serializable] - [DataContract] - public class PasswordHolder : IXElementSerialization, ICloneable - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private bool ?? = true; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private bool ??; - - public string Password - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Password")] - private string EncryptedPassword - { - get - { - if (!SavePassword) - { - return string.Empty; - } - return Encryptor.?(Password); - } - set - { - Password = Encryptor.?(text); - } - } - - [DataMember(Name = "SavePassword")] - public bool SavePassword - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string RecoverUrl - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - public bool FailedToRestorePassword - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = flag; - } - } - - public PasswordHolder(string Password = "", bool SavePassword = true, string recoverUrl = "") - { - this.Password = Password; - this.SavePassword = SavePassword; - RecoverUrl = recoverUrl; - } - - public object Clone() - { - return new PasswordHolder(Password, SavePassword, RecoverUrl); - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), EncryptedPassword)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SavePassword)); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - EncryptedPassword = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; - SavePassword = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); - if (!string.IsNullOrEmpty(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value) && string.IsNullOrEmpty(EncryptedPassword)) - { - FailedToRestorePassword = true; - } - } - } - /// - /// Typecasts setting as Period item - /// - [Serializable] - [Published] - [DataContract] - [ProtoContract] - public sealed class SettingItemPeriod : SettingItem - { - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private BasePeriod[] ??; - - public override SettingItemType Type => SettingItemType.Period; - - public int MultiplierMinimum - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int MultiplierMaximum - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public BasePeriod[] ExcludedPeriods - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Value")] - [ProtoMember(1)] - private Period ValuePeriod - { - get - { - if (value != null) - { - return (Period)value; - } - return default(Period); - } - set - { - value = period; - } - } - - public SettingItemPeriod() - { - } - - public SettingItemPeriod(string name, Period value, int sortIndex = 0) - : base(name, value, sortIndex) - { - MultiplierMinimum = 1; - MultiplierMaximum = int.MaxValue; - } - - private SettingItemPeriod(SettingItemPeriod P_0) - : base(P_0) - { - MultiplierMinimum = P_0.MultiplierMinimum; - MultiplierMaximum = P_0.MultiplierMaximum; - ExcludedPeriods = P_0.ExcludedPeriods; - } - - [NotPublished] - public override SettingItem GetCopy() - { - return new SettingItemPeriod(this); - } - - [NotPublished] - public static implicit operator Period(SettingItemPeriod item) - { - return (Period)item.Value; - } - - [NotPublished] - protected override bool IsValueTypeValid(object value) - { - return value is Period; - } - - [NotPublished] - protected override object ValidateValue(object value) - { - Period period = (Period)value; - if (period.PeriodMultiplier < MultiplierMinimum) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(17, 3); - defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - defaultInterpolatedStringHandler.AppendFormatted(MultiplierMinimum); - throw new ArgumentException(defaultInterpolatedStringHandler.ToStringAndClear()); - } - if (period.PeriodMultiplier > MultiplierMaximum) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(17, 3); - defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - defaultInterpolatedStringHandler.AppendFormatted(MultiplierMaximum); - throw new ArgumentException(defaultInterpolatedStringHandler.ToStringAndClear()); - } - BasePeriod[] excludedPeriods = ExcludedPeriods; - if (excludedPeriods != null && excludedPeriods.Contains(period.BasePeriod)) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return value; - } - - [NotPublished] - protected override XElement ValueToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((IXElementSerialization)Value).ToXElement())); - return xElement; - } - - [NotPublished] - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - if (xElement != null) - { - XElement xElement2 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - Period period = default(Period); - period.FromXElement(xElement2.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()), deserializationInfo); - value = period; - } - } - } - } - public class SettingItemPnlAlertsContainer : SettingItem - { - public override SettingItemType Type => SettingItemType.PnlAlertsContainer; - - [DataMember(Name = "Value")] - [ProtoMember(1)] - private PnlAlertsContainer PnlAlertsContainer - { - get - { - return (PnlAlertsContainer)Value; - } - set - { - Value = pnlAlertsContainer; - } - } - - public SettingItemPnlAlertsContainer() - { - } - - public SettingItemPnlAlertsContainer(string name, PnlAlertsContainer pnLAlertsCollection, int sortIndex = 0) - : base(name, pnLAlertsCollection, sortIndex) - { - } - - public SettingItemPnlAlertsContainer(SettingItemPnlAlertsContainer settingItem) - : base(settingItem) - { - value = ((PnlAlertsContainer)settingItem.Value).Clone(); - } - - public override SettingItem GetCopy() - { - return new SettingItemPnlAlertsContainer(this); - } - - protected override bool IsValueTypeValid(object value) - { - return value is PnlAlertsContainer; - } - - protected override XElement ValueToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - PnlAlertItem[] pnlAlerts = PnlAlertsContainer.PnlAlerts; - foreach (PnlAlertItem pnlAlertItem in pnlAlerts) - { - XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), pnlAlertItem.IsChecked)); - if (pnlAlertItem.Symbol != null) - { - xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), pnlAlertItem.Symbol.CreateInfo().ToXElement())); - } - xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), pnlAlertItem.TargetValue)); - xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), pnlAlertItem.Increment)); - xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), pnlAlertItem.Precision)); - xElement.Add(xElement2); - } - return xElement; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - element = xElement; - } - List list = new List(); - IEnumerable enumerable = element.Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (enumerable != null) - { - foreach (XElement item in enumerable) - { - PnlAlertItem pnlAlertItem = new PnlAlertItem - { - IsChecked = (item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToBool() ?? false), - TargetValue = (item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToDouble() ?? 0.0), - Increment = (item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToDouble() ?? 1.0), - Precision = (item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToInt() ?? 0) - }; - XElement xElement2 = item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - XElement xElement3 = xElement2.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - BusinessObjectInfo businessObjectInfo = new BusinessObjectInfo(); - businessObjectInfo.FromXElement(xElement3, deserializationInfo); - pnlAlertItem.Symbol = Core.Instance.GetSymbol(businessObjectInfo); - } - } - list.Add(pnlAlertItem); - } - } - Value = new PnlAlertsContainer - { - PnlAlerts = list.ToArray() - }; - } - } - public class SettingitemPoints : SettingItem - { - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private Func ??; - - [CompilerGenerated] - private bool ??; - - public override SettingItemType Type => SettingItemType.DrawingPoints; - - public int PointsInitialized - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Func FindVariableTick - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool EnablePriceSelection - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SettingitemPoints() - { - } - - public SettingitemPoints(string name, double[][] Points, int sortIndex = 0) - : base(name, Points, sortIndex) - { - EnablePriceSelection = true; - Value = ?(Points); - } - - private SettingitemPoints(SettingitemPoints P_0) - { - EnablePriceSelection = P_0.EnablePriceSelection; - Value = ?((double[][])P_0.value); - } - - public override SettingItem GetCopy() - { - return new SettingitemPoints(this); - } - - protected override bool IsValueTypeValid(object value) - { - return value is double[][]; - } - - protected override XElement ValueToXElement() - { - double[][] array = (double[][])Value; - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), array.Length)); - XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - double[][] array2 = array; - foreach (double[] array3 in array2) - { - XElement xElement3 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement3.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), array3[0])); - xElement3.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), array3[1])); - xElement2.Add(xElement3); - } - xElement.Add(xElement2); - return xElement; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement? xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - int level = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt(); - double[][] array = InitPoints(level); - int num = 0; - foreach (XElement item in xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Elements()) - { - array[num][0] = item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToDouble(); - array[num][1] = item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToDouble(); - num++; - } - value = array; - } - - protected double[][] InitPoints(int level) - { - double[][] array = new double[level][]; - for (int i = 0; i < array.Length; i++) - { - array[i] = new double[2]; - } - return array; - } - - private double[][] ?(double[][] P_0) - { - double[][] array = InitPoints(P_0.Length); - for (int i = 0; i < P_0.GetLength(0); i++) - { - double[] array2 = P_0[i]; - for (int j = 0; j < array2.Length; j++) - { - array[i][j] = array2[j]; - } - } - return array; - } - } - [Serializable] - [DataContract] - public sealed class SettingItemRadioLocalized : SettingItem - { - [CompilerGenerated] - private new sealed class ? - { - public object ??; - - internal bool ?(SelectItem P_0) - { - return P_0.Value.CompareTo(??) == 0; - } - } - - private List ??; - - public override SettingItemType Type => SettingItemType.RadioLocalized; - - [Bindable("items")] - public List Items - { - get - { - return ??; - } - set - { - SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - [DataMember(Name = "Value")] - private SelectItem SeletedItem - { - get - { - return Value as SelectItem; - } - set - { - Value = selectItem; - } - } - - public SettingItemRadioLocalized() - { - } - - public SettingItemRadioLocalized(string name, SelectItem value, List items, int sortIndex = 0) - : base(name, value, sortIndex) - { - Items = items; - } - - private SettingItemRadioLocalized(SettingItemRadioLocalized P_0) - : base(P_0) - { - Items = P_0.Items; - } - - public override SettingItem GetCopy() - { - return new SettingItemRadioLocalized(this); - } - - public static implicit operator SelectItem(SettingItemRadioLocalized item) - { - return item.Value as SelectItem; - } - - protected override bool IsValueTypeValid(object value) - { - return value is SelectItem; - } - - internal override void ?(object P_0, bool P_1 = false) - { - if (!(P_0 is SelectItem)) - { - SelectItem selectItem = Items?.FirstOrDefault((SelectItem selectItem2) => selectItem2.Value.CompareTo(P_0) == 0); - P_0 = selectItem ?? new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), (IComparable)P_0); - } - base.?(P_0, P_1); - } - - protected override XElement ValueToXElement() - { - string content = string.Empty; - if (SeletedItem != null) - { - if (SeletedItem.Value is int num) - { - content = num.ToString(); - } - else if (SeletedItem.Value != null) - { - content = SeletedItem.Value.ToString(); - } - } - return new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), content); - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - if (int.TryParse(xElement.Value, out var result)) - { - SeletedItem = new SelectItem(string.Empty, result); - } - else - { - SeletedItem = new SelectItem(string.Empty, xElement.Value); - } - } - } - } - public class SettingItemRangeSelector : SettingItem - { - public override SettingItemType Type => SettingItemType.RangeSelector; - - [DataMember(Name = "Value")] - [ProtoMember(29)] - private DateTimeRange ValueSelector - { - get - { - return (DateTimeRange)value; - } - set - { - value = dateTimeRange; - } - } - - public SettingItemRangeSelector() - { - } - - public SettingItemRangeSelector(string name, DateTimeRange value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemRangeSelector(SettingItemRangeSelector P_0) - : base(P_0) - { - } - - public override SettingItem GetCopy() - { - return new SettingItemRangeSelector(this); - } - - protected override bool IsValueTypeValid(object value) - { - return Value is DateTimeRange; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - base.ValueFromXElement(element, deserializationInfo); - DateTimeRange dateTimeRange = new DateTimeRange(); - dateTimeRange.FromXElement(element, deserializationInfo); - ValueSelector = dateTimeRange; - } - } - [Serializable] - [DataContract] - public sealed class SettingItemRss : SettingItem - { - public override SettingItemType Type => SettingItemType.Rss; - - [DataMember(Name = "Value")] - private Rss ValueRss - { - get - { - return Value as Rss; - } - set - { - Value = rss; - } - } - - public SettingItemRss() - { - } - - public SettingItemRss(string name, Rss value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemRss(SettingItemRss P_0) - : base(P_0) - { - } - - public override SettingItem GetCopy() - { - return new SettingItemRss(this); - } - - protected override bool IsValueTypeValid(object value) - { - return value is Rss; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - Rss rss = new Rss(); - rss.FromXElement(element, deserializationInfo); - Value = rss; - } - } - /// - /// Typecasts setting as ComboBox item - /// - [Serializable] - [Published] - [DataContract] - [ProtoContract] - public sealed class SettingItemSelector : SettingItem - { - private IEnumerable ??; - - public override SettingItemType Type => SettingItemType.Selector; - - [Bindable("items")] - public IEnumerable Items - { - get - { - return ??; - } - set - { - SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - [DataMember(Name = "Value")] - [ProtoMember(1)] - private string ValueString - { - get - { - return Value as string; - } - set - { - Value = text; - } - } - - public SettingItemSelector() - { - } - - public SettingItemSelector(string name, string value, IEnumerable items, int sortIndex = 0) - : base(name, value, sortIndex) - { - Items = items; - } - - private SettingItemSelector(SettingItemSelector P_0) - : base(P_0) - { - Items = P_0.Items; - } - - [NotPublished] - public override SettingItem GetCopy() - { - return new SettingItemSelector(this); - } - - [NotPublished] - public static implicit operator string(SettingItemSelector item) - { - return item.Value as string; - } - - [NotPublished] - protected override bool IsValueTypeValid(object value) - { - return value is string; - } - } - [Serializable] - [DataContract] - [ProtoContract] - public sealed class SettingItemSelectorLocalized : SettingItem - { - [CompilerGenerated] - private new sealed class ? - { - public SelectItem ??; - - internal bool ?(SelectItem P_0) - { - IComparable value = P_0.Value; - if (value == null) - { - return false; - } - return value.CompareTo(??.Value) == 0; - } - } - - [CompilerGenerated] - private sealed class ? - { - public object ??; - - internal bool ?(SelectItem P_0) - { - return P_0.Value.CompareTo(??) == 0; - } - } - - [CompilerGenerated] - private sealed class ? - { - public IComparable ??; - - internal bool ?(SelectItem P_0) - { - return P_0.Value.CompareTo(??) == 0; - } - } - - private List ??; - - public override SettingItemType Type => SettingItemType.SelectorLocalized; - - [Bindable("items")] - public List Items - { - get - { - return ??; - } - set - { - SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - private SelectItem SeletedItem - { - get - { - return Value as SelectItem; - } - set - { - Value = selectItem; - } - } - - [DataMember(Name = "Value")] - [ProtoMember(1)] - private string SerializeValue - { - get - { - string result = string.Empty; - if (SeletedItem == null) - { - return result; - } - if (SeletedItem.Value is int || SeletedItem.Value is Enum) - { - result = ((int)(object)SeletedItem.Value).ToString(); - } - else if (SeletedItem.Value != null) - { - result = SeletedItem.Value.ToString(); - } - return result; - } - set - { - if (int.TryParse(s, out var result)) - { - SeletedItem = new SelectItem(string.Empty, result); - } - else - { - SeletedItem = new SelectItem(string.Empty, s); - } - } - } - - public SettingItemSelectorLocalized() - { - } - - public SettingItemSelectorLocalized(string name, SelectItem value, List items, int sortIndex = 0) - : base(name, value, sortIndex) - { - Items = items; - } - - public SettingItemSelectorLocalized(string name, IComparable value, List items, int sortIndex = 0) - : this(name, items?.FirstOrDefault((SelectItem P_0) => P_0.Value.CompareTo(value) == 0), items, sortIndex) - { - } - - private SettingItemSelectorLocalized(SettingItemSelectorLocalized P_0) - : base(P_0) - { - Items = P_0.Items; - } - - public override SettingItem GetCopy() - { - return new SettingItemSelectorLocalized(this); - } - - public static implicit operator SelectItem(SettingItemSelectorLocalized item) - { - return item.Value as SelectItem; - } - - protected override bool IsValueTypeValid(object value) - { - return value is SelectItem; - } - - protected override object ValidateValue(object value) - { - SelectItem ?? = value as SelectItem; - if (?? == null) - { - return Value; - } - if (Items == null || Items.Count == 0) - { - return value; - } - if (Items.Any(delegate(SelectItem P_0) - { - IComparable comparable = P_0.Value; - return comparable != null && comparable.CompareTo(??.Value) == 0; - })) - { - return value; - } - return Value; - } - - internal override void ?(object P_0, bool P_1 = false) - { - if (P_0 is SelectItem selectItem) - { - P_0 = selectItem.Value; - } - SelectItem selectItem2 = Items?.FirstOrDefault((SelectItem selectItem3) => selectItem3.Value.CompareTo(P_0) == 0); - P_0 = selectItem2 ?? new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), (IComparable)P_0); - base.?(P_0, P_1); - } - - internal override void ?(SettingItem P_0) - { - if (P_0 is SettingItemSelectorLocalized { Items: not null } settingItemSelectorLocalized) - { - Items = settingItemSelectorLocalized.Items; - } - base.?(P_0); - } - - protected override XElement ValueToXElement() - { - return new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SerializeValue); - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - SerializeValue = xElement.Value; - } - } - } - [Serializable] - [DataContract] - [ProtoContract] - public class SettingItemSlider : SettingItem - { - private ulong ??; - - public override SettingItemType Type => SettingItemType.Slider; - - [Bindable("stepsCount")] - public ulong StepsCount - { - get - { - return ??; - } - set - { - SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - [DataMember(Name = "Value")] - [ProtoMember(1)] - private ulong ValueUlong - { - get - { - return (ulong)Value; - } - set - { - Value = num; - } - } - - public SettingItemSlider() - { - } - - public SettingItemSlider(string name, ulong value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemSlider(SettingItemSlider P_0) - : base(P_0) - { - StepsCount = P_0.StepsCount; - } - - [NotPublished] - public static implicit operator ulong(SettingItemSlider item) - { - return (ulong)item.Value; - } - - [NotPublished] - public override SettingItem GetCopy() - { - return new SettingItemSlider(this); - } - - [NotPublished] - protected override bool IsValueTypeValid(object value) - { - return value is ulong; - } - - [NotPublished] - protected override object ValidateValue(object value) - { - value = base.ValidateValue(value); - return Math.Min((ulong)value, StepsCount); - } - } - [Serializable] - [DataContract] - public class SettingItemSound : SettingItem - { - public bool EnableSounds; - - public override SettingItemType Type => SettingItemType.Sound; - - [DataMember(Name = "Value")] - private Dictionary ValuDictionrary - { - get - { - return value as Dictionary; - } - set - { - value = dictionary; - } - } - - public SettingItemSound() - { - } - - public SettingItemSound(string name, Dictionary value, bool enableSounds = true, int sortIndex = 0) - : base(name, value, sortIndex) - { - EnableSounds = enableSounds; - } - - private SettingItemSound(SettingItemSound P_0) - : base(P_0) - { - EnableSounds = P_0.EnableSounds; - } - - public override SettingItem GetCopy() - { - return new SettingItemSound(this); - } - - protected override bool IsValueTypeValid(object value) - { - return value is Dictionary; - } - - protected override XElement ValueToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), EnableSounds)); - foreach (KeyValuePair item in ValuDictionrary) - { - xElement.Add(item.Value.ToXElement()); - } - return xElement; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - EnableSounds = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); - Dictionary dictionary = new Dictionary(); - foreach (XElement item in xElement.Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - SoundItem soundItem = new SoundItem(); - soundItem.FromXElement(item, deserializationInfo); - dictionary[soundItem.Name] = soundItem; - } - ValuDictionrary = dictionary; - } - } - /// - /// Typecasts setting as TextBox item - /// - [Serializable] - [Published] - [DataContract] - [ProtoContract] - public sealed class SettingItemString : SettingItem - { - [CompilerGenerated] - private bool ??; - - public override SettingItemType Type => SettingItemType.String; - - public bool ApplyOnEachInput - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Value")] - [ProtoMember(1)] - private string ValueString - { - get - { - return Value as string; - } - set - { - Value = text; - } - } - - public SettingItemString() - { - } - - public SettingItemString(string name, string value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemString(SettingItemString P_0) - : base(P_0) - { - } - - [NotPublished] - public static implicit operator string(SettingItemString item) - { - return item.Value as string; - } - - [NotPublished] - public override SettingItem GetCopy() - { - return new SettingItemString(this); - } - - [NotPublished] - protected override bool IsValueTypeValid(object value) - { - return value is string; - } - } - /// - /// Typecasts setting as SymbolLookup item - /// - [Serializable] - [DataContract] - public sealed class SettingItemSymbol : SettingItem - { - public override SettingItemType Type => SettingItemType.Symbol; - - [DataMember(Name = "Value")] - private BusinessObjectInfo ValueInfo - { - get - { - return (Value as Symbol)?.CreateInfo() ?? BusinessObjectInfo.Empty; - } - set - { - if (!(businessObjectInfo == BusinessObjectInfo.Empty) && !(businessObjectInfo == SymbolInfo.Empty)) - { - Value = Core.Instance.GetSymbol(businessObjectInfo); - } - } - } - - public SettingItemSymbol() - { - } - - public SettingItemSymbol(string name, Symbol value = null, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemSymbol(SettingItemSymbol P_0) - : base(P_0) - { - } - - public override SettingItem GetCopy() - { - return new SettingItemSymbol(this); - } - - public static implicit operator Symbol(SettingItemSymbol item) - { - return item.Value as Symbol; - } - - protected override bool IsValueTypeValid(object value) - { - return value is Symbol; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - SymbolInfo empty = SymbolInfo.Empty; - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - empty.FromXElement(xElement, deserializationInfo); - ValueInfo = empty; - } - } - - protected override XElement ValueToXElement() - { - return ValueInfo.ToXElement(); - } - } - /// - /// Typecasts setting as TextBox item - /// - [Serializable] - [DataContract] - [ProtoContract] - public sealed class SettingItemTextArea : SettingItem - { - [CompilerGenerated] - private bool ??; - - public override SettingItemType Type => SettingItemType.TextArea; - - public bool ApplyOnEachInput - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Value")] - [ProtoMember(1)] - private string ValueString - { - get - { - return Value as string; - } - set - { - Value = text; - } - } - - public SettingItemTextArea() - { - } - - public SettingItemTextArea(string name, string value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemTextArea(SettingItemTextArea P_0) - : base(P_0) - { - } - - public override SettingItem GetCopy() - { - return new SettingItemTextArea(this); - } - - public static implicit operator string(SettingItemTextArea item) - { - return item.Value as string; - } - - protected override bool IsValueTypeValid(object value) - { - return value is string; - } - } - public class SettingItemTimeFrameConfig : SettingItem - { - public override SettingItemType Type => SettingItemType.TimeFrameConfig; - - [DataMember(Name = "Value")] - private string ValueString - { - get - { - return Value as string; - } - set - { - Value = text; - } - } - - public SettingItemTimeFrameConfig() - { - } - - public SettingItemTimeFrameConfig(string name, TimeFrameConfig value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemTimeFrameConfig(SettingItemTimeFrameConfig P_0) - : base(P_0) - { - } - - public override SettingItem GetCopy() - { - return new SettingItemTimeFrameConfig(this); - } - - protected override bool IsValueTypeValid(object value) - { - return value is TimeFrameConfig; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - TimeFrameConfig timeFrameConfig = new TimeFrameConfig(); - timeFrameConfig.FromXElement(element, deserializationInfo); - Value = timeFrameConfig; - } - } - public class SettingItemTimeInTradeContainer : SettingItem - { - [DataMember(Name = "Value")] - [ProtoMember(1)] - private TimeInTradeContainer TimeInTradeContainer - { - get - { - return (TimeInTradeContainer)Value; - } - set - { - Value = timeInTradeContainer; - } - } - - public override SettingItemType Type => SettingItemType.TimeInTradeContainer; - - public SettingItemTimeInTradeContainer() - { - } - - public SettingItemTimeInTradeContainer(string name, TimeInTradeContainer timeInTradeCollection, int sortIndex = 0) - : base(name, timeInTradeCollection, sortIndex) - { - } - - public SettingItemTimeInTradeContainer(SettingItemTimeInTradeContainer settingItem) - { - value = ((TimeInTradeContainer)settingItem.Value).Clone(); - } - - public override SettingItem GetCopy() - { - return new SettingItemTimeInTradeContainer(this); - } - - protected override bool IsValueTypeValid(object value) - { - return value is TimeInTradeContainer; - } - - protected override XElement ValueToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - TimeInTradeItem[] timeInTradeItems = TimeInTradeContainer.TimeInTradeItems; - foreach (TimeInTradeItem timeInTradeItem in timeInTradeItems) - { - XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), timeInTradeItem.IsChecked)); - if (timeInTradeItem.Symbol != null) - { - xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), timeInTradeItem.Symbol.CreateInfo().ToXElement())); - } - xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), timeInTradeItem.TimeInSeconds)); - xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)timeInTradeItem.PLDirection)); - xElement.Add(xElement2); - } - return xElement; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - element = xElement; - } - List list = new List(); - IEnumerable enumerable = element.Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (enumerable != null) - { - foreach (XElement item in enumerable) - { - TimeInTradeItem timeInTradeItem = new TimeInTradeItem - { - IsChecked = (item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToBool() ?? false), - TimeInSeconds = (item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToInt() ?? 0), - PLDirection = (TimeInTradePlDirection)(item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToInt() ?? 0) - }; - XElement xElement2 = item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - XElement xElement3 = xElement2.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - BusinessObjectInfo businessObjectInfo = new BusinessObjectInfo(); - businessObjectInfo.FromXElement(xElement3, deserializationInfo); - timeInTradeItem.Symbol = Core.Instance.GetSymbol(businessObjectInfo); - } - } - list.Add(timeInTradeItem); - } - } - Value = new TimeInTradeContainer - { - TimeInTradeItems = list.ToArray() - }; - } - } - [Serializable] - [DataContract] - [ProtoContract] - public sealed class SettingItemTimeZone : SettingItem - { - [CompilerGenerated] - private bool ??; - - [DataMember(Name = "Type")] - [ProtoMember(1)] - private TimeZoneType ??; - - [DataMember(Name = "InfoId")] - [ProtoMember(2)] - private string ??; - - [DataMember(Name = "BaseUtcOffset")] - [ProtoMember(3)] - private TimeSpan ??; - - [DataMember(Name = "DisplayName")] - [ProtoMember(4)] - private string ??; - - [DataMember(Name = "StandardDisplayName")] - [ProtoMember(5)] - private string ??; - - public override SettingItemType Type => SettingItemType.TimeZone; - - public bool IsFavorite - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override object Value - { - get - { - if (?? == TimeZoneType.Local) - { - return new TimeZone(??); - } - TimeZoneInfo timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(??); - if (timeZoneInfo == null) - { - timeZoneInfo = TimeZoneInfo.CreateCustomTimeZone(??, ??, ??, ??); - } - return new TimeZone(??, timeZoneInfo); - } - set - { - base.Value = value; - } - } - - public SettingItemTimeZone() - { - } - - public SettingItemTimeZone(string name, TimeZone value, int sortIndex = 0) - : base(name, value, sortIndex) - { - ?? = value.Type; - ?? = value.TimeZoneInfo.Id; - ?? = value.TimeZoneInfo.BaseUtcOffset; - ?? = value.TimeZoneInfo.DisplayName; - ?? = value.TimeZoneInfo.StandardName; - } - - private SettingItemTimeZone(SettingItemTimeZone P_0) - : base(P_0) - { - ?? = P_0.??; - ?? = P_0.??; - ?? = P_0.??; - ?? = P_0.??; - ?? = P_0.??; - } - - public override SettingItem GetCopy() - { - return new SettingItemTimeZone(this); - } - - public static implicit operator TimeZone(SettingItemTimeZone item) - { - return (TimeZone)item.Value; - } - - protected override bool IsValueTypeValid(object value) - { - return value is TimeZone; - } - - protected override XElement ValueToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)??)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ??)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ??)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ??)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ??)); - return xElement; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - ?? = (TimeZoneType)xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt(); - ?? = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; - ?? = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToTimeSpan(); - ?? = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; - ?? = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; - } - } - } - [Serializable] - [DataContract] - public class SettingItemTimeZoneManager : SettingItemList - { - public override SettingItemType Type => SettingItemType.TimeZoneManager; - - public List FavoriteTimeZones - { - get - { - List list = new List(); - foreach (SettingItemTimeZone item in Value as List) - { - if (item.IsFavorite) - { - list.Add((TimeZone)item.Value); - } - } - return list; - } - } - - [DataMember(Name = "Items")] - protected override List Items - { - get - { - List list = new List(); - foreach (SettingItemTimeZone item in Value as List) - { - if (item.IsFavorite) - { - list.Add(item); - } - } - return list; - } - set - { - Value = ?(value); - } - } - - public SettingItemTimeZoneManager() - { - } - - public SettingItemTimeZoneManager(string name, IList items, int sortIndex = 0) - : base(name, new List(), sortIndex) - { - Value = ?(items); - } - - private SettingItemTimeZoneManager(SettingItemTimeZoneManager P_0) - : base(P_0) - { - Value = ?(CopyItems()); - } - - public override SettingItem GetCopy() - { - return new SettingItemTimeZoneManager(this); - } - - protected override bool IsValueTypeValid(object value) - { - return value is IList; - } - - private new List ?(IList P_0) - { - List list = new List(); - Dictionary dictionary = new Dictionary(); - foreach (SettingItem item in P_0) - { - if (item is SettingItemTimeZone settingItemTimeZone) - { - dictionary[((TimeZone)settingItemTimeZone.Value).TimeZoneInfo.Id] = settingItemTimeZone; - } - } - foreach (TimeZoneInfo systemTimeZone in TimeZoneInfo.GetSystemTimeZones()) - { - SettingItemTimeZone settingItemTimeZone2 = new SettingItemTimeZone(systemTimeZone.Id, new TimeZone(TimeZoneType.Specific, systemTimeZone)); - if (dictionary.ContainsKey(systemTimeZone.Id)) - { - settingItemTimeZone2.IsFavorite = true; - } - list.Add(settingItemTimeZone2); - } - return list; - } - - protected override XElement ValueToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - List items = Items; - for (int i = 0; i < items.Count; i++) - { - xElement.Add(items[i].ToXElement()); - } - return xElement; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - List list = new List(); - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - foreach (XElement item in xElement.Elements()) - { - SettingItemTimeZone settingItemTimeZone = new SettingItemTimeZone(); - settingItemTimeZone.FromXElement(item, deserializationInfo); - list.Add(settingItemTimeZone); - } - } - Items = list; - } - } - [Serializable] - public class SelectItem : IEquatable - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private IComparable ??; - - [CompilerGenerated] - private SettingItemSeparatorGroup ??; - - [CompilerGenerated] - private object ??; - - [CompilerGenerated] - private Action ??; - - public string Text - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IComparable Value - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SettingItemSeparatorGroup SeparatorGroup - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public object SelectConfirmation - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Action Action - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SelectItem(string text, IComparable value = null) - { - Text = text; - Value = value ?? Text; - } - - public SelectItem(string text, int value) - { - Text = text; - Value = value; - } - - public SelectItem(string text, string value) - { - Text = text; - Value = value; - } - - public override string ToString() - { - return Text; - } - - public bool Equals(SelectItem other) - { - if (other == null) - { - return false; - } - if (this == other) - { - return true; - } - return object.Equals(Value, other.Value); - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - if (this == obj) - { - return true; - } - if (obj.GetType() != GetType()) - { - return false; - } - return Equals((SelectItem)obj); - } - - public override int GetHashCode() - { - if (Value == null) - { - return 0; - } - return Value.GetHashCode(); - } - } - public class SettingItemEventArgs : EventArgs - { - public new static SettingItemEventArgs Empty => new SettingItemEventArgs(); - } - public delegate void SettingItemEventHandler(SettingItem sender, SettingItemEventArgs e); - public class SettingsHolder : Dictionary - { - public SettingsHolder(IList settings) - { - if (settings == null) - { - return; - } - foreach (SettingItem setting in settings) - { - if (!ContainsKey(setting.Name)) - { - Add(setting.Name, setting); - } - } - } - } - public sealed class SymbolMap : IDisposable, IUniqueID, ICustomizable, IConnectionStateDependent - { - [CompilerGenerated] - private sealed class ? - { - public SymbolMap ??; - - public Symbol ??; - - internal void ?() - { - ??.?(??.TradableSymbol); - ??.?? = ??; - ??.?(??.QuotesSymbol); - ??.?(??.TradableSymbol); - } - } - - [CompilerGenerated] - private sealed class ? - { - public SymbolMap ??; - - public bool ??; - - internal void ?() - { - ??.?(??.TradableSymbol); - ??.?? = ??; - ??.?(?? ? ??.QuotesSymbol : ??.TradableSymbol); - ??.?(??.TradableSymbol); - } - } - - [CompilerGenerated] - private sealed class ? - { - public SymbolMap ??; - - public Symbol ??; - - public Symbol ??; - - public Action ??; - - internal void ?() - { - ??.?(??); - ??.?(delegate - { - ??.?(??); - ??.?? = ??; - ??.?(??.QuotesSymbol); - ??.?(??); - }); - ??.?(??); - } - - internal void ?() - { - ??.?(??); - ??.?? = ??; - ??.?(??.QuotesSymbol); - ??.?(??); - } - } - - [CompilerGenerated] - private string ??; - - private Symbol ??; - - private Symbol ??; - - [CompilerGenerated] - private Symbol ??; - - [CompilerGenerated] - private Symbol ??; - - [CompilerGenerated] - private Symbol ??; - - [CompilerGenerated] - private Symbol ??; - - private bool ??; - - private readonly ConnectionStateObserver ??; - - public string UniqueId => Id; - - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public Symbol TradableSymbol - { - get - { - return ??; - } - private set - { - if (?? == symbol) - { - return; - } - Symbol ?? = TradableSymbol; - ??.?(delegate - { - ?(??); - symbol.?(delegate - { - ?(symbol); - ?? = symbol; - ?(QuotesSymbol); - ?(symbol); - }); - ?(??); - }); - } - } - - public Symbol QuotesSymbol - { - get - { - return ??; - } - private set - { - if (?? != symbol) - { - TradableSymbol.?(delegate - { - ?(TradableSymbol); - ?? = symbol; - ?(QuotesSymbol); - ?(TradableSymbol); - }); - } - } - } - - public Symbol TickHistorySymbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = symbol; - } - } - - public Symbol MinuteHistorySymbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = symbol; - } - } - - public Symbol DayHistorySymbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = symbol; - } - } - - public Symbol VolumeAnalysisSymbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = symbol; - } - } - - public bool IsActive - { - get - { - return ??; - } - private set - { - if (?? == flag) - { - return; - } - if (TradableSymbol == null) - { - ?? = flag; - return; - } - TradableSymbol.?(delegate - { - ?(TradableSymbol); - ?? = flag; - ?(flag ? QuotesSymbol : TradableSymbol); - ?(TradableSymbol); - }); - } - } - - public IList Settings - { - get - { - return new List - { - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id), - new SettingItemSymbol(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TradableSymbol), - new SettingItemSymbol(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), QuotesSymbol), - new SettingItemSymbol(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TickHistorySymbol), - new SettingItemSymbol(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MinuteHistorySymbol), - new SettingItemSymbol(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), DayHistorySymbol), - new SettingItemSymbol(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), VolumeAnalysisSymbol), - new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsActive) - }; - } - set - { - Id = value.GetValueOrDefault(Id, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - ?? = value.GetValueOrDefault(??, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - ?? = value.GetValueOrDefault(??, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - TickHistorySymbol = value.GetValueOrDefault(TickHistorySymbol, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - MinuteHistorySymbol = value.GetValueOrDefault(MinuteHistorySymbol, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - DayHistorySymbol = value.GetValueOrDefault(DayHistorySymbol, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - VolumeAnalysisSymbol = value.GetValueOrDefault(VolumeAnalysisSymbol, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - IsActive = value.GetValueOrDefault(IsActive, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (value.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value2)) - { - VolumeAnalysisSymbol = value2; - } - else - { - VolumeAnalysisSymbol = DayHistorySymbol ?? MinuteHistorySymbol ?? TickHistorySymbol ?? QuotesSymbol; - } - } - } - - internal SymbolMap() - { - ?? = new ConnectionStateObserver(this, ConnectionStateObserverPriority.High, ConnectionState.Connected, ConnectionState.Disconnected, ConnectionState.ConnectionLost); - } - - internal SymbolMap(Symbol P_0) - : this() - { - Id = Guid.NewGuid().ToString(); - IsActive = true; - ?? = P_0; - } - - internal bool ?(Period P_0, out Symbol P_1) - { - P_1 = null; - if (P_0.BasePeriod >= BasePeriod.Day) - { - P_1 = DayHistorySymbol; - } - else if (P_0.BasePeriod >= BasePeriod.Minute) - { - P_1 = MinuteHistorySymbol; - } - else - { - P_1 = TickHistorySymbol; - } - return P_1 != null; - } - - internal void ?(SymbolMappingParameters P_0, bool P_1 = true) - { - IsActive = P_0.IsActive; - TradableSymbol = P_0.TradableSymbol; - if (P_1) - { - QuotesSymbol = P_0.QuotesSymbol; - } - else - { - ?? = P_0.QuotesSymbol; - } - TickHistorySymbol = P_0.TickHistorySymbol; - MinuteHistorySymbol = P_0.MinuteHistorySymbol; - DayHistorySymbol = P_0.DayHistorySymbol; - VolumeAnalysisSymbol = P_0.VolumeAnalysisSymbol; - } - - internal void ?() - { - QuotesSymbol = null; - TickHistorySymbol = null; - MinuteHistorySymbol = null; - DayHistorySymbol = null; - VolumeAnalysisSymbol = null; - } - - public SymbolMapState GetState() - { - return new SymbolMapState(this); - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(15, 6); - defaultInterpolatedStringHandler.AppendFormatted(TradableSymbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(QuotesSymbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(TickHistorySymbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(MinuteHistorySymbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(DayHistorySymbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(VolumeAnalysisSymbol); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public void Dispose() - { - ??.Dispose(); - } - - public ConnectionDependency GetConnectionStateDependency() - { - List list = new List { TradableSymbol.ConnectionId }; - ?(QuotesSymbol, list); - ?(TickHistorySymbol, list); - ?(MinuteHistorySymbol, list); - ?(DayHistorySymbol, list); - ?(VolumeAnalysisSymbol, list); - return new ConnectionDependency - { - Behavior = ConnectionDependencyBehavior.PartialDependency, - DependentConnectionsIds = list.ToArray() - }; - } - - public void OnConnectionStateChanged(Connection connection, ConnectionStateChangedEventArgs e) - { - string id = connection.Id; - if (TradableSymbol.ConnectionId == id) - { - TradableSymbol = Core.Instance.GetSymbol(TradableSymbol.CreateInfo()); - } - if (QuotesSymbol?.ConnectionId == id) - { - QuotesSymbol = Core.Instance.GetSymbol(QuotesSymbol.CreateInfo()); - } - if (TickHistorySymbol?.ConnectionId == id) - { - TickHistorySymbol = Core.Instance.GetSymbol(TickHistorySymbol.CreateInfo()); - } - if (MinuteHistorySymbol?.ConnectionId == id) - { - MinuteHistorySymbol = Core.Instance.GetSymbol(MinuteHistorySymbol.CreateInfo()); - } - if (DayHistorySymbol?.ConnectionId == id) - { - DayHistorySymbol = Core.Instance.GetSymbol(DayHistorySymbol.CreateInfo()); - } - if (VolumeAnalysisSymbol?.ConnectionId == id) - { - VolumeAnalysisSymbol = Core.Instance.GetSymbol(VolumeAnalysisSymbol.CreateInfo()); - } - } - - private void ?(Symbol P_0, List P_1) - { - if (P_0 != null) - { - P_1.Add(P_0.ConnectionId); - } - } - - private void ?(Symbol P_0) - { - if (P_0.QuotesSubscribed) - { - P_0.SubscribeAction(SubscribeQuoteType.Quote); - } - if (P_0.Level2Subscribed) - { - P_0.SubscribeAction(SubscribeQuoteType.Level2); - } - if (P_0.LastsSubscribed) - { - P_0.SubscribeAction(SubscribeQuoteType.Last); - } - if (P_0.MarkSubscribed) - { - P_0.SubscribeAction(SubscribeQuoteType.Mark); - } - } - - private void ?(Symbol P_0) - { - if (P_0.QuotesSubscribed) - { - P_0.UnSubscribeAction(SubscribeQuoteType.Quote); - } - if (P_0.Level2Subscribed) - { - P_0.UnSubscribeAction(SubscribeQuoteType.Level2); - } - if (P_0.LastsSubscribed) - { - P_0.UnSubscribeAction(SubscribeQuoteType.Last); - } - if (P_0.MarkSubscribed) - { - P_0.UnSubscribeAction(SubscribeQuoteType.Mark); - } - } - - private void ?(Symbol P_0) - { - if (P_0 != null && TradableSymbol.HasAnySubscription) - { - DayBar dayBar = ?(P_0); - dayBar.FullRefresh = true; - TradableSymbol.?(dayBar); - } - } - - private DayBar ?(Symbol P_0) - { - return ((IMessageBuilder)P_0).BuildMessage(); - } - } - public class SymbolMappingParameters - { - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private Symbol ??; - - [CompilerGenerated] - private Symbol ??; - - [CompilerGenerated] - private Symbol ??; - - [CompilerGenerated] - private Symbol ??; - - [CompilerGenerated] - private Symbol ??; - - [CompilerGenerated] - private Symbol ??; - - public bool IsActive - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Symbol TradableSymbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Symbol QuotesSymbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Symbol TickHistorySymbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Symbol MinuteHistorySymbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Symbol DayHistorySymbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Symbol VolumeAnalysisSymbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SymbolMappingParameters(Symbol tradableSymbol) - { - TradableSymbol = tradableSymbol; - } - - public SymbolMappingParameters(SymbolMap symbolMap) - { - IsActive = symbolMap.IsActive; - TradableSymbol = symbolMap.TradableSymbol; - QuotesSymbol = symbolMap.QuotesSymbol; - TickHistorySymbol = symbolMap.TickHistorySymbol; - MinuteHistorySymbol = symbolMap.MinuteHistorySymbol; - DayHistorySymbol = symbolMap.DayHistorySymbol; - VolumeAnalysisSymbol = symbolMap.VolumeAnalysisSymbol; - } - } - public sealed class SymbolMapState - { - [CompilerGenerated] - private readonly bool ??; - - [CompilerGenerated] - private readonly Symbol ??; - - [CompilerGenerated] - private readonly Symbol ??; - - [CompilerGenerated] - private readonly Symbol ??; - - [CompilerGenerated] - private readonly Symbol ??; - - [CompilerGenerated] - private readonly Symbol ??; - - [CompilerGenerated] - private readonly Symbol ??; - - public bool IsActive - { - [CompilerGenerated] - get - { - return ??; - } - } - - public Symbol TradableSymbol - { - [CompilerGenerated] - get - { - return ??; - } - } - - public Symbol QuotesSymbol - { - [CompilerGenerated] - get - { - return ??; - } - } - - public Symbol TickHistorySymbol - { - [CompilerGenerated] - get - { - return ??; - } - } - - public Symbol MinuteHistorySymbol - { - [CompilerGenerated] - get - { - return ??; - } - } - - public Symbol DayHistorySymbol - { - [CompilerGenerated] - get - { - return ??; - } - } - - public Symbol VolumeAnalysisSymbol - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal SymbolMapState(SymbolMap P_0) - { - ?? = P_0.IsActive; - ?? = P_0.TradableSymbol; - ?? = P_0.QuotesSymbol; - ?? = P_0.TickHistorySymbol; - ?? = P_0.MinuteHistorySymbol; - ?? = P_0.DayHistorySymbol; - ?? = P_0.VolumeAnalysisSymbol; - } - } - public class SymbolsMappingEventArgs : EventArgs - { - [CompilerGenerated] - private SymbolMap ??; - - [CompilerGenerated] - private readonly SymbolMapState ??; - - public SymbolMap SymbolMap - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = symbolMap; - } - } - - public SymbolMapState PreviousState - { - [CompilerGenerated] - get - { - return ??; - } - } - - public SymbolsMappingEventArgs(SymbolMap symbolMap, SymbolMapState previousState = null) - { - SymbolMap = symbolMap; - ?? = previousState; - } - } - public class SymbolsMappingManager : ICustomizable - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - internal Symbol ?(SymbolMapState P_0) - { - return P_0.QuotesSymbol; - } - - internal Symbol ?(SymbolMapState P_0) - { - return P_0.TickHistorySymbol; - } - - internal Symbol ?(SymbolMapState P_0) - { - return P_0.MinuteHistorySymbol; - } - - internal Symbol ?(SymbolMapState P_0) - { - return P_0.DayHistorySymbol; - } - - internal Symbol ?(SymbolMapState P_0) - { - return P_0.VolumeAnalysisSymbol; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - internal bool ?(SymbolMap P_0) - { - return P_0.TradableSymbol.Equals(??); - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - internal bool ?(Symbol P_0) - { - return P_0.Equals(??); - } - } - - [CompilerGenerated] - private EventHandler ??; - - [CompilerGenerated] - private EventHandler ??; - - [CompilerGenerated] - private EventHandler ??; - - [CompilerGenerated] - private EventHandler ??; - - [CompilerGenerated] - private EventHandler ??; - - private readonly Dictionary ??; - - private readonly object ??; - - public IList Settings - { - get - { - List list = new List(); - lock (??) - { - foreach (KeyValuePair item in ??) - { - list.Add(new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), item.Value.Settings)); - } - return list; - } - } - set - { - foreach (SettingItem item in value) - { - if (!(item.Name != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) && item.Value is IList settings) - { - SymbolMap symbolMap = new SymbolMap - { - Settings = settings - }; - lock (??) - { - ??.Add(symbolMap.Id, symbolMap); - } - } - } - } - } - - public SymbolMap[] AllMaps - { - get - { - lock (??) - { - return ??.Values.ToArray(); - } - } - } - - public event EventHandler MapAdded - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - public event EventHandler MapUpdating - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - public event EventHandler MapUpdated - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - public event EventHandler MapDeleting - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - public event EventHandler MapDeleted - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - internal SymbolsMappingManager() - { - ?? = new Dictionary(); - ?? = new object(); - } - - internal void ?() - { - } - - public string AddSymbolMap(SymbolMappingParameters parameters) - { - SymbolMap symbolMap; - lock (??) - { - ?(parameters, null); - symbolMap = new SymbolMap(parameters.TradableSymbol); - ??.Add(symbolMap.Id, symbolMap); - symbolMap.?(parameters); - } - ?(symbolMap); - return symbolMap.Id; - } - - public void UpdateSymbolMap(string symbolMapId, SymbolMappingParameters parameters) - { - if (string.IsNullOrEmpty(symbolMapId)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - SymbolMap symbolMap; - SymbolMapState state; - lock (??) - { - symbolMap = ??[symbolMapId]; - ?(parameters, symbolMapId); - ?(symbolMap); - state = symbolMap.GetState(); - symbolMap.?(parameters, parameters.IsActive && state.IsActive == parameters.IsActive); - } - ?(symbolMap, state); - } - - public void DeleteSymbolMap(string symbolMapId) - { - if (string.IsNullOrEmpty(symbolMapId)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - SymbolMap symbolMap; - lock (??) - { - symbolMap = ??[symbolMapId]; - ?(symbolMap); - symbolMap.?(); - ??.Remove(symbolMapId); - } - symbolMap.Dispose(); - ?(symbolMap); - } - - public void DeleteAllMaps() - { - SymbolMap[] allMaps = AllMaps; - foreach (SymbolMap symbolMap in allMaps) - { - ?(symbolMap); - symbolMap.?(); - lock (??) - { - ??.Remove(symbolMap.Id); - } - ?(symbolMap); - } - } - - public bool TryGetSymbolMapState(Symbol symbol, out SymbolMapState mapState) - { - SymbolMap symbolMap = ?(symbol); - if (symbolMap != null) - { - mapState = new SymbolMapState(symbolMap); - } - else - { - mapState = null; - } - return mapState != null; - } - - public bool TryGetQuotesSymbol(Symbol tradableSymbol, out Symbol quotesSymbol) - { - quotesSymbol = null; - lock (??) - { - SymbolMap symbolMap = ?(tradableSymbol); - if (symbolMap == null || !symbolMap.IsActive) - { - return false; - } - quotesSymbol = symbolMap.QuotesSymbol; - } - return quotesSymbol != null; - } - - public bool TryGetHistorySymbol(Symbol tradableSymbol, Period period, out Symbol historySymbol) - { - lock (??) - { - int num = 0; - Symbol symbol = null; - while (?(tradableSymbol, period, out historySymbol)) - { - symbol = historySymbol; - num++; - if (historySymbol.Id == tradableSymbol.Id) - { - break; - } - tradableSymbol = historySymbol; - } - historySymbol = symbol; - return num > 0; - } - } - - public bool TryGetVolumeAnalysisSymbol(Symbol tradableSymbol, out Symbol volumeAnalysisSymbol) - { - lock (??) - { - int num = 0; - Symbol symbol = null; - while (?(tradableSymbol, out volumeAnalysisSymbol)) - { - symbol = volumeAnalysisSymbol; - num++; - if (volumeAnalysisSymbol.Id == tradableSymbol.Id) - { - break; - } - tradableSymbol = volumeAnalysisSymbol; - } - volumeAnalysisSymbol = symbol; - return num > 0; - } - } - - private bool ?(Symbol P_0, Period P_1, out Symbol P_2) - { - P_2 = null; - SymbolMap symbolMap = ?(P_0); - if (symbolMap == null || !symbolMap.IsActive) - { - return false; - } - return symbolMap.?(P_1, out P_2); - } - - private bool ?(Symbol P_0, out Symbol P_1) - { - P_1 = null; - SymbolMap symbolMap = ?(P_0); - if (symbolMap == null || !symbolMap.IsActive) - { - return false; - } - P_1 = symbolMap.VolumeAnalysisSymbol; - return true; - } - - private SymbolMap ?(Symbol P_0) - { - return ??.Values.SingleOrDefault((SymbolMap symbolMap) => symbolMap.TradableSymbol.Equals(P_0)); - } - - private void ?(SymbolMappingParameters P_0, string P_1 = null) - { - if (P_0 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (P_0.TradableSymbol == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ?(P_0, P_1); - ?(P_0); - } - - private void ?(SymbolMappingParameters P_0, string P_1 = null) - { - SymbolMap symbolMap = ?(P_0.TradableSymbol); - bool num; - if (!string.IsNullOrEmpty(P_1)) - { - if (symbolMap == null) - { - return; - } - num = symbolMap.Id != P_1; - } - else - { - num = symbolMap != null; - } - if (num) - { - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.TradableSymbol.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - private void ?(SymbolMappingParameters P_0) - { - if (P_0.TradableSymbol.Equals(P_0.QuotesSymbol)) - { - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (P_0.TradableSymbol.Equals(P_0.TickHistorySymbol)) - { - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (P_0.TradableSymbol.Equals(P_0.MinuteHistorySymbol)) - { - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (P_0.TradableSymbol.Equals(P_0.DayHistorySymbol)) - { - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (P_0.TradableSymbol.Equals(P_0.VolumeAnalysisSymbol)) - { - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - private void ?(SymbolMappingParameters P_0) - { - ?(P_0.TradableSymbol, P_0.QuotesSymbol, (SymbolMapState symbolMapState) => symbolMapState.QuotesSymbol); - ?(P_0.TradableSymbol, P_0.TickHistorySymbol, (SymbolMapState symbolMapState) => symbolMapState.TickHistorySymbol); - ?(P_0.TradableSymbol, P_0.MinuteHistorySymbol, (SymbolMapState symbolMapState) => symbolMapState.MinuteHistorySymbol); - ?(P_0.TradableSymbol, P_0.DayHistorySymbol, (SymbolMapState symbolMapState) => symbolMapState.DayHistorySymbol); - ?(P_0.TradableSymbol, P_0.VolumeAnalysisSymbol, (SymbolMapState symbolMapState) => symbolMapState.VolumeAnalysisSymbol); - } - - private void ?(Symbol P_0, Symbol P_1, Func P_2) - { - if (P_0.Equals(P_1)) - { - return; - } - Symbol[] array = GetSymbolsChainRecursive(P_1, P_2).ToArray(); - if (!array.Any((Symbol symbol2) => symbol2.Equals(P_0))) - { - return; - } - StringBuilder stringBuilder = new StringBuilder(P_0.Name); - Symbol[] array2 = array; - foreach (Symbol symbol in array2) - { - stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - stringBuilder.Append(symbol.Name); - if (symbol.Equals(P_0)) - { - break; - } - } - string text = stringBuilder.ToString(); - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - - public IEnumerable GetSymbolsChainRecursive(Symbol mappedSymbol, Func getMappedSymbolFromMap) - { - yield return mappedSymbol; - SymbolMap symbolMap = ?(mappedSymbol); - if (symbolMap == null) - { - yield break; - } - Symbol symbol = getMappedSymbolFromMap(symbolMap.GetState()); - if (mappedSymbol.Equals(symbol)) - { - yield break; - } - foreach (Symbol item in GetSymbolsChainRecursive(symbol, getMappedSymbolFromMap)) - { - yield return item; - } - } - - private void ?(SymbolMap P_0) - { - ???.Invoke(this, new SymbolsMappingEventArgs(P_0)); - } - - private void ?(SymbolMap P_0) - { - ???.Invoke(this, new SymbolsMappingEventArgs(P_0)); - } - - private void ?(SymbolMap P_0, SymbolMapState P_1) - { - ???.Invoke(this, new SymbolsMappingEventArgs(P_0, P_1)); - } - - private void ?(SymbolMap P_0) - { - ???.Invoke(this, new SymbolsMappingEventArgs(P_0)); - } - - private void ?(SymbolMap P_0) - { - ???.Invoke(this, new SymbolsMappingEventArgs(P_0)); - } - } - public class AdvancedTradingOperations - { - private class ? - { - [CompilerGenerated] - private readonly Position ??; - - [CompilerGenerated] - private readonly IList ??; - - [CompilerGenerated] - private readonly SlTpHolder ??; - - public Position Position - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = position; - } - } - - public IList Brackets - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = list; - } - } - - public SlTpHolder InitialBracketParameters - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = slTpHolder; - } - } - } - - private class ?(Symbol, Account) : IEquatable - { - [CompilerGenerated] - private readonly Symbol ??; - - [CompilerGenerated] - private readonly Account ??; - - [CompilerGenerated] - protected virtual Type EqualityContract - { - [CompilerGenerated] - get - { - return typeof(?); - } - } - - public Symbol Symbol - { - [CompilerGenerated] - get - { - return P_0; - } - [CompilerGenerated] - init - { - P_0 = symbol; - } - } - - public Account Account - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = account; - } - } - - public ?(Symbol P_0, Account P_1) - { - ?? = P_0; - ?? = P_1; - base..ctor(); - } - - [CompilerGenerated] - public override string ToString() - { - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (?(stringBuilder)) - { - stringBuilder.Append(' '); - } - stringBuilder.Append('}'); - return stringBuilder.ToString(); - } - - [CompilerGenerated] - protected virtual bool ?(StringBuilder P_0) - { - RuntimeHelpers.EnsureSufficientExecutionStack(); - P_0.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - P_0.Append(Symbol); - P_0.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - P_0.Append(Account); - return true; - } - - [CompilerGenerated] - public static bool operator !=(?? P_0, ?? P_1) - { - return !(P_0 == P_1); - } - - [CompilerGenerated] - public static bool operator ==(?? P_0, ?? P_1) - { - if ((object)P_0 != P_1) - { - return P_0?.Equals(P_1) ?? false; - } - return true; - } - - [CompilerGenerated] - public override int GetHashCode() - { - return (EqualityComparer.Default.GetHashCode(EqualityContract) * -1521134295 + EqualityComparer.Default.GetHashCode(P_0)) * -1521134295 + EqualityComparer.Default.GetHashCode(??); - } - - [CompilerGenerated] - public override bool Equals(object? obj) - { - return Equals(obj as ?); - } - - [CompilerGenerated] - public virtual bool Equals(?? other) - { - if ((object)this != other) - { - if ((object)other != null && EqualityContract == other.EqualityContract && EqualityComparer.Default.Equals(P_0, other.P_0)) - { - return EqualityComparer.Default.Equals(??, other.??); - } - return false; - } - return true; - } - - [CompilerGenerated] - public virtual ? ?() - { - return new ?(this); - } - - [CompilerGenerated] - protected ?(? original) - { - ?? = original.??; - ?? = original.??; - } - - [CompilerGenerated] - public void ?(out Symbol P_0, out Account P_1) - { - P_0 = Symbol; - P_1 = Account; - } - } - - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - internal Symbol ?(IOrder P_0) - { - return P_0.Symbol; - } - - internal IOrder ?(IOrder P_0) - { - return P_0; - } - - internal Connection ?(IOrder P_0) - { - return P_0.Symbol.Connection; - } - - internal Symbol ?(IOrder P_0) - { - return P_0.Symbol; - } - - internal Account ?(IOrder P_0) - { - return P_0.Account; - } - - internal ? ?(IOrder P_0) - { - return new ?(P_0.Symbol, P_0.Account); - } - - internal string ?(IOrder P_0) - { - return P_0.Id; - } - - internal bool ?(Position P_0) - { - return true; - } - - internal bool ?(Position P_0) - { - return true; - } - - internal bool ?(Position P_0) - { - return true; - } - - internal bool ?(Position P_0) - { - return true; - } - - internal bool ?(OrderType P_0) - { - if (P_0.Behavior == OrderTypeBehavior.Market) - { - return (P_0.Usage & OrderTypeUsage.Order) == OrderTypeUsage.Order; - } - return false; - } - - internal bool ?(Order P_0) - { - OrderTypeBehavior behavior = P_0.OrderType.Behavior; - if ((uint)(behavior - 3) <= 1u) - { - return true; - } - return false; - } - - internal bool ?(OrderType P_0) - { - return P_0.Behavior == OrderTypeBehavior.Stop; - } - - internal bool ?(Order P_0) - { - return string.IsNullOrEmpty(P_0.GroupId); - } - - internal string ?(Order P_0) - { - return P_0.GroupId; - } - - internal bool ?(Order P_0) - { - return string.IsNullOrEmpty(P_0.GroupId); - } - - internal string ?(Order P_0) - { - return P_0.GroupId; - } - - internal double ?(Order P_0) - { - return P_0.GetExecutionPrice(); - } - - internal bool ?(Order P_0) - { - return string.IsNullOrEmpty(P_0.GroupId); - } - - internal Order ?(Order P_0, Order P_1) - { - if (!(P_0.RemainingQuantity > P_1.RemainingQuantity)) - { - return P_1; - } - return P_0; - } - - internal bool ?(Order P_0) - { - return string.IsNullOrEmpty(P_0.GroupId); - } - - internal Order ?(Order P_0, Order P_1) - { - if (!(P_0.RemainingQuantity > P_1.RemainingQuantity)) - { - return P_1; - } - return P_0; - } - - internal double ?(Order P_0) - { - return P_0.GetExecutionPrice(); - } - - internal double ?(Order P_0) - { - return P_0.GetExecutionPrice(); - } - - internal (double, double) ?(Order P_0) - { - return (P_0.GetExecutionPrice(), P_0.RemainingQuantity); - } - - internal string ?(Order P_0) - { - return P_0.Id; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - public Account ??; - - public TimeInForce ??; - - internal bool ?(IOrder P_0) - { - if (??.IsSameAs(P_0.Symbol) && P_0.Account.Equals(??)) - { - return P_0.TimeInForce == ??; - } - return false; - } - } - - [CompilerGenerated] - private sealed class ? - { - public TimeInForce ??; - - internal bool ?(IOrder P_0) - { - return P_0.TimeInForce == ??; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - public OrderTypeBehavior ??; - - internal bool ?(IOrder P_0) - { - if (??.IsSameAs(P_0.Symbol)) - { - return P_0.OrderType.Behavior == ??; - } - return false; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - public Account ??; - - public OrderTypeBehavior ??; - - internal bool ?(IOrder P_0) - { - if (??.IsSameAs(P_0.Symbol) && P_0.Account.Equals(??)) - { - return P_0.OrderType.Behavior == ??; - } - return false; - } - } - - [CompilerGenerated] - private sealed class ? - { - public OrderTypeBehavior ??; - - internal bool ?(IOrder P_0) - { - return P_0.OrderType.Behavior == ??; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Connection ??; - - internal bool ?(IOrder P_0) - { - return P_0.ConnectionId == ??.Id; - } - - internal bool ?(IOrder P_0) - { - return P_0.ConnectionId == ??.Id; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - internal bool ?(IOrder P_0) - { - return ??.IsSameAs(P_0.Symbol); - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - public Account ??; - - internal bool ?(Order P_0) - { - if (P_0.Symbol.Equals(??)) - { - return P_0.Account.Equals(??); - } - return false; - } - - internal bool ?(IOrder P_0) - { - if (??.IsSameAs(P_0.Symbol)) - { - return P_0.Account.Equals(??); - } - return false; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Func ??; - - public Func ??; - - internal bool ?(IOrder P_0) - { - if (?? != null) - { - return ??(P_0); - } - return true; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Account ??; - - internal bool ?(Position P_0) - { - return P_0.Account.Equals(??); - } - } - - [CompilerGenerated] - private sealed class ? - { - public Side ??; - - internal bool ?(Position P_0) - { - return P_0.Side == ??; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - public Side ??; - - internal bool ?(Position P_0) - { - if (??.IsSameAs(P_0.Symbol)) - { - return P_0.Side == ??; - } - return false; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - internal bool ?(Position P_0) - { - return ??.IsSameAs(P_0.Symbol); - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - internal bool ?(Position P_0) - { - return ??.IsSameAs(P_0.Symbol); - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - internal bool ?(Position P_0) - { - return ??.IsSameAs(P_0.Symbol); - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - public Account ??; - - internal bool ?(Position P_0) - { - if (??.IsSameAs(P_0.Symbol)) - { - return P_0.Account.Equals(??); - } - return false; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Func ??; - - internal bool ?(Position P_0) - { - PnLItem pnLItem = P_0.NetPnL ?? P_0.GrossPnL; - if (pnLItem != null && pnLItem.Value > 0.0) - { - if (?? != null) - { - return ??(P_0); - } - return true; - } - return false; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Func ??; - - internal bool ?(Position P_0) - { - PnLItem pnLItem = P_0.NetPnL ?? P_0.GrossPnL; - if (pnLItem != null && pnLItem.Value < 0.0) - { - if (?? != null) - { - return ??(P_0); - } - return true; - } - return false; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Func ??; - - public Func ??; - - internal bool ?(Position P_0) - { - if (?? != null) - { - return ??(P_0); - } - return true; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - internal bool ?(Position P_0) - { - return P_0.Symbol.IsSameAs(??); - } - } - - [CompilerGenerated] - private sealed class ? - { - public Account ??; - - internal bool ?(Position P_0) - { - return P_0.Account.Equals(??); - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - public Account ??; - - internal bool ?(Position P_0) - { - if (P_0.Symbol.IsSameAs(??)) - { - return P_0.Account.Equals(??); - } - return false; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - public Account ??; - - public Func ??; - - public Func ??; - - internal bool ?(Order P_0) - { - if (P_0.Symbol.Equals(??)) - { - return P_0.Account.Equals(??); - } - return false; - } - - internal bool ?(Order P_0) - { - return P_0.Symbol.Equals(??); - } - } - - [CompilerGenerated] - private sealed class ? - { - public Position ??; - - internal bool ?(Order P_0) - { - return P_0.PositionId == ??.Id; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Account ??; - - internal bool ?(IOrder P_0) - { - return P_0.Account.Equals(??); - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - public Account ??; - - public Position ??; - - internal bool ?(Position P_0) - { - if (P_0.ConnectionId == ??.ConnectionId && ??.IsSameAs(P_0.Symbol)) - { - return P_0.Account.Id == ??.Id; - } - return false; - } - - internal bool ?(Order P_0) - { - if (P_0.ConnectionId == ??.ConnectionId && ??.IsSameAs(P_0.Symbol)) - { - return P_0.Account.Id == ??.Id; - } - return false; - } - - internal bool ?(Order P_0) - { - if (P_0.OrderType.Behavior == OrderTypeBehavior.Stop) - { - return P_0.Side != ??.Side; - } - return false; - } - - internal bool ?(Order P_0) - { - if (P_0.OrderType.Behavior == OrderTypeBehavior.Stop) - { - return P_0.Side != ??.Side; - } - return false; - } - } - - [CompilerGenerated] - private sealed class ? - { - public TaskCompletionSource ??; - - internal void ?(OrderHistory P_0) - { - OrderStatus status = P_0.Status; - if ((status == OrderStatus.Opened || status == OrderStatus.Refused) ? true : false) - { - ??.SetResult(P_0); - } - } - - internal void ?() - { - ??.TrySetCanceled(); - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - public Position ??; - - internal bool ?(Order P_0) - { - if (??.IsSameAs(P_0.Symbol) && P_0.Account.Equals(??.Account) && P_0.Side != ??.Side) - { - if (P_0.Side != Side.Buy) - { - return P_0.GetExecutionPrice() < ??.OpenPrice; - } - return P_0.GetExecutionPrice() > ??.OpenPrice; - } - return false; - } - - internal bool ?(Order P_0) - { - if (??.IsSameAs(P_0.Symbol) && P_0.Account.Equals(??.Account) && P_0.Side != ??.Side) - { - if (P_0.Side != Side.Buy) - { - return P_0.GetExecutionPrice() > ??.OpenPrice; - } - return P_0.GetExecutionPrice() < ??.OpenPrice; - } - return false; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Order ??; - - internal bool ?(Order P_0) - { - return P_0.OrderTypeId != ??.OrderTypeId; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Order ??; - - internal bool ?(Order P_0) - { - return P_0.Id != ??.Id; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Order ??; - - internal bool ?(Order P_0) - { - return P_0.Id != ??.Id; - } - } - - [CompilerGenerated] - private sealed class ? - { - public ManualResetEventSlim ??; - - public string ??; - - public PlaceOrderRequestParameters ??; - - internal void ?(Order P_0) - { - if (!??.IsSet) - { - if (!string.IsNullOrEmpty(??) && P_0.Id == ??) - { - ??.Set(); - } - else if (??.IsCorrespondingOrder(P_0)) - { - ??.Set(); - } - } - } - } - - [CompilerGenerated] - private sealed class ? - { - public ManualResetEventSlim ??; - - public ModifyOrderRequestParameters ??; - - internal void ?(Order P_0) - { - if (!??.IsSet && ??.IsCorrespondingOrder(P_0)) - { - ??.Set(); - } - } - } - - [CompilerGenerated] - private sealed class ? - { - public HashSet ??; - - public ManualResetEvent ??; - - internal void ?(Order P_0) - { - ??.Remove(P_0.Id); - if (??.Count == 0) - { - ??.Set(); - } - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - public Side ??; - - internal bool ?(IOrder P_0) - { - if (??.IsSameAs(P_0.Symbol)) - { - return P_0.Side == ??; - } - return false; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - public Account ??; - - public Side ??; - - internal bool ?(IOrder P_0) - { - if (??.IsSameAs(P_0.Symbol) && P_0.Account.Equals(??)) - { - return P_0.Side == ??; - } - return false; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Side ??; - - internal bool ?(IOrder P_0) - { - return P_0.Side == ??; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Symbol ??; - - public TimeInForce ??; - - internal bool ?(IOrder P_0) - { - if (??.IsSameAs(P_0.Symbol)) - { - return P_0.TimeInForce == ??; - } - return false; - } - } - - internal AdvancedTradingOperations() - { - } - - /// - /// Cancel all pending s - /// - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult CancelOrders([CallerMemberName] string sendingSource = null) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + sendingSource); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.None); - return ?(sendingSource, groupTradingOperation); - } - - /// - /// Cancel all pending s - /// - /// s to cancel - /// the name of the initiator of the call (optional) - /// - public AdvancedTradingOperationResult CancelOrders(IOrder[] orders, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(67, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(orders.Length); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.CertainOrders); - foreach (IGrouping item in from P_0 in orders - group P_0 by P_0.Symbol) - { - Symbol key = item.Key; - IOrder[] array = item.ToArray(); - advancedTradingOperationResult.?(?(key, array, sendingSource, groupTradingOperation)); - } - return advancedTradingOperationResult; - } - - /// - /// Cancel all pending s by - /// - /// - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult CancelOrders(Symbol symbol, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(62, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Symbol); - return ?(symbol, Array.Empty(), sendingSource, groupTradingOperation); - } - - /// - /// Cancel all pending s by - /// - /// - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult CancelOrders(Account account, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(63, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(account); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Account); - return ?((IOrder P_0) => P_0.Account.Equals(account), sendingSource, groupTradingOperation); - } - - /// - /// Cancel all pending s by and - /// - /// - /// - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult CancelOrders(Symbol symbol, Account account, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(74, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(account); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.Account); - return ?(symbol, account, sendingSource, groupTradingOperation); - } - - /// - /// Cancel all pending s by and - /// - /// - /// - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult CancelOrders(Symbol symbol, Side side, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(71, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.Side); - return ?((IOrder P_0) => symbol.IsSameAs(P_0.Symbol) && P_0.Side == side, sendingSource, groupTradingOperation); - } - - /// - /// Cancel all pending s by , and - /// - /// - /// - /// - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult CancelOrders(Symbol symbol, Account account, Side side, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(83, 4); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(account); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.Account | GroupTradingOperationFilters.Side); - return ?((IOrder P_0) => symbol.IsSameAs(P_0.Symbol) && P_0.Account.Equals(account) && P_0.Side == side, sendingSource, groupTradingOperation); - } - - /// - /// Cancel all pending s by - /// - /// - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult CancelOrders(Side side, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(60, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Side); - return ?((IOrder P_0) => P_0.Side == side, sendingSource, groupTradingOperation); - } - - /// - /// Cancel all pending s by and - /// - /// - /// - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult CancelOrders(Symbol symbol, TimeInForce timeInForce, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(80, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(timeInForce); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.TimeInForce); - return ?((IOrder P_0) => symbol.IsSameAs(P_0.Symbol) && P_0.TimeInForce == timeInForce, sendingSource, groupTradingOperation); - } - - /// - /// Cancel all pending s by , and - /// - /// - /// - /// - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult CancelOrders(Symbol symbol, Account account, TimeInForce timeInForce, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(92, 4); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(account); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(timeInForce); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.Account | GroupTradingOperationFilters.TimeInForce); - return ?((IOrder P_0) => symbol.IsSameAs(P_0.Symbol) && P_0.Account.Equals(account) && P_0.TimeInForce == timeInForce, sendingSource, groupTradingOperation); - } - - /// - /// Cancel all pending s by - /// - /// - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult CancelOrders(TimeInForce timeInForce, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(69, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(timeInForce); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.TimeInForce); - return ?((IOrder P_0) => P_0.TimeInForce == timeInForce, sendingSource, groupTradingOperation); - } - - /// - /// Cancel all pending s by and - /// - /// - /// - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult CancelOrders(Symbol symbol, OrderTypeBehavior orderTypeBehavior, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(77, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(orderTypeBehavior); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.OrderType); - return ?((IOrder P_0) => symbol.IsSameAs(P_0.Symbol) && P_0.OrderType.Behavior == orderTypeBehavior, sendingSource, groupTradingOperation); - } - - /// - /// Cancel all pending s by , and - /// - /// - /// - /// - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult CancelOrders(Symbol symbol, Account account, OrderTypeBehavior orderTypeBehavior, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(98, 4); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(account); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(orderTypeBehavior); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.Account | GroupTradingOperationFilters.OrderType); - return ?((IOrder P_0) => symbol.IsSameAs(P_0.Symbol) && P_0.Account.Equals(account) && P_0.OrderType.Behavior == orderTypeBehavior, sendingSource, groupTradingOperation); - } - - /// - /// Cancel all pending s by - /// - /// - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult CancelOrders(OrderTypeBehavior orderTypeBehavior, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(75, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(orderTypeBehavior); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.OrderType); - return ?((IOrder P_0) => P_0.OrderType.Behavior == orderTypeBehavior, sendingSource, groupTradingOperation); - } - - private static AdvancedTradingOperationResult ?(string P_0, GroupTradingOperation P_1) - { - Connection[] array = (from order in ?() - select order.Symbol.Connection).Distinct().ToArray(); - AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); - Connection[] array2 = array; - foreach (Connection connection in array2) - { - advancedTradingOperationResult.?(?(connection, P_0, P_1)); - } - return advancedTradingOperationResult; - } - - private static AdvancedTradingOperationResult ?(Connection P_0, string P_1, GroupTradingOperation P_2 = null) - { - bool flag = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Id).Status == TradingOperationStatus.Allowed; - bool flag2 = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Id).Status == TradingOperationStatus.Allowed; - bool flag3 = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Id).Status == TradingOperationStatus.Allowed; - IOrder[] source = (from order in ?() - where order.ConnectionId == P_0.Id - select order).ToArray(); - Symbol[] array = source.Select((IOrder order) => order.Symbol).Distinct().ToArray(); - Account[] array2 = source.Select((IOrder order) => order.Account).Distinct().ToArray(); - if (flag && (!flag2 || array.Length <= array2.Length)) - { - Symbol[] array3 = array; - foreach (Symbol symbol in array3) - { - P_0.SendCustomRequest(new CancelAllOpenOrdersOnSymbolRequest(symbol.ComplexId) - { - ParentOperation = P_2, - SendingSource = P_1 - }); - } - return AdvancedTradingOperationResult.?(); - } - if (flag2 && (!flag || array.Length > array2.Length)) - { - Account[] array4 = array2; - foreach (Account account in array4) - { - P_0.SendCustomRequest(new CancelAllOpenOrdersOnAccountRequest(account.Id) - { - ParentOperation = P_2, - SendingSource = P_1 - }); - } - return AdvancedTradingOperationResult.?(); - } - if (flag3) - { - ?[] array5 = source.Select((IOrder order) => new ?(order.Symbol, order.Account)).Distinct().ToArray(); - foreach (? ? in array5) - { - P_0.SendCustomRequest(new CancelAllOpenOrdersOnSymbolAndAccountRequest(?.Symbol.ComplexId, ?.Account.Id) - { - ParentOperation = P_2, - SendingSource = P_1 - }); - } - return AdvancedTradingOperationResult.?(); - } - if ((object)P_2 == null) - { - P_2 = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Connection); - } - return ?((IOrder order) => order.ConnectionId == P_0.Id, P_1, P_2); - } - - private static AdvancedTradingOperationResult ?(Symbol P_0, IOrder[] P_1, string P_2, GroupTradingOperation P_3) - { - if (P_0 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - if (Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0).Status == TradingOperationStatus.Allowed) - { - P_0.Connection.SendCustomRequest(new CancelAllOpenOrdersOnSymbolRequest(P_0.ComplexId, P_1?.Select((IOrder order) => order.Id).ToArray()) - { - ParentOperation = P_3, - SendingSource = P_2 - }); - return AdvancedTradingOperationResult.?(); - } - if (P_1 == null || P_1.Length == 0) - { - return ?((IOrder order) => P_0.IsSameAs(order.Symbol), P_2, P_3); - } - return ?(((IEnumerable)P_1).Contains, P_2, P_3); - } - - private static AdvancedTradingOperationResult ?(Symbol P_0, Account P_1, string P_2, GroupTradingOperation P_3) - { - if (P_0 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - if (P_1 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - if (Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_1, P_0).Status == TradingOperationStatus.Allowed && Core.Instance.Orders.Any((Order order) => order.Symbol.Equals(P_0) && order.Account.Equals(P_1))) - { - P_0.Connection.SendCustomRequest(new CancelAllOpenOrdersOnSymbolAndAccountRequest(P_0.ComplexId, P_1.Id) - { - ParentOperation = P_3, - SendingSource = P_2 - }); - return AdvancedTradingOperationResult.?(); - } - return ?((IOrder order) => P_0.IsSameAs(order.Symbol) && order.Account.Equals(P_1), P_2, P_3); - } - - private static AdvancedTradingOperationResult ?(Func P_0, string P_1, GroupTradingOperation P_2) - { - AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); - foreach (IOrder item in from arg in ?() - where P_0 == null || P_0(arg) - select arg) - { - CancelOrderRequestParameters cancelOrderRequestParameters = new CancelOrderRequestParameters - { - Order = item, - SendingSource = P_1, - ParentOperation = P_2 - }; - item.Symbol.Connection.Limitation?.Wait(cancelOrderRequestParameters.Type, cancelOrderRequestParameters.CancellationToken); - TradingOperationResult tradingOperationResult = Core.Instance.CancelOrder(cancelOrderRequestParameters); - advancedTradingOperationResult.?(cancelOrderRequestParameters, tradingOperationResult); - } - return advancedTradingOperationResult; - } - - private static IEnumerable ?() - { - return Core.Instance.Orders.OfType().Concat(Core.Instance.LocalOrders); - } - - /// - /// Close all s - /// - /// the name of the initiator of the call (optional) - /// List of - public AdvancedTradingOperationResult ClosePositions([CallerMemberName] string sendingSource = null) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + sendingSource); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.None); - return ?(sendingSource, groupTradingOperation); - } - - /// - /// Close all s by - /// - /// - /// the name of the initiator of the call (optional) - /// List of - public AdvancedTradingOperationResult ClosePositions(Symbol symbol, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(64, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.Symbol); - return ?(symbol, sendingSource, groupTradingOperation); - } - - /// - /// Close all s by - /// - /// - /// the name of the initiator of the call (optional) - /// List of - public AdvancedTradingOperationResult ClosePositions(Account account, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(65, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(account); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.Account); - return ?((Position P_0) => P_0.Account.Equals(account), sendingSource, groupTradingOperation); - } - - /// - /// Close all s by and - /// - /// - /// - /// the name of the initiator of the call (optional) - /// List of - public AdvancedTradingOperationResult ClosePositions(Symbol symbol, Account account, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(76, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(account); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.Account); - return ?(symbol, account, sendingSource, groupTradingOperation); - } - - /// - /// Close all s by - /// - /// - /// the name of the initiator of the call (optional) - /// List of - public AdvancedTradingOperationResult ClosePositions(Side side, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(62, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.Side); - return ?((Position P_0) => P_0.Side == side, sendingSource, groupTradingOperation); - } - - /// - /// Close all s by and - /// - /// - /// - /// the name of the initiator of the call (optional) - /// List of - public AdvancedTradingOperationResult ClosePositions(Symbol symbol, Side side, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(73, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.Side); - return ?((Position P_0) => symbol.IsSameAs(P_0.Symbol) && P_0.Side == side, sendingSource, groupTradingOperation); - } - - /// - /// Close all positive s - /// - /// the name of the initiator of the call (optional) - /// List of - public AdvancedTradingOperationResult ClosePositivePositions([CallerMemberName] string sendingSource = null) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + sendingSource); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.None); - return ?((Position P_0) => true, sendingSource, groupTradingOperation); - } - - /// - /// Close all positive s by - /// - /// - /// the name of the initiator of the call (optional) - /// List of - public AdvancedTradingOperationResult ClosePositivePositions(Symbol symbol, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(73, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.Symbol); - return ?((Position P_0) => symbol.IsSameAs(P_0.Symbol), sendingSource, groupTradingOperation); - } - - /// - /// Close all negative s - /// - /// the name of the initiator of the call (optional) - /// List of - public AdvancedTradingOperationResult CloseNegativePositions([CallerMemberName] string sendingSource = null) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + sendingSource); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.None); - return ?((Position P_0) => true, sendingSource, groupTradingOperation); - } - - /// - /// Close all negative s by - /// - /// - /// the name of the initiator of the call (optional) - /// List of - public AdvancedTradingOperationResult CloseNegativePositions(Symbol symbol, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(73, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.Symbol); - return ?((Position P_0) => symbol.IsSameAs(P_0.Symbol), sendingSource, groupTradingOperation); - } - - private static AdvancedTradingOperationResult ?(Symbol P_0, string P_1, GroupTradingOperation P_2) - { - return ?((Position position) => P_0.IsSameAs(position.Symbol), P_1, P_2); - } - - private static AdvancedTradingOperationResult ?(Symbol P_0, Account P_1, string P_2, GroupTradingOperation P_3) - { - return ?((Position position) => P_0.IsSameAs(position.Symbol) && position.Account.Equals(P_1), P_2, P_3); - } - - private static AdvancedTradingOperationResult ?(string P_0, GroupTradingOperation P_1) - { - return ?((Position position) => true, P_0, P_1); - } - - private static AdvancedTradingOperationResult ?(Func P_0, string P_1, GroupTradingOperation P_2) - { - return ?(delegate(Position position) - { - PnLItem pnLItem = position.NetPnL ?? position.GrossPnL; - return pnLItem != null && pnLItem.Value > 0.0 && (P_0 == null || P_0(position)); - }, P_1, P_2); - } - - private static AdvancedTradingOperationResult ?(Func P_0, string P_1, GroupTradingOperation P_2) - { - return ?(delegate(Position position) - { - PnLItem pnLItem = position.NetPnL ?? position.GrossPnL; - return pnLItem != null && pnLItem.Value < 0.0 && (P_0 == null || P_0(position)); - }, P_1, P_2); - } - - private static AdvancedTradingOperationResult ?(Func P_0, string P_1, GroupTradingOperation P_2) - { - AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); - foreach (Position item in Core.Instance.Positions.Where((Position arg) => P_0 == null || P_0(arg))) - { - ClosePositionRequestParameters closePositionRequestParameters = new ClosePositionRequestParameters - { - Position = item, - CloseQuantity = item.Quantity, - SendingSource = P_1, - ParentOperation = P_2 - }; - TradingOperationResult tradingOperationResult = Core.Instance.ClosePosition(closePositionRequestParameters); - advancedTradingOperationResult.?(closePositionRequestParameters, tradingOperationResult); - } - return advancedTradingOperationResult; - } - - /// - /// Reverse all s - /// - /// the name of the initiator of the call (optional) - /// List of - public AdvancedTradingOperationResult ReversePositions([CallerMemberName] string sendingSource = null) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + sendingSource); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ReversePositions, GroupTradingOperationFilters.None); - return ?((Position P_0) => true, sendingSource, groupTradingOperation); - } - - /// - /// Reverse all s by - /// - /// - /// the name of the initiator of the call (optional) - /// List of - public AdvancedTradingOperationResult ReversePositions(Symbol symbol, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(66, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ReversePositions, GroupTradingOperationFilters.Symbol); - return ?((Position P_0) => P_0.Symbol.IsSameAs(symbol), sendingSource, groupTradingOperation); - } - - /// - /// Reverse all s by - /// - /// - /// the name of the initiator of the call (optional) - /// List of - public AdvancedTradingOperationResult ReversePositions(Account account, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(67, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(account); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ReversePositions, GroupTradingOperationFilters.Account); - return ?((Position P_0) => P_0.Account.Equals(account), sendingSource, groupTradingOperation); - } - - /// - /// Reverse by and - /// - /// - /// - /// the name of the initiator of the call (optional) - /// - public AdvancedTradingOperationResult ReversePosition(Symbol symbol, Account account, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(78, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(account); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ReversePositions, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.Account); - return ?((Position P_0) => P_0.Symbol.IsSameAs(symbol) && P_0.Account.Equals(account), sendingSource, groupTradingOperation); - } - - private static AdvancedTradingOperationResult ?(Func P_0, string P_1, GroupTradingOperation P_2) - { - AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); - try - { - Position[] positions = Core.Instance.Positions; - foreach (Position position in positions) - { - if ((position.Symbol.NettingType == NettingType.OnePosition || position.Symbol.NettingType == NettingType.Undefined || position.Account.NettingType == NettingType.OnePosition) && (P_0 == null || P_0(position))) - { - OrderType orderType = (Core.Instance.Connections[position.ConnectionId]?.BusinessObjects?.OrderTypes)?.FirstOrDefault((OrderType orderType2) => orderType2.Behavior == OrderTypeBehavior.Market && (orderType2.Usage & OrderTypeUsage.Order) == OrderTypeUsage.Order); - if (orderType != null) - { - PlaceOrderRequestParameters placeOrderRequestParameters = new PlaceOrderRequestParameters - { - Account = position.Account, - Symbol = position.Symbol, - OrderTypeId = orderType.Id, - Quantity = position.Quantity * 2.0, - TimeInForce = TimeInForce.Default, - Side = ((position.Side == Side.Buy) ? Side.Sell : Side.Buy), - SendingSource = P_1, - ParentOperation = P_2 - }; - TradingOperationResult tradingOperationResult = Core.Instance.PlaceOrder(placeOrderRequestParameters); - advancedTradingOperationResult.?(placeOrderRequestParameters, tradingOperationResult); - } - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - return advancedTradingOperationResult; - } - - /// - /// Cancel all s and close all s - /// - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult Flatten([CallerMemberName] string sendingSource = null) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + sendingSource); - AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.Flatten, GroupTradingOperationFilters.None); - advancedTradingOperationResult.?(?(sendingSource, groupTradingOperation)); - ?((Symbol)null, (Account)null); - advancedTradingOperationResult.?(?(sendingSource, groupTradingOperation)); - return advancedTradingOperationResult; - } - - /// - /// Cancel all s and close all s by - /// - /// - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult Flatten(Symbol symbol, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(56, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.Flatten, GroupTradingOperationFilters.Symbol); - advancedTradingOperationResult.?(?(symbol, Array.Empty(), sendingSource, groupTradingOperation)); - ?(symbol); - advancedTradingOperationResult.?(?(symbol, sendingSource, groupTradingOperation)); - return advancedTradingOperationResult; - } - - /// - /// Cancel all s and close all s by and - /// - /// - /// - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult Flatten(Symbol symbol, Account account, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(68, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(account); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); - GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.Flatten, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.Account); - advancedTradingOperationResult.?(?(symbol, account, sendingSource, groupTradingOperation)); - ?(symbol, account); - advancedTradingOperationResult.?(?(symbol, account, sendingSource, groupTradingOperation)); - return advancedTradingOperationResult; - } - - private static void ?(Symbol P_0 = null, Account P_1 = null) - { - try - { - CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(5.0)); - while (!cancellationTokenSource.IsCancellationRequested && ((P_0 != null && P_1 != null) ? Core.Instance.Orders.Count((Order order) => order.Symbol.Equals(P_0) && order.Account.Equals(P_1)) : ((P_0 == null) ? Core.Instance.Orders.Length : Core.Instance.Orders.Count((Order order) => order.Symbol.Equals(P_0)))) != 0) - { - Task.Delay(50, cancellationTokenSource.Token).Wait(cancellationTokenSource.Token); - } - if (cancellationTokenSource.IsCancellationRequested) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - /// - /// Modify SL to breakeven price - /// - /// - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult BreakEven(Position position, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(60, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(position); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - return ?(position, 0, null, sendingSource); - } - - /// - /// Modify SL to breakeven price with certain additional offset - /// - /// - /// offset in ticks - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult BreakEven(Position position, int offset, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(71, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(position); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(offset); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - return ?(position, offset, null, sendingSource); - } - - /// - /// Modify SL to breakeven price - /// - /// - /// list of s that will be used for order placing - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult BreakEven(Position position, IList additionalParameters, [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(92, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(position); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(additionalParameters?.Count); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - return ?(position, 0, additionalParameters, sendingSource); - } - - private static AdvancedTradingOperationResult ?(Position P_0, int P_1, IList P_2, string P_3) - { - if (P_0 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (P_0.Symbol.NettingType == NettingType.OnePosition || P_0.Account.NettingType == NettingType.OnePosition) - { - return ?(P_0.Symbol, P_0.Account, P_1, P_2, P_3); - } - double num = ?(P_0, P_1); - double currentPrice = P_0.CurrentPrice; - Order order = Core.Instance.Orders.Where((Order order2) => order2.PositionId == P_0.Id).FirstOrDefault(delegate(Order order2) - { - OrderTypeBehavior behavior = order2.OrderType.Behavior; - return (uint)(behavior - 3) <= 1u; - }); - if (order == null) - { - return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ModifyOrderRequestParameters modifyOrderRequestParameters = new ModifyOrderRequestParameters(order); - if (order.OrderType.Behavior == OrderTypeBehavior.TrailingStop) - { - num = P_0.Symbol.CalculateTicks(currentPrice, num); - modifyOrderRequestParameters.TrailOffset = num; - } - else - { - modifyOrderRequestParameters.TriggerPrice = num; - } - modifyOrderRequestParameters.SendingSource = P_3; - TradingOperationResult tradingOperationResult = Core.Instance.ModifyOrder(modifyOrderRequestParameters); - return new AdvancedTradingOperationResult(modifyOrderRequestParameters, tradingOperationResult); - } - - private static AdvancedTradingOperationResult ?(Symbol P_0, Account P_1, int P_2, IList P_3, string P_4) - { - if (P_0 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - if (P_1 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - if (P_0.NettingType != NettingType.OnePosition && P_1.NettingType != NettingType.OnePosition) - { - return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - OrderType orderType = P_0.Connection.BusinessObjects.OrderTypes.FirstOrDefault((OrderType orderType2) => orderType2.Behavior == OrderTypeBehavior.Stop); - if (orderType == null) - { - return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - Position ?? = Core.Instance.Positions.FirstOrDefault((Position position) => position.ConnectionId == P_0.ConnectionId && P_0.IsSameAs(position.Symbol) && position.Account.Id == P_1.Id); - if (?? == null) - { - return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); - try - { - Order[] array = Core.Instance.Orders.Where((Order order3) => order3.ConnectionId == P_0.ConnectionId && P_0.IsSameAs(order3.Symbol) && order3.Account.Id == P_1.Id).ToArray(); - Order order = array.FirstOrDefault((Order order3) => order3.OrderType.Behavior == OrderTypeBehavior.Stop && order3.Side != ??.Side); - if (order != null && !array.Any((Order order3) => string.IsNullOrEmpty(order3.GroupId)) && (from order3 in array - group order3 by order3.GroupId).Count() == 1) - { - ModifyOrderRequestParameters modifyOrderRequestParameters = new ModifyOrderRequestParameters(order) - { - TriggerPrice = ?(??, P_2), - SendingSource = P_4 - }; - TradingOperationResult tradingOperationResult = Core.Instance.ModifyOrder(modifyOrderRequestParameters); - advancedTradingOperationResult.?(modifyOrderRequestParameters, tradingOperationResult); - } - else if (order != null && array.Count() % 2 == 0 && !array.Any((Order order3) => string.IsNullOrEmpty(order3.GroupId)) && (from order3 in array - group order3 by order3.GroupId).Count() * 2 == array.Count()) - { - Order[] array2 = array.Where((Order order3) => order3.OrderType.Behavior == OrderTypeBehavior.Stop && order3.Side != ??.Side).ToArray(); - for (int num = 0; num < array2.Length; num++) - { - ModifyOrderRequestParameters modifyOrderRequestParameters2 = new ModifyOrderRequestParameters(array2[num]) - { - TriggerPrice = ?(??, P_2), - SendingSource = P_4 - }; - TradingOperationResult tradingOperationResult2 = Core.Instance.ModifyOrder(modifyOrderRequestParameters2); - advancedTradingOperationResult.?(modifyOrderRequestParameters2, tradingOperationResult2); - } - } - else - { - TaskCompletionSource ?? = new TaskCompletionSource(); - CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(); - Action value = delegate(OrderHistory orderHistory) - { - OrderStatus status = orderHistory.Status; - if ((status == OrderStatus.Opened || status == OrderStatus.Refused) ? true : false) - { - ??.SetResult(orderHistory); - } - }; - Core.Instance.OrdersHistoryAdded += value; - cancellationTokenSource.CancelAfter(TimeSpan.FromSeconds(5.0)); - try - { - PlaceOrderRequestParameters placeOrderRequestParameters = new PlaceOrderRequestParameters - { - Account = ??.Account, - Symbol = ??.Symbol, - OrderTypeId = orderType.Id, - TriggerPrice = ?(??, P_2), - Side = ((??.Side == Side.Buy) ? Side.Sell : Side.Buy), - Quantity = ??.Quantity, - SendingSource = P_4 - }; - if (P_3 != null) - { - placeOrderRequestParameters.AdditionalParameters = P_3; - } - TradingOperationResult tradingOperationResult3 = Core.Instance.PlaceOrder(placeOrderRequestParameters); - advancedTradingOperationResult.?(placeOrderRequestParameters, tradingOperationResult3); - if (tradingOperationResult3.Status == TradingOperationResultStatus.Failure) - { - return advancedTradingOperationResult; - } - CancellationToken token = cancellationTokenSource.Token; - token.Register(delegate - { - ??.TrySetCanceled(); - }); - OrderHistory result = ??.Task.Result; - if (token.IsCancellationRequested) - { - return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (result.Status == OrderStatus.Refused) - { - return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - Order[] array2 = array; - foreach (Order order2 in array2) - { - CancelOrderRequestParameters cancelOrderRequestParameters = new CancelOrderRequestParameters - { - Order = order2, - SendingSource = P_4 - }; - TradingOperationResult tradingOperationResult4 = Core.Instance.CancelOrder(cancelOrderRequestParameters); - advancedTradingOperationResult.?(cancelOrderRequestParameters, tradingOperationResult4); - } - } - finally - { - Core.Instance.OrdersHistoryAdded -= value; - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - return advancedTradingOperationResult; - } - - private static double ?(Position P_0, int P_1) - { - if (P_0 == null) - { - return double.NaN; - } - double num = P_0.OpenPrice; - decimal num2 = (decimal)P_0.Symbol.RoundPriceToTickSize(P_0.OpenPrice); - if ((decimal)P_0.OpenPrice != num2) - { - decimal num3 = ((!(num2 < (decimal)P_0.OpenPrice)) ? ((P_0.Side == Side.Buy) ? num2 : ((decimal)P_0.Symbol.CalculatePrice((double)num2, -1.0))) : ((P_0.Side == Side.Buy) ? ((decimal)P_0.Symbol.CalculatePrice((double)num2, 1.0)) : num2)); - num = (double)num3; - } - if (P_1 != 0) - { - num = P_0.Symbol.CalculatePrice(num, (P_0.Side == Side.Buy) ? P_1 : (-P_1)); - } - return num; - } - - /// - /// Adjust SL/TP for given - /// - /// - /// - /// the name of the initiator of the call (optional) - public AdvancedTradingOperationResult AdjustSlTp(Position position, CancellationToken cancellationToken = default(CancellationToken), [CallerMemberName] string sendingSource = null) - { - if (position == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - Symbol ?? = position.Symbol; - List list = Core.Instance.Orders.Where((Order P_0) => ??.IsSameAs(P_0.Symbol) && P_0.Account.Equals(position.Account) && P_0.Side != position.Side && ((P_0.Side != Side.Buy) ? (P_0.GetExecutionPrice() < position.OpenPrice) : (P_0.GetExecutionPrice() > position.OpenPrice))).ToList(); - List list2 = Core.Instance.Orders.Where((Order P_0) => ??.IsSameAs(P_0.Symbol) && P_0.Account.Equals(position.Account) && P_0.Side != position.Side && ((P_0.Side != Side.Buy) ? (P_0.GetExecutionPrice() > position.OpenPrice) : (P_0.GetExecutionPrice() < position.OpenPrice))).ToList(); - if (!list.Any() && !list2.Any()) - { - return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(63, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(position); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - AdvancedTradingOperationResult advancedTradingOperationResult = null; - AdvancedTradingOperationResult advancedTradingOperationResult2 = null; - AdvancedTradingOperationResult advancedTradingOperationResult3 = new AdvancedTradingOperationResult(); - try - { - if (list.Any()) - { - advancedTradingOperationResult = ?(new ? - { - Position = position, - Brackets = list - }, cancellationToken, sendingSource); - } - else if (list2.Count > 1) - { - List list3 = list2.OrderBy((Order P_0) => P_0.GetExecutionPrice()).ToList(); - Order ?? = ((position.Side == Side.Buy) ? list3.First() : list3.Last()); - list3.Remove(??); - if (list3.All((Order P_0) => P_0.OrderTypeId != ??.OrderTypeId)) - { - list2.Remove(??); - advancedTradingOperationResult = ?(new ? - { - Position = position, - Brackets = new List { ?? } - }, cancellationToken, sendingSource); - } - } - if (list2.Any()) - { - advancedTradingOperationResult2 = ?(new ? - { - Position = position, - Brackets = list2 - }, cancellationToken, sendingSource); - } - if (advancedTradingOperationResult == null) - { - return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (advancedTradingOperationResult2 == null) - { - return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - advancedTradingOperationResult3.?(advancedTradingOperationResult).?(advancedTradingOperationResult2); - if (!(advancedTradingOperationResult.Value is string orderId) || !(advancedTradingOperationResult2.Value is string orderId2) || Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), position.Account, position.Symbol).Status != TradingOperationStatus.Allowed) - { - return advancedTradingOperationResult3; - } - Order order = null; - Order order2 = null; - CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(5.0)); - while ((order == null || order2 == null) && !cancellationTokenSource.IsCancellationRequested) - { - order = Core.Instance.GetOrderById(orderId, position.ConnectionId); - order2 = Core.Instance.GetOrderById(orderId2, position.ConnectionId); - Task.Delay(100, cancellationTokenSource.Token).Wait(cancellationTokenSource.Token); - } - if (order == null || order2 == null) - { - return advancedTradingOperationResult3; - } - Core instance = Core.Instance; - string connectionId = position.ConnectionId; - LinkOCORequestParameters linkOCORequestParameters = new LinkOCORequestParameters(); - int num = 2; - List list4 = new List(num); - CollectionsMarshal.SetCount(list4, num); - Span span = CollectionsMarshal.AsSpan(list4); - int num2 = 0; - span[num2] = order; - num2++; - span[num2] = order2; - linkOCORequestParameters.OrdersToLink = list4; - linkOCORequestParameters.CancellationToken = cancellationToken; - instance.SendCustomRequest(connectionId, linkOCORequestParameters); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - return advancedTradingOperationResult3; - } - - /// - /// Adjust stop loss for given - /// - /// - /// list of s - /// initial stop loss parameters (optional) - /// - /// the name of the initiator of the call (optional) - /// - public AdvancedTradingOperationResult AdjustStopLoss(Position position, IList stops, SlTpHolder initialStopLoss = null, CancellationToken cancellationToken = default(CancellationToken), [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(97, 4); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(position); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(stops.Count); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(initialStopLoss); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - return ?(new ? - { - Position = position, - Brackets = stops, - InitialBracketParameters = initialStopLoss - }, cancellationToken, sendingSource); - } - - /// - /// Adjust take profit for given - /// - /// - /// list of s - /// initial take profit parameters (optional) - /// - /// the name of the initiator of the call (optional) - /// - public AdvancedTradingOperationResult AdjustTakeProfit(Position position, IList takes, SlTpHolder initialTakeProfit, CancellationToken cancellationToken = default(CancellationToken), [CallerMemberName] string sendingSource = null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(101, 4); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(position); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(takes.Count); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(initialTakeProfit); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(sendingSource); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - return ?(new ? - { - Position = position, - Brackets = takes, - InitialBracketParameters = initialTakeProfit - }, cancellationToken, sendingSource); - } - - private static AdvancedTradingOperationResult ?(? P_0, CancellationToken P_1, string P_2) - { - AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); - Position position = P_0.Position; - IList brackets = P_0.Brackets; - SlTpHolder initialBracketParameters = P_0.InitialBracketParameters; - double quantity = position.Quantity; - double num = ?(position, brackets, initialBracketParameters); - List source = brackets.Where((Order order) => string.IsNullOrEmpty(order.GroupId)).ToList(); - if (source.Any()) - { - Order ?? = source.Aggregate((Order order, Order order2) => (!(order.RemainingQuantity > order2.RemainingQuantity)) ? order2 : order); - advancedTradingOperationResult.?(?(brackets.Where((Order order) => order.Id != ??.Id).ToList(), P_1, P_2)); - if (Math.Abs(??.RemainingQuantity - quantity) > double.Epsilon || Math.Abs(??.GetExecutionPrice() - num) > double.Epsilon) - { - ModifyOrderRequestParameters modifyOrderRequestParameters = new ModifyOrderRequestParameters(??) - { - Quantity = quantity, - CancellationToken = P_1, - SendingSource = P_2 - }; - modifyOrderRequestParameters.SetExecutionPrice(num); - TradingOperationResult tradingOperationResult = ?(modifyOrderRequestParameters); - advancedTradingOperationResult.?(modifyOrderRequestParameters, tradingOperationResult); - if (tradingOperationResult.Status != TradingOperationResultStatus.Success) - { - return advancedTradingOperationResult; - } - advancedTradingOperationResult.Value = tradingOperationResult.OrderId; - } - else - { - advancedTradingOperationResult.Value = ??.Id; - } - } - else - { - PlaceOrderRequestParameters placeOrderRequestParameters = new PlaceOrderRequestParameters(brackets.FirstOrDefault()) - { - Quantity = quantity, - CancellationToken = P_1, - GroupId = string.Empty, - SendingSource = P_2 - }; - advancedTradingOperationResult.?(?(brackets, P_1, P_2)); - placeOrderRequestParameters.SetExecutionPrice(num); - TradingOperationResult tradingOperationResult2 = ?(placeOrderRequestParameters); - if (tradingOperationResult2.Status != TradingOperationResultStatus.Success) - { - return advancedTradingOperationResult; - } - advancedTradingOperationResult.?(placeOrderRequestParameters, tradingOperationResult2); - advancedTradingOperationResult.Value = tradingOperationResult2.OrderId; - } - return advancedTradingOperationResult; - } - - private static AdvancedTradingOperationResult ?(? P_0, CancellationToken P_1, string P_2) - { - AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); - Position position = P_0.Position; - IList brackets = P_0.Brackets; - SlTpHolder initialBracketParameters = P_0.InitialBracketParameters; - double quantity = position.Quantity; - double num = ?(position, brackets, initialBracketParameters); - if (double.IsNaN(num)) - { - return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - List source = brackets.Where((Order order) => string.IsNullOrEmpty(order.GroupId)).ToList(); - if (source.Any()) - { - Order ?? = source.Aggregate((Order order, Order order2) => (!(order.RemainingQuantity > order2.RemainingQuantity)) ? order2 : order); - advancedTradingOperationResult.?(?(brackets.Where((Order order) => order.Id != ??.Id).ToList(), P_1, P_2)); - if (Math.Abs(??.RemainingQuantity - quantity) > double.Epsilon || Math.Abs(??.GetExecutionPrice() - num) > double.Epsilon) - { - ModifyOrderRequestParameters modifyOrderRequestParameters = new ModifyOrderRequestParameters(??) - { - Quantity = quantity, - CancellationToken = P_1, - SendingSource = P_2 - }; - modifyOrderRequestParameters.SetExecutionPrice(num); - TradingOperationResult tradingOperationResult = ?(modifyOrderRequestParameters); - advancedTradingOperationResult.?(modifyOrderRequestParameters, tradingOperationResult); - if (tradingOperationResult.Status != TradingOperationResultStatus.Success) - { - return advancedTradingOperationResult; - } - advancedTradingOperationResult.Value = tradingOperationResult.OrderId; - } - else - { - advancedTradingOperationResult.Value = ??.Id; - } - } - else - { - PlaceOrderRequestParameters placeOrderRequestParameters = new PlaceOrderRequestParameters(brackets.FirstOrDefault()) - { - Quantity = quantity, - CancellationToken = P_1, - GroupId = string.Empty, - SendingSource = P_2 - }; - advancedTradingOperationResult.?(?(brackets, P_1, P_2)); - placeOrderRequestParameters.SetExecutionPrice(num); - TradingOperationResult tradingOperationResult2 = ?(placeOrderRequestParameters); - advancedTradingOperationResult.?(placeOrderRequestParameters, tradingOperationResult2); - if (tradingOperationResult2.Status != TradingOperationResultStatus.Success) - { - return advancedTradingOperationResult; - } - advancedTradingOperationResult.Value = tradingOperationResult2.OrderId; - } - return advancedTradingOperationResult; - } - - private static double ?(Position P_0, IEnumerable P_1, SlTpHolder P_2 = null) - { - if (P_2 != null) - { - if (P_2.PriceMeasurement != PriceMeasurement.Absolute) - { - return P_0.Symbol.RoundPriceToTickSize(P_0.Symbol.CalculatePrice(P_0.OpenPrice, (double)((P_0.Side != Side.Buy) ? 1 : (-1)) * P_2.Price)); - } - return P_2.Price; - } - if (P_0.Side != Side.Buy) - { - return P_1.Min((Order order) => order.GetExecutionPrice()); - } - return P_1.Max((Order order) => order.GetExecutionPrice()); - } - - private static double ?(Position P_0, IEnumerable P_1, SlTpHolder P_2 = null) - { - if (P_2 != null) - { - if (P_2.PriceMeasurement != PriceMeasurement.Absolute) - { - return P_0.Symbol.RoundPriceToTickSize(P_0.Symbol.CalculatePrice(P_0.OpenPrice, (double)((P_0.Side == Side.Buy) ? 1 : (-1)) * P_2.Price)); - } - return P_2.Price; - } - return CoreMath.GetWeightedAverage(P_1.Select((Order order) => (order.GetExecutionPrice(), order.RemainingQuantity)), P_0.Symbol); - } - - private static TradingOperationResult ?(PlaceOrderRequestParameters P_0) - { - ManualResetEventSlim ?? = new ManualResetEventSlim(); - string ?? = null; - try - { - Core.Instance.OrderAdded += delegate(Order order) - { - if (!??.IsSet) - { - if (!string.IsNullOrEmpty(??) && order.Id == ??) - { - ??.Set(); - } - else if (P_0.IsCorrespondingOrder(order)) - { - ??.Set(); - } - } - }; - Core.Instance.Connections[P_0.ConnectionId]?.Limitation?.Wait(P_0.Type, P_0.CancellationToken); - TradingOperationResult tradingOperationResult = Core.Instance.PlaceOrder(P_0); - if (tradingOperationResult != null && tradingOperationResult.Status == TradingOperationResultStatus.Failure) - { - return tradingOperationResult; - } - ?? = tradingOperationResult.OrderId; - ??.Wait(TimeSpan.FromSeconds(5.0)); - return tradingOperationResult; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - Core.Instance.OrderAdded -= delegate(Order order) - { - if (!??.IsSet) - { - if (!string.IsNullOrEmpty(??) && order.Id == ??) - { - ??.Set(); - } - else if (P_0.IsCorrespondingOrder(order)) - { - ??.Set(); - } - } - }; - } - return null; - } - - private static TradingOperationResult ?(ModifyOrderRequestParameters P_0) - { - ManualResetEventSlim ?? = new ManualResetEventSlim(); - try - { - Core.Instance.OrderAdded += delegate(Order order) - { - if (!??.IsSet && P_0.IsCorrespondingOrder(order)) - { - ??.Set(); - } - }; - Core.Instance.Connections[P_0.ConnectionId]?.Limitation?.Wait(P_0.Type, P_0.CancellationToken); - TradingOperationResult tradingOperationResult = Core.Instance.ModifyOrder(P_0); - if (tradingOperationResult != null && tradingOperationResult.Status == TradingOperationResultStatus.Failure) - { - return tradingOperationResult; - } - ??.Wait(TimeSpan.FromSeconds(5.0)); - return tradingOperationResult; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - Core.Instance.OrderAdded -= delegate(Order order) - { - if (!??.IsSet && P_0.IsCorrespondingOrder(order)) - { - ??.Set(); - } - }; - } - return null; - } - - private static AdvancedTradingOperationResult ?(IList P_0, CancellationToken P_1, string P_2) - { - if (!P_0.Any()) - { - return AdvancedTradingOperationResult.?(); - } - AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); - ManualResetEvent ?? = new ManualResetEvent(initialState: false); - HashSet ?? = new HashSet(P_0.Select((Order order) => order.Id)); - try - { - Core.Instance.OrderRemoved += delegate(Order order) - { - ??.Remove(order.Id); - if (??.Count == 0) - { - ??.Set(); - } - }; - foreach (Order item in P_0) - { - CancelOrderRequestParameters cancelOrderRequestParameters = new CancelOrderRequestParameters - { - Order = item, - CancellationToken = P_1, - SendingSource = P_2 - }; - item.Connection.Limitation?.Wait(cancelOrderRequestParameters.Type, cancelOrderRequestParameters.CancellationToken); - TradingOperationResult tradingOperationResult = Core.Instance.CancelOrder(cancelOrderRequestParameters); - if (tradingOperationResult != null && tradingOperationResult.Status == TradingOperationResultStatus.Failure) - { - ??.Remove(item.Id); - } - advancedTradingOperationResult.?(cancelOrderRequestParameters, tradingOperationResult); - } - if (!??.Any()) - { - ??.Set(); - } - ??.WaitOne(TimeSpan.FromSeconds(5.0)); - return advancedTradingOperationResult; - } - finally - { - Core.Instance.OrderRemoved -= delegate(Order order) - { - ??.Remove(order.Id); - if (??.Count == 0) - { - ??.Set(); - } - }; - } - } - } - public record GroupTradingOperation - { - public GroupTradingOperationType Type - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public GroupTradingOperationFilters Filters - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - [CompilerGenerated] - private readonly GroupTradingOperationType ??; - - [CompilerGenerated] - private readonly GroupTradingOperationFilters ??; - - public GroupTradingOperation(GroupTradingOperationType Type, GroupTradingOperationFilters Filters) - { - ?? = Type; - ?? = Filters; - base..ctor(); - } - - [CompilerGenerated] - public override string ToString() - { - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (PrintMembers(stringBuilder)) - { - stringBuilder.Append(' '); - } - stringBuilder.Append('}'); - return stringBuilder.ToString(); - } - - [CompilerGenerated] - protected virtual bool PrintMembers(StringBuilder builder) - { - RuntimeHelpers.EnsureSufficientExecutionStack(); - builder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - builder.Append(Type.ToString()); - builder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - builder.Append(Filters.ToString()); - return true; - } - - [CompilerGenerated] - public void Deconstruct(out GroupTradingOperationType Type, out GroupTradingOperationFilters Filters) - { - Type = this.Type; - Filters = this.Filters; - } - } - [Flags] - public enum GroupTradingOperationFilters - { - None = 0, - Connection = 1, - Symbol = 2, - Account = 4, - Side = 8, - TimeInForce = 0x10, - OrderType = 0x20, - CertainOrders = 0x40 - } - public enum GroupTradingOperationType - { - CancelOrders, - ClosePositions, - ReversePositions, - Flatten - } - public interface ISubTradingOperation - { - GroupTradingOperation ParentOperation { get; } - } - /// - /// The allowed result. - /// - public sealed class AllowedResult - { - [CompilerGenerated] - private TradingOperationStatus ??; - - [CompilerGenerated] - private string ??; - - /// - /// Gets the status. - /// - public TradingOperationStatus Status - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = tradingOperationStatus; - } - } - - /// - /// Gets the reason. - /// - public string Reason - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Get the allowed result. - /// - /// An AllowedResult. - public static AllowedResult GetAllowedResult() - { - return new AllowedResult - { - Status = TradingOperationStatus.Allowed - }; - } - - /// - /// Gets the not allowed result. - /// - /// The reason. - /// An AllowedResult. - public static AllowedResult GetNotAllowedResult(string reason = "") - { - return new AllowedResult - { - Status = TradingOperationStatus.NotAllowed, - Reason = reason - }; - } - } - public static class TradingOperations - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func ??; - - internal bool ?(OrderType P_0) - { - if (P_0.Behavior == OrderTypeBehavior.Limit) - { - return (P_0.Usage & OrderTypeUsage.CloseOrder) == OrderTypeUsage.CloseOrder; - } - return false; - } - - internal bool ?(OrderType P_0) - { - if (P_0.Behavior == OrderTypeBehavior.Stop) - { - return (P_0.Usage & OrderTypeUsage.CloseOrder) == OrderTypeUsage.CloseOrder; - } - return false; - } - - internal bool ?(OrderType P_0) - { - if (P_0.Behavior == OrderTypeBehavior.TrailingStop) - { - return (P_0.Usage & OrderTypeUsage.CloseOrder) == OrderTypeUsage.CloseOrder; - } - return false; - } - } - - public static AllowedResult IsAllowed(TradingOperation operation, TradingOperationParameters parameters) - { - if (parameters == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (Core.Instance.TradingStatus == TradingStatus.Locked) - { - return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - Symbol symbol = parameters.Symbol; - if (symbol != null && symbol.State == BusinessObjectState.Fake) - { - return AllowedResult.GetNotAllowedResult(string.Empty); - } - if (parameters.Account.IsLocked()) - { - return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return operation switch - { - TradingOperation.PlaceOrder => ?(parameters), - TradingOperation.ModifyOrder => ?(parameters), - TradingOperation.CancelOrder => ?(parameters), - TradingOperation.ClosePosition => ?(parameters), - _ => throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - }; - } - - public static AllowedResult IsAllowed(TradingOperation operation, IList parametersList) - { - if (parametersList == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - foreach (TradingOperationParameters parameters in parametersList) - { - AllowedResult allowedResult = IsAllowed(operation, parameters); - if (allowedResult.Status == TradingOperationStatus.NotAllowed) - { - return allowedResult; - } - } - return AllowedResult.GetAllowedResult(); - } - - public static AllowedResult IsOrderTpAllowed(TradingOperationParameters parameters) - { - TradingObject tradingObject = (parameters.Order as TradingObject) ?? parameters.Position; - if (tradingObject == null) - { - return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - AllowedResult allowedResult = AllowedResult.GetAllowedResult(); - OrderType orderType = parameters.Order?.OrderType; - if (orderType != null) - { - allowedResult = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), tradingObject.Account, tradingObject.Symbol, orderType); - if (allowedResult.Status == TradingOperationStatus.NotAllowed) - { - return allowedResult; - } - allowedResult = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), tradingObject.Account, tradingObject.Symbol, orderType); - } - else - { - allowedResult = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), tradingObject.Account, tradingObject.Symbol); - } - if (allowedResult.Status == TradingOperationStatus.NotAllowed) - { - return allowedResult; - } - if ((Core.Instance.Connections[tradingObject.ConnectionId]?.BusinessObjects?.OrderTypes)?.FirstOrDefault((OrderType P_0) => P_0.Behavior == OrderTypeBehavior.Limit && (P_0.Usage & OrderTypeUsage.CloseOrder) == OrderTypeUsage.CloseOrder) == null) - { - return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return AllowedResult.GetAllowedResult(); - } - - public static AllowedResult IsOrderSlAllowed(TradingOperationParameters parameters) - { - TradingObject tradingObject = (parameters.Order as TradingObject) ?? parameters.Position; - if (tradingObject == null) - { - return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - AllowedResult allowedResult = AllowedResult.GetAllowedResult(); - OrderType orderType = parameters.Order?.OrderType; - if (orderType != null) - { - allowedResult = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), tradingObject.Account, tradingObject.Symbol, orderType); - if (allowedResult.Status == TradingOperationStatus.NotAllowed) - { - return allowedResult; - } - allowedResult = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), tradingObject.Account, tradingObject.Symbol, orderType); - } - else - { - allowedResult = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), tradingObject.Account, tradingObject.Symbol); - } - if (allowedResult.Status == TradingOperationStatus.NotAllowed) - { - return allowedResult; - } - if ((Core.Instance.Connections[tradingObject.ConnectionId]?.BusinessObjects?.OrderTypes)?.FirstOrDefault((OrderType P_0) => P_0.Behavior == OrderTypeBehavior.Stop && (P_0.Usage & OrderTypeUsage.CloseOrder) == OrderTypeUsage.CloseOrder) == null) - { - return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return AllowedResult.GetAllowedResult(); - } - - public static AllowedResult IsOrderSLTrailAllowed(TradingOperationParameters parameters) - { - TradingObject tradingObject = (parameters.Order as TradingObject) ?? parameters.Position; - if (tradingObject == null) - { - return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - AllowedResult allowedResult = AllowedResult.GetAllowedResult(); - OrderType orderType = parameters.Order?.OrderType; - allowedResult = ((orderType == null) ? Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), tradingObject.Account, tradingObject.Symbol) : Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), tradingObject.Account, tradingObject.Symbol, orderType)); - if (allowedResult.Status == TradingOperationStatus.NotAllowed) - { - return allowedResult; - } - if ((Core.Instance.Connections[tradingObject.ConnectionId]?.BusinessObjects?.OrderTypes)?.FirstOrDefault((OrderType P_0) => P_0.Behavior == OrderTypeBehavior.TrailingStop && (P_0.Usage & OrderTypeUsage.CloseOrder) == OrderTypeUsage.CloseOrder) == null) - { - return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return AllowedResult.GetAllowedResult(); - } - - private static AllowedResult ?(TradingOperationParameters P_0) - { - if (P_0.Account != null && P_0.Symbol != null) - { - return Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), P_0.Account, P_0.Symbol); - } - if (P_0.Symbol != null) - { - return Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), P_0.Symbol); - } - return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - - private static AllowedResult ?(TradingOperationParameters P_0) - { - return AllowedResult.GetAllowedResult(); - } - - private static AllowedResult ?(TradingOperationParameters P_0) - { - if (P_0.Order == null || P_0.Order.State == BusinessObjectState.Fake) - { - return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return AllowedResult.GetAllowedResult(); - } - - private static AllowedResult ?(TradingOperationParameters P_0) - { - if (P_0.Position == null || P_0.Position.State == BusinessObjectState.Fake) - { - return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return AllowedResult.GetAllowedResult(); - } - } - /// - /// Defines advanced trading operation respond bundle - /// - public sealed class AdvancedTradingOperationResult - { - [CompilerGenerated] - private AdvancedTradingOperationResultStatus ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private object ??; - - [CompilerGenerated] - private IDictionary ??; - - /// - /// Respond operation state - /// - public AdvancedTradingOperationResultStatus Status - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = advancedTradingOperationResultStatus; - } - } - - /// - /// Respond message - /// - public string Message - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Respond value (optional) - /// - public object Value - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = obj; - } - } - - /// - /// Details of sub-operations - /// - public IDictionary Details - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dictionary; - } - } - - internal AdvancedTradingOperationResult() - { - Status = AdvancedTradingOperationResultStatus.Success; - Details = new Dictionary(); - } - - internal AdvancedTradingOperationResult(RequestParameters P_0, TradingOperationResult P_1) - : this() - { - ?(P_0, P_1); - } - - internal static AdvancedTradingOperationResult ?() - { - return new AdvancedTradingOperationResult(); - } - - internal static AdvancedTradingOperationResult ?(string P_0) - { - return new AdvancedTradingOperationResult - { - Status = AdvancedTradingOperationResultStatus.Failure, - Message = P_0 - }; - } - - internal void ?(RequestParameters P_0, TradingOperationResult P_1) - { - Details.Add(P_0, P_1); - ?(); - } - - internal AdvancedTradingOperationResult ?(AdvancedTradingOperationResult P_0) - { - foreach (var (key, value) in P_0.Details) - { - Details.Add(key, value); - } - ?(); - return this; - } - - private void ?() - { - int num = 0; - string text = null; - foreach (TradingOperationResult value in Details.Values) - { - switch (value.Status) - { - case TradingOperationResultStatus.Success: - num++; - break; - case TradingOperationResultStatus.Failure: - if (text == null) - { - text = value.Message; - } - break; - } - } - if (num == Details.Count) - { - Status = AdvancedTradingOperationResultStatus.Success; - return; - } - Message = text; - Status = ((num > 0) ? AdvancedTradingOperationResultStatus.PartiallySuccess : AdvancedTradingOperationResultStatus.Failure); - } - } - public sealed class BrandingInformationHelpLink - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private bool ??; - - public string Text - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string URL - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool Separator - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - } - public interface IBrandingInformation - { - string ApplicationName { get; } - - string ApplicationID { get; } - - string CopyrightDetails { get; } - - string PrivacePolicyUrl { get; } - - string TermsOfUseUrl { get; } - - string OfficialWebSite { get; } - - string LiveChatUrl { get; } - - string UpdateUrl { get; } - - string PricingPageUrl { get; } - - string AccountDashboardUrl { get; } - - string WelcomeScreenText { get; } - - string HelpCustomURL { get; } - - string GitCustomURL { get; } - - string ReleaseNotesURL { get; } - - BrandingInformationHelpLink[] HelpLinks { get; } - - bool IsGrayLabel { get; } - - /// - /// Get all available custom resources - /// - string[] GetResourceNames(); - - /// - /// Get custom resource stream by name - /// - Stream GetResource(string resourceName); - - /// - /// Check whether specified items was hidden by branding specification - /// - /// - bool IsItemHidden(string itemType, string itemName); - } -} -namespace ? -{ - internal sealed class ? : IBrandingInformation - { - public string ApplicationName => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public string ApplicationID => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public string CopyrightDetails => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public string PrivacePolicyUrl => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public string TermsOfUseUrl => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public string OfficialWebSite => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public string LiveChatUrl => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public string UpdateUrl => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public string PricingPageUrl => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public string AccountDashboardUrl => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public string WelcomeScreenText => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public string HelpCustomURL => null; - - public string GitCustomURL => null; - - public string ReleaseNotesURL => null; - - public BrandingInformationHelpLink[] HelpLinks => null; - - public bool IsGrayLabel => false; - - public string[] GetResourceNames() - { - return null; - } - - public Stream GetResource(string resourceName) - { - return null; - } - - public bool IsItemHidden(string itemType, string itemName) - { - return false; - } - } -} -namespace TradingPlatform.BusinessLayer -{ - /// - /// The assembly loader. - /// - public static class AssemblyLoader - { - private class ? - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private Assembly ??; - - public string AssemblyFolder - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = text; - } - } - - public Assembly Assembly - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = assembly; - } - } - - public ?(string P_0, Assembly P_1) - { - AssemblyFolder = P_0; - Assembly = P_1; - } - } - - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - internal Assembly? ?(object P_0, ResolveEventArgs P_1) - { - try - { - try - { - if (P_1.RequestingAssembly != null && ??.TryGetValue(P_1.Name, out var value) && File.Exists(value)) - { - Assembly assembly = Assembly.Load(File.ReadAllBytes(value)); - if ((object)assembly != null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(74, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_1.Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_1.RequestingAssembly); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - LoggerManager loggers2 = Core.Instance.Loggers; - defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(74, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_1.Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_1.RequestingAssembly); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - loggers2.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - return assembly; - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - if (P_1.RequestingAssembly != null && ??.TryGetValue(P_1.RequestingAssembly.FullName, out var value2)) - { - Assembly assembly2 = AssemblyLoader.?(P_1.Name, value2.AssemblyFolder); - if ((object)assembly2 != null) - { - return assembly2; - } - if (??.TryGetValue(P_1.Name, out var value3)) - { - return value3.Assembly; - } - LoggerManager loggers3 = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(74, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_1.Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_1.RequestingAssembly); - loggers3.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - } - } - catch (Exception ex2) - { - Core.Instance.Loggers.Log(ex2); - } - return null; - } - } - - private static readonly HashSet ??; - - private static readonly Dictionary ??; - - private static readonly Dictionary ??; - - private static Dictionary> ??; - - static AssemblyLoader() - { - ?? = new Dictionary>(); - ?? = new Dictionary(); - ?? = new HashSet - { - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }; - try - { - ?? = new Dictionary(); - string text = Path.Combine(Const.CUSTOM_SCRIPTS_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (File.Exists(text)) - { - XmlDocument xmlDocument = new XmlDocument(); - xmlDocument.Load(text); - foreach (XmlNode childNode in xmlDocument.DocumentElement.ChildNodes) - { - if (childNode.Attributes[3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()] != null && childNode.Attributes[3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()] != null) - { - string value = Path.Combine(Const.CUSTOM_SCRIPTS_PATH, childNode.Attributes[3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()].Value); - ??[childNode.Attributes[3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()].Value] = value; - } - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - AppDomain.CurrentDomain.AssemblyResolve += delegate(object P_0, ResolveEventArgs P_1) - { - try - { - try - { - if (P_1.RequestingAssembly != null && ??.TryGetValue(P_1.Name, out var value2) && File.Exists(value2)) - { - Assembly assembly = Assembly.Load(File.ReadAllBytes(value2)); - if ((object)assembly != null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(74, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_1.Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_1.RequestingAssembly); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - LoggerManager loggers2 = Core.Instance.Loggers; - defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(74, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_1.Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_1.RequestingAssembly); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value2); - loggers2.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - return assembly; - } - } - } - catch (Exception ex2) - { - Core.Instance.Loggers.Log(ex2); - } - if (P_1.RequestingAssembly != null && ??.TryGetValue(P_1.RequestingAssembly.FullName, out var value3)) - { - Assembly assembly2 = ?(P_1.Name, value3.AssemblyFolder); - if ((object)assembly2 != null) - { - return assembly2; - } - if (??.TryGetValue(P_1.Name, out var value4)) - { - return value4.Assembly; - } - LoggerManager loggers3 = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(74, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_1.Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_1.RequestingAssembly); - loggers3.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - } - } - catch (Exception ex3) - { - Core.Instance.Loggers.Log(ex3); - } - return (Assembly?)null; - }; - } - - /// - /// Load types. - /// - /// The folder name. - /// The target type. - /// The assembly name filter. - /// The search option. - /// If true, load in memory. - /// If true, allow loading references. - /// ]]> - public static List LoadTypes(string folderName, Type targetType, string assemblyNameFilter = null, SearchOption searchOption = SearchOption.TopDirectoryOnly, bool loadInMemory = false, bool allowLoadingReferences = false) - { - List list = new List(); - try - { - foreach (string item in Directory.EnumerateFiles(Path.Combine(Const.EXECUTING_FOLDER, folderName), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), searchOption)) - { - string fileName = Path.GetFileName(item); - if (string.IsNullOrEmpty(assemblyNameFilter) || fileName.Contains(assemblyNameFilter)) - { - List list2 = ?(item, targetType, loadInMemory, allowLoadingReferences); - if (list2 != null) - { - list.AddRange(list2); - } - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - return list; - } - - internal static List ?(string P_0, Type P_1, bool P_2 = false, bool P_3 = false) - { - List list = new List(); - try - { - Assembly assembly = (P_2 ? Assembly.Load(File.ReadAllBytes(P_0)) : Assembly.LoadFrom(P_0)); - if (P_3) - { - ??[assembly.FullName] = new ?(Path.GetDirectoryName(P_0), assembly); - } - foreach (Type exportedType in assembly.ExportedTypes) - { - if (!exportedType.IsAbstract && (P_1.IsAssignableFrom(exportedType) || exportedType.GetInterfaces().Contains(P_1))) - { - list.Add(new TypeWrapper(exportedType, P_0)); - } - } - if (P_3 && list.Any()) - { - ?(assembly, P_0); - } - } - catch (BadImageFormatException ex) - { - Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); - } - catch (Exception ex2) - { - Core.Instance.Loggers.Log(ex2); - } - return list; - } - - private static void ?(Assembly P_0, string P_1) - { - AssemblyName[] referencedAssemblies = P_0.GetReferencedAssemblies(); - foreach (AssemblyName assemblyName in referencedAssemblies) - { - if (assemblyName.Name.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) || ??.Contains(assemblyName.Name)) - { - continue; - } - try - { - string path = Path.Combine(Path.GetDirectoryName(P_1), assemblyName.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (File.Exists(path)) - { - Assembly assembly = Assembly.Load(File.ReadAllBytes(path)); - if ((object)assembly != null) - { - ??[assemblyName.FullName] = new ?(Path.GetDirectoryName(P_1), assembly); - ?(assembly, P_1); - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - } - - private static void ?(string P_0) - { - ??[P_0] = new Dictionary(); - foreach (string item in Directory.EnumerateFiles(P_0, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SearchOption.AllDirectories)) - { - try - { - Assembly assembly = Assembly.Load(File.ReadAllBytes(item)); - if ((object)assembly != null) - { - ??[P_0][assembly.FullName] = assembly; - } - } - catch (BadImageFormatException ex) - { - Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); - } - catch (Exception ex2) - { - Core.Instance.Loggers.Log(ex2); - } - } - } - - private static Assembly ?(string P_0, string P_1) - { - if (!??.ContainsKey(P_1)) - { - ?(P_1); - } - if (??.TryGetValue(P_1, out var value) && value.TryGetValue(P_0, out var value2)) - { - return value2; - } - return null; - } - } - public class TypeWrapper - { - [CompilerGenerated] - private Type ??; - - [CompilerGenerated] - private string ??; - - public Type Type - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = type; - } - } - - public string AssemblyLocation - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - internal TypeWrapper(Type P_0, string P_1) - { - Type = P_0; - AssemblyLocation = P_1; - } - - public static implicit operator Type(TypeWrapper typeWrapper) - { - return typeWrapper.Type; - } - - public override string ToString() - { - return Type?.ToString(); - } - } -} -namespace ? -{ - internal enum ? - { - ??, - ??, - ??, - ??, - ??, - ??, - ??, - ??, - ??, - ??, - ??, - ??, - ??, - ??, - ??, - ??, - ??, - ??, - ??, - ?? - } -} -namespace TradingPlatform.BusinessLayer -{ - /// - /// Quote type for subscribtion dictum - /// - public enum SubscribeQuoteType - { - /// - /// Level 1 quote - /// - Quote, - /// - /// Level 2 quote - /// - Level2, - /// - /// Last - /// - Last, - /// - /// Mark price - /// - Mark - } - [DataContract(Name = "HistoryType", Namespace = "TradingPlatform")] - public enum HistoryType - { - [Description("Bid")] - [EnumMember] - Bid, - [Description("Ask")] - [EnumMember] - Ask, - [Description("Midpoint")] - [EnumMember] - Midpoint, - [Description("Last")] - [EnumMember] - Last, - [Description("Bid/Ask")] - [EnumMember] - BidAsk, - [Description("Mark")] - [EnumMember] - Mark - } - public enum Side - { - Buy, - Sell - } - [Flags] - public enum LoggingLevel - { - System = 1, - [Description("Exception")] - Error = 2, - Trading = 4, - Verbose = 8, - Quotes = 0x10, - Painting = 0x20, - Performance = 0x40, - [Description("Loading history")] - LoadingHistory = 0x80 - } - /// - /// Trading operation state - /// - public enum TradingOperationResultStatus - { - Success, - Failure - } - /// - /// Complex trading operation state - /// - public enum AdvancedTradingOperationResultStatus - { - Success, - PartiallySuccess, - Failure - } - public enum NonFixedListDownload - { - Download, - IgnoreDownload - } - [DataContract(Name = "OptionType", Namespace = "TradingPlatform")] - public enum OptionType - { - [EnumMember] - Call, - [EnumMember] - Put - } - [Obfuscation(Exclude = true)] - public enum AggressorFlag - { - [Description("None")] - None, - [Description("Buy")] - Buy, - [Description("Sell")] - Sell, - [Description("Not set")] - NotSet - } - [Obfuscation(Exclude = true)] - public enum TickDirection - { - [Description("Not set")] - NotSet, - [Description("None")] - None, - [Description("Up")] - Up, - [Description("Down")] - Down - } - public enum CloseOrderType - { - [Description("Stop loss")] - StopLoss, - [Description("Take profit")] - TakeProfit - } - public enum TradingStatus - { - Allowed, - Locked, - AllowedFromStrategies - } - public enum TradingOperationStatus - { - Allowed, - NotAllowed - } - public enum TradingOperation - { - PlaceOrder, - ModifyOrder, - CancelOrder, - ClosePosition - } - public enum ValidateState - { - Valid, - NotValid - } - public enum RequestType - { - PlaceOrder, - ModifyOrder, - History, - Symbol, - SearchSymbol, - QuoteSubscribe, - FutureContracts, - OptionSeries, - Strikes, - ClosePosition, - CancelOrder, - Custom, - PnL, - Report, - Connect, - VolumeAnalysis, - VolumeAnalysisByPeriod, - PlaceMultiOrderOrder, - TradesHistory, - OrdersHistory, - ConvertPosition, - TradingSignals - } - public enum ColouringModes - { - [Description("None")] - None, - [Description("Compare to previous")] - Previous, - [Description("By sign")] - Signed - } - [Flags] - public enum NativeModifierKeys - { - None = 0, - Alt = 1, - Shift = 2, - Control = 4 - } - public enum NativeAlignment - { - NotSet, - Left, - Center, - Right - } - public enum NativeKey - { - None = 0, - Cancel = 1, - Back = 2, - Tab = 3, - LineFeed = 4, - Clear = 5, - Return = 6, - Enter = 6, - Pause = 7, - Capital = 8, - CapsLock = 8, - KanaMode = 9, - HangulMode = 9, - JunjaMode = 10, - FinalMode = 11, - HanjaMode = 12, - KanjiMode = 12, - Escape = 13, - ImeConvert = 14, - ImeNonConvert = 15, - ImeAccept = 16, - ImeModeChange = 17, - Space = 18, - Prior = 19, - PageUp = 19, - PageDown = 20, - End = 21, - Home = 22, - Left = 23, - Up = 24, - Right = 25, - Down = 26, - Select = 27, - Print = 28, - Execute = 29, - Snapshot = 30, - PrintScreen = 30, - Insert = 31, - Delete = 32, - Help = 33, - D0 = 34, - D1 = 35, - D2 = 36, - D3 = 37, - D4 = 38, - D5 = 39, - D6 = 40, - D7 = 41, - D8 = 42, - D9 = 43, - A = 44, - B = 45, - C = 46, - D = 47, - E = 48, - F = 49, - G = 50, - H = 51, - I = 52, - J = 53, - K = 54, - L = 55, - M = 56, - N = 57, - O = 58, - P = 59, - Q = 60, - R = 61, - S = 62, - T = 63, - U = 64, - V = 65, - W = 66, - X = 67, - Y = 68, - Z = 69, - LWin = 70, - RWin = 71, - Apps = 72, - Sleep = 73, - NumPad0 = 74, - NumPad1 = 75, - NumPad2 = 76, - NumPad3 = 77, - NumPad4 = 78, - NumPad5 = 79, - NumPad6 = 80, - NumPad7 = 81, - NumPad8 = 82, - NumPad9 = 83, - Multiply = 84, - Add = 85, - Separator = 86, - Subtract = 87, - Decimal = 88, - Divide = 89, - F1 = 90, - F2 = 91, - F3 = 92, - F4 = 93, - F5 = 94, - F6 = 95, - F7 = 96, - F8 = 97, - F9 = 98, - F10 = 99, - F11 = 100, - F12 = 101, - F13 = 102, - F14 = 103, - F15 = 104, - F16 = 105, - F17 = 106, - F18 = 107, - F19 = 108, - F20 = 109, - F21 = 110, - F22 = 111, - F23 = 112, - F24 = 113, - NumLock = 114, - Scroll = 115, - LeftShift = 116, - RightShift = 117, - LeftCtrl = 118, - RightCtrl = 119, - LeftAlt = 120, - RightAlt = 121, - BrowserBack = 122, - BrowserForward = 123, - BrowserRefresh = 124, - BrowserStop = 125, - BrowserSearch = 126, - BrowserFavorites = 127, - BrowserHome = 128, - VolumeMute = 129, - VolumeDown = 130, - VolumeUp = 131, - MediaNextTrack = 132, - MediaPreviousTrack = 133, - MediaStop = 134, - MediaPlayPause = 135, - LaunchMail = 136, - SelectMedia = 137, - LaunchApplication1 = 138, - LaunchApplication2 = 139, - Oem1 = 140, - OemSemicolon = 140, - OemPlus = 141, - OemComma = 142, - OemMinus = 143, - OemPeriod = 144, - Oem2 = 145, - OemQuestion = 145, - Oem3 = 146, - OemTilde = 146, - AbntC1 = 147, - AbntC2 = 148, - Oem4 = 149, - OemOpenBrackets = 149, - Oem5 = 150, - OemPipe = 150, - Oem6 = 151, - OemCloseBrackets = 151, - Oem7 = 152, - OemQuotes = 152, - Oem8 = 153, - Oem102 = 154, - OemBackslash = 154, - ImeProcessed = 155, - System = 156, - OemAttn = 157, - DbeAlphanumeric = 157, - OemFinish = 158, - DbeKatakana = 158, - OemCopy = 159, - DbeHiragana = 159, - OemAuto = 160, - DbeSbcsChar = 160, - OemEnlw = 161, - DbeDbcsChar = 161, - OemBackTab = 162, - DbeRoman = 162, - Attn = 163, - DbeNoRoman = 163, - CrSel = 164, - DbeEnterWordRegisterMode = 164, - ExSel = 165, - DbeEnterImeConfigureMode = 165, - EraseEof = 166, - DbeFlushString = 166, - Play = 167, - DbeCodeInput = 167, - Zoom = 168, - DbeNoCodeInput = 168, - NoName = 169, - DbeDetermineString = 169, - Pa1 = 170, - DbeEnterDialogConversionMode = 170, - OemClear = 171, - DeadCharProcessed = 172 - } - public class NativeKeyEventArgs - { - [CompilerGenerated] - private readonly NativeKey ??; - - [CompilerGenerated] - private readonly NativeModifierKeys ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - public NativeKey Key - { - [CompilerGenerated] - get - { - return ??; - } - } - - public NativeModifierKeys Modifiers - { - [CompilerGenerated] - get - { - return ??; - } - } - - public bool Handled - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool IsRepeated - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public NativeKeyEventArgs(NativeKey key, NativeModifierKeys modifiers) - { - ?? = key; - ?? = modifiers; - } - } - public enum NativeDragDropEffects - { - Scroll = int.MinValue, - All = -2147483645, - None = 0, - Copy = 1, - Move = 2, - Link = 4 - } - public class NativeDragEventArgs - { - [CompilerGenerated] - private NativeDragDropEffects ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private readonly object[] ??; - - [CompilerGenerated] - private object ??; - - [CompilerGenerated] - private readonly Point ??; - - public NativeDragDropEffects Effects - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool Handled - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public object[] Data - { - [CompilerGenerated] - get - { - return ??; - } - } - - public object Source - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Point MousePosition - { - [CompilerGenerated] - get - { - return ??; - } - } - - public NativeDragEventArgs(NativeDragDropEffects effects, object source, object[] data, Point mousePosition) - { - Effects = effects; - Source = source; - ?? = data; - ?? = mousePosition; - } - - public NativeDragEventArgs(object source, object[] data, Point mousePosition) - { - Source = source; - ?? = data; - ?? = mousePosition; - } - } - public enum NativeWindowCaptionButtonType - { - Action, - Maximize, - Minimize, - Close, - FullScreen, - None - } - public enum PositionImpactType - { - Undefined, - Open, - Close - } - [Obfuscation(Exclude = true)] - public enum CorporateActionType - { - Undefined, - Split, - Dividend - } - public enum EntityLifecycle - { - Created, - Changed, - Removed - } - public enum VwapStdCalculationType - { - StandardDeviation, - VWAPVariance - } - public enum VWAPStandardDeviationMode - { - [Description("Single")] - Single, - [Description("Multiple")] - Multiple - } - public enum VwapDataType - { - [Description("Tick")] - Tick, - [Description("Current TF")] - CurrentTF - } - public enum VwapPriceType - { - [Description("Open")] - Open, - [Description("High")] - High, - [Description("Low")] - Low, - [Description("Close")] - Close, - [Description("HL/2")] - HL2, - [Description("HLC/3")] - HLC3, - [Description("OHLC/4")] - OHLC4 - } - public enum HistoryProcessorReversalCalculationType - { - [Description("Previous bar")] - PreviousBar, - [Description("Independent")] - Independent - } -} -namespace ? -{ - internal class ? : IBufferedProcessorValue - { - public ? ??; - - public IConnectionBindedObject ??; - - public ? Key => ??; - - public ?(? P_0, IConnectionBindedObject P_1) - { - ?? = P_0; - ?? = P_1; - } - } -} -namespace TradingPlatform.BusinessLayer -{ - /// - /// The account extensions. - /// - public static class AccountExtensions - { - /// - /// Returns a custom name if available otherwise, returns the name. - /// - /// The account. - public static string GetCurrentName(this Account account) - { - string text = Core.Instance.CustomAccountPropertiesProvider.GetProperty(account, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) as string; - if (!string.IsNullOrEmpty(text)) - { - return text; - } - return account.Name; - } - - /// - /// Returns information about whether the account supports trading operations - /// - /// The account. - public static bool IsLocked(this Account account) - { - return Core.Instance.CustomAccountPropertiesProvider.GetProperty(account, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) as bool? == true; - } - } - /// - /// The aggressor flag calculator extensions. - /// - public static class AggressorFlagCalculatorExtensions - { - /// - /// Collect bid ask. - /// - /// The calculator. - /// The quote. - public static void CollectBidAsk(this IAggressorFlagCalculator calculator, Quote quote) - { - calculator.CollectBidAsk(quote.SymbolId, quote.Time.Ticks, quote.Bid, quote.Ask); - } - - /// - /// Calculate aggressor flag. - /// - /// The calculator. - /// The last. - /// An AggressorFlag. - public static AggressorFlag CalculateAggressorFlag(this IAggressorFlagCalculator calculator, Last last) - { - return calculator.CalculateAggressorFlag(last.SymbolId, last.Time.Ticks, last.Price); - } - } - public static class DateTimeExtensions - { - public static DateTime ToSelectedTimeZone(this DateTime dt) - { - return Core.Instance.TimeUtils.ConvertFromUTCToSelectedTimeZone(dt); - } - - public static DateTime FromSelectedTimeZoneToUtc(this DateTime dt) - { - return Core.Instance.TimeUtils.ConvertFromSelectedTimeZoneToUTC(dt); - } - - public static DateTime TrimSeconds(this DateTime value) - { - return new DateTime(value.Year, value.Month, value.Day, value.Hour, value.Minute, 0, value.Kind); - } - - public static DateTime CeilingTo(this DateTime value, TimeSpan timeSpan) - { - long num = value.Ticks % timeSpan.Ticks; - if (num == 0L) - { - return value; - } - return new DateTime(value.Ticks - num + timeSpan.Ticks, value.Kind); - } - - public static DateTime CeilingTo(this DateTime value, Period period) - { - return value.CeilingTo(TimeSpan.FromTicks(period.Ticks)); - } - - public static DateTime FloorTo(this DateTime value, TimeSpan timeSpan) - { - return new DateTime(value.Ticks - value.Ticks % timeSpan.Ticks, value.Kind); - } - - public static DateTime FloorTo(this DateTime value, Period period) - { - return value.FloorTo(TimeSpan.FromTicks(period.Ticks)); - } - - public static long ToUnixSeconds(this DateTime dateTime) - { - return new DateTimeOffset(dateTime).ToUnixTimeSeconds(); - } - - public static long ToUnixMilliseconds(this DateTime dateTime) - { - return new DateTimeOffset(dateTime).ToUnixTimeMilliseconds(); - } - - public static DateTime SetKind(this DateTime dateTime, DateTimeKind kind) - { - return new DateTime(dateTime.Ticks, kind); - } - - public static int GetWeekOfYear(this DateTime dateTime, DayOfWeek firstWeekDay = DayOfWeek.Monday) - { - return CultureInfo.InvariantCulture.Calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstFullWeek, firstWeekDay); - } - - public static IEnumerable GetDaysOfWeekForCurrMonth(this DateTime date, DayOfWeek dayOfWeek) - { - DateTime dateTime = new DateTime(date.Year, date.Month, 1); - DateTime dateTime2 = dateTime.AddMonths(1); - while (dateTime < dateTime2 && dateTime.DayOfWeek != dayOfWeek) - { - dateTime = dateTime.AddDays(1.0); - } - while (dateTime < dateTime2) - { - yield return dateTime; - dateTime = dateTime.AddDays(7.0); - } - } - } - public static class DateTimeIntervalExtensions - { - public static TimeSpan GetLength(this Interval interval) - { - return TimeSpan.FromTicks(Math.Abs(interval.From.Ticks - interval.To.Ticks)); - } - - public static IEnumerable> Split(this Interval interval, TimeSpan step, bool roundToStep = false) - { - if (step == TimeSpan.Zero || step == Timeout.InfiniteTimeSpan) - { - yield return interval; - yield break; - } - DateTime dateTime; - DateTime to; - if (interval.IsReversal) - { - to = interval.From; - do - { - dateTime = to.Add(-step); - if (roundToStep) - { - dateTime = dateTime.CeilingTo(step); - } - if (dateTime < interval.To) - { - dateTime = interval.To; - } - yield return new Interval(dateTime, to); - to = dateTime; - } - while (dateTime > interval.To); - yield break; - } - dateTime = interval.From; - do - { - to = dateTime.Add(step); - if (roundToStep) - { - to = to.FloorTo(step); - } - if (to > interval.To) - { - to = interval.To; - } - yield return new Interval(dateTime, to); - dateTime = to; - } - while (to.Ticks < interval.To.Ticks); - } - - public static bool Contains(this Interval interval, Period period) - { - DateTime value = interval.From; - DateTime dateTime = interval.To; - if (interval.IsReversal) - { - value = interval.To; - dateTime = interval.From; - } - dateTime = dateTime.AddTicks(1L); - long ticks = value.CeilingTo(period).Ticks; - long ticks2 = dateTime.FloorTo(period).Ticks; - return period.Ticks <= ticks2 - ticks; - } - } - public static class DelegateExtensions - { - public static void InvokeSafely(this Delegate @delegate, params object[] args) - { - if ((object)@delegate == null) - { - return; - } - Delegate[] invocationList = @delegate.GetInvocationList(); - foreach (Delegate obj in invocationList) - { - try - { - obj.DynamicInvoke(args); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - } - } - public static class DoubleExtensions - { - private const string ?? = "#,0.##########"; - - public static string Format(this double value, int precision = 2, bool abbreviate = false) - { - if (double.IsNaN(value)) - { - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); - } - if (abbreviate) - { - return value.?(precision); - } - double num = ((value == -0.0) ? Math.Abs(value) : value); - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(1, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(precision); - return num.ToString(defaultInterpolatedStringHandler.ToStringAndClear()); - } - - private static string ?(this double P_0, int P_1) - { - string value = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); - if (Math.Abs(P_0) >= 1000000000000.0) - { - P_0 /= 1000000000000.0; - value = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - else if (Math.Abs(P_0) >= 1000000000.0) - { - P_0 /= 1000000000.0; - value = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - else if (Math.Abs(P_0) >= 1000000.0) - { - P_0 /= 1000000.0; - value = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - else if (Math.Abs(P_0) >= 1000.0) - { - P_0 /= 1000.0; - value = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler; - if (!string.IsNullOrEmpty(value)) - { - defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(1, 2); - defaultInterpolatedStringHandler.AppendFormatted(P_0.?(1)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(1, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_1); - return P_0.ToString(defaultInterpolatedStringHandler.ToStringAndClear()); - } - - private static double ?(this double P_0, int P_1) - { - double num = Math.Pow(10.0, P_1); - return Math.Truncate(P_0 * num) / num; - } - - public static bool IsNanOrDefault(this double value) - { - if (value != 0.0) - { - return double.IsNaN(value); - } - return true; - } - - public static string FormatPriceWithMaxPrecision(this double price, IFormatProvider formatProvider = null) - { - if (double.IsInfinity(price) || double.IsNaN(price)) - { - price = 0.0; - } - if (formatProvider != null) - { - return price.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), formatProvider); - } - return price.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - - public static string FormatPriceWithMaxPrecision(this double price, int precision) - { - if (double.IsInfinity(price) || double.IsNaN(price)) - { - price = 0.0; - } - string text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - for (int i = 0; i < precision; i++) - { - text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - for (int j = precision; j < 10; j++) - { - text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - return price.ToString(text); - } - - public static double RoundTo(this double value, int degree) - { - decimal num = (decimal)value; - decimal num2 = (decimal)Math.Pow(10.0, degree); - return (double)(num - num % num2); - } - } - public static class EnumExtensions - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - internal string ?(EnumMemberAttribute P_0) - { - return P_0.Value; - } - - internal string ?(DescriptionAttribute P_0) - { - return P_0.Description; - } - } - - public static string GetEnumMember(this Enum value) - { - return value.GetAttributeValueOrDefault((EnumMemberAttribute P_0) => P_0.Value, value.ToString()); - } - - public static string GetDescription(this Enum value) - { - return value.GetAttributeValueOrDefault((DescriptionAttribute P_0) => P_0.Description, value.ToString()); - } - - public static TValue GetAttributeValueOrDefault(this Enum value, Func valueFunc, TValue defaultValue) where TAttribute : Attribute - { - TAttribute attribute = value.GetAttribute(); - if (valueFunc == null || attribute == null) - { - return defaultValue; - } - return valueFunc(attribute); - } - - public static TAttribute GetAttribute(this Enum value) where TAttribute : Attribute - { - return value.GetType().GetField(value.ToString()).GetCustomAttributes(typeof(TAttribute), inherit: false) - .Cast() - .FirstOrDefault(); - } - } - public static class ExceptionExtensions - { - public static string GetMessageRecursive(this Exception exception) - { - return exception?.InnerException?.GetMessageRecursive() ?? exception?.Message ?? string.Empty; - } - - public static string GetFullMessageRecursive(this Exception exception) - { - StringBuilder stringBuilder = new StringBuilder(exception.Message); - if (exception.InnerException != null) - { - StringBuilder stringBuilder2 = stringBuilder; - StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(18, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(exception.InnerException.GetFullMessageRecursive()); - stringBuilder2.Append(ref handler); - } - return stringBuilder.ToString(); - } - - public static IEnumerable GetInnerExceptionsRecursive(this Exception exception) - { - for (Exception ex = exception; ex != null; ex = ex.InnerException) - { - yield return ex; - } - } - } - public static class HistoricalDataExtensions - { - /// - /// Gets the price from historical data - /// - /// - /// - /// - public static double GetPrice(this HistoricalData historicalData, PriceType priceType, int offset = 0) - { - return historicalData[offset, SeekOriginHistory.End][priceType]; - } - - /// - /// Get Bid price - /// - /// Offset value - /// - public static double Bid(this HistoricalData historicalData, int offset = 0) - { - return historicalData.GetPrice(PriceType.Bid, offset); - } - - /// - /// Get Ask price - /// - /// Offset value - /// - public static double Ask(this HistoricalData historicalData, int offset = 0) - { - return historicalData.GetPrice(PriceType.Ask, offset); - } - - /// - /// Get Last price - /// - /// Offset value - /// - public static double Last(this HistoricalData historicalData, int offset = 0) - { - return historicalData.GetPrice(PriceType.Last, offset); - } - - /// - /// Get Open price - /// - /// Offset value - /// - public static double Open(this HistoricalData historicalData, int offset = 0) - { - return historicalData.GetPrice(PriceType.Open, offset); - } - - /// - /// Get High price - /// - /// Offset value - /// - public static double High(this HistoricalData historicalData, int offset = 0) - { - return historicalData.GetPrice(PriceType.High, offset); - } - - /// - /// Get Low price - /// - /// Offset value - /// - public static double Low(this HistoricalData historicalData, int offset = 0) - { - return historicalData.GetPrice(PriceType.Low, offset); - } - - /// - /// Get Close price - /// - /// Offset value - /// - public static double Close(this HistoricalData historicalData, int offset = 0) - { - return historicalData.GetPrice(PriceType.Close, offset); - } - - /// - /// Get Median price - /// - /// Offset value - /// - public static double Median(this HistoricalData historicalData, int offset = 0) - { - return historicalData.GetPrice(PriceType.Median, offset); - } - - /// - /// Get Typical price - /// - /// Offset value - /// - public static double Typical(this HistoricalData historicalData, int offset = 0) - { - return historicalData.GetPrice(PriceType.Typical, offset); - } - - /// - /// Get Weighted price - /// - /// Offset value - /// - public static double Weighted(this HistoricalData historicalData, int offset = 0) - { - return historicalData.GetPrice(PriceType.Weighted, offset); - } - - /// - /// Get Volume - /// - /// Offset value - /// - public static double Volume(this HistoricalData historicalData, int offset = 0) - { - return historicalData.GetPrice(PriceType.Volume, offset); - } - - /// - /// Get Volume in quoting asset - /// - /// Offset value - /// - public static double QuoteAssetVolume(this HistoricalData historicalData, int offset = 0) - { - return historicalData.GetPrice(PriceType.QuoteAssetVolume, offset); - } - - /// - /// Get Ticks - /// - /// Offset value - /// - public static double Ticks(this HistoricalData historicalData, int offset = 0) - { - return historicalData.GetPrice(PriceType.Ticks, offset); - } - - /// - /// Get Open interest - /// - /// Offset value - /// - public static double OpenInterest(this HistoricalData historicalData, int offset = 0) - { - return historicalData.GetPrice(PriceType.OpenInterest, offset); - } - - /// - /// Get Funding rate - /// - /// Offset value - /// - public static double FundingRate(this HistoricalData historicalData, int offset = 0) - { - return historicalData.GetPrice(PriceType.FundingRate, offset); - } - - /// - /// Get Time - /// - /// Offset value - /// - public static DateTime Time(this HistoricalData historicalData, int offset = 0) - { - return new DateTime(historicalData[offset, SeekOriginHistory.End].TicksLeft, DateTimeKind.Utc); - } - } - public static class HistoryItemExtensions - { - public static void ProcessTickDirection(this IList historyItems, CancellationToken cancellationToken) - { - if (historyItems == null || historyItems.Count == 0 || historyItems[0] is HistoryItemBar) - { - return; - } - if (historyItems[0] is HistoryItemTick) - { - double previousPrice = double.NaN; - double previousPrice2 = double.NaN; - TickDirection prevItemTickDirection = TickDirection.NotSet; - TickDirection prevItemTickDirection2 = TickDirection.NotSet; - { - foreach (HistoryItemTick item in historyItems.OfType()) - { - if (cancellationToken.IsCancellationRequested) - { - break; - } - item.BidTickDirection = Symbol.DetermineTickDirection(previousPrice, item.Bid, prevItemTickDirection); - item.AskTickDirection = Symbol.DetermineTickDirection(previousPrice2, item.Ask, prevItemTickDirection2); - previousPrice = item.Bid; - previousPrice2 = item.Ask; - prevItemTickDirection = item.BidTickDirection; - prevItemTickDirection2 = item.AskTickDirection; - } - return; - } - } - double previousPrice3 = double.NaN; - TickDirection prevItemTickDirection3 = TickDirection.NotSet; - foreach (HistoryItemLast item2 in historyItems.OfType()) - { - if (cancellationToken.IsCancellationRequested) - { - break; - } - item2.TickDirection = Symbol.DetermineTickDirection(previousPrice3, item2.Price, prevItemTickDirection3); - previousPrice3 = item2.Price; - prevItemTickDirection3 = item2.TickDirection; - } - } - } - public static class Int32Extensions - { - public static DateTime AsUnixSecondsToDateTime(this int seconds) - { - return DateTimeOffset.FromUnixTimeSeconds(seconds).DateTime; - } - } - public static class Int64Extensions - { - public static DateTime AsUnixSecondsToDateTime(this long seconds) - { - return DateTimeOffset.FromUnixTimeSeconds(seconds).DateTime.SetKind(DateTimeKind.Utc); - } - - public static DateTime AsUnixMillisecondsToDateTime(this long milliseconds) - { - return DateTimeOffset.FromUnixTimeMilliseconds(milliseconds).DateTime.SetKind(DateTimeKind.Utc); - } - } - public static class IntervalExtensions - { - [Serializable] - [CompilerGenerated] - private sealed class ? where ? : IComparable - { - public static readonly ? ?? = new ?(); - - public static Func, ?> ??; - - public static Func ??; - - public static Func, ?> ??; - - public static Func ??; - - internal ? ?(Interval P_0) - { - return P_0.Min; - } - - internal ? ?(? P_0) - { - return P_0; - } - - internal ? ?(Interval P_0) - { - return P_0.Max; - } - - internal ? ?(? P_0) - { - return P_0; - } - } - - /// - /// Combines intersecting intervals - /// - public static IEnumerable> Optimize(this IEnumerable> intervals) where T : IComparable - { - Interval[] source = intervals.ToArray(); - T[] array = (from P_0 in source - select P_0.Min into P_0 - orderby P_0 - select P_0).ToArray(); - T[] array2 = (from P_0 in source - select P_0.Max into P_0 - orderby P_0 - select P_0).ToArray(); - int num = 0; - int num2 = 0; - T val = array.First(); - int num3 = 0; - while (num < array.Length && num2 < array2.Length) - { - T val2 = array[num]; - T val3 = array2[num2]; - if (val2.CompareTo(val3) <= 0) - { - num3++; - num++; - } - else - { - num3--; - num2++; - } - if (num3 == 0) - { - yield return new Interval(val, val3); - val = val2; - } - } - yield return new Interval(val, array2.Last()); - } - } - public static class ListExtensions - { - public static void AddRange(this IList list, IEnumerable items) - { - if (items == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - foreach (T item in items) - { - list.Add(item); - } - } - } - public static class OidcClientOptionsExtensions - { - public static OidcClientOptions GetCopy(this OidcClientOptions oidc) - { - return new OidcClientOptions - { - Authority = oidc.Authority, - ClientId = oidc.ClientId, - ClientSecret = oidc.ClientSecret, - RedirectUri = oidc.RedirectUri, - PostLogoutRedirectUri = oidc.PostLogoutRedirectUri, - Scope = oidc.Scope, - ClockSkew = oidc.ClockSkew, - LoadProfile = oidc.LoadProfile, - ProviderInformation = oidc.ProviderInformation?.GetCopy() - }; - } - - public static ProviderInformation GetCopy(this ProviderInformation providerInformation) - { - return new ProviderInformation - { - IssuerName = providerInformation.IssuerName, - AuthorizeEndpoint = providerInformation.AuthorizeEndpoint, - TokenEndpoint = providerInformation.TokenEndpoint, - EndSessionEndpoint = providerInformation.EndSessionEndpoint, - KeySet = providerInformation.KeySet - }; - } - } - public static class OrderExtensions - { - public static double GetExecutionPrice(this IOrder order) - { - if (order != null) - { - OrderType orderType = order.OrderType; - if (orderType != null) - { - _ = orderType.Behavior; - if (0 == 0) - { - return order.OrderType.Behavior switch - { - OrderTypeBehavior.Unspecified => double.NaN, - OrderTypeBehavior.Market => double.NaN, - OrderTypeBehavior.Limit => order.Price, - OrderTypeBehavior.Stop => order.TriggerPrice, - OrderTypeBehavior.TrailingStop => order.TriggerPrice, - OrderTypeBehavior.StopLimit => order.Price, - _ => throw new ArgumentOutOfRangeException(), - }; - } - } - } - return double.NaN; - } - } - public static class OrderRequestParametersExtensions - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - internal bool ?(SlTpHolder P_0) - { - if (double.IsNaN(P_0.QuantityPercentage)) - { - return double.IsNaN(P_0.Quantity); - } - return false; - } - - internal bool ?(SlTpHolder P_0) - { - return P_0.Quantity == 0.0; - } - } - - public static double GetExecutionPrice(this OrderRequestParameters parameters) - { - if (parameters != null) - { - OrderType orderType = parameters.OrderType; - if (orderType != null) - { - _ = orderType.Behavior; - if (0 == 0) - { - return parameters.OrderType.Behavior switch - { - OrderTypeBehavior.Unspecified => double.NaN, - OrderTypeBehavior.Market => double.NaN, - OrderTypeBehavior.Limit => parameters.Price, - OrderTypeBehavior.Stop => parameters.TriggerPrice, - OrderTypeBehavior.TrailingStop => parameters.TriggerPrice, - OrderTypeBehavior.StopLimit => parameters.Price, - _ => throw new ArgumentOutOfRangeException(), - }; - } - } - } - return double.NaN; - } - - public static void SetExecutionPrice(this OrderRequestParameters parameters, double price) - { - if (parameters == null) - { - return; - } - OrderType orderType = parameters.OrderType; - if (orderType == null) - { - return; - } - _ = orderType.Behavior; - if (0 == 0) - { - switch (parameters.OrderType.Behavior) - { - case OrderTypeBehavior.Limit: - parameters.Price = price; - break; - case OrderTypeBehavior.Stop: - case OrderTypeBehavior.StopLimit: - parameters.TriggerPrice = price; - break; - case OrderTypeBehavior.TrailingStop: - break; - } - } - } - - public static bool IsCorrespondingOrder(this OrderRequestParameters parameters, IOrder order) - { - if (parameters.Symbol.IsSameAs(order.Symbol) && parameters.Account.Equals(order.Account) && parameters.OrderTypeId == order.OrderTypeId && parameters.Side == order.Side && Math.Abs(parameters.Quantity - order.TotalQuantity) < double.Epsilon) - { - return Math.Abs(parameters.OrderType.GetFillPrice(parameters) - order.GetExecutionPrice()) < double.Epsilon; - } - return false; - } - - public static bool TryCorrectBracketsQuantity(this OrderRequestParameters requestParameters, out string error) - { - error = null; - if (!?(requestParameters.Quantity, requestParameters.Symbol.LotStep, requestParameters.StopLossItems, out error)) - { - return false; - } - if (!?(requestParameters.Quantity, requestParameters.Symbol.LotStep, requestParameters.TakeProfitItems, out error)) - { - return false; - } - return true; - } - - private static bool ?(double P_0, double P_1, List P_2, out string P_3) - { - P_3 = null; - if (P_2 == null || P_2.Count == 0 || P_2.All((SlTpHolder slTpHolder) => double.IsNaN(slTpHolder.QuantityPercentage) && double.IsNaN(slTpHolder.Quantity))) - { - return true; - } - double num = 0.0; - foreach (SlTpHolder item in P_2) - { - if (double.IsNaN(item.QuantityPercentage)) - { - num += item.Quantity; - continue; - } - double num2 = (item.Quantity = CoreMath.RoundToIncrement(item.QuantityPercentage / 100.0 * P_0, P_1)); - num += num2; - } - if (num != P_0) - { - if (num < P_0) - { - P_2.Last().Quantity += P_0 - num; - } - else - { - if (!(P_2.Last().Quantity > num - P_0)) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(93, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(num); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - P_3 = defaultInterpolatedStringHandler.ToStringAndClear(); - return false; - } - P_2.Last().Quantity -= num - P_0; - } - } - if (P_2.Any((SlTpHolder slTpHolder) => slTpHolder.Quantity == 0.0)) - { - P_3 = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - return false; - } - return true; - } - } - public static class PeriodExtensions - { - public static Interval FindInterval(this Period period, DateTime dateTime) - { - return period.FindInterval(dateTime.Ticks); - } - - public static Interval FindInterval(this Period period, long dateTimeTicks) - { - long ticks = period.Ticks; - DateTime dateTime = new DateTime(dateTimeTicks - dateTimeTicks % ticks, DateTimeKind.Utc); - DateTime to = dateTime.AddTicks(ticks - 1); - return new Interval(dateTime, to); - } - } - public static class PositionExtensions - { - public static bool IsBreakevenPossible(this Position position) - { - PnLItem pnLItem = position?.NetPnL ?? position?.GrossPnL; - if (pnLItem == null) - { - return true; - } - return pnLItem.Value > 0.0; - } - } - public static class SelectItemExtensions - { - [CompilerGenerated] - private sealed class ? - { - public ? ??; - - internal bool ?(SelectItem P_0) - { - return P_0.Value.Equals(??); - } - } - - public static SelectItem GetItemByValue(this IEnumerable list, TValue value) - { - return list.FirstOrDefault((SelectItem P_0) => P_0.Value.Equals(value)); - } - } - public static class SessionsExtensions - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Comparison ??; - - internal bool ?(ISession P_0) - { - return P_0.IsPrimary; - } - - internal bool ?(ISession P_0) - { - return P_0.ContainsTime(TimeSpan.Zero); - } - - internal bool ?(ISession P_0) - { - return P_0.CloseTime > P_0.OpenTime; - } - - internal int ?(ISession P_0, ISession P_1) - { - return P_0.OpenTime.CompareTo(P_1.OpenTime); - } - } - - [CompilerGenerated] - private sealed class ? - { - public DateTime ??; - - internal bool ?(TimeZoneInfo.AdjustmentRule P_0) - { - return P_0.DateStart < ??.Date; - } - - internal bool ?(TimeZoneInfo.AdjustmentRule P_0) - { - return P_0.DateEnd > ??.Date; - } - - internal bool ?(TimeZoneInfo.AdjustmentRule P_0) - { - return P_0.DateStart < ??.Date; - } - - internal bool ?(TimeZoneInfo.AdjustmentRule P_0) - { - return P_0.DateEnd > ??.Date; - } - } - - [CompilerGenerated] - private sealed class ? - { - public DateTime ??; - - internal bool ?(ISession P_0) - { - return P_0.ContainsDate(??); - } - } - - [CompilerGenerated] - private sealed class ? - { - public DateTime ??; - - public ISessionsContainer ??; - - internal bool ?(ISession P_0) - { - return P_0.ContainsDate(??, ??.TimeZone); - } - - internal bool ?(ISession P_0) - { - return P_0.ContainsDate(??); - } - } - - public static bool ContainsDate(this ISession session, DateTime dateTime) - { - return session.ContainsTime(dateTime.TimeOfDay); - } - - public static bool ContainsDate(this ISession session, long dateTimeTicks) - { - return session.ContainsTime(dateTimeTicks % 864000000000L); - } - - public static bool ContainsTime(this ISession session, TimeSpan time) - { - return session.ContainsTime(time.Ticks); - } - - public static bool ContainsTime(this ISession session, long timeTicks) - { - if (session.OpenTime < session.CloseTime) - { - if (timeTicks < session.OpenTime.Ticks || timeTicks >= session.CloseTime.Ticks) - { - return false; - } - } - else if (timeTicks >= session.CloseTime.Ticks && timeTicks < session.OpenTime.Ticks) - { - return false; - } - return true; - } - - public static bool ContainsDate(this ISession session, DateTime dateTime, TimeZoneInfo timeZone) - { - TimeSpan time = dateTime.TimeOfDay + ?(dateTime, timeZone); - return session.ContainsTime(time); - } - - internal static TimeSpan ?(DateTime P_0, TimeZoneInfo P_1) - { - TimeSpan result = TimeSpan.Zero; - if (P_1 == null) - { - return result; - } - DateTime date = DateTime.UtcNow.Date; - if (!P_1.IsDaylightSavingTime(P_0) && P_1.IsDaylightSavingTime(date)) - { - TimeZoneInfo.AdjustmentRule adjustmentRule = (from adjustmentRule3 in P_1.GetAdjustmentRules() - where adjustmentRule3.DateStart < P_0.Date - where adjustmentRule3.DateEnd > P_0.Date - select adjustmentRule3).FirstOrDefault(); - if (adjustmentRule != null) - { - result = -adjustmentRule.DaylightDelta; - } - } - if (P_1.IsDaylightSavingTime(P_0) && !P_1.IsDaylightSavingTime(date)) - { - TimeZoneInfo.AdjustmentRule adjustmentRule2 = (from adjustmentRule3 in P_1.GetAdjustmentRules() - where adjustmentRule3.DateStart < P_0.Date - where adjustmentRule3.DateEnd > P_0.Date - select adjustmentRule3).FirstOrDefault(); - if (adjustmentRule2 != null) - { - result = adjustmentRule2.DaylightDelta; - } - } - return result; - } - - public static ISession GetSessionForDate(this ISessionsContainer sessionsContainer, DateTime dateTime) - { - ISession[] sessionsForDate = sessionsContainer.GetSessionsForDate(dateTime); - if (!sessionsForDate.Any()) - { - return null; - } - return sessionsForDate.FirstOrDefault((ISession P_0) => P_0.ContainsDate(dateTime)); - } - - public static bool ContainsDate(this ISessionsContainer sessionsContainer, DateTime dateTime) - { - ISession[] sessionsForDate = sessionsContainer.GetSessionsForDate(dateTime); - if (!sessionsForDate.Any()) - { - return false; - } - if (sessionsContainer.TimeZone != null && sessionsContainer.TimeZone.SupportsDaylightSavingTime) - { - return sessionsForDate.Any((ISession P_0) => P_0.ContainsDate(dateTime, sessionsContainer.TimeZone)); - } - return sessionsForDate.Any((ISession P_0) => P_0.ContainsDate(dateTime)); - } - - public static bool ContainsDate(this ISessionsContainer sessionsContainer, long dateTimeTicks) - { - return sessionsContainer.ContainsDate(new DateTime(dateTimeTicks, DateTimeKind.Utc)); - } - - public static long GetSessionOffset(this ISessionsContainer sessionsContainer, TimeZone timezone, bool isWeek, bool applyNegativeSignForInDaySession = true) - { - ISession session = sessionsContainer.?(); - long num = ((session == null) ? (-timezone.TimeZoneInfo.BaseUtcOffset.Ticks) : ((!(session.CloseTime >= session.OpenTime)) ? (-(TimeSpan.FromHours(24.0).Ticks - session.OpenTime.Ticks)) : (((!applyNegativeSignForInDaySession) ? 1 : (-1)) * session.OpenTime.Ticks))); - if (isWeek) - { - num += (long)(new DateTime(1, 1, 1, 0, 0, 0, DateTimeKind.Utc).DayOfWeek - 1) * 864000000000L; - } - return num; - } - - public static long GetSessionOpenTime(this ISessionsContainer sessionsContainer, TimeZone timezone) - { - return sessionsContainer.?()?.OpenTime.Ticks ?? timezone.TimeZoneInfo.BaseUtcOffset.Ticks; - } - - private static ISession ?(this ISessionsContainer P_0) - { - if (P_0 == null) - { - return null; - } - List list = P_0.ActiveSessions?.Where((ISession session) => session.IsPrimary).ToList(); - if (list == null || list.Count == 0) - { - list = P_0.ActiveSessions?.Where((ISession session) => session.ContainsTime(TimeSpan.Zero)).ToList(); - } - if (list == null || list.Count == 0) - { - list = P_0.ActiveSessions?.Where((ISession session) => session.CloseTime > session.OpenTime).ToList(); - } - if (list == null || list.Count == 0) - { - list = P_0.ActiveSessions?.ToList(); - } - list?.Sort((ISession session, ISession session2) => session.OpenTime.CompareTo(session2.OpenTime)); - return list?.FirstOrDefault(); - } - } - public static class SettingItemExtensions - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - internal string ?(SettingItem P_0) - { - return P_0.Name; - } - - internal string ?(SettingItem P_0) - { - return P_0.Name; - } - - internal SettingItem ?(SettingItem P_0) - { - return P_0; - } - - internal string ?(AdditionalInfoItem P_0) - { - return P_0.Id; - } - - internal object ?(AdditionalInfoItem P_0) - { - return P_0.Value; - } - - internal SettingItem ?(SettingItem P_0) - { - return P_0.GetCopy(); - } - } - - [CompilerGenerated] - private sealed class ? - { - public SettingItem ??; - - public object ??; - - internal void ?() - { - ??.Value = ??; - } - } - - public static SettingItem GetItemByName(this IEnumerable list, string name) - { - if (string.IsNullOrEmpty(name)) - { - return null; - } - foreach (SettingItem item in list) - { - if (item != null && item.Name == name) - { - return item; - } - } - return null; - } - - public static SettingItem GetItemByPath(this IEnumerable list, params string[] pathLevels) - { - if (pathLevels == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - IEnumerable list2 = list; - for (int i = 0; i < pathLevels.Length; i++) - { - string name = pathLevels[i]; - SettingItem itemByName = list2.GetItemByName(name); - if (itemByName == null) - { - return null; - } - if (i == pathLevels.Length - 1) - { - return itemByName; - } - list2 = itemByName.Value as IList; - } - return null; - } - - /// - /// Get all settings or particular settings by provided hierarchy path - /// - public static IEnumerable GetItemsByPath(this IEnumerable list, params string[] pathLevels) - { - if (pathLevels == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - IEnumerable enumerable = list; - for (int i = 0; i < pathLevels.Length; i++) - { - string text = pathLevels[i]; - if (string.IsNullOrEmpty(text)) - { - return enumerable; - } - SettingItem itemByName = enumerable.GetItemByName(text); - if (itemByName == null) - { - return null; - } - if (itemByName.Value is IList list2) - { - enumerable = list2; - } - else if (i == pathLevels.Length - 1) - { - return new List { itemByName }; - } - } - return enumerable; - } - - public static bool TryGetItemByName(this IEnumerable items, string name, out SettingItem item) - { - item = items?.GetItemByName(name); - return item != null; - } - - public static void ApplyVisualGroup(this IEnumerable list, SettingItemVisualGroup visualGroup, params string[] pathLevels) - { - if (pathLevels == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - IEnumerable itemsByPath = list.GetItemsByPath(pathLevels); - if (itemsByPath == null) - { - return; - } - foreach (SettingItem item in itemsByPath) - { - if (item.Type == SettingItemType.Group && item.Value is IEnumerable list2) - { - list2.ApplyVisualGroup(visualGroup); - } - else - { - item.VisualGroup = visualGroup; - } - } - } - - public static SettingItem UpdateItemValue(this IEnumerable list, string name, object newValue, bool force = false) - { - SettingItem itemByName = list.GetItemByName(name); - if (itemByName == null) - { - return null; - } - if (itemByName is SettingItemGroup && itemByName.Value is IList list2 && newValue is IList list3) - { - foreach (SettingItem item in list3) - { - list2.UpdateItemValue(item.Name, item.Value); - } - } - else - { - itemByName.?(newValue, force); - } - return itemByName; - } - - public static void UpdateValues(this IEnumerable list, IEnumerable other, bool ignoreValidation = false, params string[] filterNames) - { - if (list == null || other == null) - { - return; - } - Dictionary dictionary = other.DistinctBy((SettingItem P_0) => P_0.Name).ToDictionary((SettingItem P_0) => P_0.Name, (SettingItem P_0) => P_0); - foreach (SettingItem item in list) - { - if ((filterNames.Any() && !filterNames.Contains(item.Name)) || !dictionary.TryGetValue(item.Name, out var value)) - { - continue; - } - if (item.Value is IList list2 && value.Value is IList other2) - { - list2.UpdateValues(other2, ignoreValidation); - continue; - } - try - { - item.?(value.Value, ignoreValidation); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - } - - public static void UpdateValues(this IEnumerable list, AdditionalInfoCollection additionalInfoCollection) - { - if (additionalInfoCollection == null) - { - return; - } - Dictionary dictionary = additionalInfoCollection.ToDictionary((AdditionalInfoItem P_0) => P_0.Id, (AdditionalInfoItem P_0) => P_0.Value); - foreach (SettingItem item in list) - { - try - { - if (dictionary.TryGetValue(item.Name, out var value)) - { - item.?(value); - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - } - - public static bool IsAny(this IEnumerable list, Predicate predicate) - { - foreach (SettingItem item in list) - { - if (predicate(item)) - { - return true; - } - if (item.Value is IList list2 && list2.IsAny(predicate)) - { - return true; - } - } - return false; - } - - public static T GetValueOrDefault(this IEnumerable settings, T defaultValue, params string[] pathLevels) - { - SettingItem itemByPath = settings.GetItemByPath(pathLevels); - if (itemByPath == null) - { - return defaultValue; - } - return itemByPath.GetValue(); - } - - public static T GetVisibleValueOrDefault(this IEnumerable settings, T defaultValue, params string[] pathLevels) - { - SettingItem itemByPath = settings.GetItemByPath(pathLevels); - if (itemByPath == null || !itemByPath.Enabled || !itemByPath.Visible) - { - return defaultValue; - } - return itemByPath.GetValue(); - } - - public static T GetValue(this IEnumerable settings, params string[] pathLevels) - { - SettingItem itemByPath = settings.GetItemByPath(pathLevels); - if (itemByPath == null) - { - return default(T); - } - return itemByPath.GetValue(); - } - - public static T GetVisibleValue(this IEnumerable settings, params string[] pathLevels) - { - SettingItem itemByPath = settings.GetItemByPath(pathLevels); - if (itemByPath == null || !itemByPath.Enabled || !itemByPath.Visible) - { - return default(T); - } - return itemByPath.GetValue(); - } - - public static T GetValue(this SettingItem item) - { - try - { - object value = item.Value; - return (!(value is SelectItem selectItem)) ? ((!(value is PasswordHolder passwordHolder)) ? ((T)item.Value) : ((T)(object)passwordHolder.Password)) : ((!(typeof(T) == typeof(string))) ? ((T)selectItem.Value) : ((T)(object)selectItem.Value?.ToString())); - } - catch - { - return default(T); - } - } - - public static bool TryGetValue(this IEnumerable settings, string name, out T value) - { - value = default(T); - SettingItem itemByName = settings.GetItemByName(name); - if (itemByName == null) - { - return false; - } - value = itemByName.GetValue(); - return true; - } - - public static bool TryGetVisibleValue(this IEnumerable settings, string name, out T value) - { - value = default(T); - SettingItem itemByName = settings.GetItemByName(name); - if (itemByName == null || !itemByName.Enabled || !itemByName.Visible) - { - return false; - } - value = itemByName.GetValue(); - return true; - } - - public static IEnumerable ExpandGroups(this IEnumerable settings) - { - if (settings == null) - { - yield break; - } - foreach (SettingItem setting in settings) - { - if (setting.Value is IEnumerable settings2) - { - foreach (SettingItem item in settings2.ExpandGroups()) - { - yield return item; - } - } - else - { - yield return setting; - } - } - } - - public static SettingItem RestoreGroupsNesting(this SettingItem settingItem) - { - List list = new List(); - ?(settingItem, list); - if (list.Count > 0) - { - (list[0].Value as IList).Add(settingItem); - for (int i = 0; i < list.Count - 1; i++) - { - (list[i + 1].Value as IList).Add(list[i]); - } - return list.Last(); - } - return settingItem; - } - - public static void MergeWith(this IList origin, IList other) - { - if (other == null) - { - return; - } - foreach (SettingItem item in other) - { - SettingItem itemByName = origin.GetItemByName(item.Name); - if (itemByName == null) - { - origin.Add(item); - } - else if ((itemByName as SettingItemGroup)?.Value is IList origin2 && (item as SettingItemGroup)?.Value is IList other2) - { - origin2.MergeWith(other2); - } - else - { - itemByName.?(item); - } - } - } - - public static IEnumerable DeepCopy(this IEnumerable settings) - { - return settings.Select((SettingItem P_0) => P_0.GetCopy()); - } - - public static void SetValueWithReason(this SettingItem settingItem, object value, SettingItemValueChangingReason reason) - { - settingItem.InvokeActionWithReason(reason, delegate - { - settingItem.Value = value; - }); - } - - public static void InvokeActionWithReason(this SettingItem settingItem, SettingItemValueChangingReason reason, Action action) - { - SettingItemValueChangingReason valueChangingReason = settingItem.ValueChangingReason; - try - { - settingItem.ValueChangingReason = reason; - action?.Invoke(); - } - finally - { - settingItem.ValueChangingReason = valueChangingReason; - } - } - - [CompilerGenerated] - internal static void ?(SettingItem P_0, ICollection P_1) - { - if (P_0.Type == SettingItemType.Group) - { - SettingItemGroup item = new SettingItemGroup(P_0.Name, new List()); - P_1.Add(item); - } - if (P_0.Group != null) - { - ?(P_0.Group, P_1); - } - } - } - public static class StrategyExtensions - { - /// - /// Write info log message - /// - public static void LogInfo(this Strategy strategy, string message) - { - strategy.Log(message); - } - - /// - /// Write trading log message - /// - public static void LogTrading(this Strategy strategy, string message) - { - strategy.Log(message, StrategyLoggingLevel.Trading); - } - - /// - /// Write error log message - /// - public static void LogError(this Strategy strategy, string message) - { - strategy.Log(message, StrategyLoggingLevel.Error); - } - } - public static class StrategyMetricExtensions - { - public static void Add(this List metrics, string name, string formattedValue) - { - metrics.Add(new StrategyMetric - { - Name = name, - FormattedValue = formattedValue - }); - } - - public static void Add(this List metrics, string name, object value) - { - metrics.Add(name, value.ToString()); - } - } - public static class StringExtensions - { - public static bool Contains(this string str1, string str2, StringComparison stringComparison) - { - return str1.IndexOf(str2, stringComparison) >= 0; - } - - public static bool TryParseEnum(this string str, Func getAttributeValue, out TEnum enumValue) where TEnum : struct, IConvertible where TAttribute : Attribute - { - if (!typeof(TEnum).IsEnum) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - enumValue = default(TEnum); - FieldInfo[] fields = enumValue.GetType().GetFields(); - foreach (FieldInfo fieldInfo in fields) - { - object[] customAttributes = fieldInfo.GetCustomAttributes(typeof(TAttribute), inherit: false); - if (customAttributes.Length == 0) - { - continue; - } - object[] array = customAttributes; - for (int j = 0; j < array.Length; j++) - { - if (array[j] is TAttribute arg && getAttributeValue(arg) == str) - { - enumValue = (TEnum)fieldInfo.GetValue(null); - return true; - } - } - } - return false; - } - - public static string EncodeFilePathPart(this string fileName) - { - string text = fileName; - char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); - foreach (char value in invalidFileNameChars) - { - text = text.Replace($"{value}", $"{value}"); - } - return text; - } - } - public static class SymbolExtensions - { - public static ISessionsContainer FindSessionsContainer(this Symbol symbol) - { - if (symbol == null) - { - return null; - } - if (Core.Instance.CustomSessions.Assignments.TryGetSessionsContainer(symbol, out var container)) - { - return container; - } - SessionsContainer currentSessionsInfo = symbol.CurrentSessionsInfo; - if (currentSessionsInfo == null) - { - Exchange exchange = symbol.Exchange; - if (exchange == null) - { - return null; - } - currentSessionsInfo = exchange.CurrentSessionsInfo; - } - return currentSessionsInfo; - } - - public static TimeSpan GetHistoryDownloadingStep(this Symbol symbol, HistoryAggregation aggregation) - { - return symbol?.HistoryMetadata?.?(aggregation) ?? new TimeSpan(10, 0, 0, 0); - } - - public static double CalculateValue(this Symbol symbol, Side side, double price, double quantity) - { - if (symbol == null || double.IsNaN(price) || double.IsNaN(quantity)) - { - return double.NaN; - } - return (double)((side == Side.Buy) ? 1 : (-1)) * ((symbol.QuotingType == SymbolQuotingType.LotSize) ? (price * symbol.LotSize * quantity) : (price * (symbol.GetTickCost(price) / symbol.GetTickSize(price)) * quantity)); - } - - public static string GetFormattedPoints(this Symbol symbol, Side side, double closePrice, double openPrice) - { - double num = symbol.CalculatePoints(side, closePrice, openPrice); - if (double.IsNaN(num)) - { - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); - } - int precision = symbol.FindVariableTick(openPrice)?.Precision ?? CoreMath.GetValuePrecision((decimal)symbol.TickSize); - return num.Format(precision); - } - - public static string GetFormattedPoints(this Symbol symbol, double points, string suffix = "points") - { - if (double.IsNaN(points)) - { - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); - } - int valuePrecision = CoreMath.GetValuePrecision((decimal)symbol.TickSize); - return points.Format(valuePrecision) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + suffix; - } - - public static double CalculatePoints(this Symbol symbol, Side side, double closePrice, double openPrice) - { - if (double.IsNaN(closePrice) || double.IsNaN(openPrice)) - { - return double.NaN; - } - decimal num = (decimal)closePrice; - decimal num2 = (decimal)openPrice; - if (side != Side.Buy) - { - return (double)(num2 - num); - } - return (double)(num - num2); - } - - public static HistoricalData GetHistory(this Symbol symbol, Period period, HistoryType historyType, int itemsCount) - { - TimeSpan timeSpan = TimeSpan.FromDays(36500.0); - HistoricalData historicalData = null; - int i = 1; - long num = period.Ticks * itemsCount; - num *= 3; - num = Math.Min(timeSpan.Ticks, num); - DateTime dateTime = Core.Instance.TimeUtils.DateTimeUtcNow.AddTicks(-num); - DateTime dateTime2 = Core.Instance.TimeUtils.DateTimeUtcNow.Add(-timeSpan); - if (period >= Period.MIN1 && period <= Period.DAY1) - { - ISessionsContainer sessionsContainer = symbol.FindSessionsContainer(); - if (sessionsContainer != null) - { - int num2 = 0; - while (!sessionsContainer.ContainsDate(dateTime) && num2 < 5760) - { - dateTime = dateTime.AddTicks(-period.Ticks); - num2++; - } - } - } - int num3 = -1; - for (; historicalData == null || (dateTime > dateTime2 && 10 >= i); i++) - { - if (period.BasePeriod != BasePeriod.Tick) - { - historicalData = symbol.GetHistory(period, historyType, dateTime); - } - else - { - long ticks = ?(symbol.Connection, i); - historicalData = symbol.GetHistory(period, historyType, new DateTime(ticks, DateTimeKind.Utc)); - } - if (historicalData.Count > itemsCount || (num3 != -1 && num3 == historicalData.Count && period.BasePeriod == BasePeriod.Day)) - { - break; - } - if (historicalData.Count > 0) - { - num *= itemsCount / historicalData.Count + 1; - } - if (num >= dateTime.Ticks) - { - break; - } - dateTime = dateTime.AddTicks(-num); - num3 = historicalData.Count; - } - if (historicalData.Count > itemsCount && itemsCount != 0) - { - historicalData.CutItems(historicalData.Count - itemsCount); - } - return historicalData; - } - - public static DeltaCalculationType GetDeltaCalculationTypeForQuotes(this Symbol symbol) - { - if (!Core.Instance.SymbolsMapping.TryGetQuotesSymbol(symbol, out var quotesSymbol)) - { - return symbol.DeltaCalculationType; - } - return quotesSymbol.DeltaCalculationType; - } - - public static DeltaCalculationType GetDeltaCalculationTypeForHistory(this Symbol symbol, Period period) - { - if (!Core.Instance.SymbolsMapping.TryGetHistorySymbol(symbol, period, out var historySymbol)) - { - return symbol.DeltaCalculationType; - } - return historySymbol.DeltaCalculationType; - } - - public static DeltaCalculationType GetDeltaCalculationTypeForVolumeAnalysis(this Symbol symbol) - { - if (!Core.Instance.SymbolsMapping.TryGetVolumeAnalysisSymbol(symbol, out var volumeAnalysisSymbol)) - { - return symbol.DeltaCalculationType; - } - return volumeAnalysisSymbol.DeltaCalculationType; - } - - public static HistoryMetadata GetHistoryMetadata(this Symbol symbol) - { - if (!Core.Instance.SymbolsMapping.TryGetVolumeAnalysisSymbol(symbol, out var volumeAnalysisSymbol)) - { - return symbol.HistoryMetadata; - } - return volumeAnalysisSymbol.HistoryMetadata; - } - - public static bool TryGetTradingSymbolId(this Symbol symbol, out string tradingSymbolId) - { - tradingSymbolId = null; - if (symbol == null) - { - return false; - } - if (symbol.State == BusinessObjectState.Fake) - { - return false; - } - if (symbol.AdditionalInfo == null) - { - return false; - } - if (!symbol.AdditionalInfo.TryGetItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var item)) - { - return false; - } - tradingSymbolId = item.Value as string; - return !string.IsNullOrEmpty(tradingSymbolId); - } - - public static bool IsSameAs(this Symbol symbol, Symbol otherSymbol) - { - if (symbol.Equals(otherSymbol)) - { - return true; - } - if (symbol.TryGetTradingSymbolId(out var tradingSymbolId) && otherSymbol.Id == tradingSymbolId) - { - return true; - } - if (otherSymbol.TryGetTradingSymbolId(out tradingSymbolId) && symbol.Id == tradingSymbolId) - { - return true; - } - return false; - } - - public static Symbol GetTradingSymbol(this Symbol symbol) - { - if (!symbol.TryGetTradingSymbolId(out var tradingSymbolId)) - { - return null; - } - return Core.Instance.GetSymbol(new GetSymbolRequestParameters - { - SymbolId = tradingSymbolId - }, symbol.ConnectionId); - } - - [CompilerGenerated] - internal static long ?(Connection P_0, int P_1) - { - long ticks = P_0.HistoryMetaData.DownloadingStep_Tick.Ticks; - ticks = (long)((double)ticks * Math.Pow(2.0, --P_1)); - return Core.Instance.TimeUtils.DateTimeUtcNow.Ticks - ticks; - } - } - public static class TaskExtensions - { - public static void GetResultWithoutContextCapturing(this Task task) - { - task.ConfigureAwait(continueOnCapturedContext: false).GetAwaiter().GetResult(); - } - - public static T GetResultWithoutContextCapturing(this Task task) - { - return task.ConfigureAwait(continueOnCapturedContext: false).GetAwaiter().GetResult(); - } - } - public static class TimeInForceExtensions - { - public static string Format(this TimeInForce value, DateTime expiration = default(DateTime)) - { - if (expiration == default(DateTime)) - { - return value.ToString(); - } - switch (value) - { - case TimeInForce.GTD: - return value.ToString() + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + Core.Instance.TimeUtils.ConvertFromUTCToSelectedTimeZone(expiration).ToShortDateString() + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); - case TimeInForce.GTT: - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 2); - defaultInterpolatedStringHandler.AppendFormatted(value.ToString()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - defaultInterpolatedStringHandler.AppendFormatted(Core.Instance.TimeUtils.ConvertFromUTCToSelectedTimeZone(expiration), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - default: - return value.ToString(); - } - } - } - public static class TradingSignalExtensions - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal DateTime ?(Symbol P_0) - { - return P_0.ExpirationDate; - } - } - - [CompilerGenerated] - private sealed class ? - { - public TradingSignal ??; - - public Func ??; - - public Func ??; - - internal bool ?(Connection P_0) - { - return P_0.VendorName == ??.VendorName; - } - - internal bool ?(Symbol P_0) - { - return P_0.Name == ??.Ticker; - } - - internal bool ?(Connection P_0) - { - if (string.IsNullOrEmpty(??.VendorName) || P_0.VendorName == ??.VendorName) - { - return P_0.??.SymbolTypes.Contains(SymbolType.Futures); - } - return false; - } - - internal bool ?(Symbol P_0) - { - return P_0.Root == ??.Root; - } - } - - public static bool TryFindSymbol(this TradingSignal tradingSignal, out Symbol symbol) - { - symbol = null; - if (!string.IsNullOrEmpty(tradingSignal.Ticker)) - { - SearchSymbolsRequestParameters searchSymbolsRequestParameters = new SearchSymbolsRequestParameters - { - FilterName = tradingSignal.Ticker - }; - IList list = ((!string.IsNullOrEmpty(tradingSignal.VendorName)) ? Core.Instance.Connections.Connected.FirstOrDefault((Connection P_0) => P_0.VendorName == tradingSignal.VendorName)?.?(searchSymbolsRequestParameters) : Core.Instance.SearchSymbols(searchSymbolsRequestParameters)); - if (list == null || !list.Any()) - { - return false; - } - symbol = list.FirstOrDefault((Symbol P_0) => P_0.Name == tradingSignal.Ticker); - } - else if (!string.IsNullOrEmpty(tradingSignal.Root)) - { - foreach (Connection item in Core.Instance.Connections.Connected.Where((Connection P_0) => (string.IsNullOrEmpty(tradingSignal.VendorName) || P_0.VendorName == tradingSignal.VendorName) && P_0.??.SymbolTypes.Contains(SymbolType.Futures))) - { - IList source = item.?(new SearchSymbolsRequestParameters - { - FilterName = tradingSignal.Root, - SymbolTypes = new SymbolType[1] { SymbolType.Futures } - }); - if (!source.Any()) - { - continue; - } - List source2 = source.Where((Symbol P_0) => P_0.Root == tradingSignal.Root).ToList(); - if (source2.Any()) - { - symbol = source2.MinBy((Symbol P_0) => P_0.ExpirationDate); - if (symbol != null) - { - break; - } - } - } - } - if (symbol != null) - { - symbol = Core.Instance.GetSymbol(symbol.CreateInfo()); - } - Symbol symbol2 = symbol; - if (symbol2 != null) - { - return symbol2.State == BusinessObjectState.Normal; - } - return false; - } - } - public static class VolumeAnalysisExtensions - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func, VolumeAnalysisData> ??; - - public static Func ??; - - internal DateTime ?(VolumeAnalysisData P_0) - { - return P_0.TimeLeft; - } - - internal VolumeAnalysisData ?(VolumeAnalysisData P_0) - { - return P_0; - } - - internal VolumeAnalysisData ?(KeyValuePair P_0) - { - return P_0.Value; - } - - internal DateTime ?(VolumeAnalysisData P_0) - { - return P_0.TimeLeft; - } - } - - public static IEnumerable AggregateVolumeAnalysis(this IEnumerable tickItems, Period period, CancellationToken cancellationToken, double minVolumeAnalysisTickSize = double.NaN) - { - if (tickItems == null) - { - yield break; - } - VolumeAnalysisData volumeAnalysisData = null; - Interval interval = default(Interval); - foreach (IVolumeTickData tickItem in tickItems) - { - if (cancellationToken.IsCancellationRequested) - { - yield break; - } - DateTime dateTime = new DateTime(tickItem.Time, DateTimeKind.Utc); - if (!interval.Contains(dateTime)) - { - if (volumeAnalysisData != null) - { - yield return volumeAnalysisData; - } - interval = period.FindInterval(dateTime); - volumeAnalysisData = null; - } - if (volumeAnalysisData == null) - { - volumeAnalysisData = new VolumeAnalysisData - { - TimeLeft = interval.From - }; - } - double num = tickItem.Price; - if (!double.IsNaN(minVolumeAnalysisTickSize)) - { - num = CoreMath.RoundToIncrement(num, minVolumeAnalysisTickSize); - } - volumeAnalysisData.Calculate(num, tickItem.Volume, Symbol.ConvertTickDirection(tickItem.TickDirection)); - } - if (volumeAnalysisData != null) - { - yield return volumeAnalysisData; - } - } - - public static IEnumerable AggregateVolumeAnalysisByAgressor(this IEnumerable tickItems, Period period, CancellationToken cancellationToken, double minVolumeAnalysisTickSize = double.NaN) - { - if (tickItems == null) - { - yield break; - } - VolumeAnalysisData volumeAnalysisData = null; - Interval interval = default(Interval); - foreach (IVolumeTickData tickItem in tickItems) - { - if (cancellationToken.IsCancellationRequested) - { - yield break; - } - DateTime dateTime = new DateTime(tickItem.Time, DateTimeKind.Utc); - if (!interval.Contains(dateTime)) - { - if (volumeAnalysisData != null) - { - yield return volumeAnalysisData; - } - interval = period.FindInterval(dateTime); - volumeAnalysisData = null; - } - if (volumeAnalysisData == null) - { - volumeAnalysisData = new VolumeAnalysisData - { - TimeLeft = interval.From - }; - } - double num = tickItem.Price; - if (!double.IsNaN(minVolumeAnalysisTickSize)) - { - num = CoreMath.RoundToIncrement(num, minVolumeAnalysisTickSize); - } - volumeAnalysisData.Calculate(num, tickItem.Volume, tickItem.AggressorFlag); - } - if (volumeAnalysisData != null) - { - yield return volumeAnalysisData; - } - } - - public static IEnumerable AggregateVolumeAnalysis(this IEnumerable dataItems, Period period, CancellationToken cancellationToken) - { - if (dataItems == null) - { - yield break; - } - VolumeAnalysisData volumeAnalysisData = null; - Interval interval = default(Interval); - foreach (VolumeAnalysisData dataItem in dataItems) - { - if (cancellationToken.IsCancellationRequested) - { - yield break; - } - DateTime timeLeft = dataItem.TimeLeft; - if (!interval.Contains(timeLeft)) - { - if (volumeAnalysisData != null) - { - yield return volumeAnalysisData; - } - interval = period.FindInterval(timeLeft); - volumeAnalysisData = null; - } - if (volumeAnalysisData == null) - { - volumeAnalysisData = new VolumeAnalysisData - { - TimeLeft = interval.From - }; - } - volumeAnalysisData.Combine(dataItem); - } - if (volumeAnalysisData != null) - { - yield return volumeAnalysisData; - } - } - - public static IList Combine(this IEnumerable dataItems, IEnumerable anotherItems) - { - Dictionary dictionary = dataItems.ToDictionary((VolumeAnalysisData P_0) => P_0.TimeLeft, (VolumeAnalysisData P_0) => P_0); - foreach (VolumeAnalysisData anotherItem in anotherItems) - { - if (dictionary.TryGetValue(anotherItem.TimeLeft, out var value)) - { - value.Combine(anotherItem); - } - else - { - dictionary.Add(anotherItem.TimeLeft, anotherItem); - } - } - return (from P_0 in dictionary - select P_0.Value into P_0 - orderby P_0.TimeLeft - select P_0).ToList(); - } - - public static VolumeAnalysisData Collapse(this IEnumerable dataItems) - { - VolumeAnalysisData volumeAnalysisData = new VolumeAnalysisData(); - foreach (VolumeAnalysisData dataItem in dataItems) - { - volumeAnalysisData.Combine(dataItem); - } - return volumeAnalysisData; - } - } - public static class XElementExtensions - { - public static bool ToBool(this XElement element) - { - if (!bool.TryParse(element.Value, out var result)) - { - return false; - } - return result; - } - - public static int ToInt(this XElement element) - { - if (!int.TryParse(element.Value, out var result)) - { - return 0; - } - return result; - } - - public static long ToLong(this XElement element) - { - if (!long.TryParse(element.Value, out var result)) - { - return 0L; - } - return result; - } - - public static double ToDouble(this XElement element) - { - if (!double.TryParse(element.Value, NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) - { - return 0.0; - } - return result; - } - - public static decimal ToDecimal(this XElement element) - { - if (!decimal.TryParse(element.Value, out var result)) - { - return 0m; - } - return result; - } - - public static DateTime ToDateTime(this XElement element, bool toUTC = false) - { - if (DateTime.TryParse(element.Value, out var result)) - { - if (!toUTC) - { - return result; - } - return result.ToUniversalTime(); - } - return default(DateTime); - } - - public static DateTime ToDateTime(this XElement element, string format) - { - if (DateTime.TryParseExact(element.Value, format, CultureInfo.InvariantCulture, DateTimeStyles.None, out var result)) - { - return DateTime.SpecifyKind(result, DateTimeKind.Utc); - } - return default(DateTime); - } - - public static TimeSpan ToTimeSpan(this XElement element) - { - if (!TimeSpan.TryParse(element.Value, out var result)) - { - return default(TimeSpan); - } - return result; - } - - public static Color ToColor(this XElement element) - { - if (string.IsNullOrEmpty(element.Value)) - { - return Color.Empty; - } - int num = element.Value.IndexOf(','); - int num2 = element.Value.IndexOf(',', num + 1); - int num3 = element.Value.IndexOf(',', num2 + 1); - return Color.FromArgb(int.Parse(element.Value.Substring(num3 + 1, element.Value.Length - num3 - 1)), int.Parse(element.Value.Substring(0, num)), int.Parse(element.Value.Substring(num + 1, num2 - num - 1)), int.Parse(element.Value.Substring(num2 + 1, num3 - num2 - 1))); - } - - public static XElement ToXElement(this Color color, string nodeName = "Color") - { - XName? name = nodeName; - string content; - if (!color.IsEmpty) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 4); - defaultInterpolatedStringHandler.AppendFormatted(color.R); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(color.G); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(color.B); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(color.A); - content = defaultInterpolatedStringHandler.ToStringAndClear(); - } - else - { - content = string.Empty; - } - return new XElement(name, content); - } - - public static Font ToFont(this XElement element) - { - if (string.IsNullOrEmpty(element.Value)) - { - return null; - } - int num = element.Value.IndexOf(','); - int num2 = element.Value.IndexOf(',', num + 1); - int num3 = element.Value.IndexOf(',', num2 + 1); - float.TryParse(element.Value.Substring(num + 1, num2 - num - 1), NumberStyles.Float, CultureInfo.InvariantCulture, out var result); - return new Font(element.Value.Substring(0, num), result, (FontStyle)int.Parse(element.Value.Substring(num2 + 1, num3 - num2 - 1)), (GraphicsUnit)int.Parse(element.Value.Substring(num3 + 1, element.Value.Length - num3 - 1))); - } - - public static XElement ToXElement(this Font font, string nodeName = "Font") - { - XName? name = nodeName; - string content; - if (font != null) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 4); - defaultInterpolatedStringHandler.AppendFormatted(font.Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(font.Size.ToString(CultureInfo.InvariantCulture)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted((int)font.Style); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted((int)font.Unit); - content = defaultInterpolatedStringHandler.ToStringAndClear(); - } - else - { - content = string.Empty; - } - return new XElement(name, content); - } - } - public interface IRenamable - { - string Name { get; set; } - - bool IsNameAllowed(string s, ref string error); - } - public class Renamable : IRenamable - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Converter ??; - - internal string ?(string P_0) - { - return P_0.ToLower(); - } - } - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private List ??; - - public bool AllowFileSystemForbiddenSymbols = true; - - [CompilerGenerated] - private string ??; - - public bool AllowEmptyName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public List ExcludeNames - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool IsNameAllowed(string s, ref string error) - { - if (!AllowEmptyName && string.IsNullOrWhiteSpace(s)) - { - error = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - return false; - } - if (ExcludeNames != null && ExcludeNames.ConvertAll((string P_0) => P_0.ToLower()).ToArray().Contains(s.ToLower())) - { - error = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - return false; - } - char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); - if (s.IndexOfAny(invalidFileNameChars) != -1) - { - string text = string.Empty; - string text2 = string.Empty; - char[] array = invalidFileNameChars; - foreach (char c in array) - { - if (char.IsWhiteSpace(c) || char.IsControl(c)) - { - string text3 = text2; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(4, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted((int)c); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - text2 = text3 + defaultInterpolatedStringHandler.ToStringAndClear(); - } - else - { - string text4 = text; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(2, 1); - defaultInterpolatedStringHandler.AppendFormatted(c); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - text = text4 + defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - text2 = text2.Trim(); - text2 = text2.Trim(','); - text += text2; - error = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + text; - return false; - } - error = string.Empty; - return true; - } - } - /// - /// The application logger event. - /// - public class ApplicationLoggerEvent : LoggerEvent - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - public string Message - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string ConnectionName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - } -} -namespace ? -{ - internal class ? - { - [CompilerGenerated] - private LoggingLevel ??; - - [Option('l', "log", Required = false, HelpText = "Set logging level")] - public LoggingLevel LoggingLevel - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = loggingLevel; - } - } - } -} -namespace TradingPlatform.BusinessLayer -{ - public interface ILoggable - { - string Event { get; } - - string Message { get; } - } - public interface ILogger : IDisposable - { - LoggerScope AllowedScopes { get; } - - void Configure(LoggerConfig loggerConfig); - - void Log(string message, DateTime date, LoggingLevel level = LoggingLevel.System, string connection = null); - - void Log(string message, Exception exception, DateTime date, LoggingLevel level = LoggingLevel.Error, string connection = null); - - void Log(Exception exception, DateTime date, LoggingLevel level = LoggingLevel.Error, string connection = null); - - void Log(ILoggable loggable, DateTime date, LoggingLevel level = LoggingLevel.Error, string connection = null); - - List GetHistory(DateTime from, DateTime to); - - void DeleteLogFilesExcept(DateTime from, DateTime to); - } - [Flags] - public enum LoggerScope - { - Hidden = 0, - Application = 1, - General = 2, - LocalCopyTrading = 4 - } - public class LocalCopyTradingLoggerEvent : LoggerEvent - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private PlaceOrderRequestParameters ??; - - public string ConnectionName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public PlaceOrderRequestParameters OrderRequestParameters - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - } - public class Loggable : ILoggable - { - [CompilerGenerated] - private readonly string ??; - - [CompilerGenerated] - private readonly string ??; - - public string Event - { - [CompilerGenerated] - get - { - return ??; - } - } - - public string Message - { - [CompilerGenerated] - get - { - return ??; - } - } - - public Loggable(string @event, string message) - { - ?? = @event; - ?? = message; - } - } - public record LoggerConfig - { - public string LoggerName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string OutputFolderPath - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public LoggerScope Scope - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private LoggerScope ??; - - [CompilerGenerated] - public override string ToString() - { - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (PrintMembers(stringBuilder)) - { - stringBuilder.Append(' '); - } - stringBuilder.Append('}'); - return stringBuilder.ToString(); - } - - [CompilerGenerated] - protected virtual bool PrintMembers(StringBuilder builder) - { - RuntimeHelpers.EnsureSufficientExecutionStack(); - builder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - builder.Append((object?)LoggerName); - builder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - builder.Append((object?)OutputFolderPath); - builder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - builder.Append(Scope.ToString()); - return true; - } - } -} -namespace ? -{ - internal class ? : ILogger, IDisposable - { - [CompilerGenerated] - private readonly LoggerScope ??; - - private readonly ICollection ??; - - public LoggerScope AllowedScopes - { - [CompilerGenerated] - get - { - return ??; - } - } - - public ?(ICollection P_0) - { - ?? = new List(); - foreach (ILogger item in P_0) - { - ??.Add(item); - } - } - - public void Configure(LoggerConfig loggerConfig) - { - foreach (ILogger item in ??) - { - try - { - item.Configure(loggerConfig); - } - catch (Exception) - { - } - } - } - - public void Log(string message, DateTime date, LoggingLevel level = LoggingLevel.System, string connection = null) - { - foreach (ILogger item in ??) - { - try - { - item.Log(message, date, level, connection); - } - catch (Exception) - { - } - } - } - - public void Log(string message, Exception exception, DateTime date, LoggingLevel level = LoggingLevel.Error, string connection = null) - { - foreach (ILogger item in ??) - { - try - { - item.Log(message, exception, date, level, connection); - } - catch (Exception) - { - } - } - } - - public void Log(Exception exception, DateTime date, LoggingLevel level = LoggingLevel.Error, string connection = null) - { - foreach (ILogger item in ??) - { - try - { - item.Log(exception, date, level, connection); - } - catch (Exception) - { - } - } - } - - public void Log(ILoggable loggable, DateTime date, LoggingLevel level = LoggingLevel.Error, string connection = null) - { - foreach (ILogger item in ??) - { - try - { - item.Log(loggable, date, level, connection); - } - catch (Exception) - { - } - } - } - - public List GetHistory(DateTime from, DateTime to) - { - List list = new List(); - ILogger logger = ??.FirstOrDefault(); - if (logger != null) - { - list.AddRange(logger.GetHistory(from, to)); - } - return list; - } - - public void DeleteLogFilesExcept(DateTime from, DateTime to) - { - foreach (ILogger item in ??) - { - item.DeleteLogFilesExcept(from, to); - } - } - - public void Dispose() - { - foreach (ILogger item in ??) - { - item.Dispose(); - } - ??.Clear(); - } - } -} -namespace TradingPlatform.BusinessLayer -{ - public class LoggerEvent - { - [CompilerGenerated] - private LoggingLevel ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private string ??; - - public LoggingLevel Type - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DateTime Date - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Event - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - } - public sealed class LoggerManager : BufferedProcessor, IDisposable - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Action ??; - - public static Func ??; - - public static Func ??; - - public static Predicate ??; - - internal void ?(ParserSettings P_0) - { - P_0.IgnoreUnknownArguments = true; - } - - internal bool ?(TypeWrapper P_0) - { - return !P_0.Type.IsAbstract; - } - - internal Type ?(TypeWrapper P_0) - { - return P_0.Type; - } - - internal bool ?(ILogger P_0) - { - return P_0 == null; - } - } - - [CompilerGenerated] - private sealed class ? - { - public LoggerManager ??; - - public string ??; - - public LoggingLevel ??; - - public string ??; - - internal void ?() - { - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - ??.???.Log(??, dateTimeUtcNow, ??, ??); - ApplicationLoggerEvent applicationLoggerEvent = new ApplicationLoggerEvent - { - Date = dateTimeUtcNow, - Type = ??, - Event = ??, - Message = string.Empty, - ConnectionName = ?? - }; - ??.?(applicationLoggerEvent); - ??.?(dateTimeUtcNow, ??, string.Empty); - } - } - - [CompilerGenerated] - private sealed class ? - { - public LoggerManager ??; - - public string ??; - - public Exception ??; - - public LoggingLevel ??; - - public string ??; - - internal void ?() - { - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - ??.???.Log(??, ??, dateTimeUtcNow, ??, ??); - ApplicationLoggerEvent applicationLoggerEvent = new ApplicationLoggerEvent - { - Date = dateTimeUtcNow, - Type = ??, - Event = ??, - Message = GetFormattedErrorMessage(??), - ConnectionName = ?? - }; - ??.?(applicationLoggerEvent); - ??.?(dateTimeUtcNow, ??, ??.Message); - } - } - - [CompilerGenerated] - private sealed class ? - { - public LoggerManager ??; - - public ILoggable ??; - - public LoggingLevel ??; - - public string ??; - - internal void ?() - { - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - ??.??.Log(??, dateTimeUtcNow, ??, ??); - ApplicationLoggerEvent applicationLoggerEvent = new ApplicationLoggerEvent - { - Date = dateTimeUtcNow, - Type = ??, - Event = ??.Event, - Message = ??.Message, - ConnectionName = ?? - }; - ??.?(applicationLoggerEvent); - ??.?(dateTimeUtcNow, ??.Event, ??.Message); - } - } - - [CompilerGenerated] - private sealed class ? - { - public LoggerManager ??; - - public string ??; - - public DateTime ??; - - internal void ?() - { - ??.?(??, ??); - } - } - - [CompilerGenerated] - private sealed class ? - { - public ILogger ??; - - public DateTime ??; - - public DateTime ??; - - internal void ?() - { - ??.DeleteLogFilesExcept(??, ??); - } - } - - private const int ?? = 864000; - - private const int ?? = 600; - - private const string ?? = "Loggers"; - - private int ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private LoggingLevel ??; - - private ILogger ??; - - private readonly List ??; - - private readonly List ??; - - private readonly List ??; - - public bool EnableAutoDeleting - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int AutoDeletePeriod - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Current logging level - /// - public LoggingLevel CurrentLogLevel - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = loggingLevel; - } - } - - public event Action NewLog - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public LoggerManager() - { - AutoDeletePeriod = 30; - EnableAutoDeleting = true; - ?? = 863400; - ?? = new List(); - ?? = new List(); - ?? = new List(); - CurrentLogLevel = LoggingLevel.System | LoggingLevel.Error | LoggingLevel.Trading; - new Parser(delegate(ParserSettings P_0) - { - P_0.IgnoreUnknownArguments = true; - }).ParseArguments(Environment.GetCommandLineArgs()).WithParsed(delegate(? P_0) - { - AddLogLevel(P_0.LoggingLevel); - }).WithNotParsed(delegate(IEnumerable P_0) - { - foreach (Error item in P_0) - { - Log(item.ToString(), LoggingLevel.Error); - } - }); - } - - internal void ?() - { - List list = AssemblyLoader.LoadTypes(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), typeof(ILogger), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SearchOption.AllDirectories); - if (list != null) - { - ??.AddRange(from P_0 in list - where !P_0.Type.IsAbstract - select P_0.Type); - ?? = GetLogger(new LoggerConfig - { - LoggerName = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - OutputFolderPath = Path.Combine(Directory.GetParent(Const.EXECUTING_FOLDER).FullName, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - Scope = LoggerScope.Application - }); - Start(); - Core.Instance.?(?); - } - } - - public void Dispose() - { - Core.Instance.?(?); - Stop(); - if (?? != null) - { - ??.Dispose(); - ?? = null; - } - } - - public ILogger GetLogger(LoggerConfig loggerConfig) - { - List list = new List(); - foreach (Type item in ??) - { - ILogger logger = (ILogger)Activator.CreateInstance(item); - if (logger.AllowedScopes.HasFlag(loggerConfig.Scope)) - { - list.Add(logger); - } - } - ? ? = new ?(list); - ?.Configure(loggerConfig); - ?(?); - return ?; - } - - /// - /// Sets logs with custom messag, logging level, connection name - /// - public void Log(string message, LoggingLevel loggingLevel = LoggingLevel.System, string connectionName = null) - { - if (?(loggingLevel)) - { - Push(delegate - { - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - ???.Log(message, dateTimeUtcNow, loggingLevel, connectionName); - ApplicationLoggerEvent applicationLoggerEvent = new ApplicationLoggerEvent - { - Date = dateTimeUtcNow, - Type = loggingLevel, - Event = message, - Message = string.Empty, - ConnectionName = connectionName - }; - ?(applicationLoggerEvent); - ?(dateTimeUtcNow, message, string.Empty); - }); - } - } - - /// - /// Sets logs with exception and custom message (optional), logging level, connection name - /// - public void Log(Exception ex, string message = null, LoggingLevel loggingLevel = LoggingLevel.Error, string connectionName = null) - { - if (!(ex is ThreadAbortException) && ?(loggingLevel)) - { - Push(delegate - { - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - ???.Log(message, ex, dateTimeUtcNow, loggingLevel, connectionName); - ApplicationLoggerEvent applicationLoggerEvent = new ApplicationLoggerEvent - { - Date = dateTimeUtcNow, - Type = loggingLevel, - Event = message, - Message = GetFormattedErrorMessage(ex), - ConnectionName = connectionName - }; - ?(applicationLoggerEvent); - ?(dateTimeUtcNow, message, ex.Message); - }); - } - } - - /// - /// Sets logs with objects inherited from ILoggable interface,logging level, connection name - /// - public void Log(ILoggable loggable, LoggingLevel loggingLevel = LoggingLevel.System, string connectionName = null) - { - if (loggable == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (?(loggingLevel)) - { - Push(delegate - { - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - ??.Log(loggable, dateTimeUtcNow, loggingLevel, connectionName); - ApplicationLoggerEvent applicationLoggerEvent = new ApplicationLoggerEvent - { - Date = dateTimeUtcNow, - Type = loggingLevel, - Event = loggable.Event, - Message = loggable.Message, - ConnectionName = connectionName - }; - ?(applicationLoggerEvent); - ?(dateTimeUtcNow, loggable.Event, loggable.Message); - }); - } - } - - public void Log(string @event, string message, LoggingLevel loggingLevel = LoggingLevel.System, string connectionName = null) - { - Log(new Loggable(@event, message), loggingLevel, connectionName); - } - - private void ?(ApplicationLoggerEvent P_0) - { - ???.Invoke(P_0); - } - - /// - /// Sets a log level in case of deep debug - /// - public void AddLogLevel(LoggingLevel loggingLevel) - { - CurrentLogLevel |= loggingLevel; - } - - /// - /// Remove a log level if one has not needed already - /// - public void RemoveLogLevel(LoggingLevel loggingLevel) - { - CurrentLogLevel &= ~loggingLevel; - } - - public List GetHistory(DateTime from, DateTime to) - { - List list = new List(); - if (?? != null) - { - list.AddRange(??.GetHistory(from, to).OfType()); - } - return list; - } - - /// - /// Manage files existence in folder. - /// - public void RegisterExternalLogFolder(string path) - { - if (!Directory.Exists(path)) - { - return; - } - if (!??.Contains(path)) - { - ??.Add(path); - } - if (EnableAutoDeleting && ?? < 863400) - { - DateTime ?? = Core.Instance.TimeUtils.DateTimeUtcNow.AddDays(-AutoDeletePeriod); - Push(delegate - { - ?(path, ??); - }); - } - } - - private void ?() - { - if (?? == null || !EnableAutoDeleting) - { - return; - } - Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - DateTime dateTime = dateTimeUtcNow.AddDays(-AutoDeletePeriod); - foreach (ILogger item in ??) - { - item?.DeleteLogFilesExcept(dateTime, dateTimeUtcNow); - } - foreach (string item2 in ??) - { - ?(item2, dateTime); - } - Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - - private void ?(string P_0, DateTime P_1) - { - if (string.IsNullOrEmpty(P_0)) - { - return; - } - try - { - if (!Directory.Exists(P_0)) - { - return; - } - string[] files = Directory.GetFiles(P_0); - foreach (string text in files) - { - FileInfo fileInfo = new FileInfo(text); - if (fileInfo.CreationTimeUtc < P_1 || fileInfo.LastWriteTime < P_1) - { - File.Delete(text); - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - private void ?(ILogger P_0) - { - ??.RemoveAll((ILogger logger) => logger == null); - ??.Add(P_0); - if (EnableAutoDeleting && ?? < 863400) - { - DateTime ?? = Core.Instance.TimeUtils.DateTimeUtcNow; - DateTime ?? = ??.AddDays(-AutoDeletePeriod); - Push(delegate - { - P_0.DeleteLogFilesExcept(??, ??); - }); - } - } - - private void ?() - { - if (?? < 864000) - { - ??++; - return; - } - Push(?); - ?? = 0; - } - - private bool ?(LoggingLevel P_0) - { - if (!CurrentLogLevel.HasFlag(P_0)) - { - return (LoggingLevel.System | LoggingLevel.Error | LoggingLevel.Trading | LoggingLevel.LoadingHistory).HasFlag(P_0); - } - return true; - } - - private void ?(DateTime P_0, string P_1, string P_2) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(4, 1); - defaultInterpolatedStringHandler.AppendFormatted(P_0, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - StringBuilder stringBuilder = new StringBuilder(defaultInterpolatedStringHandler.ToStringAndClear()); - if (!string.IsNullOrEmpty(P_1)) - { - StringBuilder stringBuilder2 = stringBuilder; - StringBuilder stringBuilder3 = stringBuilder2; - StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(9, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(P_1); - stringBuilder3.Append(ref handler); - } - if (!string.IsNullOrEmpty(P_2)) - { - StringBuilder stringBuilder2 = stringBuilder; - StringBuilder stringBuilder4 = stringBuilder2; - StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(11, 1, stringBuilder2); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(P_2); - stringBuilder4.Append(ref handler); - } - } - - protected override void Process(Action subject) - { - subject?.Invoke(); - } - - protected static string GetFormattedErrorMessage(Exception ex) - { - return new StringBuilder().Append(ex.Message).Append(' ').Append(ex.StackTrace) - .Replace(Environment.NewLine, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - .ToString(); - } - - [CompilerGenerated] - private void ?(? P_0) - { - AddLogLevel(P_0.LoggingLevel); - } - - [CompilerGenerated] - private void ?(IEnumerable P_0) - { - foreach (Error item in P_0) - { - Log(item.ToString(), LoggingLevel.Error); - } - } - } - /// - /// ??? ?????????, ??????? ????? ?????????????? ??? ???????? email - /// - public class EmailParameters - { - public string[] address; - - public string subject; - - public string text; - - public string[] fileNames; - - public bool asFile; - - public SendMailCallbackDelegate callBack; - } - public delegate void SendMailCallbackDelegate(EmailSendCompletedResult result); - public class EmailSendCompletedResult - { - public EmailSendCompletedStatus Status; - - public string Message; - - public void SetError(Exception ex) - { - Message = ex.Message; - Status = EmailSendCompletedStatus.Failure; - } - } - public enum EmailSendCompletedStatus - { - Success, - Failure - } - public class MailUtils : ICustomizable - { - [CompilerGenerated] - private sealed class ? - { - public MailUtils ??; - - public EmailParameters ??; - - internal void ?() - { - try - { - ??.?(??); - } - catch (Exception error) - { - if (??.callBack != null) - { - EmailSendCompletedResult emailSendCompletedResult = new EmailSendCompletedResult(); - emailSendCompletedResult.SetError(error); - ??.callBack(emailSendCompletedResult); - } - } - } - } - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private int ??; - - public bool MailUseSSLConnection - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = flag; - } - } - - public string MailLogin - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public string MailPassword - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public int MailSMTPServerTimeout - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public string MailSMTPServer - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public int MailSMTPPort - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public IList Settings - { - get - { - List list = new List(); - list.Add(new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MailUseSSLConnection) - { - Text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - SortIndex = 10 - }); - if (MailLogin != null) - { - list.Add(new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MailLogin) - { - Text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - SortIndex = 30 - }); - } - if (MailPassword != null) - { - list.Add(new SettingItemPassword(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new PasswordHolder(MailPassword, SavePassword: true, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())) - { - Text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - SortIndex = 40 - }); - } - list.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MailSMTPServerTimeout) - { - Text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - SortIndex = 50, - Minimum = 0, - Maximum = int.MaxValue, - Increment = 1 - }); - if (MailSMTPServer != null) - { - list.Add(new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MailSMTPServer) - { - Text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - SortIndex = 70 - }); - } - list.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MailSMTPPort) - { - Text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - SortIndex = 80, - Minimum = 0, - Maximum = int.MaxValue, - Increment = 1 - }); - return list; - } - set - { - if (value == null) - { - return; - } - foreach (SettingItem value2 in new SettingsHolder(value).Values) - { - string name = value2.Name; - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - MailSMTPPort = (int)value2.Value; - } - } - else - { - MailSMTPServer = (string)value2.Value; - } - } - else - { - MailSMTPServerTimeout = (int)value2.Value; - } - } - else - { - MailPassword = (value2.Value as PasswordHolder).Password; - } - } - else - { - MailLogin = (string)value2.Value; - } - } - else - { - MailUseSSLConnection = (bool)value2.Value; - } - } - } - } - - private void ?(EmailParameters P_0) - { - EmailSendCompletedResult emailSendCompletedResult = new EmailSendCompletedResult(); - MailMessage mailMessage = new MailMessage(); - SmtpClient smtpClient = null; - try - { - if (string.IsNullOrEmpty(MailLogin)) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - mailMessage.From = new MailAddress(MailLogin); - mailMessage.Subject = P_0.subject; - if (P_0.address != null) - { - string[] address = P_0.address; - foreach (string addresses in address) - { - mailMessage.To.Add(addresses); - } - } - AlternateView item = AlternateView.CreateAlternateViewFromString(P_0.text, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - string text = P_0.text; - if (text != null) - { - text = text.Replace(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - text = text.Replace(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (P_0.fileNames != null) - { - if (!P_0.asFile) - { - text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - for (int j = 0; j < P_0.fileNames.Length; j++) - { - text = text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + j + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - AlternateView alternateView = AlternateView.CreateAlternateViewFromString(text, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - for (int k = 0; k < P_0.fileNames.Length; k++) - { - if (P_0.fileNames[k] != null) - { - LinkedResource linkedResource = new LinkedResource(P_0.fileNames[k]); - linkedResource.ContentId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + k; - alternateView.LinkedResources.Add(linkedResource); - } - } - mailMessage.AlternateViews.Add(item); - mailMessage.AlternateViews.Add(alternateView); - } - else - { - mailMessage.AlternateViews.Add(item); - string[] address = P_0.fileNames; - foreach (string fileName in address) - { - mailMessage.Attachments.Add(new Attachment(fileName)); - } - } - } - else - { - AlternateView item2 = AlternateView.CreateAlternateViewFromString(text, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - mailMessage.AlternateViews.Add(item); - mailMessage.AlternateViews.Add(item2); - } - smtpClient = new SmtpClient(MailSMTPServer) - { - Credentials = new NetworkCredential(mailMessage.From.Address, MailPassword), - EnableSsl = MailUseSSLConnection, - Port = MailSMTPPort, - Timeout = MailSMTPServerTimeout - }; - smtpClient.Send(mailMessage); - emailSendCompletedResult.Status = EmailSendCompletedStatus.Success; - } - catch (Exception error) - { - emailSendCompletedResult.SetError(error); - } - finally - { - mailMessage?.Dispose(); - smtpClient?.Dispose(); - P_0.callBack?.Invoke(emailSendCompletedResult); - } - } - - /// - /// ???????? ????????? ?? E-mail - /// - public void SendAsync(EmailParameters parameters) - { - Task.Factory.StartNew(delegate - { - try - { - ?(parameters); - } - catch (Exception error) - { - if (parameters.callBack != null) - { - EmailSendCompletedResult emailSendCompletedResult = new EmailSendCompletedResult(); - emailSendCompletedResult.SetError(error); - parameters.callBack(emailSendCompletedResult); - } - } - }); - } - - internal void ?() - { - } - } - [Serializable] - public class PairColor : IXElementSerialization, IEquatable - { - [CompilerGenerated] - private Color ??; - - [CompilerGenerated] - private Color ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - public Color Color1 - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Color Color2 - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Text1 - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Text2 - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public PairColor() - { - } - - public PairColor(Color color1, Color color2, string text1 = null, string text2 = null) - { - Color1 = color1; - Color2 = color2; - Text1 = text1; - Text2 = text2; - } - - public XElement ToXElement() - { - return new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Color1.ToXElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), Color2.ToXElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - Color1 = xElement.ToColor(); - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - Color2 = xElement2.ToColor(); - } - } - - public bool Equals(PairColor other) - { - if (other == null) - { - return false; - } - if (this == other) - { - return true; - } - if (Color1.Equals(other.Color1) && Color2.Equals(other.Color2) && Text1 == other.Text1) - { - return Text2 == other.Text2; - } - return false; - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - if (this == obj) - { - return true; - } - if (obj.GetType() != GetType()) - { - return false; - } - return Equals((PairColor)obj); - } - - public override int GetHashCode() - { - return HashCode.Combine(Color1, Color2, Text1, Text2); - } - } - public class PublishedAttribute : Attribute - { - } - public class NotPublishedAttribute : Attribute - { - } - public static class loc - { - private const string ?? = "CoreLocarizer"; - - public const string HIDDEN = "#hidden#"; - - private static ? ??; - - private static Dictionary ?? = new Dictionary(); - - private static CultureInfo DefaultCultureInfo => CultureInfo.CurrentUICulture; - - private static CultureInfo TerminalCultureInfo => CultureInfo.DefaultThreadCurrentUICulture; - - /// - /// - /// - public static void OnLocaleChanged() - { - foreach (? value in ??.Values) - { - value.?(TerminalCultureInfo); - } - ???.?(TerminalCultureInfo); - } - - private static ? ?(string P_0, string P_1) - { - return new ? - { - DirectoryPath = Path.GetDirectoryName(P_0), - Name = P_1 - }; - } - - /// - /// ?????, ?? ?????? ??? ??????? xgettext.exe - /// - /// - /// - public static string key(string text) - { - return text; - } - - public static string _(string text, string pluginFolderName = null, [CallerFilePath] string callerFilePath = null) - { - if (string.IsNullOrWhiteSpace(text)) - { - return string.Empty; - } - string empty = string.Empty; - string text2 = text; - empty = ((!string.IsNullOrWhiteSpace(pluginFolderName)) ? pluginFolderName : ?(callerFilePath)); - if (!string.IsNullOrWhiteSpace(empty)) - { - if (??.ContainsKey(empty) && ??[empty].Catalog.Translations.ContainsKey(text)) - { - text2 = ??[empty].Catalog.GetString(text); - } - if (!text2.Equals(text)) - { - return text2; - } - } - if (?? != null && ??.Catalog.Translations.ContainsKey(text)) - { - text2 = ??.Catalog.GetString(text); - } - return text2; - } - - /// - /// Check, whether current translation equal to hidden - /// - public static bool IsHidden(string text, string pluginFolderName = null, [CallerFilePath] string callerFilePath = null) - { - try - { - if (string.IsNullOrWhiteSpace(text)) - { - return false; - } - if (text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - return true; - } - string empty = string.Empty; - bool flag = false; - empty = ((!string.IsNullOrWhiteSpace(pluginFolderName)) ? pluginFolderName : ?(callerFilePath)); - if (!string.IsNullOrWhiteSpace(empty)) - { - if (??.ContainsKey(empty) && ??[empty].CatalogEN.Translations.ContainsKey(text)) - { - flag = ??[empty].CatalogEN.GetString(text) == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - if (flag) - { - return flag; - } - } - if (?? != null && ??.CatalogEN.Translations.ContainsKey(text)) - { - flag = ??.CatalogEN.GetString(text) == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - return flag; - } - catch - { - return false; - } - } - - private static string ?(string P_0) - { - if (P_0 == null) - { - return string.Empty; - } - foreach (string item in Path.GetDirectoryName(P_0).Split(Path.DirectorySeparatorChar).Reverse()) - { - if (??.ContainsKey(item)) - { - return item; - } - } - return string.Empty; - } - - /// - /// - /// - /// - public static void UnRegisterPlugin(string pluginName) - { - if (??.ContainsKey(pluginName)) - { - ? ? = ??[pluginName]; - ?.?(); - if (?.AttachedPluginCounter <= 0) - { - ??.Remove(pluginName); - } - } - } - - /// - /// - /// - /// - /// - public static void RegisterPlugin(string pluginName, string location) - { - if (!??.ContainsKey(pluginName)) - { - ? ? = ?(location, pluginName); - ??[pluginName] = new ?(TerminalCultureInfo ?? DefaultCultureInfo, ?); - } - } - - /// - /// - /// - public static void InitializeCoreLocalizer() - { - ? ? = ?(Assembly.GetCallingAssembly().Location, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - ?? = new ?(TerminalCultureInfo ?? DefaultCultureInfo, ?); - } - } -} -namespace ? -{ - internal class ? - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - public string DirectoryPath - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - } - internal class ? - { - private const string ?? = "locale"; - - private ? ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private Catalog ??; - - [CompilerGenerated] - private Catalog ??; - - internal int AttachedPluginCounter - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - internal Catalog Catalog - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = catalog; - } - } - - internal Catalog CatalogEN - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = catalog; - } - } - - internal ?(CultureInfo P_0, ? P_1) - { - Catalog = new Catalog(); - AttachedPluginCounter = 0; - ?? = P_1; - ?(); - ?(P_0); - ?(); - } - - internal void ?(CultureInfo P_0) - { - Catalog = new Catalog(); - if (P_0 != null) - { - string text = ?(??, P_0); - if (File.Exists(text)) - { - MoLoader loader = new MoLoader(text); - Catalog = new Catalog(loader); - } - } - } - - internal void ?() - { - AttachedPluginCounter++; - } - - internal void ?() - { - AttachedPluginCounter--; - } - - private string ?(? P_0, CultureInfo P_1) - { - return Path.Combine(P_0.DirectoryPath, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_1.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - - private void ?() - { - CatalogEN = new Catalog(); - try - { - CultureInfo cultureInfo = CultureInfo.GetCultureInfo(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - string text = ?(??, cultureInfo); - if (File.Exists(text)) - { - MoLoader loader = new MoLoader(text); - CatalogEN = new Catalog(loader); - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - CatalogEN = new Catalog(); - } - } - } -} -namespace TradingPlatform.BusinessLayer -{ - /// - /// Allows to save Symbols into named lists - /// - public class SymbolList : IComparable, ICustomizable, IRenamable - { - [CompilerGenerated] - private sealed class ? - { - public string ??; - - internal bool ?(SymbolList P_0) - { - return P_0.Name == ??; - } - } - - [CompilerGenerated] - private bool ??; - - private string ??; - - [CompilerGenerated] - private string ??; - - private List ??; - - public bool AllowToModify - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = flag; - } - } - - public string Name - { - get - { - return ??; - } - set - { - if (AllowToModify) - { - if (Core.Instance.SymbolList.FirstOrDefault((SymbolList P_0) => P_0.Name == ??) != null) - { - Core.Instance.RenameSymbolList(??, value); - } - else - { - Core.Instance.AddSymbolList(value, Symbols); - } - } - } - } - - public string Group - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IEnumerable Symbols - { - get - { - foreach (BusinessObjectInfo item in ??) - { - yield return new Symbol(item); - } - } - set - { - ??.Clear(); - foreach (Symbol item in value) - { - ??.Add(item.CreateInfo()); - } - } - } - - public IList Settings - { - get - { - List list = new List - { - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name) - }; - foreach (Symbol symbol in Symbols) - { - list.Add(new SettingItemSymbol(symbol.Name, symbol)); - } - return list; - } - set - { - List list = new List(); - foreach (SettingItem item in value) - { - if (item.Type == SettingItemType.Symbol) - { - list.Add(item.Value as Symbol); - } - else if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - ?(item.Value as string); - } - } - if (list.Count > 0) - { - Symbols = list; - } - } - } - - public bool IsNameAllowed(string s, ref string error) - { - if (string.IsNullOrWhiteSpace(s)) - { - error = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - return false; - } - if (Name != s && Core.Instance.SymbolList.Any((SymbolList P_0) => P_0.Name == s)) - { - error = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - return false; - } - return true; - } - - public IEnumerable GetRealSymbols() - { - foreach (BusinessObjectInfo item in ??) - { - yield return Core.Instance.GetSymbol(item); - } - } - - internal SymbolList() - { - ?? = new List(); - AllowToModify = true; - } - - public SymbolList(string name, IEnumerable symbols) - : this() - { - if (string.IsNullOrEmpty(name)) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ?(name); - Symbols = symbols ?? throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - - internal SymbolList(IList P_0, bool P_1) - : this() - { - Settings = P_0; - AllowToModify = P_1; - } - - public int CompareTo(object obj) - { - return Name.CompareTo((obj as SymbolList).Name); - } - - internal void ?(string P_0) - { - if (AllowToModify) - { - ?? = P_0; - } - } - - [CompilerGenerated] - private bool ?(SymbolList P_0) - { - return P_0.Name == ??; - } - } - public sealed class TimeUtils - { - public enum TimeFormat - { - Hours12, - Hours24 - } - - public static readonly string[] AvailableDateFormats = new string[12] - { - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }; - - public const long UNIX_START_TIME_TICKS = 621355968000000000L; - - [CompilerGenerated] - private TimeZone ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private ? ??; - - private CultureInfo ??; - - [CompilerGenerated] - private bool ??; - - public DateTime DateTimeUtcNow => DateTime.UtcNow.AddMilliseconds(TimeSynchronizer.ServerTimeOffset); - - public int ServerTimeOffset => TimeSynchronizer?.ServerTimeOffset ?? 0; - - public TimeZone SelectedTimeZone - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DateTime StartTerminalDateTimeUtc - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - internal ? TimeSynchronizer - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = ?; - } - } - - public bool IsSyncFailed => TimeSynchronizer.State == ?.??; - - public string SyncErrorMessage => TimeSynchronizer.LastSyncErrorMessage; - - public CultureInfo CultureInfo - { - get - { - if (!UseUICultureInfo) - { - return ??; - } - return CultureInfo.CurrentCulture; - } - } - - public bool UseUICultureInfo - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string DateFormatPattern - { - get - { - return ??.DateTimeFormat.ShortDatePattern; - } - set - { - if (!string.IsNullOrEmpty(value)) - { - ??.DateTimeFormat.ShortDatePattern = value; - ??.DateTimeFormat.DateSeparator = (value.Contains('.') ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - } - - public TimeFormat TimeHoursFormat - { - get - { - if (!??.DateTimeFormat.ShortTimePattern.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - return TimeFormat.Hours24; - } - return TimeFormat.Hours12; - } - set - { - ??.DateTimeFormat.ShortTimePattern = ((value == TimeFormat.Hours12) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - ??.DateTimeFormat.LongTimePattern = ((value == TimeFormat.Hours12) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public TimeUtils() - { - TimeSynchronizer = new ?(); - SelectedTimeZone = new TimeZone(TimeZoneType.Local); - UseUICultureInfo = true; - ?? = (CultureInfo)CultureInfo.InvariantCulture.Clone(); - DateFormatPattern = AvailableDateFormats[0]; - TimeHoursFormat = TimeFormat.Hours24; - } - - internal void ?() - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - TimeSynchronizer.?(); - StartTerminalDateTimeUtc = DateTimeUtcNow; - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - } - - internal void ?() - { - TimeSynchronizer.Dispose(); - } - - public DateTime ConvertFromUTCToSelectedTimeZone(DateTime dateTime) - { - return ConvertFromUTCToTimeZone(dateTime, SelectedTimeZone); - } - - public TimeSpan ConvertFromUTCToSelectedTimeZone(TimeSpan time) - { - return ConvertFromUTCToTimeZone(time, SelectedTimeZone); - } - - public DateTime ConvertFromSelectedTimeZoneToUTC(DateTime dateTime) - { - return ConvertFromTimeZoneToUTC(dateTime, SelectedTimeZone); - } - - public DateTime ConvertFromUTCToTimeZone(DateTime dateTime, TimeZone timeZone) - { - if (timeZone.TimeZoneInfo != null && dateTime.Kind != DateTimeKind.Local) - { - return TimeZoneInfo.ConvertTimeFromUtc(dateTime, timeZone.TimeZoneInfo); - } - return dateTime; - } - - public TimeSpan ConvertFromUTCToTimeZone(TimeSpan time, TimeZone timeZone) - { - DateTime dateTime = DateTimeUtcNow.Date + time; - if (timeZone.TimeZoneInfo != null && dateTime.Kind != DateTimeKind.Local) - { - return TimeZoneInfo.ConvertTimeFromUtc(dateTime, timeZone.TimeZoneInfo).TimeOfDay; - } - return time; - } - - public DateTime ConvertFromTimeZoneToUTC(DateTime dateTime, TimeZone timeZone) - { - if (dateTime.Kind == DateTimeKind.Utc) - { - return dateTime; - } - if (dateTime.Kind == DateTimeKind.Local) - { - dateTime = DateTime.SpecifyKind(dateTime, DateTimeKind.Unspecified); - } - if (timeZone.TimeZoneInfo != null) - { - return TimeZoneInfo.ConvertTimeToUtc(dateTime, timeZone.TimeZoneInfo); - } - return dateTime; - } - - public string GetFormatedDateTime(DateTime dateTime) - { - return dateTime.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo); - } - - public string GetFormatedDateShortTime(DateTime dateTime) - { - return dateTime.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo); - } - - public string GetFormatedDate(DateTime dateTime) - { - return dateTime.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo); - } - - public string GetFormatedDateTimeWithMilliseconds(DateTime dateTime) - { - string text = CultureInfo.DateTimeFormat.ShortDatePattern + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + CultureInfo.DateTimeFormat.LongTimePattern.Replace(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return dateTime.ToString(text, CultureInfo); - } - - public string GetFormatedShortTime(DateTime dateTime) - { - return dateTime.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo); - } - - public string GetFormatedLongTime(DateTime dateTime) - { - return dateTime.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo); - } - - public string GetFormatedLongTimeWithMilliseconds(DateTime dateTime) - { - string text = CultureInfo.DateTimeFormat.LongTimePattern.Replace(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return dateTime.ToString(text, CultureInfo); - } - - public string GetFormatedLongTime(TimeSpan timeSpan) - { - return GetFormatedLongTime(DateTimeUtcNow.Date + timeSpan); - } - } - public readonly struct TimeZone : IEquatable, IComparable, IComparable - { - [CompilerGenerated] - private readonly TimeZoneInfo ??; - - [CompilerGenerated] - private readonly TimeZoneType ??; - - public TimeZoneInfo TimeZoneInfo - { - [CompilerGenerated] - get - { - return ??; - } - } - - public TimeZoneType Type - { - [CompilerGenerated] - get - { - return ??; - } - } - - public bool IsEmpty - { - get - { - if (Type == TimeZoneType.Specific) - { - return TimeZoneInfo == null; - } - return false; - } - } - - public TimeZone(TimeZoneType type, TimeZoneInfo timeZoneInfo = null) - { - if (type == TimeZoneType.Local && timeZoneInfo != null) - { - throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (type == TimeZoneType.Specific && timeZoneInfo == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ?? = type; - ?? = ((type == TimeZoneType.Local) ? TimeZoneInfo.Local : timeZoneInfo); - } - - public static string ShortName(TimeZone timeZone) - { - if (timeZone.Type != TimeZoneType.Local) - { - return ?(timeZone.TimeZoneInfo, false); - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - - public static string Cities(TimeZone timeZone) - { - return ?(timeZone.TimeZoneInfo, true); - } - - private static string ?(TimeZoneInfo P_0, bool P_1) - { - if (P_0 == null) - { - return string.Empty; - } - if (P_0.Id == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - if (P_1) - { - int num = P_0.DisplayName.IndexOf(')') + 1; - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.DisplayName.Substring(num, P_0.DisplayName.Length - num); - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.DisplayName.Substring(1, P_0.DisplayName.IndexOf(')') - 1); - } - - public static bool operator ==(TimeZone timeZone1, TimeZone timeZone2) - { - if (timeZone1.Type == timeZone2.Type) - { - return timeZone1.TimeZoneInfo?.Id == timeZone2.TimeZoneInfo?.Id; - } - return false; - } - - public static bool operator !=(TimeZone timeZone1, TimeZone timeZone2) - { - if (timeZone1.Type == timeZone2.Type) - { - return timeZone1.TimeZoneInfo?.Id != timeZone2.TimeZoneInfo?.Id; - } - return true; - } - - public bool Equals(TimeZone other) - { - if (object.Equals(TimeZoneInfo, other.TimeZoneInfo)) - { - return Type == other.Type; - } - return false; - } - - public override bool Equals(object obj) - { - if (obj is TimeZone other) - { - return Equals(other); - } - return false; - } - - public override int GetHashCode() - { - return (((TimeZoneInfo != null) ? TimeZoneInfo.GetHashCode() : 0) * 397) ^ (int)Type; - } - - public int CompareTo(TimeZone other) - { - if (TimeZoneInfo == null) - { - return 1; - } - if (other.TimeZoneInfo == null) - { - return -1; - } - int num = TimeZoneInfo.BaseUtcOffset.CompareTo(other.TimeZoneInfo.BaseUtcOffset); - if (num != 0) - { - return num; - } - return string.Compare(TimeZoneInfo.Id, other.TimeZoneInfo.Id, StringComparison.Ordinal); - } - - public int CompareTo(object obj) - { - if (!(obj is TimeZone other)) - { - return 0; - } - return CompareTo(other); - } - - public override string ToString() - { - return TimeZoneInfo?.DisplayName; - } - } - public enum TimeZoneType - { - Specific, - Local - } - /// - /// Defines a trading operation respond bundle - /// - public sealed class TradingOperationResult : ILoggable - { - [CompilerGenerated] - private TradingOperationResultStatus ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private long ??; - - /// - /// Respond operation state - /// - public TradingOperationResultStatus Status - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = tradingOperationResultStatus; - } - } - - /// - /// Respond message - /// - public string Message - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Respond order id - /// - public string OrderId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public long RequestId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - string ILoggable.Event => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - string ILoggable.Message => ToString(); - - private TradingOperationResult() - { - } - - public static TradingOperationResult CreateSuccess(long requestId, string orderId = null) - { - return new TradingOperationResult - { - RequestId = requestId, - Status = TradingOperationResultStatus.Success, - OrderId = orderId - }; - } - - public static TradingOperationResult CreateError(long requestId, string message) - { - return new TradingOperationResult - { - RequestId = requestId, - Status = TradingOperationResultStatus.Failure, - Message = message - }; - } - - [NotPublished] - public void SetOrderId(string orderId) - { - OrderId = orderId; - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 3); - defaultInterpolatedStringHandler.AppendFormatted(Status); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted((Status == TradingOperationResultStatus.Success) ? (3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + OrderId) : Message); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(RequestId); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - public delegate TradingOperationResult TradingRequestHandler(TradingRequestParameters requestParameters); - public struct ValidateResult - { - [CompilerGenerated] - private ValidateState ??; - - [CompilerGenerated] - private string ??; - - public ValidateState State - { - [CompilerGenerated] - readonly get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Reason - { - [CompilerGenerated] - readonly get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public static ValidateResult Valid => new ValidateResult - { - State = ValidateState.Valid - }; - - public static ValidateResult NotValid(string reason) - { - return new ValidateResult - { - State = ValidateState.NotValid, - Reason = reason - }; - } - } - /// - /// Provides VA calculation parameters - /// - [Published] - public class VolumeAnalysisCalculationParameters - { - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private DeltaCalculationType ??; - - [CompilerGenerated] - private CumulativeDeltaReset ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private ISessionsContainer ??; - - [CompilerGenerated] - private TimeZone ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - public double FilteredVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool ForceReload - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DeltaCalculationType DeltaCalculationType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public CumulativeDeltaReset CumulativeDeltaReset - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double CustomTickSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int CustomStep - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public ISessionsContainer SessionsContainer - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public TimeZone TimeZone - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool CalculatePriceLevels - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool ForceUsingTickData - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public VolumeAnalysisCalculationParameters() - { - FilteredVolume = 0.0; - ForceReload = false; - DeltaCalculationType = DeltaCalculationType.AggressorFlag; - CustomTickSize = double.NaN; - CustomStep = 1; - CalculatePriceLevels = true; - ForceUsingTickData = false; - } - - internal VolumeAnalysisCalculationParameters(VolumeAnalysisCalculationParameters P_0) - { - FilteredVolume = P_0.FilteredVolume; - ForceReload = P_0.ForceReload; - DeltaCalculationType = P_0.DeltaCalculationType; - CumulativeDeltaReset = P_0.CumulativeDeltaReset; - CustomTickSize = P_0.CustomTickSize; - CustomStep = P_0.CustomStep; - SessionsContainer = P_0.SessionsContainer; - TimeZone = P_0.TimeZone; - CalculatePriceLevels = P_0.CalculatePriceLevels; - ForceUsingTickData = P_0.ForceUsingTickData; - } - } - /// - /// Provides VA calculation request per - /// - [Published] - public class VolumeAnalysisCalculationRequest : VolumeAnalysisCalculationParameters - { - [CompilerGenerated] - private Symbol ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private DateTime ??; - - public Symbol Symbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DateTime From - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DateTime To - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - internal string Marker => Symbol?.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Symbol?.ConnectionId; - - public VolumeAnalysisCalculationRequest() - { - } - - internal VolumeAnalysisCalculationRequest(VolumeAnalysisCalculationRequest P_0) - : base(P_0) - { - Symbol = P_0.Symbol; - From = P_0.From; - To = P_0.To; - } - - internal VolumeAnalysisCalculationRequest(VolumeAnalysisCalculationParameters P_0) - : base(P_0) - { - } - } -} -namespace ? -{ - internal abstract class ? : IVolumeAnalysisCalculationProgress, IDisposable - { - protected enum ? - { - ??, - ??, - ??, - ??, - ??, - ??, - ??, - ?? - } - - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func> ??; - - public static Func ??; - - internal DateTime ?(VolumeAnalysisInterval P_0) - { - return P_0.Interval.From; - } - - internal IEnumerable ?(VolumeAnalysisInterval P_0) - { - return P_0.VolumeAnalysis; - } - - internal long ?(Period P_0) - { - return P_0.Ticks; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Period ??; - - internal bool ?(Period P_0) - { - return P_0.Ticks < ??.Ticks; - } - } - - [CompilerGenerated] - private EventHandler ??; - - [CompilerGenerated] - private EventHandler ??; - - private VolumeAnalysisCalculationState ??; - - [CompilerGenerated] - private int ??; - - private readonly CancellationTokenSource ??; - - protected readonly VolumeAnalysisCalculationRequest ??; - - private Interval ??; - - private Interval ??; - - [CompilerGenerated] - private bool ?? = true; - - private readonly ManualResetEventSlim ??; - - private readonly ConcurrentQueue ??; - - private bool ??; - - private DateTime? ??; - - public VolumeAnalysisCalculationState State - { - get - { - return ??; - } - protected internal set - { - if (volumeAnalysisCalculationState != ??) - { - ?? = volumeAnalysisCalculationState; - ?(); - if (State == VolumeAnalysisCalculationState.Finished) - { - ??.Set(); - } - } - } - } - - public int ProgressPercent => (int)(??.GetLength().Ticks * 100 / CorrectedInterval.GetLength().Ticks); - - public int ProgressBarIndex - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public bool IsAborted => ??.IsCancellationRequested; - - protected CancellationToken CancellationToken => ??.Token; - - protected Interval CorrectedInterval - { - get - { - return ??; - } - private set - { - ?? = interval; - ?? = new Interval(??.To, ??.To); - } - } - - public VolumeAnalysisCalculationParameters CalculationParameters => new VolumeAnalysisCalculationParameters(??); - - protected Symbol Symbol => ??.Symbol; - - protected Connection Connection => Symbol?.Connection; - - protected VolumeAnalysisMetadata VolumeAnalysisMetadata => Symbol?.VolumeAnalysisMetadata; - - protected double PriceStep - { - get - { - double num = Symbol.TickSize; - if (!??.CustomTickSize.IsNanOrDefault()) - { - num = ??.CustomTickSize; - } - if (??.CustomStep > 1) - { - num *= (double)??.CustomStep; - } - return num; - } - } - - public bool AllowByLicense - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = flag; - } - } - - public event EventHandler StateChanged - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - public event EventHandler ProgressChanged - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - protected ?(VolumeAnalysisCalculationRequest P_0) - { - ?? = P_0 ?? throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - CorrectedInterval = new Interval(??.From, ??.To); - ?? = new CancellationTokenSource(); - ?? = VolumeAnalysisCalculationState.None; - ProgressBarIndex = int.MaxValue; - ?? = new ConcurrentQueue(); - ?? = new ManualResetEventSlim(); - } - - internal virtual void ?() - { - if (Symbol == null || Symbol.State == BusinessObjectState.Fake || (Connection == null && Symbol.SymbolType != SymbolType.Synthetic)) - { - State = VolumeAnalysisCalculationState.Finished; - return; - } - try - { - State = VolumeAnalysisCalculationState.Processing; - ?(); - CorrectedInterval = ?(); - if (CorrectedInterval.IsEmpty) - { - State = VolumeAnalysisCalculationState.Finished; - return; - } - if (?(out var ?2)) - { - ?(); - return; - } - bool flag = (((uint)(?2 - 3) <= 1u || ?2 == ?.?.??) ? true : false); - if (flag && Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ??.Symbol).Status == TradingOperationStatus.NotAllowed) - { - Core.Instance.PushDealTicket(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Symbol?.Connection?.VendorName, DealTicketType.Refuse); - return; - } - foreach (Interval item in CorrectedInterval.Reverse().Split(Symbol?.HistoryMetadata?.DownloadingStep_Tick ?? TimeSpan.FromHours(1.0), roundToStep: true)) - { - int num = 0; - try - { - if (IsAborted) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 1); - defaultInterpolatedStringHandler.AppendFormatted(this); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); - break; - } - HistoricalData history = Symbol.GetHistory(new HistoryRequestParameters - { - Symbol = Symbol, - FromTime = item.From, - ToTime = item.To, - Aggregation = new HistoryAggregationTick((Symbol.VolumeType == SymbolVolumeType.Volume) ? HistoryType.Last : HistoryType.BidAsk), - CancellationToken = CancellationToken, - ForceReload = ??.ForceReload - }); - if (history.Count > 0) - { - IHistoryItem historyItem = history.LastOrDefault(); - if (historyItem != null && (!??.HasValue || ?? < historyItem.TimeLeft)) - { - ?? = historyItem.TimeLeft; - } - num = ?(history, item); - } - else if (!??.HasValue) - { - ?? = CorrectedInterval.From; - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - if (item.To == CorrectedInterval.To) - { - ?? = true; - ?(); - } - ?(item.From, (num != 0) ? num : ProgressBarIndex); - } - } - } - catch (Exception ex2) - { - Core.Instance.Loggers.Log(ex2); - } - finally - { - try - { - if (!??) - { - ?? = true; - ?(); - } - ?(); - } - catch (Exception ex3) - { - Core.Instance.Loggers.Log(ex3); - } - State = VolumeAnalysisCalculationState.Finished; - } - } - - private protected virtual void ?() - { - } - - public void AbortLoading() - { - ???.Cancel(); - } - - public void Wait(CancellationToken token = default(CancellationToken)) - { - WaitHandle.WaitAny(new WaitHandle[3] - { - ??.WaitHandle, - ???.Token.WaitHandle, - token.WaitHandle - }); - } - - public virtual void Dispose() - { - ?(); - ??.Clear(); - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(13, 3); - defaultInterpolatedStringHandler.AppendFormatted(GetType().Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - defaultInterpolatedStringHandler.AppendFormatted(CorrectedInterval); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - protected virtual bool ?(out ? P_0) - { - P_0 = ?.?.??; - VolumeAnalysisMetadata volumeAnalysisMetadata = VolumeAnalysisMetadata; - if (volumeAnalysisMetadata == null || !volumeAnalysisMetadata.IsVolumeAnalysisAvailable) - { - P_0 = ?.?.??; - return false; - } - if (Symbol.VolumeType != SymbolVolumeType.Volume) - { - P_0 = ?.?.??; - return false; - } - if (??.DeltaCalculationType != Symbol.GetDeltaCalculationTypeForVolumeAnalysis()) - { - P_0 = ?.?.??; - return false; - } - if (!??.FilteredVolume.IsNanOrDefault()) - { - P_0 = ?.?.??; - return false; - } - if (??.ForceUsingTickData) - { - P_0 = ?.?.??; - return false; - } - if (!VolumeAnalysisMetadata.TryFindLargestLoadingPeriod(CorrectedInterval, ??.CalculatePriceLevels, out var _)) - { - P_0 = ?.?.??; - return false; - } - return true; - } - - protected abstract void ?(); - - protected void ?(Interval P_0, Period P_1, ? P_2) - { - IDictionary downloadingStepByPeriod = VolumeAnalysisMetadata.GetDownloadingStepByPeriod(??.CalculatePriceLevels); - foreach (Interval item in P_0.Reverse().Split(downloadingStepByPeriod[P_1], roundToStep: true)) - { - int progressBarIndex = ProgressBarIndex; - try - { - if (IsAborted) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 1); - defaultInterpolatedStringHandler.AppendFormatted(this); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); - break; - } - VolumeAnalysisByPeriodRequestParameters volumeAnalysisByPeriodRequestParameters = new VolumeAnalysisByPeriodRequestParameters - { - SymbolId = Symbol.Id, - FromTime = item.From, - ToTime = item.To.AddTicks(-1L), - Period = P_1, - CalculatePriceLevels = ??.CalculatePriceLevels, - CancellationToken = CancellationToken, - MinVolumeAnalysisTickSize = Symbol.MinVolumeAnalysisTickSize, - SessionsContainer = ??.SessionsContainer - }; - List list = new List(); - List parametersForServerRequest = new List(); - VolumeAnalysisStorage volumeAnalysisStorage = Symbol.Connection.VolumeAnalysisStorage; - if (!??.ForceReload && volumeAnalysisStorage != null) - { - IList collection = volumeAnalysisStorage.Load(volumeAnalysisByPeriodRequestParameters, out parametersForServerRequest); - if (IsAborted) - { - LoggerManager loggers2 = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 1); - defaultInterpolatedStringHandler.AppendFormatted(this); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers2.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); - break; - } - list.AddRange(collection); - } - else - { - parametersForServerRequest.Add(volumeAnalysisByPeriodRequestParameters); - } - foreach (VolumeAnalysisByPeriodRequestParameters item2 in parametersForServerRequest) - { - if (IsAborted) - { - LoggerManager loggers3 = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 1); - defaultInterpolatedStringHandler.AppendFormatted(this); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers3.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); - return; - } - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - item2.ForceReload = ??.ForceReload; - if (item2.ToTime.Ticks % 10 == 0L) - { - item2.ToTime = item2.ToTime.AddTicks(-1L); - } - VolumeAnalysisInterval volumeAnalysisInterval = Connection.LoadVolumeAnalysis(item2); - if (volumeAnalysisInterval?.VolumeAnalysis == null) - { - continue; - } - list.Add(volumeAnalysisInterval); - Period period = item2.Period; - TimeSpan timeSpan = period.BasePeriod switch - { - BasePeriod.Month => TimeSpan.FromDays(2.0), - BasePeriod.Year => TimeSpan.FromDays(2.0), - _ => TimeSpan.FromHours(2.0), - }; - VolumeAnalysisData volumeAnalysisData = volumeAnalysisInterval.VolumeAnalysis.LastOrDefault(); - if (volumeAnalysisData != null) - { - DateTime dateTime = period.BasePeriod switch - { - BasePeriod.Month => volumeAnalysisData.TimeLeft.AddMonths(period.PeriodMultiplier), - BasePeriod.Year => volumeAnalysisData.TimeLeft.AddYears(period.PeriodMultiplier), - _ => volumeAnalysisData.TimeLeft.AddTicks(period.Ticks), - }; - if (dateTime > item2.Interval.To && dateTime > dateTimeUtcNow) - { - volumeAnalysisInterval = new VolumeAnalysisInterval - { - Description = volumeAnalysisInterval.Description, - VolumeAnalysis = volumeAnalysisInterval.VolumeAnalysis.Take(volumeAnalysisInterval.VolumeAnalysis.Count - 1).ToList(), - Interval = new Interval(volumeAnalysisInterval.Interval.From, volumeAnalysisData.TimeLeft) - }; - } - else if (volumeAnalysisInterval.Interval.To > dateTimeUtcNow - timeSpan) - { - volumeAnalysisInterval = new VolumeAnalysisInterval - { - Description = volumeAnalysisInterval.Description, - VolumeAnalysis = volumeAnalysisInterval.VolumeAnalysis.ToList(), - Interval = new Interval(volumeAnalysisInterval.Interval.From, dateTime) - }; - } - } - else if (!volumeAnalysisInterval.Interval.IsEmpty) - { - DateTime dateTime2 = item2.Interval.To.FloorTo(new TimeSpan(period.Ticks)); - if (dateTime2 > dateTimeUtcNow - timeSpan) - { - dateTime2 = (dateTimeUtcNow - timeSpan).FloorTo(new TimeSpan(period.Ticks)); - } - if (dateTime2 < item2.Interval.From) - { - dateTime2 = item2.Interval.From; - } - volumeAnalysisInterval = new VolumeAnalysisInterval - { - Description = volumeAnalysisInterval.Description, - VolumeAnalysis = volumeAnalysisInterval.VolumeAnalysis.ToList(), - Interval = new Interval(volumeAnalysisInterval.Interval.From, dateTime2) - }; - } - if (!volumeAnalysisInterval.Interval.IsEmpty) - { - if (volumeAnalysisInterval.Interval.To.Microsecond == 999) - { - volumeAnalysisInterval = new VolumeAnalysisInterval - { - Description = volumeAnalysisInterval.Description, - VolumeAnalysis = volumeAnalysisInterval.VolumeAnalysis, - Interval = new Interval(volumeAnalysisInterval.Interval.From, volumeAnalysisInterval.Interval.To.AddTicks(1L)) - }; - } - _ = volumeAnalysisInterval.Interval.To.Second; - volumeAnalysisStorage?.Save(volumeAnalysisInterval); - } - } - List list2 = list.OrderBy((VolumeAnalysisInterval volumeAnalysisInterval2) => volumeAnalysisInterval2.Interval.From).SelectMany((VolumeAnalysisInterval volumeAnalysisInterval2) => volumeAnalysisInterval2.VolumeAnalysis).ToList(); - if (list2 == null || list2.Count <= 0) - { - continue; - } - VolumeAnalysisData volumeAnalysisData2 = list2.LastOrDefault(); - if (volumeAnalysisData2 != null) - { - DateTime value = (VolumeAnalysisMetadata.BuildUncompletedBars ? volumeAnalysisData2.TimeLeft.AddTicks(P_1.Ticks) : volumeAnalysisData2.TimeLeft); - if (!??.HasValue || ?? < value) - { - ?? = value; - } - } - P_2?.Invoke(list2, item, ref progressBarIndex); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - if (!?? && item.To == CorrectedInterval.To) - { - ?(P_1, item, P_2); - ?? = true; - ?(); - } - ?(item.From, progressBarIndex); - } - } - } - - private void ?(Period P_0, Interval P_1, ? P_2) - { - if (!VolumeAnalysisMetadata.BuildUncompletedBars) - { - return; - } - Period[] array = (from period2 in VolumeAnalysisMetadata.GetAllowedPeriods(??.CalculatePriceLevels) - where period2.Ticks < P_0.Ticks - orderby period2.Ticks descending - select period2).ToArray(); - if (!array.Any()) - { - Interval interval; - if (??.HasValue) - { - interval = new Interval(??.Value, P_1.To); - } - else - { - TimeSpan maxTicksLoadingPeriod = VolumeAnalysisMetadata.MaxTicksLoadingPeriod; - interval = ((!(P_1.GetLength() > maxTicksLoadingPeriod)) ? P_1 : new Interval(P_1.To - maxTicksLoadingPeriod, P_1.To)); - } - HistoricalData history = Symbol.GetHistory(new HistoryRequestParameters - { - Symbol = Symbol, - Interval = interval, - Aggregation = new HistoryAggregationTick((Symbol.VolumeType == SymbolVolumeType.Volume) ? HistoryType.Last : HistoryType.BidAsk), - CancellationToken = CancellationToken, - ForceReload = ??.ForceReload, - HistoryRequestType = HistoryRequestType.BuildUncompleteBarLogic - }); - IHistoryItem historyItem = history.LastOrDefault(); - if (historyItem != null && (!??.HasValue || ?? < historyItem.TimeLeft)) - { - ?? = historyItem.TimeLeft; - } - ?(history, P_1); - return; - } - Period[] array2 = array; - foreach (Period period in array2) - { - DateTime dateTime = (??.HasValue ? ??.Value : ((P_0.BasePeriod == BasePeriod.Tick) ? P_1.From : (((P_1.To - P_1.From).Ticks >= P_0.Ticks) ? P_1.To.AddTicks(-P_0.Ticks) : P_1.From))); - if (dateTime == P_1.To) - { - break; - } - ?(new Interval(dateTime, P_1.To), period, P_2); - } - } - - protected abstract int ?(HistoricalData P_0, Interval P_1); - - protected virtual void ?() - { - if (Symbol != null) - { - if (Symbol.VolumeType == SymbolVolumeType.Volume) - { - Symbol.NewLast += ?; - } - else - { - Symbol.NewQuote += ?; - } - } - } - - protected virtual void ?() - { - if (Symbol != null) - { - if (Symbol.VolumeType == SymbolVolumeType.Volume) - { - Symbol.NewLast -= ?; - } - else - { - Symbol.NewQuote -= ?; - } - } - } - - private void ?(Symbol P_0, MessageQuote P_1) - { - ?(P_1); - } - - protected virtual void ?(MessageQuote P_0) - { - if (!?(P_0)) - { - ?(P_0); - } - } - - protected abstract VolumeAnalysisData ?(long P_0); - - private bool ?(MessageQuote P_0) - { - if (?? && ??.IsEmpty) - { - return false; - } - ??.Enqueue(P_0); - return true; - } - - private void ?() - { - MessageQuote result; - while (??.TryDequeue(out result)) - { - if (result != null) - { - ?(result); - } - } - } - - private void ?(MessageQuote P_0) - { - if (P_0.Time <= (?? ?? CorrectedInterval.To) || !AllowByLicense) - { - return; - } - VolumeAnalysisData volumeAnalysisData = ?(P_0.Time.Ticks); - if (volumeAnalysisData == null) - { - return; - } - lock (volumeAnalysisData) - { - volumeAnalysisData.?(??, P_0); - } - } - - protected virtual Interval ?() - { - DateTime dateTime = ??.From; - DateTime dateTime2 = ??.To; - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - if (dateTime > dateTimeUtcNow) - { - dateTime = dateTimeUtcNow; - } - if (dateTime2 > dateTimeUtcNow) - { - dateTime2 = dateTimeUtcNow; - } - if (Symbol.QuoteDelay != default(TimeSpan) && dateTime2 > dateTimeUtcNow - Symbol.QuoteDelay) - { - dateTime2 = dateTimeUtcNow - Symbol.QuoteDelay; - } - return new Interval(dateTime, dateTime2); - } - - protected void ?(DateTime P_0, int P_1 = int.MaxValue) - { - ?? = new Interval(P_0, ??.To); - ProgressBarIndex = P_1; - ?(); - } - - private void ?() - { - ???.InvokeSafely(this, new VolumeAnalysisTaskEventArgs(this)); - } - - private void ?() - { - ???.InvokeSafely(this, new VolumeAnalysisTaskEventArgs(this)); - } - } - internal delegate void ?(IList P_0, Interval P_1, ref int P_2); - internal class ? : ?, IVolumeAnalysisCalculationTask, IDisposable - { - [Serializable] - [CompilerGenerated] - private new sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - internal Period ?(Period P_0) - { - return P_0; - } - - internal DateTime ?(VolumeAnalysisData P_0) - { - return P_0.TimeLeft; - } - } - - [CompilerGenerated] - private new sealed class ? - { - public long ??; - - public Period ??; - - public ? ??; - - public DateTime ??; - - public DateTime ??; - - public DateTime ??; - - public VolumeAnalysisData ??; - - public Func ??; - - internal bool ?(Period P_0) - { - return P_0.Ticks <= ??; - } - - internal bool ?(Period P_0) - { - return P_0 < ??; - } - - internal void ?(IList P_0, Interval P_1, ref int P_2) - { - if (??.?? == default(DateTime) || ??.?? > ??) - { - ??.?? = ??; - } - if (??.?? == default(DateTime) || ??.?? < ??) - { - ??.?? = ??; - } - if (P_0.Count > 0) - { - ?? = new DateTime(Math.Max(??.Ticks, ((IEnumerable)P_0).Max((Func)?.?.??.?).Ticks + ??.Ticks), DateTimeKind.Utc); - } - if (??.??.SessionsContainer != null && ?? < Period.DAY1) - { - P_0 = P_0.Where((VolumeAnalysisData volumeAnalysisData) => ??.??.SessionsContainer.ContainsDate(volumeAnalysisData.TimeLeft)).ToList(); - } - ??.Combine(P_0.Collapse()); - } - - internal bool ?(VolumeAnalysisData P_0) - { - return ??.??.SessionsContainer.ContainsDate(P_0.TimeLeft); - } - } - - [CompilerGenerated] - private VolumeAnalysisData ??; - - private DateTime ??; - - private DateTime ??; - - public VolumeAnalysisData Result - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = volumeAnalysisData; - } - } - - public IVolumeAnalysisCalculationProgress Progress => this; - - internal ?(VolumeAnalysisCalculationRequest P_0) - : base(P_0) - { - Result = new VolumeAnalysisData(); - } - - public override void Dispose() - { - Result = null; - base.Dispose(); - } - - protected override void ?() - { - try - { - ?(base.CorrectedInterval, Result); - if (base.PriceStep != base.Symbol.TickSize) - { - Result = Result?.CreateAggregatedSnapshot(base.PriceStep); - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - ?(base.CorrectedInterval.From); - } - } - - private void ?(Interval P_0, VolumeAnalysisData P_1, Period P_2 = default(Period)) - { - if (P_0.IsEmpty) - { - return; - } - Period[] allowedPeriods = base.VolumeAnalysisMetadata.GetAllowedPeriods(??.CalculatePriceLevels); - long ?? = (P_0.To - P_0.From).Ticks; - allowedPeriods = allowedPeriods.Where((Period period) => period.Ticks <= ??).ToArray(); - if (P_2 == default(Period)) - { - P_2 = allowedPeriods.Max((Period result) => result); - } - else - { - P_2 = allowedPeriods.FirstOrDefault((Period period) => period < P_2); - } - if (P_2 == default(Period)) - { - HistoricalData history = base.Symbol.GetHistory(new HistoryRequestParameters - { - Symbol = base.Symbol, - Interval = P_0, - Aggregation = new HistoryAggregationTick((base.Symbol.VolumeType == SymbolVolumeType.Volume) ? HistoryType.Last : HistoryType.BidAsk), - CancellationToken = base.CancellationToken, - ForceReload = ??.ForceReload - }); - ?(history, P_0); - return; - } - DateTime ?? = P_0.From; - DateTime ?? = P_0.To; - if (P_2.Ticks - (?? - ??).Ticks != 1) - { - ?? = P_0.From.CeilingTo(P_2); - ?? = P_0.To.FloorTo(P_2); - } - if (??.Ticks + P_2.Ticks == P_0.To.Ticks + 1) - { - ?? = P_0.To; - } - DateTime ?? = ??; - if (!(?? == ??)) - { - ?(new Interval(??, ??), P_2, delegate(IList list, Interval interval, ref int reference) - { - if (?? == default(DateTime) || ?? > ??) - { - ?? = ??; - } - if (?? == default(DateTime) || ?? < ??) - { - ?? = ??; - } - if (list.Count > 0) - { - ?? = new DateTime(Math.Max(??.Ticks, ((IEnumerable)list).Max((Func)?.?.??.?).Ticks + P_2.Ticks), DateTimeKind.Utc); - } - if (??.SessionsContainer != null && P_2 < Period.DAY1) - { - list = list.Where((VolumeAnalysisData volumeAnalysisData) => ??.SessionsContainer.ContainsDate(volumeAnalysisData.TimeLeft)).ToList(); - } - P_1.Combine(list.Collapse()); - }); - } - ?? = ??; - if (P_0.From < ??) - { - ?(new Interval(P_0.From, ??), P_1, P_2); - } - if (?? < P_0.To) - { - ?(new Interval(??, P_0.To), P_1, P_2); - } - } - - protected override int ?(HistoricalData P_0, Interval P_1) - { - Result?.?(??, P_0); - return 0; - } - - protected override void ?() - { - DateTime dateTime = Core.Instance.TimeUtils.DateTimeUtcNow; - if (???.Symbol?.Connection != null) - { - dateTime = ??.Symbol.Connection.ServerTime; - } - if (!(??.To < dateTime)) - { - base.?(); - } - } - - protected override void ?(MessageQuote P_0) - { - if (P_0.Time > ??.To) - { - ?(); - } - else if (!(P_0.Time < ??.From)) - { - base.?(P_0); - } - } - - protected override VolumeAnalysisData ?(long P_0) - { - return Result; - } - } - internal class ? : ? - { - private const int ?? = 1000000; - - private readonly ConcurrentQueue ??; - - private readonly ConcurrentQueue ??; - - internal ?(HistoricalData P_0, VolumeAnalysisCalculationRequest P_1) - : base(P_0, P_1) - { - if (??.Aggregation is HistoryAggregationRenko) - { - ?? = default(Period); - } - ?? = new ConcurrentQueue(); - ?? = new ConcurrentQueue(); - ??.NewHistoryItem += ?; - } - - public override void Dispose() - { - if (?? != null) - { - ??.NewHistoryItem -= ?; - } - base.Dispose(); - } - - private protected override void ?(HistoricalData P_0, int P_1) - { - if (P_0.Count <= P_1 + 1) - { - return; - } - IHistoryItem historyItem = null; - if (??.Any()) - { - IHistoryItem historyItem2 = ??[0, SeekOriginHistory.End]; - if (historyItem2.TryGetData(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var data) && data) - { - historyItem = historyItem2; - historyItem.VolumeAnalysisData = ?(historyItem2, ??.Count - 1); - } - } - foreach (IVolumeTickData item in P_0.Skip(P_1 + 1).OfType()) - { - if (historyItem != null && historyItem.TicksLeft <= item.Time) - { - lock (historyItem.VolumeAnalysisData) - { - historyItem.VolumeAnalysisData.?(??, item); - } - } - ??.Enqueue(item); - } - } - - protected override void ?(MessageQuote P_0) - { - if (!base.AllowByLicense || !(P_0 is IVolumeTickData item)) - { - return; - } - VolumeAnalysisData volumeAnalysisData = ?(P_0.Time.Ticks); - bool data = false; - IHistoryItem historyItem = null; - if (??.Any()) - { - historyItem = ??[0, SeekOriginHistory.End]; - if (historyItem.TimeLeft <= P_0.Time) - { - historyItem.TryGetData(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out data); - } - } - if (volumeAnalysisData == null && historyItem != null && data) - { - volumeAnalysisData = ?(historyItem, ??.Count - 1); - } - if (volumeAnalysisData == null || data) - { - ??.Enqueue(item); - while (??.Count > 1000000) - { - ??.TryDequeue(out var _); - } - if (!data) - { - return; - } - } - if (volumeAnalysisData != null) - { - lock (volumeAnalysisData) - { - volumeAnalysisData.?(??, P_0); - } - ???.?(); - } - } - - private void ?(object P_0, HistoryEventArgs P_1) - { - ?(??); - ?(??); - ???.?(); - } - - private void ?(ConcurrentQueue P_0) - { - IVolumeTickData result; - while (P_0.TryPeek(out result)) - { - VolumeAnalysisData volumeAnalysisData = ?(result.Time); - if (volumeAnalysisData == null) - { - break; - } - P_0.TryDequeue(out result); - lock (volumeAnalysisData) - { - volumeAnalysisData.?(??, result); - } - } - } - } - internal class ? : ? - { - [CompilerGenerated] - private new sealed class ? - { - public ? ??; - - public double ??; - - public Func ??; - - internal void ?(IList P_0, Interval P_1, ref int P_2) - { - if (??.??.SessionsContainer != null && ??.?? < Period.DAY1) - { - P_0 = P_0.Where((VolumeAnalysisData volumeAnalysisData3) => ??.??.SessionsContainer.ContainsDate(volumeAnalysisData3.TimeLeft)).ToList(); - } - int num = ??.?(??.??, P_1); - if (num < 0) - { - return; - } - P_2 = num; - int num2 = 0; - while (num < ??.??.Count && num2 < P_0.Count) - { - IHistoryItem historyItem = ??.??[num, SeekOriginHistory.Begin]; - VolumeAnalysisData volumeAnalysisData = P_0[num2]; - if (volumeAnalysisData.TimeLeft.Ticks > historyItem.TicksRight) - { - num++; - continue; - } - if (volumeAnalysisData.TimeLeft.Ticks + ??.??.Ticks - 1 < historyItem.TicksLeft) - { - num2++; - continue; - } - IHistoryItem historyItem2 = historyItem; - if (historyItem2.VolumeAnalysisData == null) - { - VolumeAnalysisData obj = new VolumeAnalysisData - { - TimeLeft = historyItem.TimeLeft - }; - VolumeAnalysisData volumeAnalysisData2 = obj; - historyItem2.VolumeAnalysisData = obj; - } - if (?? != ??.Symbol.TickSize) - { - historyItem.VolumeAnalysisData.Combine(volumeAnalysisData.CreateAggregatedSnapshot(??)); - } - else - { - historyItem.VolumeAnalysisData.Combine(volumeAnalysisData); - } - num2++; - } - } - - internal bool ?(VolumeAnalysisData P_0) - { - return ??.??.SessionsContainer.ContainsDate(P_0.TimeLeft); - } - } - - protected HistoricalData ??; - - protected Period ??; - - internal ?(HistoricalData P_0, VolumeAnalysisCalculationRequest P_1) - : base(P_1) - { - ?? = P_0; - if (Vendor.TryCorrectPeriodForDirectDownload(base.VolumeAnalysisMetadata?.GetAllowedPeriods(P_1.CalculatePriceLevels), ??.Aggregation.GetPeriod, out var allowedPeriod)) - { - ?? = allowedPeriod; - } - } - - internal override void ?() - { - if (?? == null) - { - base.State = VolumeAnalysisCalculationState.Finished; - } - else - { - base.?(); - } - } - - private protected override void ?() - { - base.?(); - double num = 0.0; - DateTime dateTime = default(DateTime); - if (base.IsAborted) - { - return; - } - for (int i = 0; i < ??.Count; i++) - { - IHistoryItem historyItem = ??[i, SeekOriginHistory.Begin]; - num = ?(dateTime, historyItem.TimeLeft, num); - if (historyItem.VolumeAnalysisData?.Total != null) - { - historyItem.VolumeAnalysisData.Total.?? = num; - num += (double)(decimal)historyItem.VolumeAnalysisData.Total.Delta; - } - dateTime = historyItem.TimeLeft; - } - } - - public override void Dispose() - { - base.Dispose(); - if (?? != null) - { - ??.VolumeAnalysisCalculationProgress = null; - for (int i = 0; i < ??.Count; i++) - { - ??[i, SeekOriginHistory.End].VolumeAnalysisData = null; - } - ?? = null; - } - } - - protected override bool ?(out ?.? P_0) - { - if (?? == default(Period)) - { - P_0 = ?.?.??; - return false; - } - return base.?(out P_0); - } - - protected override void ?() - { - double ?? = base.PriceStep; - ?(base.CorrectedInterval, ??, delegate(IList P_0, Interval P_1, ref int P_2) - { - if (??.SessionsContainer != null && ?? < Period.DAY1) - { - P_0 = P_0.Where((VolumeAnalysisData volumeAnalysisData3) => ??.SessionsContainer.ContainsDate(volumeAnalysisData3.TimeLeft)).ToList(); - } - int num = ?(??, P_1); - if (num >= 0) - { - P_2 = num; - int num2 = 0; - while (num < ??.Count && num2 < P_0.Count) - { - IHistoryItem historyItem = ??[num, SeekOriginHistory.Begin]; - VolumeAnalysisData volumeAnalysisData = P_0[num2]; - if (volumeAnalysisData.TimeLeft.Ticks > historyItem.TicksRight) - { - num++; - } - else if (volumeAnalysisData.TimeLeft.Ticks + ??.Ticks - 1 < historyItem.TicksLeft) - { - num2++; - } - else - { - IHistoryItem historyItem2 = historyItem; - if (historyItem2.VolumeAnalysisData == null) - { - VolumeAnalysisData obj = new VolumeAnalysisData - { - TimeLeft = historyItem.TimeLeft - }; - VolumeAnalysisData volumeAnalysisData2 = obj; - historyItem2.VolumeAnalysisData = obj; - } - if (?? != base.Symbol.TickSize) - { - historyItem.VolumeAnalysisData.Combine(volumeAnalysisData.CreateAggregatedSnapshot(??)); - } - else - { - historyItem.VolumeAnalysisData.Combine(volumeAnalysisData); - } - num2++; - } - } - } - }); - } - - protected override int ?(HistoricalData P_0, Interval P_1) - { - int num = ?(??, P_1); - int i = 0; - if (num < 0) - { - return 0; - } - int result = num; - while (i < P_0.Count && num < ??.Count) - { - IHistoryItem historyItem = ??[num, SeekOriginHistory.Begin]; - if (historyItem.TryGetData(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var data) && data) - { - num++; - continue; - } - DateTime timeLeft = historyItem.TimeLeft; - DateTime dateTime = new DateTime(historyItem.TicksRight, DateTimeKind.Utc); - while (P_0[i, SeekOriginHistory.Begin].TimeLeft < timeLeft) - { - i++; - if (i >= P_0.Count) - { - break; - } - } - for (; i < P_0.Count; i++) - { - IHistoryItem historyItem2 = P_0[i, SeekOriginHistory.Begin]; - if (historyItem2.TimeLeft > dateTime) - { - break; - } - IHistoryItem historyItem3 = historyItem; - if (historyItem3.VolumeAnalysisData == null) - { - VolumeAnalysisData obj = new VolumeAnalysisData - { - TimeLeft = timeLeft - }; - VolumeAnalysisData volumeAnalysisData = obj; - historyItem3.VolumeAnalysisData = obj; - } - historyItem.VolumeAnalysisData.?(??, historyItem2); - } - num++; - } - ?(P_0, i); - return result; - } - - private protected virtual void ?(HistoricalData P_0, int P_1) - { - } - - protected override void ?() - { - if (?? != null) - { - ??.?(?); - } - } - - protected override void ?() - { - if (?? != null) - { - ??.?(?); - } - } - - protected override VolumeAnalysisData ?(long P_0) - { - int num = (int)??.GetIndexByTime(P_0, SeekOriginHistory.Begin); - if (num < 0 || num >= ??.Count) - { - return null; - } - IHistoryItem historyItem = ??[num, SeekOriginHistory.Begin]; - if (historyItem == null) - { - return null; - } - return ?(historyItem, num); - } - - private protected VolumeAnalysisData ?(IHistoryItem P_0, int P_1) - { - if (P_0.VolumeAnalysisData != null) - { - return P_0.VolumeAnalysisData; - } - P_0.VolumeAnalysisData = new VolumeAnalysisData - { - TimeLeft = P_0.TimeLeft - }; - if (P_1 <= 0) - { - return P_0.VolumeAnalysisData; - } - IHistoryItem historyItem = ??[P_1 - 1, SeekOriginHistory.Begin]; - if (historyItem?.VolumeAnalysisData != null) - { - P_0.VolumeAnalysisData.Total.?? = ?(historyItem.TimeLeft, P_0.TimeLeft, historyItem.VolumeAnalysisData.Total.CumulativeDelta); - } - return P_0.VolumeAnalysisData; - } - - private void ?(object P_0, HistoryEventArgs P_1) - { - if (P_1 is ? { MessageQuote: not null } ?2) - { - ?(?2.MessageQuote); - } - } - - protected override void ?(MessageQuote P_0) - { - base.?(P_0); - ???.?(); - } - - protected override Interval ?() - { - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - DateTime dateTime = ??.From; - DateTime dateTime2 = ((??.ToTime == default(DateTime)) ? dateTimeUtcNow : ??.ToTime); - if (dateTime > dateTimeUtcNow) - { - dateTime = dateTimeUtcNow; - } - if (dateTime2 > dateTimeUtcNow) - { - dateTime2 = dateTimeUtcNow; - } - if (base.Symbol.QuoteDelay != default(TimeSpan) && dateTime2 > dateTimeUtcNow - base.Symbol.QuoteDelay) - { - dateTime2 -= base.Symbol.QuoteDelay; - } - return new Interval(dateTime, dateTime2); - } - - private int ?(HistoricalData P_0, Interval P_1) - { - if (P_0 == null || P_0.Count == 0) - { - return -1; - } - if (new Interval(P_0[0, SeekOriginHistory.Begin].TimeLeft, new DateTime(P_0[0, SeekOriginHistory.End].TicksRight, DateTimeKind.Utc)).Intersect(P_1) == Interval.Default) - { - return -1; - } - long num = P_1.From.Ticks; - long num2 = Math.Abs(P_0.Aggregation.GetPeriod.Ticks); - do - { - int num3 = (int)P_0.GetIndexByTime(num, SeekOriginHistory.Begin); - if (num3 >= 0) - { - return num3; - } - num += num2; - } - while (num <= P_1.To.Ticks); - return -1; - } - - private double ?(DateTime P_0, DateTime P_1, double P_2) - { - TimeZoneInfo timeZoneInfo = ??.TimeZone.TimeZoneInfo; - DateTime dateTime = P_0; - DateTime dateTime2 = P_1; - if (timeZoneInfo != null) - { - dateTime = TimeZoneInfo.ConvertTime(P_0, timeZoneInfo); - dateTime2 = TimeZoneInfo.ConvertTime(P_1, timeZoneInfo); - } - return ??.CumulativeDeltaReset switch - { - CumulativeDeltaReset.Never => P_2, - CumulativeDeltaReset.Daily => (dateTime.DayOfWeek != dateTime2.DayOfWeek) ? 0.0 : P_2, - CumulativeDeltaReset.Weekly => (dateTime.GetWeekOfYear() != dateTime2.GetWeekOfYear()) ? 0.0 : P_2, - CumulativeDeltaReset.ByChartSession => ?(??.SessionsContainer, P_0, P_1) ? 0.0 : P_2, - _ => P_2, - }; - } - - private bool ?(ISessionsContainer P_0, DateTime P_1, DateTime P_2) - { - if (P_0 == null) - { - return false; - } - ISession sessionForDate = P_0.GetSessionForDate(P_2); - if (sessionForDate == null) - { - return false; - } - ISession sessionForDate2 = P_0.GetSessionForDate(P_1); - if (sessionForDate2 == null) - { - return true; - } - if (P_1.TimeOfDay <= sessionForDate2.CloseTime && P_1.TimeOfDay < sessionForDate.OpenTime && sessionForDate.OpenTime <= P_2.TimeOfDay && sessionForDate2.CloseTime < P_2.TimeOfDay) - { - return true; - } - return false; - } - } -} -namespace TradingPlatform.BusinessLayer -{ - public class VolumeAnalysisTaskEventArgs : EventArgs - { - [CompilerGenerated] - private readonly VolumeAnalysisCalculationState ??; - - [CompilerGenerated] - private readonly int ??; - - public VolumeAnalysisCalculationState CalculationState - { - [CompilerGenerated] - get - { - return ??; - } - } - - public int ProgressPercent - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal VolumeAnalysisTaskEventArgs(IVolumeAnalysisCalculationProgress P_0) - { - ?? = P_0.State; - ?? = P_0.ProgressPercent; - } - } - [Published] - public class VolumeAnalysisData - { - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private VolumeAnalysisItem ??; - - [CompilerGenerated] - private Dictionary ??; - - [CompilerGenerated] - private EventHandler ??; - - public DateTime TimeLeft - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Summary calculated Volume info - /// - public VolumeAnalysisItem Total - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Volume info for each price - /// - public Dictionary PriceLevels - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Fire in case of price level was added or existing was updated - /// - public event EventHandler ItemUpdated - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - public VolumeAnalysisData() - { - Total = new VolumeAnalysisItem(); - PriceLevels = new Dictionary(); - } - - internal VolumeAnalysisData(VolumeAnalysisData P_0) - { - TimeLeft = P_0.TimeLeft; - Total = new VolumeAnalysisItem(P_0.Total); - PriceLevels = new Dictionary(); - foreach (KeyValuePair priceLevel in P_0.PriceLevels) - { - PriceLevels.Add(priceLevel.Key, new VolumeAnalysisItem(priceLevel.Value)); - } - } - - internal void ?(VolumeAnalysisCalculationRequest P_0, HistoricalData P_1) - { - foreach (object item in P_1) - { - ?(P_0, item); - } - } - - internal void ?(VolumeAnalysisCalculationRequest P_0, MessageQuote P_1) - { - ?(P_0, (object)P_1); - } - - internal void ?(VolumeAnalysisCalculationRequest P_0, IVolumeTickData P_1) - { - ?(P_0, (object)P_1); - } - - internal void ?(VolumeAnalysisCalculationRequest P_0, object P_1) - { - if (!(P_1 is IVolumeTickData { Price: var price, Volume: var volume } volumeTickData)) - { - return; - } - AggressorFlag aggressorFlag = ((P_0.DeltaCalculationType == DeltaCalculationType.TickDirection) ? Symbol.ConvertTickDirection(volumeTickData.TickDirection) : volumeTickData.AggressorFlag); - bool flag = volumeTickData.VolumeTickDataType == VolumeTickDataType.Ticks; - long time = volumeTickData.Time; - if (P_0.SessionsContainer == null || P_0.SessionsContainer.ContainsDate(time)) - { - double num = P_0.Symbol.GetTickSize(price); - if (!P_0.CustomTickSize.IsNanOrDefault()) - { - num = P_0.CustomTickSize; - } - if (P_0.CustomStep > 1) - { - num *= (double)P_0.CustomStep; - } - if (!double.IsNaN(P_0.Symbol.MinVolumeAnalysisTickSize) && num < P_0.Symbol.MinVolumeAnalysisTickSize) - { - num = P_0.Symbol.MinVolumeAnalysisTickSize; - } - double num2 = CoreMath.RoundToIncrement(price, num); - ?(num2, volume, aggressorFlag, flag, P_0.FilteredVolume); - } - } - - private void ?(double P_0, double P_1, AggressorFlag P_2, bool P_3, double P_4) - { - Total.?(P_1, P_2, P_3, P_4); - if (!PriceLevels.TryGetValue(P_0, out var value)) - { - PriceLevels.Add(P_0, value = new VolumeAnalysisItem()); - } - value.?(P_1, P_2, P_3, P_4); - ?(P_0, value); - } - - public void Calculate(double price, double size, AggressorFlag aggressorFlag) - { - ?(price, size, aggressorFlag, false, 0.0); - } - - public VolumeAnalysisData CreateAggregatedSnapshot(double aggregationStep) - { - VolumeAnalysisData volumeAnalysisData = new VolumeAnalysisData(); - try - { - volumeAnalysisData.Total = Total; - foreach (KeyValuePair priceLevel in PriceLevels) - { - double key = CoreMath.RoundToIncrement(priceLevel.Key, aggregationStep); - if (!volumeAnalysisData.PriceLevels.TryGetValue(key, out var value)) - { - volumeAnalysisData.PriceLevels.Add(key, value = new VolumeAnalysisItem()); - } - value.Combine(priceLevel.Value); - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - return volumeAnalysisData; - } - - private void ?(double P_0, VolumeAnalysisItem P_1) - { - ???.Invoke(this, new VolumeAnalysisDataEventArgs(P_0, P_1)); - } - - public void Combine(VolumeAnalysisData data) - { - Total.Combine(data.Total); - foreach (KeyValuePair priceLevel in data.PriceLevels) - { - if (!PriceLevels.TryGetValue(priceLevel.Key, out var value)) - { - value = (PriceLevels[priceLevel.Key] = new VolumeAnalysisItem()); - } - value.Combine(priceLevel.Value); - } - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(15, 2); - defaultInterpolatedStringHandler.AppendFormatted(TimeLeft); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(PriceLevels.Count); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - [Published] - public class VolumeAnalysisDataEventArgs : EventArgs - { - [CompilerGenerated] - private readonly double ??; - - [CompilerGenerated] - private readonly VolumeAnalysisItem ??; - - public double Price - { - [CompilerGenerated] - get - { - return ??; - } - } - - public VolumeAnalysisItem Item - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal VolumeAnalysisDataEventArgs(double P_0, VolumeAnalysisItem P_1) - { - ?? = P_0; - ?? = P_1; - } - } - [Published] - public enum VolumeAnalysisCalculationState - { - None = 0, - Processing = 4, - Finished = 0x10 - } - [Published] - [Obfuscation(ApplyToMembers = true, Exclude = true)] - public enum VolumeAnalysisField - { - Trades, - BuyTrades, - SellTrades, - Volume, - BuyVolume, - SellVolume, - BuySellVolume, - FilteredVolume, - FilteredBuyVolume, - FilteredSellVolume, - MaxOneTradeVolume, - BuyVolumePercent, - SellVolumePercent, - Delta, - DeltaPercent, - CumulativeDelta, - FilteredTotalVolumePercent, - FilteredBuyVolumePercent, - FilteredSellVolumePercent, - MaxOneTradeVolumePercent, - AverageSize, - AverageBuySize, - AverageSellSize, - OpenInterest, - MinDelta, - MaxDelta, - DeltaFinish - } - public enum CumulativeDeltaReset - { - [Description("Full chart range")] - Never, - [Description("Daily")] - Daily, - [Description("Weekly")] - Weekly, - [Description("By chart session")] - ByChartSession - } - /// - /// Represent item with Volume Analysis calculation results - /// - [Published] - public class VolumeAnalysisItem : IVolumeAnalysisItem - { - private const double ?? = double.MaxValue; - - private const double ?? = double.MinValue; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - internal double ??; - - public int Trades - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int BuyTrades - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int SellTrades - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double Volume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double BuyVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double SellVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double FilteredTotalVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public double FilteredBuyVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public double FilteredSellVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public double MaxOneTradeVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double MinDelta - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double MaxDelta - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double BuyVolumePercent - { - get - { - if (!(Volume > 0.0)) - { - return 0.0; - } - return BuyVolume / Volume * 100.0; - } - } - - public double SellVolumePercent - { - get - { - if (!(Volume > 0.0)) - { - return 0.0; - } - return SellVolume / Volume * 100.0; - } - } - - public double Delta => BuyVolume - SellVolume; - - public double DeltaPercent - { - get - { - if (Volume == 0.0) - { - return 0.0; - } - return Delta / Volume * 100.0; - } - } - - public double CumulativeDelta => ?? + Delta; - - public double FilteredTotalVolumePercent - { - get - { - if (!(Volume > 0.0)) - { - return 0.0; - } - return FilteredTotalVolume / Volume * 100.0; - } - } - - public double FilteredBuyVolumePercent - { - get - { - if (!(Volume > 0.0)) - { - return 0.0; - } - return FilteredBuyVolume / Volume * 100.0; - } - } - - public double FilteredSellVolumePercent - { - get - { - if (!(Volume > 0.0)) - { - return 0.0; - } - return FilteredSellVolume / Volume * 100.0; - } - } - - public double MaxOneTradeVolumePercent - { - get - { - if (!(Volume > 0.0)) - { - return 0.0; - } - return MaxOneTradeVolume / Volume * 100.0; - } - } - - public double AverageSize - { - get - { - if (Trades <= 0) - { - return 0.0; - } - return Volume / (double)Trades; - } - } - - public double AverageBuySize - { - get - { - if (BuyTrades <= 0) - { - return 0.0; - } - return BuyVolume / (double)BuyTrades; - } - } - - public double AverageSellSize - { - get - { - if (SellTrades <= 0) - { - return 0.0; - } - return SellVolume / (double)SellTrades; - } - } - - public double DeltaFinish => Delta - ((Math.Abs(MinDelta) > Math.Abs(MaxDelta)) ? MinDelta : MaxDelta); - - public VolumeAnalysisItem() - { - MinDelta = double.MaxValue; - MaxDelta = double.MinValue; - } - - internal VolumeAnalysisItem(VolumeAnalysisItem P_0) - { - Trades = P_0.Trades; - BuyTrades = P_0.BuyTrades; - SellTrades = P_0.SellTrades; - Volume = P_0.Volume; - BuyVolume = P_0.BuyVolume; - SellVolume = P_0.SellVolume; - FilteredTotalVolume = P_0.FilteredTotalVolume; - FilteredBuyVolume = P_0.FilteredBuyVolume; - FilteredSellVolume = P_0.FilteredSellVolume; - MaxOneTradeVolume = P_0.MaxOneTradeVolume; - MinDelta = P_0.MinDelta; - MaxDelta = P_0.MaxDelta; - ?? = P_0.??; - } - - public double GetValue(VolumeAnalysisField field) - { - return field switch - { - VolumeAnalysisField.Trades => Trades, - VolumeAnalysisField.BuyTrades => BuyTrades, - VolumeAnalysisField.SellTrades => SellTrades, - VolumeAnalysisField.Volume => Volume, - VolumeAnalysisField.BuySellVolume => Volume, - VolumeAnalysisField.BuyVolume => BuyVolume, - VolumeAnalysisField.BuyVolumePercent => BuyVolumePercent, - VolumeAnalysisField.SellVolume => SellVolume, - VolumeAnalysisField.SellVolumePercent => SellVolumePercent, - VolumeAnalysisField.Delta => Delta, - VolumeAnalysisField.DeltaPercent => DeltaPercent, - VolumeAnalysisField.CumulativeDelta => CumulativeDelta, - VolumeAnalysisField.AverageSize => AverageSize, - VolumeAnalysisField.AverageBuySize => AverageBuySize, - VolumeAnalysisField.AverageSellSize => AverageSellSize, - VolumeAnalysisField.MaxOneTradeVolume => MaxOneTradeVolume, - VolumeAnalysisField.MaxOneTradeVolumePercent => MaxOneTradeVolumePercent, - VolumeAnalysisField.FilteredVolume => FilteredTotalVolume, - VolumeAnalysisField.FilteredTotalVolumePercent => FilteredTotalVolumePercent, - VolumeAnalysisField.FilteredBuyVolume => FilteredBuyVolume, - VolumeAnalysisField.FilteredBuyVolumePercent => FilteredBuyVolumePercent, - VolumeAnalysisField.FilteredSellVolume => FilteredSellVolume, - VolumeAnalysisField.FilteredSellVolumePercent => FilteredSellVolumePercent, - VolumeAnalysisField.MinDelta => (MinDelta != double.MaxValue) ? MinDelta : 0.0, - VolumeAnalysisField.MaxDelta => (MaxDelta != double.MinValue) ? MaxDelta : 0.0, - VolumeAnalysisField.DeltaFinish => DeltaFinish, - _ => 0.0, - }; - } - - public void Combine(VolumeAnalysisItem item) - { - Trades += item.Trades; - BuyTrades += item.BuyTrades; - SellTrades += item.SellTrades; - Volume += item.Volume; - BuyVolume += item.BuyVolume; - SellVolume += item.SellVolume; - FilteredTotalVolume += item.FilteredTotalVolume; - FilteredBuyVolume += item.FilteredBuyVolume; - FilteredSellVolume += item.FilteredSellVolume; - MaxOneTradeVolume = Math.Max(item.MaxOneTradeVolume, MaxOneTradeVolume); - MinDelta = ((MinDelta == double.MaxValue) ? Math.Min(MinDelta, item.MinDelta) : double.NaN); - MaxDelta = ((MaxDelta == double.MinValue) ? Math.Max(MaxDelta, item.MaxDelta) : double.NaN); - } - - internal void ?(double P_0, AggressorFlag P_1 = AggressorFlag.None, bool P_2 = false, double P_3 = 0.0) - { - Volume += P_0; - BuyVolume += ((P_1 == AggressorFlag.Buy) ? P_0 : 0.0); - SellVolume += ((P_1 == AggressorFlag.Sell) ? P_0 : 0.0); - double delta = Delta; - MinDelta = Math.Min(MinDelta, delta); - MaxDelta = Math.Max(MaxDelta, delta); - if (P_2) - { - return; - } - Trades++; - if (P_0 > MaxOneTradeVolume) - { - MaxOneTradeVolume = P_0; - } - if (P_0 >= P_3) - { - FilteredTotalVolume += P_0; - } - switch (P_1) - { - case AggressorFlag.Buy: - BuyTrades++; - if (P_0 >= P_3) - { - FilteredBuyVolume += P_0; - } - break; - case AggressorFlag.Sell: - SellTrades++; - if (P_0 >= P_3) - { - FilteredSellVolume += P_0; - } - break; - } - } - } - /// - /// Volume Analysis calculations - /// - [Published] - public class VolumeAnalysisManager - { - private const int ?? = 10; - - private const int ?? = 7; - - private int ??; - - private readonly ActionBufferedProcessorWithPriority ??; - - internal VolumeAnalysisManager() - { - ?? = new ActionBufferedProcessorWithPriority(3); - } - - internal void ?() - { - ??.Start(); - } - - internal void ?() - { - ???.Stop(); - } - - /// - /// Calculate volume profile for requested time range - /// - public IVolumeAnalysisCalculationTask CalculateProfile(VolumeAnalysisCalculationRequest request) - { - VolumeAnalysisCalculationRequest volumeAnalysisCalculationRequest = new VolumeAnalysisCalculationRequest(request); - if (Core.Instance.SymbolsMapping.TryGetVolumeAnalysisSymbol(request.Symbol, out var volumeAnalysisSymbol)) - { - volumeAnalysisCalculationRequest.Symbol = volumeAnalysisSymbol; - } - bool num = ?(volumeAnalysisCalculationRequest); - ? ? = new ?(volumeAnalysisCalculationRequest); - if (!num) - { - ?.State = VolumeAnalysisCalculationState.Finished; - return ?; - } - ??.Push(?.?, 1, volumeAnalysisCalculationRequest.Marker); - return ?; - } - - /// - /// Calculate volume profile for each bar in History Data - /// - public IVolumeAnalysisCalculationProgress CalculateProfile(HistoricalData historicalData, VolumeAnalysisCalculationParameters calculationParameters) - { - VolumeAnalysisCalculationRequest volumeAnalysisCalculationRequest = new VolumeAnalysisCalculationRequest(calculationParameters) - { - Symbol = historicalData.Symbol, - From = ((historicalData.Count == 0) ? Core.Instance.TimeUtils.DateTimeUtcNow : historicalData[0, SeekOriginHistory.Begin].TimeLeft), - To = ((historicalData.ToTime == DateTime.MinValue) ? Core.Instance.TimeUtils.DateTimeUtcNow : historicalData.ToTime) - }; - if (Core.Instance.SymbolsMapping.TryGetVolumeAnalysisSymbol(volumeAnalysisCalculationRequest.Symbol, out var volumeAnalysisSymbol)) - { - volumeAnalysisCalculationRequest.Symbol = volumeAnalysisSymbol; - } - bool num = ?(volumeAnalysisCalculationRequest); - ? ? = ((historicalData.Aggregation.BarCreationBehavior == BarCreationBehavior.Deferred) ? new ?(historicalData, volumeAnalysisCalculationRequest) : new ?(historicalData, volumeAnalysisCalculationRequest)); - if (!num) - { - ?.State = VolumeAnalysisCalculationState.Finished; - return ?; - } - historicalData.VolumeAnalysisCalculationProgress = ?; - ??.Push(?.?, 1, volumeAnalysisCalculationRequest.Marker); - return ?; - } - - /// - /// Calculate volume profile for requested time range - /// - public IVolumeAnalysisCalculationTask CalculateProfile(Symbol symbol, DateTime from, DateTime to) - { - return CalculateProfile(new VolumeAnalysisCalculationRequest - { - Symbol = symbol, - From = from, - To = to - }); - } - - /// - /// Calculate volume profile for each bar in History Data - /// - public IVolumeAnalysisCalculationProgress CalculateProfile(HistoricalData historicalData) - { - return CalculateProfile(historicalData, new VolumeAnalysisCalculationParameters()); - } - - private bool ?(VolumeAnalysisCalculationRequest P_0) - { - if (P_0 == null) - { - return false; - } - if ((Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())) == null && Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), P_0.Symbol).Status != TradingOperationStatus.Allowed && Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Symbol).Status != TradingOperationStatus.Allowed && (P_0.Symbol == null || P_0.Symbol.State != BusinessObjectState.Fake)) - { - ??++; - if (?? > 10) - { - Core.Instance.Licences.OnLicenceCheckError(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null); - return false; - } - DateTime dateTime = Core.Instance.TimeUtils.DateTimeUtcNow.AddDays(-7.0); - if (P_0.From < dateTime) - { - P_0.From = dateTime; - Core.Instance.Licences.OnLicenceCheckError(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null); - } - } - return true; - } - } -} -namespace TradingPlatform.BusinessLayer.TimeSync -{ - public enum _Mode - { - SymmetricActive, - SymmetricPassive, - Client, - Server, - Broadcast, - Unknown - } - public enum _Stratum - { - Unspecified, - PrimaryReference, - SecondaryReference, - Reserved - } - /// - /// from: - /// http://www.codeguru.com/csharp/csharp/cs_date_time/timeroutines/article.php/c4207/C-SNTP-Client.htm - /// +++ ???????? ???????, ?????????? ToString(), ????? ?????? ?????. - /// +++ ReceiveTimeout?SendTimeout - /// - /// NTPClient is a C# class designed to connect to time servers on the Internet. - /// The implementation of the protocol is based on the RFC 2030. - /// - /// Public class members: - /// - /// LeapIndicator - Warns of an impending leap second to be inserted/deleted in the last - /// minute of the current day. (See the _LeapIndicator enum) - /// - /// VersionNumber - Version number of the protocol (3 or 4). - /// - /// Mode - Returns mode. (See the _Mode enum) - /// - /// Stratum - Stratum of the clock. (See the _Stratum enum) - /// - /// PollInterval - Maximum interval between successive messages. - /// - /// Precision - Precision of the clock. - /// - /// RootDelay - Round trip time to the primary reference source. - /// - /// RootDispersion - Nominal error relative to the primary reference source. - /// - /// ReferenceTimestamp - The time at which the clock was last set or corrected. - /// - /// OriginateTimestamp - The time at which the request departed the client for the server. - /// - /// ReceiveTimestamp - The time at which the request arrived at the server. - /// - /// Transmit Timestamp - The time at which the reply departed the server for client. - /// - /// RoundTripDelay - The time between the departure of request and arrival of reply. - /// - /// LocalClockOffset - The offset of the local clock relative to the primary reference - /// source. - /// - /// Initialize - Sets up data structure and prepares for connection. - /// - /// Connect - Connects to the time server and populates the data structure. - /// - /// IsResponseValid - Returns true if received data is valid and if comes from - /// a NTP-compliant time server. - /// - /// ToString - Returns a string representation of the object. - /// - /// ----------------------------------------------------------------------------- - /// Structure of the standard NTP header (as described in RFC 2030) - /// 1 2 3 - /// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - /// |LI | VN |Mode | Stratum | Poll | Precision | - /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - /// | Root Delay | - /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - /// | Root Dispersion | - /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - /// | Reference Identifier | - /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - /// | | - /// | Reference Timestamp (64) | - /// | | - /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - /// | | - /// | Originate Timestamp (64) | - /// | | - /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - /// | | - /// | Receive Timestamp (64) | - /// | | - /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - /// | | - /// | Transmit Timestamp (64) | - /// | | - /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - /// | Key Identifier (optional) (32) | - /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - /// | | - /// | | - /// | Message Digest (optional) (128) | - /// | | - /// | | - /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - /// - /// ----------------------------------------------------------------------------- - /// - /// NTP Timestamp Format (as described in RFC 2030) - /// 1 2 3 - /// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - /// | Seconds | - /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - /// | Seconds Fraction (0-padded) | - /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - /// - /// - public class NTPClient : IDisposable - { - private const byte ?? = 48; - - private const byte ?? = 16; - - private const byte ?? = 24; - - private const byte ?? = 32; - - private const byte ?? = 40; - - private byte[] ??; - - public DateTime ReceptionTimestamp; - - private UdpClient ??; - - private readonly string ??; - - public byte VersionNumber => (byte)((??[0] & 0x38) >> 3); - - public _Mode Mode => (byte)(??[0] & 7) switch - { - 1 => _Mode.SymmetricActive, - 2 => _Mode.SymmetricPassive, - 3 => _Mode.Client, - 4 => _Mode.Server, - 5 => _Mode.Broadcast, - _ => _Mode.Unknown, - }; - - public _Stratum Stratum - { - get - { - byte b = ??[1]; - if (b == 0) - { - return _Stratum.Unspecified; - } - if (b == 1) - { - return _Stratum.PrimaryReference; - } - if (b <= 15) - { - return _Stratum.SecondaryReference; - } - return _Stratum.Reserved; - } - } - - public double Precision => 1000.0 * Math.Pow(2.0, (int)??[3]); - - public DateTime ReferenceTimestamp - { - get - { - DateTime dateTime = ?(?(16)); - TimeSpan utcOffset = TimeZoneInfo.Local.GetUtcOffset(DateTime.Now); - return dateTime + utcOffset; - } - } - - public DateTime OriginateTimestamp => ?(?(24)); - - public DateTime ReceiveTimestamp - { - get - { - DateTime dateTime = ?(?(32)); - TimeSpan utcOffset = TimeZoneInfo.Local.GetUtcOffset(DateTime.Now); - return dateTime + utcOffset; - } - } - - public DateTime TransmitTimestamp - { - get - { - DateTime dateTime = ?(?(40)); - TimeSpan utcOffset = TimeZoneInfo.Local.GetUtcOffset(DateTime.Now); - return dateTime + utcOffset; - } - set - { - ?(40, value); - } - } - - public int RoundTripDelay => (int)(ReceiveTimestamp - OriginateTimestamp + (ReceptionTimestamp - TransmitTimestamp)).TotalMilliseconds; - - public int LocalClockOffset => (int)((ReceiveTimestamp - OriginateTimestamp - (ReceptionTimestamp - TransmitTimestamp)).TotalMilliseconds / 2.0); - - private DateTime ?(ulong P_0) - { - TimeSpan timeSpan = TimeSpan.FromMilliseconds(P_0); - return new DateTime(1900, 1, 1) + timeSpan; - } - - private ulong ?(byte P_0) - { - ulong num = 0uL; - ulong num2 = 0uL; - for (int i = 0; i <= 3; i++) - { - num = 256 * num + ??[P_0 + i]; - } - for (int j = 4; j <= 7; j++) - { - num2 = 256 * num2 + ??[P_0 + j]; - } - return num * 1000 + num2 * 1000 / 4294967296L; - } - - private void ?(byte P_0, DateTime P_1) - { - DateTime dateTime = new DateTime(1900, 1, 1, 0, 0, 0); - ulong num = (ulong)(P_1 - dateTime).TotalMilliseconds; - ulong num2 = num / 1000; - ulong num3 = num % 1000 * 4294967296L / 1000; - ulong num4 = num2; - for (int num5 = 3; num5 >= 0; num5--) - { - ??[P_0 + num5] = (byte)(num4 % 256); - num4 /= 256; - } - num4 = num3; - for (int num6 = 7; num6 >= 4; num6--) - { - ??[P_0 + num6] = (byte)(num4 % 256); - num4 /= 256; - } - } - - private void ?() - { - ??[0] = 27; - for (int i = 1; i < 48; i++) - { - ??[i] = 0; - } - TransmitTimestamp = DateTime.Now; - } - - public NTPClient(string host) - { - ?? = new byte[48]; - ?? = host; - } - - /// - /// Connect to the time server - /// - public void Connect() - { - try - { - try - { - if (?? != null) - { - ??.Close(); - } - } - catch - { - } - IPEndPoint remoteEP = new IPEndPoint(Dns.GetHostAddresses(??)[0], 123); - ?? = new UdpClient(); - ??.Connect(remoteEP); - ?(); - Socket client = ??.Client; - int receiveTimeout = (??.Client.SendTimeout = (int)TimeSpan.FromSeconds(5.0).TotalMilliseconds); - client.ReceiveTimeout = receiveTimeout; - ??.Send(??, ??.Length); - ?? = ??.Receive(ref remoteEP); - if (!IsResponseValid()) - { - throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ??); - } - ReceptionTimestamp = DateTime.Now; - } - catch (SocketException ex) - { - throw new Exception(ex.Message); - } - } - - public bool IsResponseValid() - { - if (??.Length < 48 || Mode != _Mode.Server) - { - return false; - } - return true; - } - - public override string ToString() - { - string text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); - text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - switch (Mode) - { - case _Mode.Unknown: - text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - break; - case _Mode.SymmetricActive: - text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - break; - case _Mode.SymmetricPassive: - text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - break; - case _Mode.Client: - text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - break; - case _Mode.Server: - text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - break; - case _Mode.Broadcast: - text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - break; - } - text = text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + TransmitTimestamp; - text = text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + LocalClockOffset + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - return text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - - public void Dispose() - { - try - { - if (?? != null) - { - ??.Close(); - } - ?? = null; - } - catch - { - } - } - } -} -namespace ? -{ - internal sealed class ? : IDisposable - { - private const int ?? = 1800000; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private ? ??; - - [CompilerGenerated] - private string ??; - - private ReadOnlyCollection ??; - - private Timer ??; - - public int ServerTimeOffset - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = num; - } - } - - public ? State - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = ?2; - } - } - - public string LastSyncErrorMessage - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public ?() - { - State = ?.??; - } - - public void ?() - { - ServerTimeOffset = 0; - ?? = new string[4] - { - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }.AsReadOnly(); - ?? = new Timer(?, null, TimeSpan.FromMilliseconds(-1.0), new TimeSpan(1, 0, 0)); - ?(); - } - - public void Dispose() - { - if (?? != null) - { - ??.Dispose(); - ?? = null; - } - } - - public void ?() - { - bool flag = false; - string text = string.Empty; - try - { - State = ?.??; - foreach (string item in ??) - { - try - { - using NTPClient nTPClient = new NTPClient(item); - nTPClient.Connect(); - if (nTPClient.IsResponseValid()) - { - if (nTPClient.LocalClockOffset <= 1800000) - { - flag = true; - ServerTimeOffset = nTPClient.LocalClockOffset; - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(45, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(ServerTimeOffset); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - break; - } - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + item); - } - } - catch (Exception ex) - { - text = ex.Message; - Core.Instance.Loggers.Log(text, LoggingLevel.Verbose); - } - } - } - finally - { - if (flag) - { - State = ?.??; - LastSyncErrorMessage = string.Empty; - } - else - { - State = ?.??; - LastSyncErrorMessage = text; - } - } - } - - private void ?(object P_0) - { - ?(); - } - } - internal enum ? - { - ??, - ??, - ??, - ?? - } -} -namespace TradingPlatform.BusinessLayer.Options -{ - public sealed class BlackScholesPriceModel : PriceModel - { - public const double START_IV = 1E-05; - - public override PriceModels Type => PriceModels.BlackScholes; - - protected override double NormDist(double x) - { - double num = 0.049867347; - double num2 = 0.0211410061; - double num3 = 0.0032776263; - double num4 = 3.80036E-05; - double num5 = 4.88906E-05; - double num6 = 5.383E-06; - double num7 = Math.Abs(x); - double num8 = 1.0 + num7 * (num + num7 * (num2 + num7 * (num3 + num7 * (num4 + num7 * (num5 + num7 * num6))))); - num8 *= num8; - num8 *= num8; - num8 *= num8; - num8 *= num8; - num8 = 1.0 / (2.0 * num8); - if (x >= 0.0) - { - num8 = 1.0 - num8; - } - return num8; - } - - public override double Delta(Symbol option, double IV, double Int_Rate, double shift) - { - if (option == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (option.Underlier == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return Delta(option.ExpirationDate, option.StrikePrice, option.OptionType, option.Underlier.Last, IV, Int_Rate, shift); - } - - public override double Delta(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift) - { - double num = ((double)OptionMath.CalculateDaysToExpire(ExpirationDate) - shift) / 365.0; - if (num <= 0.0) - { - num = (double)OptionMath.CalculateDaysToExpire(ExpirationDate) / 365.0; - } - double x = (Math.Log(price / StrikePrice) + (Int_Rate + IV * IV / 2.0) * num) / (IV * Math.Sqrt(num)); - Math.Sqrt(num); - if (OptionType == OptionType.Call) - { - return NormDist(x); - } - return NormDist(x) - 1.0; - } - - public override double Gamma(Symbol option, double IV, double int_Rate, double shift) - { - if (option == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (option.Underlier == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return Gamma(option.ExpirationDate, option.StrikePrice, option.OptionType, option.Underlier.Last, IV, int_Rate, shift); - } - - public override double Gamma(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift) - { - double num = ((double)OptionMath.CalculateDaysToExpire(ExpirationDate) - shift) / 365.0; - if (num <= 0.0) - { - num = (double)OptionMath.CalculateDaysToExpire(ExpirationDate) / 365.0; - } - double num2 = (Math.Log(price / StrikePrice) + (Int_Rate + IV * IV / 2.0) * num) / (IV * Math.Sqrt(num)); - Math.Sqrt(num); - return Math.Exp(-1.0 * num2 * num2 / 2.0) / Math.Sqrt(Math.PI * 2.0) / (price * IV * Math.Sqrt(num)); - } - - public override double TheorPrice(Symbol option, double IV, double Int_Rate, double shift) - { - if (option == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (option.Underlier == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return TheorPrice(option.ExpirationDate, option.StrikePrice, option.OptionType, option.Underlier.Last, IV, Int_Rate, shift); - } - - public override double TheorPrice(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift) - { - double num = ((double)OptionMath.CalculateDaysToExpire(ExpirationDate) - shift) / 365.0; - if (num <= 0.0) - { - num = (double)OptionMath.CalculateDaysToExpire(ExpirationDate) / 365.0; - } - double num2 = (Math.Log(price / StrikePrice) + (Int_Rate + IV * IV / 2.0) * num) / (IV * Math.Sqrt(num)); - double num3 = num2 - IV * Math.Sqrt(num); - if (OptionType == OptionType.Call) - { - return price * NormDist(num2) - StrikePrice * Math.Exp(-1.0 * (Int_Rate * num)) * NormDist(num3); - } - return StrikePrice * Math.Exp(-1.0 * (Int_Rate * num)) * NormDist(0.0 - num3) - price * NormDist(0.0 - num2); - } - - public override double IV(Symbol option, OptionPriceType priceType, double Int_Rate, double shift) - { - if (option == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (option.Underlier == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return IV(option.ExpirationDate, option.StrikePrice, option.OptionType, OptionMath.GetOptionLastPrice(option, priceType), option.Underlier.Last, priceType, Int_Rate, shift); - } - - public override double IV(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double optionPrice, double underlierPrice, OptionPriceType priceType, double Int_Rate, double shift) - { - if (double.IsNaN(optionPrice)) - { - return double.NaN; - } - double num = ((double)OptionMath.CalculateDaysToExpire(ExpirationDate) - shift) / 365.0; - if (num <= 0.0) - { - num = (double)OptionMath.CalculateDaysToExpire(ExpirationDate) / 365.0; - } - double num2 = 0.0; - double num3 = 0.0; - double num4 = 1E-05; - if (optionPrice == 0.0 || underlierPrice == 0.0 || StrikePrice == 0.0 || num <= 0.0) - { - return 0.0; - } - if (underlierPrice <= optionPrice) - { - return 0.0; - } - double num5 = 0.1; - if (OptionType == OptionType.Call) - { - while (num2 <= optionPrice) - { - while (true) - { - double num6 = (Math.Log(underlierPrice / StrikePrice) + (Int_Rate + num4 * num4 / 2.0) * num) / (num4 * Math.Sqrt(num)); - double x = num6 - num4 * Math.Sqrt(num); - num2 = underlierPrice * NormDist(num6) - StrikePrice * Math.Exp(-1.0 * (Int_Rate * num)) * NormDist(x); - if (!(num2 > optionPrice) || !(num5 > 1E-05) || !(num4 > 0.0001)) - { - break; - } - num4 -= num5; - num5 *= 0.1; - num4 += num5; - } - if (num2 > optionPrice) - { - return num4; - } - num4 += num5; - if (num4 > 10000.0) - { - return double.NaN; - } - } - return num4; - } - while (num3 <= optionPrice) - { - while (true) - { - double num6 = (Math.Log(underlierPrice / StrikePrice) + (Int_Rate + num4 * num4 / 2.0) * num) / (num4 * Math.Sqrt(num)); - double x = num6 - num4 * Math.Sqrt(num); - num3 = StrikePrice * Math.Exp(-1.0 * (Int_Rate * num)) * NormDist(0.0 - x) - underlierPrice * NormDist(0.0 - num6); - if (!(num3 > optionPrice) || !(num5 > 1E-05) || !(num4 > 0.0001)) - { - break; - } - num4 -= num5; - num5 *= 0.1; - num4 += num5; - } - if (num3 > optionPrice) - { - return num4; - } - num4 += num5; - if (num4 > 10000.0) - { - return double.NaN; - } - } - return num4; - } - - public override double Theta(Symbol option, double IV, double int_Rate, double shift) - { - if (option == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (option.Underlier == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return Theta(option.ExpirationDate, option.StrikePrice, option.OptionType, option.Underlier.Last, IV, int_Rate, shift); - } - - public override double Theta(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double int_Rate, double shift) - { - double num = ((double)OptionMath.CalculateDaysToExpire(ExpirationDate) - shift) / 365.0; - if (num <= 0.0) - { - num = (double)OptionMath.CalculateDaysToExpire(ExpirationDate) / 365.0; - } - double num2 = (Math.Log(price / StrikePrice) + (int_Rate + IV * IV / 2.0) * num) / (IV * Math.Sqrt(num)); - double num3 = num2 - IV * Math.Sqrt(num); - if (OptionType == OptionType.Call) - { - return (-1.0 * (price * (Math.Exp(-1.0 * num2 * num2 / 2.0) / Math.Sqrt(Math.PI * 2.0)) * IV) / (2.0 * Math.Sqrt(num)) - int_Rate * StrikePrice * Math.Exp(-1.0 * (int_Rate * num)) * NormDist(num3)) / 365.0; - } - return (-1.0 * (price * (Math.Exp(-1.0 * num2 * num2 / 2.0) / Math.Sqrt(Math.PI * 2.0)) * IV) / (2.0 * Math.Sqrt(num)) + int_Rate * StrikePrice * Math.Exp(-1.0 * (int_Rate * num)) * NormDist(0.0 - num3)) / 365.0; - } - - public override double Vega(Symbol option, double IV, double int_Rate, double shift) - { - if (option == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (option.Underlier == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return Vega(option.ExpirationDate, option.StrikePrice, option.OptionType, option.Underlier.Last, IV, int_Rate, shift); - } - - public override double Vega(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double int_Rate, double shift) - { - double num = ((double)OptionMath.CalculateDaysToExpire(ExpirationDate) - shift) / 365.0; - if (num <= 0.0) - { - num = (double)OptionMath.CalculateDaysToExpire(ExpirationDate) / 365.0; - } - double num2 = (Math.Log(price / StrikePrice) + (int_Rate + IV * IV / 2.0) * num) / (IV * Math.Sqrt(num)); - Math.Sqrt(num); - return price * Math.Sqrt(num) * (Math.Exp(-1.0 * num2 * num2 / 2.0) / Math.Sqrt(Math.PI * 2.0)) / 100.0; - } - - public override double Rho(Symbol option, double IV, double int_Rate, double shift) - { - if (option == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (option.Underlier == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return Rho(option.ExpirationDate, option.StrikePrice, option.OptionType, option.Underlier.Last, IV, int_Rate, shift); - } - - public override double Rho(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double int_Rate, double shift) - { - double num = StrikePrice; - double num2 = ((double)OptionMath.CalculateDaysToExpire(ExpirationDate) - shift) / 365.0; - if (num2 <= 0.0) - { - num2 = (double)OptionMath.CalculateDaysToExpire(ExpirationDate) / 365.0; - } - double num3 = (Math.Log(price / num) + (int_Rate + IV * IV / 2.0) * num2) / (IV * Math.Sqrt(num2)) - IV * Math.Sqrt(num2); - if (OptionType != OptionType.Call) - { - num *= -1.0; - num3 *= -1.0; - } - return num * num2 * Math.Exp(-1.0 * int_Rate * num2) * NormDist(num3) / 100.0; - } - } - public class NativePriceModel : PriceModel - { - public override PriceModels Type => PriceModels.Native; - - public override bool IsCalculationAllowed(Symbol symbol, OptionPriceType priceType) - { - return true; - } - - public override double IV(Symbol option, OptionPriceType priceType, double Int_Rate, double shift) - { - return option.IV; - } - - public override double Delta(Symbol option, double IV, double Int_Rate, double shift) - { - return option.Delta; - } - - public override double Gamma(Symbol option, double IV, double int_Rate, double shift) - { - return option.Gamma; - } - - public override double Vega(Symbol option, double IV, double int_Rate, double shift) - { - return option.Vega; - } - - public override double Theta(Symbol option, double IV, double int_Rate, double shift) - { - return option.Theta; - } - - public override double Rho(Symbol option, double IV, double int_Rate, double shift) - { - return option.Rho; - } - - protected override double NormDist(double x) - { - return double.NaN; - } - - public override double IV(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double optionPrice, double underlierPrice, OptionPriceType priceType, double Int_Rate, double shift) - { - return double.NaN; - } - - public override double TheorPrice(Symbol option, double IV, double Int_Rate, double shift) - { - return double.NaN; - } - - public override double TheorPrice(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift) - { - return double.NaN; - } - - public override double Delta(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift) - { - return double.NaN; - } - - public override double Vega(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift) - { - return double.NaN; - } - - public override double Gamma(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift) - { - return double.NaN; - } - - public override double Theta(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift) - { - return double.NaN; - } - - public override double Rho(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift) - { - return double.NaN; - } - } - public class OptionMath - { - public static double GetOptionLastPrice(Symbol optSymbol, OptionPriceType optionPriceType) - { - double result = double.NaN; - if (optionPriceType == OptionPriceType.Ask) - { - result = optSymbol.Ask; - } - else if (optionPriceType == OptionPriceType.BidAsk && (!optSymbol.Ask.IsNanOrDefault() || optSymbol.Bid.IsNanOrDefault())) - { - result = (optSymbol.Ask + optSymbol.Bid) / 2.0; - } - else - { - switch (optionPriceType) - { - case OptionPriceType.Bid: - result = optSymbol.Bid; - break; - case OptionPriceType.Last: - result = optSymbol.Last; - break; - } - } - return result; - } - - public static int CalculateDaysToExpire(DateTime expDate) - { - return (int)(expDate - Core.Instance.TimeUtils.DateTimeUtcNow).TotalDays + 1; - } - } - public enum PriceModels - { - BlackScholes, - Binominal, - Native - } - public enum OptionPriceType - { - Ask, - Bid, - BidAsk, - Last - } - public abstract class PriceModel - { - public abstract PriceModels Type { get; } - - public static PriceModel CreateModel(PriceModels type) - { - return type switch - { - PriceModels.BlackScholes => new BlackScholesPriceModel(), - PriceModels.Native => new NativePriceModel(), - _ => null, - }; - } - - public virtual bool IsCalculationAllowed(Symbol symbol, OptionPriceType priceType) - { - if (symbol?.Underlier == null) - { - return false; - } - return priceType switch - { - OptionPriceType.Bid => !symbol.Bid.IsNanOrDefault(), - OptionPriceType.Ask => !symbol.Ask.IsNanOrDefault(), - OptionPriceType.Last => !symbol.Last.IsNanOrDefault(), - _ => true, - }; - } - - protected abstract double NormDist(double x); - - public abstract double IV(Symbol option, OptionPriceType priceType, double Int_Rate, double shift); - - public abstract double IV(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double optionPrice, double underlierPrice, OptionPriceType priceType, double Int_Rate, double shift); - - public abstract double TheorPrice(Symbol option, double IV, double Int_Rate, double shift); - - public abstract double TheorPrice(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift); - - public abstract double Delta(Symbol option, double IV, double Int_Rate, double shift); - - public abstract double Delta(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift); - - public abstract double Vega(Symbol option, double IV, double int_Rate, double shift); - - public abstract double Vega(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift); - - public abstract double Gamma(Symbol option, double IV, double int_Rate, double shift); - - public abstract double Gamma(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift); - - public abstract double Theta(Symbol option, double IV, double int_Rate, double shift); - - public abstract double Theta(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift); - - public abstract double Rho(Symbol option, double IV, double int_Rate, double shift); - - public abstract double Rho(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift); - } -} -namespace TradingPlatform.BusinessLayer.GlobalVariables -{ - /// - /// Variable lifetime - /// - [Obfuscation(ApplyToMembers = true, Exclude = true)] - public enum VariableLifetime - { - /// - /// The variable will be removed on exit - /// - SaveSession, - /// - /// The variable will be written to file - /// - SaveFile - } - /// - /// Global variable entry - /// - [Obsolete("Should be removed at future releases")] - public sealed class GlobalVariable - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private object ??; - - /// - /// Variable name - /// - /// - /// - /// - /// using System; - /// using System.Text; - /// using PTLRuntime.NETScript; - /// - /// namespace GlobalVariablesManager - /// { - /// public class GlobalVariablesManager : NETIndicator - /// { - /// List<GlobalVariable> global_List=new List<GlobalVariable>(); - /// - /// public override void Init() - /// { - /// if(GlobalVariablesManager.Count()>0) - /// { - /// global_List=GlobalVariablesManager.GetGlobalVariablesList(); - /// foreach (var el in global_List) - /// { - /// Print(el.Name); - /// Print(el.Value); - /// } - /// } - /// } - /// } - /// } - /// - /// - /// - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Variable value - /// - /// - /// - /// - /// using System; - /// using System.Text; - /// using PTLRuntime.NETScript; - /// - /// namespace GlobalVariablesManager - /// { - /// public class GlobalVariablesManager : NETIndicator - /// { - /// List<GlobalVariable> global_List=new List<GlobalVariable>(); - /// public override void Init() - /// { - /// if(GlobalVariablesManager.Count()>0) - /// { - /// global_List=GlobalVariablesManager.GetGlobalVariablesList(); - /// foreach (var el in global_List) - /// { - /// Print(el.Name); - /// Print(el.Value); - /// } - /// } - /// } - /// } - /// } - /// - /// - /// - public object Value - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Initializes new variable - /// - /// - /// - /// - /// using System; - /// using System.Text; - /// using PTLRuntime.NETScript; - /// - /// namespace GlobalVariablesManager - /// { - /// public class GlobalVariablesManager : NETIndicator - /// { - /// List<GlobalVariable> global_List=new List<GlobalVariable>(); - /// public override void Init() - /// { - /// if(GlobalVariablesManager.Count()>0) - /// { - /// global_List=GlobalVariablesManager.GetGlobalVariablesList(); - /// foreach (var el in global_List) - /// { - /// //Simplified way to retrieve global variable value - /// el.GlobalVariable("new_global_variable_period", period) - /// - /// //However, to obtain certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. - /// } - /// } - /// } - /// } - /// } - /// - /// - /// - /// Variable name - /// Variable value - public GlobalVariable(string name, object value) - { - Name = name; - Value = value; - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 2); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - defaultInterpolatedStringHandler.AppendFormatted(Value.GetType()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - [Obsolete("Should be removed at future releases")] - public static class GlobalVariablesManager - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal GlobalVariable ?(? P_0) - { - return P_0.Variable; - } - } - - private const string ?? = "GlobalVariables.dat"; - - private const int ?? = 100000; - - private static readonly ConcurrentDictionary ??; - - private static string PathToGlobalVariablesFile => Path.Combine(Const.EXECUTING_FOLDER, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - - static GlobalVariablesManager() - { - ?? = new ConcurrentDictionary(); - ?(); - } - - /// - /// Sets variable value to a global storage - /// - /// - /// - /// - /// using System; - /// using System.Text; - /// using PTLRuntime.NETScript; - /// - /// namespace GlobalVariablesManager - /// { - /// public class GlobalVariablesManager : NETIndicator - /// { - /// GlobalVariablesManager(){ - /// base.ProjectName = "GlobalVariablesManager"; - /// base.Password=GetHashedPassword(ProjectName); - /// } - /// - /// [InputParameter("Period", 0, 1, 9999)] - /// public int period = 5; - /// - /// public override void OnQuote() - /// { - /// //Simplified way to store a global variable - /// - /// GlobalVariablesManager.SetValue("global_variable_period", period, VariableLifetime.SaveSession); - /// - /// //However, to indicate any variable belongs to certain indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. - /// - /// GlobalVariablesManager.SetValue("global_variable_period" +Symbols.Current.Name+period+Password, period, VariableLifetime.SaveSession); - /// } - /// } - /// } - /// - /// - /// - /// Variable name - /// New value - /// Variable lifetime - public static void SetValue(string name, object value, VariableLifetime lifetime = VariableLifetime.SaveSession) - { - if (!?(value)) - { - throw new NonSerializableObjectException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (!??.TryGetValue(name, out var _)) - { - GlobalVariable globalVariable = new GlobalVariable(name, value); - ??.TryAdd(name, new ?(globalVariable)); - } - ??[name].Lifetime = lifetime; - ? ? = ?(value, lifetime == VariableLifetime.SaveFile); - ??[name].Variable.Value = ?.??; - ??[name].ObjectBytes = ?.??; - } - - /// - /// Removes specified variable from global storage - /// - /// - /// - /// - /// using System; - /// using System.Text; - /// using PTLRuntime.NETScript; - /// - /// namespace GlobalVariablesManager - /// { - /// public class GlobalVariablesManager : NETIndicator - /// { - /// public override void Init() - /// { - /// //Simplified way to remove a global variable - /// - /// GlobalVariablesManager.Remove("global_variable_period"); - /// - /// //However, to remove certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. - /// } - /// } - /// } - /// - /// - /// - /// Variable name - public static bool Remove(string name) - { - ? value; - return ??.TryRemove(name, out value); - } - - /// - /// Returns variables' count in global storage - /// - /// - /// - /// - /// using System; - /// using System.Text; - /// using PTLRuntime.NETScript; - /// - /// namespace GlobalVariablesManager - /// { - /// public class GlobalVariablesManager : NETIndicator - /// { - /// public override void Init() - /// { - /// if(GlobalVariablesManager.Count()>0) - /// { - /// Print("Your session obtains "+GlobalVariablesManager.Count()+" global variables"); - /// } - /// } - /// } - /// } - /// - /// - /// - /// - public static int Count() - { - return ??.Count; - } - - /// - /// Removes all variables from global storage - /// - /// - /// - /// - /// using System; - /// using System.Text; - /// using PTLRuntime.NETScript; - /// - /// namespace GlobalVariablesManager - /// { - /// public class GlobalVariablesManager : NETIndicator - /// { - /// public override void Init() - /// { - /// GlobalVariablesManager.RemoveAll(); - /// - /// if(GlobalVariablesManager.Count()==0) - /// { - /// Print("Your session does not have any global variables"); - /// } - /// } - /// } - /// } - /// - /// - /// - public static void RemoveAll() - { - ??.Clear(); - } - - /// - /// Check if variable with specified name exists in global storage - /// - /// - /// - /// - /// using System; - /// using System.Text; - /// using PTLRuntime.NETScript; - /// - /// namespace GlobalVariablesManager - /// { - /// public class GlobalVariablesManager : NETIndicator - /// { - /// public override void Init() - /// { - /// //Simplified way to check an existance of a global variable - /// - /// if(GlobalVariablesManager.Exists("global_variable_period")) - /// Print("Your session has this global variable"); - /// else - /// GlobalVariablesManager.SetValue("global_variable_period"); - /// - /// //However, to obtain certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. - /// } - /// } - /// } - /// - /// - /// - /// Variable name - /// - public static bool Exists(string name) - { - return ??.ContainsKey(name); - } - - /// - /// Returns variable value by name - /// - /// - /// - /// - /// using System; - /// using System.Text; - /// using PTLRuntime.NETScript; - /// - /// namespace GlobalVariablesManager - /// { - /// public class GlobalVariablesManager : NETIndicator - /// { - /// public override void Init() - /// { - /// //Simplified way to retrieve global variable value - /// - /// if(GlobalVariablesManager.Exists("global_variable_period")) - /// //Always perform a type casting before assigning any variable from global storage - /// period = (int)GlobalVariablesManager.GetValue("global_variable_period"); - /// - /// //However, to obtain certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. - /// } - /// } - /// } - /// - /// - /// - /// Variable name - /// Variable value - public static object GetValue(string name) - { - if (!??.TryGetValue(name, out var value)) - { - throw new VariableNotExistsException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), name); - } - return value.Variable.Value; - } - - /// - /// Performs a variable assigning from a global storage if such name exists in a scope - /// - /// - /// - /// - /// using System; - /// using System.Text; - /// using PTLRuntime.NETScript; - /// - /// namespace GlobalVariablesManager - /// { - /// public class GlobalVariablesManager : NETIndicator - /// { - /// public override void Init() - /// { - /// int new_period; - /// - /// //Simplified way to retrieve global variable value - /// - /// if(GlobalVariablesManager.TryGetValue("global_variable_period")) - /// Print("New variable is assigned from globals: " + new_period); - /// if(new_period==period) - /// Print("Matching, no need to re-assign globals: "); - /// else - /// GlobalVariablesManager.SetValue("global_variable_period", period, VariableLifetime.SaveSession); - /// - /// //However, to obtain certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. - /// } - /// } - /// } - /// - /// - /// - /// Variable name - /// Variable value - /// True if variable exists - public static bool TryGetValue(string name, out object obj) - { - if (??.TryGetValue(name, out var value)) - { - obj = value.Variable.Value; - return true; - } - obj = null; - return false; - } - - /// - /// Saves all serializable variables to disk - /// - /// - /// - /// - /// using System; - /// using System.Text; - /// using PTLRuntime.NETScript; - /// - /// namespace GlobalVariablesManager - /// { - /// public class GlobalVariablesManager : NETIndicator - /// { - /// Connection myConnection = Connection.CurrentConnection; - /// public override void OnQuote() - /// { - /// if(myConnection.Status==Disconnected) - /// GlobalVariablesManager.Flush(); - /// } - /// } - /// } - /// - /// - /// - public static void Flush() - { - try - { - XmlDocument xmlDocument = new XmlDocument(); - XmlElement xmlElement = xmlDocument.CreateElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (KeyValuePair item in ??) - { - ? value = item.Value; - if (value.Lifetime == VariableLifetime.SaveFile) - { - XmlElement xmlElement2 = xmlDocument.CreateElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xmlElement2.SetAttribute(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value.Variable.Name); - xmlElement2.SetAttribute(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ?(value.ObjectBytes)); - xmlElement2.SetAttribute(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (value.Variable.Value == null).ToString()); - xmlElement.AppendChild(xmlElement2); - } - } - xmlDocument.AppendChild(xmlElement); - using XmlTextWriter xmlTextWriter = new XmlTextWriter(PathToGlobalVariablesFile, Encoding.UTF8); - xmlTextWriter.Formatting = Formatting.Indented; - xmlDocument.WriteContentTo(xmlTextWriter); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - /// - /// Returns all global variables as list - /// - /// - /// - /// - /// using System; - /// using System.Text; - /// using PTLRuntime.NETScript; - /// - /// namespace GlobalVariablesManager - /// { - /// public class GlobalVariablesManager : NETIndicator - /// { - /// List <GlobalVariable>global_List=new List<GlobalVariable>(); - /// public override void Init() - /// { - /// if(GlobalVariablesManager.Count()>0) - /// global_List=GlobalVariablesManager.GetGlobalVariablesList(); - /// - /// foreach (var el in global_List) - /// { - /// Print(el.Name); - /// } - /// } - /// } - /// } - /// - /// - /// - /// Collection of global variables - public static List GetGlobalVariablesList() - { - return ??.Values.Select((? P_0) => P_0.Variable).ToList(); - } - - private static void ?() - { - try - { - if (!File.Exists(PathToGlobalVariablesFile)) - { - return; - } - using XmlReader xmlReader = XmlReader.Create(PathToGlobalVariablesFile); - xmlReader.MoveToContent(); - xmlReader.Read(); - while (!xmlReader.EOF && xmlReader.ReadState == ReadState.Interactive) - { - if (xmlReader.NodeType == XmlNodeType.Element && xmlReader.Name.Equals(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - try - { - if (!(XNode.ReadFrom(xmlReader) is XElement xElement)) - { - continue; - } - string value = xElement.Attribute(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; - string value2 = xElement.Attribute(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; - if (value2 != null && value2.Equals(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - SetValue(value, null, VariableLifetime.SaveFile); - continue; - } - byte[] array = Convert.FromBase64String(xElement.Attribute(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value); - using MemoryStream memoryStream = new MemoryStream(); - memoryStream.Write(array, 0, array.Length); - memoryStream.Position = 0L; - object value3 = new BinaryFormatter().Deserialize(memoryStream); - SetValue(value, value3, VariableLifetime.SaveFile); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - else - { - xmlReader.Read(); - } - } - } - catch (Exception ex2) - { - Core.Instance.Loggers.Log(ex2); - } - } - - private static bool ?(object P_0) - { - if (P_0 == null) - { - return true; - } - if (P_0 is ISerializable) - { - return true; - } - return Attribute.IsDefined(P_0.GetType(), typeof(SerializableAttribute)); - } - - private static ? ?(object P_0, bool P_1) - { - ? ? = new ?(); - if (P_0 == null) - { - return ?; - } - using MemoryStream memoryStream = new MemoryStream(); - BinaryFormatter binaryFormatter = new BinaryFormatter(); - binaryFormatter.Serialize(memoryStream, P_0); - long length = memoryStream.Length; - if (P_1 && length > 100000) - { - throw new TooBigObjectException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - memoryStream.Position = 0L; - byte[] array = new byte[memoryStream.Length]; - memoryStream.Read(array, 0, (int)memoryStream.Length); - memoryStream.Position = 0L; - object ?? = binaryFormatter.Deserialize(memoryStream); - ?.?? = array; - ?.?? = ??; - return ?; - } - - private static string ?(byte[] P_0) - { - return Convert.ToBase64String(P_0, Base64FormattingOptions.None); - } - } -} -namespace ? -{ - internal class ? - { - [CompilerGenerated] - private GlobalVariable ??; - - [CompilerGenerated] - private byte[] ??; - - [CompilerGenerated] - private VariableLifetime ??; - - public GlobalVariable Variable - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = globalVariable; - } - } - - public byte[] ObjectBytes - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = array; - } - } - - public VariableLifetime Lifetime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = variableLifetime; - } - } - - internal ?(GlobalVariable P_0) - { - Variable = P_0; - } - } -} -namespace TradingPlatform.BusinessLayer.GlobalVariables -{ - /// - /// Object is non-serializable - /// - [Serializable] - public class NonSerializableObjectException : Exception - { - public NonSerializableObjectException() - { - } - - public NonSerializableObjectException(string message) - : base(message) - { - } - - public NonSerializableObjectException(string message, Exception inner) - : base(message, inner) - { - } - - protected NonSerializableObjectException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } - } -} -namespace ? -{ - internal class ? - { - internal byte[] ??; - - internal object ??; - - internal ?() - { - ?? = null; - ?? = new byte[0]; - } - } -} -namespace TradingPlatform.BusinessLayer.GlobalVariables -{ - /// - /// Object too big - /// - [Serializable] - public class TooBigObjectException : Exception - { - public TooBigObjectException() - { - } - - public TooBigObjectException(string message) - : base(message) - { - } - - public TooBigObjectException(string message, Exception inner) - : base(message, inner) - { - } - - protected TooBigObjectException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } - } - [Serializable] - public class VariableNotExistsException : Exception - { - [CompilerGenerated] - private string ??; - - public string VariableName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public VariableNotExistsException() - { - } - - public VariableNotExistsException(string message) - : base(message) - { - } - - public VariableNotExistsException(string message, Exception inner) - : base(message, inner) - { - } - - public VariableNotExistsException(string message, string variableName) - : base(message) - { - VariableName = variableName; - } - - protected VariableNotExistsException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } - } -} -namespace TradingPlatform.BusinessLayer.Utils -{ - public class ActionRepeater : IDisposable - { - private class ? : IDisposable - { - private readonly ActionRepeaterCallback ??; - - private readonly CancellationTokenSource ??; - - private int ??; - - private readonly int ??; - - private Task ??; - - public ?(ActionRepeaterCallback P_0, int P_1) - { - ?? = P_0; - ?? = new CancellationTokenSource(); - ?? = 0; - ?? = P_1; - } - - public void ?() - { - try - { - if (??++ >= ?? && ?? == null) - { - ?? = 0; - ?? = Task.Run(delegate - { - ???.Invoke(??.Token); - }, ??.Token).ContinueWith((Task t) => ?? = null); - } - } - catch - { - } - } - - public void Dispose() - { - ??.Cancel(); - } - - [CompilerGenerated] - private void ?() - { - ???.Invoke(??.Token); - } - - [CompilerGenerated] - private Task ?(Task t) - { - return ?? = null; - } - } - - private readonly Timer ??; - - private readonly TimeSpan ??; - - private readonly IDictionary ??; - - private ?[] ??; - - private readonly object ??; - - public ActionRepeater() - { - ?? = new Timer(?); - ?? = TimeSpan.FromSeconds(1.0); - ?? = new Dictionary(); - ?? = Array.Empty(); - ?? = new object(); - } - - public void BeginRepeat(ActionRepeaterCallback callback, TimeSpan period) - { - lock (??) - { - ??.Add(callback, new ?(callback, (int)Math.Max(1L, period.Ticks / ??.Ticks))); - ?? = ??.Values.ToArray(); - if (??.Any()) - { - ??.Change(??, ??); - } - } - } - - public void EndRepeat(ActionRepeaterCallback callback) - { - lock (??) - { - ??.Remove(callback); - ?? = ??.Values.ToArray(); - } - } - - public void Dispose() - { - lock (??) - { - ?[] array = ??; - for (int i = 0; i < array.Length; i++) - { - array[i].Dispose(); - } - } - ??.Change(-1, -1); - ??.Dispose(); - } - - private void ?(object P_0) - { - ?[] array = ??; - for (int i = 0; i < array.Length; i++) - { - array[i].?(); - } - } - } - public delegate void ActionRepeaterCallback(CancellationToken cancellation); - /// - /// The action wrapper. - /// - public class ActionWrapper : IXElementSerialization - { - [CompilerGenerated] - private List ??; - - /// - /// Gets or Sets the items. - /// - public List Items - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Initializes a new instance of the class. - /// - public ActionWrapper() - { - Items = new List(); - } - - /// - /// Froms the X element. - /// - /// The element. - /// The deserialization info. - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - foreach (XElement item2 in element.Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (Serializer.DeserializeNode(item2, deserializationInfo) is SettingItem item) - { - Items.Add(item); - } - } - } - - /// - /// Tos the X element. - /// - /// A XElement. - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (SettingItem item in Items) - { - xElement.Add(item.ToXElement()); - } - return xElement; - } - } - /// - /// The aggressor flag calculator. - /// - public class AggressorFlagCalculator : IAggressorFlagCalculator, IDisposable - { - private const int ?? = 1000; - - private ConcurrentDictionary ??; - - /// - /// Initializes a new instance of the class. - /// - public AggressorFlagCalculator() - { - ?? = new ConcurrentDictionary(); - } - - /// - /// Collect bid ask. - /// - /// The symbol. - /// The time ticks. - /// The bid. - /// The ask. - public void CollectBidAsk(string symbol, long timeTicks, double bid, double ask) - { - try - { - if (?? != null && (??.TryGetValue(symbol, out var value) || ??.TryAdd(symbol, value = new AggressorFlagCalculatorItem(1000)))) - { - value.CollectBidAsk(timeTicks, bid, ask); - } - } - catch (Exception exception) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + exception.GetMessageRecursive()); - } - } - - /// - /// Calculate aggressor flag. - /// - /// The symbol. - /// The time ticks. - /// The last. - /// An AggressorFlag. - public AggressorFlag CalculateAggressorFlag(string symbol, long timeTicks, double last) - { - try - { - if (?? == null || !??.TryGetValue(symbol, out var value)) - { - return AggressorFlag.NotSet; - } - return value.CalculateAggressorFlag(timeTicks, last); - } - catch (Exception exception) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + exception.GetMessageRecursive()); - } - return AggressorFlag.NotSet; - } - - /// - /// - /// - public void Dispose() - { - ICollection values = ??.Values; - ?? = null; - foreach (AggressorFlagCalculatorItem item in values) - { - item.Dispose(); - } - } - - /// - /// Calculate aggressor flag. - /// - /// The previous bid. - /// The previous ask. - /// The last. - /// An AggressorFlag. - public static AggressorFlag CalculateAggressorFlag(double previousBid, double previousAsk, double last) - { - if (last >= previousAsk) - { - return AggressorFlag.Buy; - } - if (last <= previousBid) - { - return AggressorFlag.Sell; - } - return AggressorFlag.None; - } - } - public class AggressorFlagCalculatorItem : IDisposable - { - private class ? - { - [CompilerGenerated] - private long ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - public long TimeTicks - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = num; - } - } - - public double Bid - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = num; - } - } - - public double Ask - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = num; - } - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(4, 3); - defaultInterpolatedStringHandler.AppendFormatted(TimeTicks); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Bid); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Ask); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - - private readonly int ??; - - private ?[] ??; - - private volatile int ??; - - private volatile int ??; - - public AggressorFlagCalculatorItem(int cacheCapacity) - { - ?? = cacheCapacity; - ?? = new ?[cacheCapacity]; - for (int i = 0; i < cacheCapacity; i++) - { - ??[i] = new ?(); - } - ?? = -1; - ?? = -1; - } - - public void CollectBidAsk(long timeTicks, double bid, double ask) - { - int num = Math.Abs(Interlocked.Increment(ref ??) % ??); - ?[] array = ??; - ? ? = ((array != null) ? array[num] : null); - if (? != null) - { - ?.TimeTicks = timeTicks; - ?.Bid = bid; - ?.Ask = ask; - Interlocked.Increment(ref ??); - } - } - - public AggressorFlag CalculateAggressorFlag(long timeTicks, double last) - { - int num = Math.Abs(?? % ??); - int num2 = num; - do - { - ?[] array = ??; - ? ? = ((array != null) ? array[num2] : null); - if (? == null || ?.TimeTicks == 0L) - { - break; - } - if (?.TimeTicks <= timeTicks) - { - return AggressorFlagCalculator.CalculateAggressorFlag(?.Bid, ?.Ask, last); - } - num2--; - if (num2 < 0) - { - num2 = ?? - 1; - } - } - while (num2 != num); - return AggressorFlag.NotSet; - } - - public void Dispose() - { - ?? = null; - } - } - public interface IAggressorFlagCalculator : IDisposable - { - void CollectBidAsk(string symbol, long timeTicks, double bid, double ask); - - AggressorFlag CalculateAggressorFlag(string symbol, long timeTicks, double last); - } - /// - /// The alert. - /// - public class Alert - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private string ??; - - /// - /// Gets or Sets the text. - /// - public string Text - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the symbol name. - /// - public string SymbolName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the connection name. - /// - public string ConnectionName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the action on confirm. - /// - public Action ActionOnConfirm - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the name. - /// - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - } - /// - /// The alert data. - /// - [DataContract(Name = "Alert", Namespace = "TradingPlatform")] - public class AlertData : IXElementSerialization - { - /// - /// The name. - /// - [DataMember(Name = "Name")] - public string Name; - - [CompilerGenerated] - private List ??; - - [CompilerGenerated] - private List ??; - - [CompilerGenerated] - private List ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private Hashtable ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private object ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ?? = true; - - [CompilerGenerated] - private int ?? = 1; - - [CompilerGenerated] - private int ?? = 1; - - private const string ?? = "ddMMyyyy HH:mm:ss.ffffff"; - - /// - /// Gets or Sets the columns. - /// - public List Columns - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the groups. - /// - public List Groups - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the actions. - /// - public List Actions - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets a value indicating whether enabled. - /// - [DataMember(Name = "Enabled")] - public bool Enabled - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the table dictionary. - /// - public Hashtable TableDictionary - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets a value indicating whether coloring is alert. - /// - [DataMember(Name = "IsColoringAlert")] - public bool IsColoringAlert - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets a value indicating whether filter alert. - /// - [DataMember(Name = "FilterAlert")] - public bool FilterAlert - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets a value indicating whether search alert. - /// - [DataMember(Name = "SearchAlert")] - public bool SearchAlert - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets a value indicating whether to remove. - /// - public bool ToRemove - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the ID. - /// - public string ID - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the command sender. - /// - public object CommandSender - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets a value indicating whether need confirm trading. - /// - public bool NeedConfirmTrading - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Expiration time - /// - public DateTime ExpiryTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool Expire - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool RepeatAlertActions - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int RepeatMaxCount - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int RepeatPeriodMinutes - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Initializes a new instance of the class. - /// - public AlertData() - { - Columns = new List(); - Groups = new List(); - Actions = new List(); - NeedConfirmTrading = true; - } - - /// - /// To the XML element. - /// - /// A XElement. - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Enabled)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsColoringAlert)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), FilterAlert)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), NeedConfirmTrading)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Expire)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExpiryTime.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo.InvariantCulture))); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), RepeatAlertActions)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), RepeatMaxCount)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), RepeatPeriodMinutes)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SearchAlert)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ID)); - XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (ConditionGroup group in Groups) - { - xElement2.Add(group.ToXElement()); - } - xElement.Add(xElement2); - XElement xElement3 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (ActionWrapper action in Actions) - { - xElement3.Add(action.ToXElement()); - } - xElement.Add(xElement3); - return xElement; - } - - /// - /// From the XML element. - /// - /// The element. - /// The deserialization info. - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - Name = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString(); - Enabled = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); - IsColoringAlert = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); - FilterAlert = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); - XElement xElement2 = xElement?.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - NeedConfirmTrading = xElement2.ToBool(); - } - XElement xElement3 = xElement?.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - Expire = xElement3.ToBool(); - } - XElement xElement4 = xElement?.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - ExpiryTime = xElement4.ToDateTime(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - XElement xElement5 = xElement?.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement5 != null) - { - RepeatAlertActions = xElement5.ToBool(); - } - XElement xElement6 = xElement?.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement6 != null) - { - RepeatMaxCount = xElement6.ToInt(); - } - XElement xElement7 = xElement?.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement7 != null) - { - RepeatPeriodMinutes = xElement7.ToInt(); - } - SearchAlert = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); - ID = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString(); - List list = new List(); - foreach (XElement item in xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - ConditionGroup conditionGroup = new ConditionGroup(); - conditionGroup.FromXElement(item, deserializationInfo); - list.Add(conditionGroup); - } - Groups = list; - List list2 = new List(); - foreach (XElement item2 in xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - ActionWrapper actionWrapper = new ActionWrapper(); - actionWrapper.FromXElement(item2, deserializationInfo); - list2.Add(actionWrapper); - } - Actions = list2; - } - } - /// - /// The arbitrage symbol. - /// - [Serializable] - public class ArbitrageSymbol : IXElementSerialization, IComparable - { - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private readonly Guid ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private Symbol ??; - - [CompilerGenerated] - private Account ??; - - [CompilerGenerated] - private double ??; - - /// - /// Gets or Sets the index. - /// - public int Index - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets the unique ID. - /// - public Guid UniqueID - { - [CompilerGenerated] - get - { - return ??; - } - } - - /// - /// Gets the symbol id. - /// - public string SymbolId - { - get - { - if (Symbol == null) - { - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - return Symbol.ConnectionId + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Symbol.Id; - } - } - - /// - /// Gets or Sets a value indicating whether is selected. - /// - public bool IsSelected - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the symbol. - /// - public Symbol Symbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the account. - /// - public Account Account - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Gets or Sets the commission. - /// - public double Commission - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Initializes a new instance of the class. - /// - public ArbitrageSymbol() - { - ?? = Guid.NewGuid(); - } - - /// - /// Compare to. - /// - /// The other. - /// An int. - public int CompareTo(ArbitrageSymbol other) - { - return Index.CompareTo(other.Index); - } - - /// - /// Froms the X element. - /// - /// The element. - /// The deserialization info. - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.XPathSelectElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - BusinessObjectInfo businessObjectInfo = new BusinessObjectInfo(); - businessObjectInfo.FromXElement(xElement, deserializationInfo); - Symbol = Core.Instance.GetSymbol(businessObjectInfo); - } - XElement xElement2 = element.XPathSelectElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - BusinessObjectInfo businessObjectInfo2 = new BusinessObjectInfo(); - businessObjectInfo2.FromXElement(xElement2, deserializationInfo); - Account = Core.Instance.GetAccount(businessObjectInfo2); - } - IsSelected = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); - Commission = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToDouble(); - } - - /// - /// Tos the X element. - /// - /// A XElement. - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsSelected)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Symbol?.CreateInfo().ToXElement())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Account?.CreateInfo().ToXElement())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Commission)); - return xElement; - } - } - /// - /// The action buffered processor. - /// - public class ActionBufferedProcessor : BufferedProcessor - { - protected override void Process(Action subject) - { - try - { - subject(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - } - /// - /// The action buffered processor with priority. - /// - public class ActionBufferedProcessorWithPriority : BufferedProcessorWithPriority - { - /// - /// Initializes a new instance of the class. - /// - /// The threads count. - public ActionBufferedProcessorWithPriority(int threadsCount = 1) - : base(threadsCount) - { - } - - protected override void Process(Action action) - { - action?.Invoke(); - } - } - /// - /// The buffered processor. - /// - /// - public abstract class BufferedProcessor - { - [CompilerGenerated] - private sealed class ? - { - public T ??; - - public Task ??; - - public BufferedProcessor ??; - - internal void ?() - { - try - { - ??.State = BufferedProcessorState.ProcessSubject; - ??.Process(??); - } - catch (Exception ex) - { - ??.?(ex.InnerException ?? ex); - } - finally - { - ??.State = BufferedProcessorState.Started; - } - } - - internal void ?(Task P_0) - { - ??.??.Remove(??.Id); - ??.??.Set(); - } - } - - [StructLayout(LayoutKind.Auto)] - [CompilerGenerated] - private struct ? - { - public BufferedProcessor ??; - - public CancellationToken? ??; - } - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private BufferedProcessorState ??; - - protected int ProcessTreadsCount; - - private CancellationTokenSource ??; - - private readonly Queue ??; - - private readonly object ??; - - private readonly ManualResetEventSlim ??; - - private readonly HashSet ??; - - /// - /// Gets the state. - /// - public BufferedProcessorState State - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = bufferedProcessorState; - } - } - - /// - /// Gets the queue depth. - /// - public int QueueDepth => ??.Count; - - public event Action ExceptionOccurred - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - protected BufferedProcessor() - { - ProcessTreadsCount = 1; - ?? = new Queue(); - ?? = new object(); - ?? = new ManualResetEventSlim(initialState: false); - ?? = new HashSet(); - State = BufferedProcessorState.Created; - } - - /// - /// - /// - public virtual void Start() - { - ?? = new CancellationTokenSource(); - if (ProcessTreadsCount == 1) - { - Task.Factory.StartNew(?, ??.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default); - } - else - { - Task.Factory.StartNew(?, ??.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default); - } - State = BufferedProcessorState.Started; - } - - /// - /// - /// - public virtual void Stop() - { - lock (??) - { - ???.Cancel(); - Clear(); - ??.Set(); - State = BufferedProcessorState.Stopped; - } - } - - /// - /// - /// - /// The subject. - public virtual void Push(T subject) - { - lock (??) - { - ??.Enqueue(subject); - ??.Set(); - } - } - - private void ?() - { - CancellationToken token = ??.Token; - while (true) - { - try - { - if (token.IsCancellationRequested) - { - break; - } - ??.Wait(token); - if (token.IsCancellationRequested) - { - break; - } - while (??.Count > 0) - { - if (token.IsCancellationRequested) - { - return; - } - try - { - T val = default(T); - lock (??) - { - State = BufferedProcessorState.ProcessSubject; - val = ??.Dequeue(); - } - Process(val); - } - catch (Exception ex) - { - ?(ex.InnerException ?? ex); - } - finally - { - State = BufferedProcessorState.Started; - } - } - } - catch (Exception ex2) - { - ?(ex2.InnerException ?? ex2); - } - finally - { - lock (??) - { - if (??.Count == 0) - { - ??.Reset(); - } - } - } - } - } - - private void ?() - { - CancellationToken token = ??.Token; - while (true) - { - try - { - if (token.IsCancellationRequested) - { - break; - } - ??.Wait(token); - if (token.IsCancellationRequested) - { - break; - } - while (??.Count > 0 && ??.Count < ProcessTreadsCount) - { - if (token.IsCancellationRequested) - { - return; - } - T ?? = default(T); - lock (??) - { - ?? = ??.Dequeue(); - } - Task ?? = Task.Factory.StartNew(delegate - { - try - { - State = BufferedProcessorState.ProcessSubject; - Process(??); - } - catch (Exception ex2) - { - ?(ex2.InnerException ?? ex2); - } - finally - { - State = BufferedProcessorState.Started; - } - }); - ??.ContinueWith(delegate - { - ??.Remove(??.Id); - ??.Set(); - }); - if (??.Status != TaskStatus.RanToCompletion && ??.Status != TaskStatus.Canceled && ??.Status != TaskStatus.Faulted) - { - ??.Add(??.Id); - } - } - } - catch (Exception ex) - { - ?(ex.InnerException ?? ex); - } - finally - { - ??.Reset(); - } - } - } - - private void ?(Exception P_0) - { - ???.Invoke(P_0); - } - - [Obfuscation(Exclude = false)] - protected abstract void Process(T P_0); - - protected internal virtual void Clear() - { - ???.Clear(); - } - - /// - /// Wait all messages process. - /// - /// The external token. - public void WaitAllMessagesProcess(CancellationToken? externalToken = null) - { - ? ? = default(?); - ?.?? = this; - ?.?? = externalToken; - if (?(ref ?)) - { - return; - } - do - { - lock (??) - { - if (QueueDepth <= 0 && State != BufferedProcessorState.ProcessSubject) - { - break; - } - } - } - while (!?(ref ?)); - } - - [CompilerGenerated] - private bool ?(ref ? P_0) - { - return ???.IsCancellationRequested ?? P_0.???.IsCancellationRequested ?? true; - } - } - /// - /// The buffered processor state. - /// - public enum BufferedProcessorState - { - Created, - Started, - ProcessSubject, - Stopped - } - public abstract class BufferedProcessorWithPriority - { - [CompilerGenerated] - private sealed class ? - { - public QueueObj ??; - - public Task ??; - - public BufferedProcessorWithPriority ??; - - internal void ?() - { - string name = Thread.CurrentThread.Name; - try - { - Thread.CurrentThread.Name = ??.??; - ??.ProcessMessageNow = true; - ??.Process(??.Value); - ??.ProcessMessageNow = false; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ex.Message, LoggingLevel.Verbose); - } - finally - { - Thread.CurrentThread.Name = name; - } - } - - internal void ?(Task P_0) - { - lock (??.??) - { - ??.??.Remove(??.Marker); - } - ??.??.Remove(??.Id); - ??.??.Set(); - } - } - - private readonly TasksHolder ??; - - private readonly object ??; - - private readonly ManualResetEvent ??; - - private CancellationTokenSource ??; - - protected int ProcessTreadsCount; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - private readonly HashSet ??; - - private readonly HashSet ??; - - private readonly string ??; - - internal bool Started - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = flag; - } - } - - internal bool ProcessMessageNow - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = flag; - } - } - - protected BufferedProcessorWithPriority(int threadsCount = 1) - { - ?? = Guid.NewGuid().ToShortString(); - ProcessTreadsCount = threadsCount; - ?? = new TasksHolder(2); - ?? = new object(); - ?? = new ManualResetEvent(initialState: false); - ?? = new HashSet(); - ?? = new HashSet(); - } - - public void Start() - { - ?? = new CancellationTokenSource(); - Task.Factory.StartNew(?, ??.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default); - Started = true; - } - - public virtual void Stop() - { - lock (??) - { - ???.Cancel(); - Clear(); - ??.Set(); - Started = false; - } - } - - protected virtual void Clear() - { - ???.?(); - } - - private void ?() - { - while (true) - { - try - { - ??.WaitOne(); - ??.Reset(); - CancellationTokenSource cancellationTokenSource = ??; - if (cancellationTokenSource != null && cancellationTokenSource.IsCancellationRequested) - { - break; - } - while (??.Count > 0 && ??.Count < ProcessTreadsCount) - { - CancellationTokenSource cancellationTokenSource2 = ??; - if (cancellationTokenSource2 != null && cancellationTokenSource2.IsCancellationRequested) - { - return; - } - QueueObj ?? = null; - lock (??) - { - ?? = ??.Dequeue(??); - if (?? == null) - { - break; - } - ??.Add(??.Marker); - goto IL_00ba; - } - IL_00ba: - Task ?? = Task.Factory.StartNew(delegate - { - string name = Thread.CurrentThread.Name; - try - { - Thread.CurrentThread.Name = ??; - ProcessMessageNow = true; - Process(??.Value); - ProcessMessageNow = false; - } - catch (Exception ex2) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ex2.Message, LoggingLevel.Verbose); - } - finally - { - Thread.CurrentThread.Name = name; - } - }); - ??.ContinueWith(delegate - { - lock (??) - { - ??.Remove(??.Marker); - } - ??.Remove(??.Id); - ??.Set(); - }); - if (??.Status != TaskStatus.RanToCompletion && ??.Status != TaskStatus.Canceled && ??.Status != TaskStatus.Faulted) - { - ??.Add(??.Id); - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ex.Message, LoggingLevel.Verbose); - } - } - } - - public void Push(T subject, int priority, string marker) - { - if (Thread.CurrentThread.Name == ??) - { - try - { - Process(subject); - return; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ex.Message, LoggingLevel.Verbose); - return; - } - } - lock (??) - { - ??.Enqueue(subject, priority, marker); - } - ??.Set(); - } - - [Obfuscation(Exclude = false)] - protected abstract void Process(T P_0); - } -} -namespace ? -{ - internal class ? where ? : IBufferedProcessorValue - { - private readonly Dictionary>> ??; - - private readonly object ??; - - public ?() - { - ?? = new Dictionary>>(); - ?? = new object(); - } - - public void ?(Action P_0, params ?[] messagesTypes) - { - if (P_0 == null) - { - return; - } - lock (??) - { - foreach (? key in messagesTypes) - { - if (??.TryGetValue(key, out var value)) - { - List> value2 = new List>(value) { P_0 }; - ??[key] = value2; - } - else - { - ??.Add(key, new List> { P_0 }); - } - } - } - } - - public void ?(Action P_0, params ?[] messagesTypes) - { - if (P_0 == null) - { - return; - } - lock (??) - { - if (messagesTypes.Length == 0) - { - foreach (KeyValuePair>> item in ??) - { - item.Value.Remove(P_0); - } - return; - } - foreach (? key in messagesTypes) - { - if (??.TryGetValue(key, out var value)) - { - List> list = new List>(value); - list.Remove(P_0); - ??[key] = list; - } - } - } - } - - public void ?(? P_0) - { - List> value; - lock (??) - { - ??.TryGetValue(P_0.Key, out value); - } - if (value == null) - { - return; - } - foreach (Action item in value) - { - try - { - item(P_0); - } - catch - { - } - } - } - } -} -namespace TradingPlatform.BusinessLayer.Utils -{ - public interface IBufferedProcessorValue - { - TKey Key { get; } - } - public class QueueObj - { - public readonly T Value; - - public readonly string Marker; - - public QueueObj(T value, string marker) - { - Value = value; - Marker = marker; - } - } - public class TasksHolder - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func>, int> ??; - - internal int ?(List> P_0) - { - return P_0.Count; - } - } - - private readonly List>[] ??; - - public int Count => ??.Sum((List> P_0) => P_0.Count); - - /// - /// - /// - public TasksHolder(int prioritiesCount) - { - ?? = new List>[prioritiesCount]; - for (int i = 0; i < ??.Length; i++) - { - ??[i] = new List>(); - } - } - - public void Enqueue(TTask task, int priority, string marker) - { - if (priority >= ??.Length) - { - throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - QueueObj item = new QueueObj(task, marker); - lock (??) - { - ??[priority].Add(item); - } - } - - public QueueObj Dequeue(HashSet markersAtWork) - { - QueueObj queueObj = null; - lock (??) - { - List>[] array = ??; - foreach (List> list in array) - { - foreach (QueueObj item in list) - { - if (!markersAtWork.Contains(item.Marker)) - { - queueObj = item; - list.Remove(item); - break; - } - } - if (queueObj != null) - { - break; - } - } - } - return queueObj; - } - - internal void ?() - { - for (int i = 0; i < ??.Length; i++) - { - ??[i].Clear(); - } - } - } - public class TimeFrameConfig : IXElementSerialization, ICloneable - { - public List TFList; - - [CompilerGenerated] - private HistoryAggregation ??; - - /// - /// ?????????, ?? ???? ????????????????? ?? ???????? ??? "TimeFrameScreen". - /// ??????? ??????????? ????????? ?????. - /// - public HistoryAggregation DefaultAggregation - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public TimeFrameConfig() - { - TFList = new List(); - } - - public void AddTF(HistoryAggregation info) - { - TFList.Add(info.ToString()); - } - - public bool IsAllowed(HistoryAggregation otherTf) - { - if (TFList.Count == 0 || otherTf == null) - { - return true; - } - string item = otherTf.ToString(); - return TFList.Contains(item); - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (string tF in TFList) - { - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), tF)); - } - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - TFList = new List(); - foreach (XElement item in element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Elements()) - { - string text = item.Value.ToString(); - if (text.StartsWith(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) && text.EndsWith(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) && text != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - text = text.Replace(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - TFList.Add(text); - } - } - - public object Clone() - { - return new TimeFrameConfig - { - TFList = new List(TFList), - DefaultAggregation = ((DefaultAggregation == null) ? null : ((HistoryAggregation)DefaultAggregation.Clone())) - }; - } - } - public class ClusterCustomColoringLevel : IXElementSerialization, IEquatable - { - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private Color ??; - - [CompilerGenerated] - private Color ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - public bool IsChecked - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double Value - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Color LeftColor - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Color RightColor - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string LeftColorLabel - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string RightColorLabel - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsChecked)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Value)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LeftColor.ToArgb())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), RightColor.ToArgb())); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - Value = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToDouble(); - IsChecked = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); - LeftColor = Color.FromArgb(xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt()); - RightColor = Color.FromArgb(xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt()); - } - } - - public void UpdateLevel(ClusterCustomColoringLevel level) - { - IsChecked = level.IsChecked; - Value = level.Value; - LeftColor = level.LeftColor; - RightColor = level.RightColor; - if (!string.IsNullOrEmpty(level.LeftColorLabel)) - { - LeftColorLabel = level.LeftColorLabel; - } - if (!string.IsNullOrEmpty(level.RightColorLabel)) - { - RightColorLabel = level.RightColorLabel; - } - } - - public bool Equals(ClusterCustomColoringLevel other) - { - if (other == null) - { - return false; - } - if (this == other) - { - return true; - } - if (IsChecked == other.IsChecked && Value.Equals(other.Value) && LeftColor.Equals(other.LeftColor) && RightColor.Equals(other.RightColor) && LeftColorLabel == other.LeftColorLabel) - { - return RightColorLabel == other.RightColorLabel; - } - return false; - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - if (this == obj) - { - return true; - } - if (obj.GetType() != GetType()) - { - return false; - } - return Equals((ClusterCustomColoringLevel)obj); - } - - public override int GetHashCode() - { - return HashCode.Combine(IsChecked, Value, LeftColor, RightColor, LeftColorLabel, RightColorLabel); - } - } - public sealed class ColorStyleWidth : IXElementSerialization, ICloneable - { - public Color Color; - - public LineStyle Style; - - public int Width; - - public bool DisableColor; - - public bool DisableStyle; - - public bool DisableWidth; - - public bool CheckBoxVisible; - - public bool Checked; - - public bool AllLineStyles; - - public ColorStyleWidth() - { - Width = 1; - Checked = true; - } - - public ColorStyleWidth(Color color, LineStyle Style, int Width) - : this() - { - Color = color; - this.Style = Style; - this.Width = Width; - } - - public void ApplyFromClone(ColorStyleWidth clone) - { - Color = Color.FromArgb(clone.Color.ToArgb()); - Style = clone.Style; - Width = clone.Width; - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Color.ToArgb())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)Style)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Width)); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - Color = Color.FromArgb(xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt()); - Style = (LineStyle)xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt(); - Width = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt(); - } - - public object Clone() - { - return new ColorStyleWidth - { - AllLineStyles = AllLineStyles, - CheckBoxVisible = CheckBoxVisible, - Checked = Checked, - Color = Color, - DisableColor = DisableColor, - DisableStyle = DisableStyle, - DisableWidth = DisableWidth, - Style = Style, - Width = Width - }; - } - } - public class ColumnBaseInformation : IComparable, IXElementSerialization - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private TableBaseType ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private bool ??; - - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public TableBaseType Type - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = tableBaseType; - } - } - - public string HeaderText - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public bool IsIndicatorColumn - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = flag; - } - } - - public ColumnBaseInformation() - { - } - - public ColumnBaseInformation(string name, TableBaseType type, string headerText, bool isIndicatorColumn) - { - Name = name; - Type = type; - HeaderText = headerText; - IsIndicatorColumn = isIndicatorColumn; - } - - public int CompareTo(object obj) - { - return Name.CompareTo(obj); - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Type.ToString())); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - Name = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString(); - Type = (TableBaseType)Enum.Parse(typeof(TableBaseType), xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString()); - } - } - public class ConditionGroup : IXElementSerialization - { - [CompilerGenerated] - private List ?? = new List(); - - public List ConditionItems - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - List list = new List(); - foreach (XElement item in element.Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - ConditionItem conditionItem = new ConditionItem(); - conditionItem.FromXElement(item, deserializationInfo); - list.Add(conditionItem); - } - ConditionItems = list; - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (ConditionItem conditionItem in ConditionItems) - { - xElement.Add(conditionItem.ToXElement()); - } - return xElement; - } - } - public class ConditionItem : IXElementSerialization - { - [CompilerGenerated] - private ColumnBaseInformation ??; - - [CompilerGenerated] - private TableConditionType ??; - - [CompilerGenerated] - private object ??; - - [CompilerGenerated] - private ColumnBaseInformation ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private int ??; - - public ColumnBaseInformation Column - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public TableConditionType ConditionType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public object ConditionValue - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public ColumnBaseInformation Column2 - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int Column1Offset - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int Column2Offset - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - ColumnBaseInformation columnBaseInformation = new ColumnBaseInformation(); - columnBaseInformation.FromXElement(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), deserializationInfo); - Column = columnBaseInformation; - ConditionType = (TableConditionType)Enum.Parse(typeof(TableConditionType), element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString()); - ConditionValue = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString(); - if (element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) != null) - { - Column1Offset = int.Parse(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString()); - } - if (element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) != null) - { - Column2Offset = int.Parse(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString()); - } - if (element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) != null) - { - ColumnBaseInformation columnBaseInformation2 = new ColumnBaseInformation(); - columnBaseInformation2.FromXElement(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), deserializationInfo); - Column2 = columnBaseInformation2; - } - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Column.ToXElement())); - if (Column2 != null) - { - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Column2.ToXElement())); - } - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ConditionType.ToString())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ConditionValue?.ToString())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Column1Offset.ToString())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Column2Offset.ToString())); - return xElement; - } - } - public static class Const - { - public const double DOUBLE_UNDEFINED = double.NaN; - - public const string SETTINGS_FOLDER_NAME = "Settings"; - - public const string SCRIPTS_FOLDER_NAME = "Scripts"; - - public const string INDICATORS_FOLDER_NAME = "Indicators"; - - public const string STRATEGIES_FOLDER_NAME = "Strategies"; - - public const string PLACE_ORDER_STRATEGIES_FOLDER_NAME = "PlaceOrderStrategies"; - - public const string SCRIPTS_DATA_FOLDER_NAME = "ScriptsData"; - - public const string MEDIA_FOLDER_NAME = "Media"; - - public const string MESSENGERS_FOLDER_NAME = "Messengers"; - - private const string ?? = "History"; - - internal const string ?? = "history.db"; - - private const string ?? = "VolumeAnalysis"; - - internal const string ?? = "volume-analysis.db"; - - private const string ?? = "UserTradesCache"; - - public const string USER_TRADES_STORAGE_FILE_NAME = "user-trades.db"; - - public const string ORDERS_HISTORY_STORAGE_FILE_NAME = "orders-history.db"; - - public static readonly string EXECUTING_FOLDER; - - public static readonly string PLUGINS_FOLDER; - - public static readonly string HISTORY_PATH; - - public static readonly string VOLUME_ANALYSIS_PATH; - - public static readonly string USER_TRADES_CACHE_PATH; - - public static readonly string LOGS_FOLDER_PATH; - - public static readonly string CUSTOM_SCRIPTS_PATH; - - public static readonly string SCRIPTS_DATA_PATH; - - public static readonly string DEFAULT_INDICATORS_RELATIVE_PATH; - - public static readonly string CUSTOM_INDICATORS_PATH; - - public static readonly string DEFAULT_STRATEGIES_RELATIVE_PATH; - - public static readonly string CUSTOM_STRATEGIES_PATH; - - public static readonly string DEFAULT_PLACE_ORDER_STRATEGIES_RELATIVE_PATH; - - public static readonly string CUSTOM_PLACE_ORDER_STRATEGIES_PATH; - - public static readonly string CUSTOM_PLUGINS_PATH; - - public static readonly string CUSTOM_VENDORS_PATH; - - public static readonly string CUSTOM_BIN_PATH; - - public static readonly string TEMP_PATH; - - public static readonly string MEDIA_PATH; - - public static readonly string MESSENGERS_PATH; - - public const string PLUGINS_FOLDER_NAME = "plug-ins"; - - public const string VENDORS_FOLDER_NAME = "Vendors"; - - public const string BIN_FOLDER_NAME = "bin"; - - public const string NOT_AVAILABLE_STRING = "N/A"; - - public const string CONSOLE_SCREEN_STRING = "*console#"; - - public const string TEMP_STRING = "Temp"; - - public const string LOGS_FOLDER_NAME = "Logs"; - - static Const() - { - EXECUTING_FOLDER = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - PLUGINS_FOLDER = Path.Combine(EXECUTING_FOLDER, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - HISTORY_PATH = Path.Combine(EXECUTING_FOLDER, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - VOLUME_ANALYSIS_PATH = Path.Combine(EXECUTING_FOLDER, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - USER_TRADES_CACHE_PATH = Path.Combine(EXECUTING_FOLDER, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - LOGS_FOLDER_PATH = Path.Combine(EXECUTING_FOLDER, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - CUSTOM_SCRIPTS_PATH = Path.Combine(EXECUTING_FOLDER, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - SCRIPTS_DATA_PATH = Path.Combine(CUSTOM_SCRIPTS_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - DEFAULT_INDICATORS_RELATIVE_PATH = Path.Combine(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - CUSTOM_INDICATORS_PATH = Path.Combine(CUSTOM_SCRIPTS_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - DEFAULT_STRATEGIES_RELATIVE_PATH = Path.Combine(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - CUSTOM_STRATEGIES_PATH = Path.Combine(CUSTOM_SCRIPTS_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - DEFAULT_STRATEGIES_RELATIVE_PATH = Path.Combine(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - CUSTOM_STRATEGIES_PATH = Path.Combine(CUSTOM_SCRIPTS_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - DEFAULT_PLACE_ORDER_STRATEGIES_RELATIVE_PATH = Path.Combine(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - CUSTOM_PLACE_ORDER_STRATEGIES_PATH = Path.Combine(CUSTOM_SCRIPTS_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - CUSTOM_PLUGINS_PATH = Path.Combine(CUSTOM_SCRIPTS_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - CUSTOM_VENDORS_PATH = Path.Combine(CUSTOM_SCRIPTS_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - CUSTOM_BIN_PATH = Path.Combine(CUSTOM_SCRIPTS_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - TEMP_PATH = Path.Combine(EXECUTING_FOLDER, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - MEDIA_PATH = Path.Combine(EXECUTING_FOLDER, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - MESSENGERS_PATH = Path.Combine(MEDIA_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - public static class CoreMath - { - public static int GetValuePrecision(decimal value) - { - value = Math.Abs(value); - decimal num = value - (decimal)(long)value; - int num2 = 0; - if (num != 0m) - { - num2 = 1; - while (true) - { - decimal num3 = num * (decimal)Math.Pow(10.0, num2); - if (!(num3 - (decimal)(long)num3 > 0m)) - { - break; - } - num2++; - } - } - return num2; - } - - public static double RoundToIncrement(double value, double increment) - { - if (increment <= 0.0 || double.IsNaN(value)) - { - return value; - } - return (double)((decimal)(long)Math.Round((decimal)value / (decimal)increment, MidpointRounding.AwayFromZero) * (decimal)increment); - } - - public static double FloorToIncrement(double value, double increment) - { - if (increment <= 0.0 || double.IsNaN(value)) - { - return value; - } - return (double)((decimal)(long)Math.Floor((decimal)value / (decimal)increment) * (decimal)increment); - } - - public static double ProcessNaN(double value, double defaultValue = 0.0) - { - if (!double.IsNaN(value)) - { - return value; - } - return defaultValue; - } - - public static double GetWeightedAverage(IEnumerable<(double, double)> array, Symbol symbol = null) - { - double num = 0.0; - double num2 = 0.0; - foreach (var item3 in array) - { - double item = item3.Item1; - double item2 = item3.Item2; - num += item * item2; - num2 += item2; - } - if (num2 == 0.0) - { - return double.NaN; - } - double num3 = num / num2; - return symbol?.RoundPriceToTickSize(num3) ?? num3; - } - } - public class CrossRateCache : IDisposable - { - private readonly struct ? : IEquatable - { - private readonly string ??; - - private readonly string ??; - - public ?(string P_0, string P_1) - { - ?? = P_0; - ?? = P_1; - } - - public bool Equals(? other) - { - if (?? == other.??) - { - return ?? == other.??; - } - return false; - } - - public override bool Equals(object obj) - { - if (obj is ? other) - { - return Equals(other); - } - return false; - } - - public override int GetHashCode() - { - return (((?? != null) ? ??.GetHashCode() : 0) * 397) ^ ((?? != null) ? ??.GetHashCode() : 0); - } - - public override string ToString() - { - return ?? + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ??; - } - } - - private readonly Dictionary ??; - - public CrossRateCache() - { - ?? = new Dictionary(); - } - - public void ProcessPrice(string baseAsset, string quoteAsset, double price) - { - if (!double.IsNaN(price)) - { - ? key = new ?(baseAsset, quoteAsset); - ??[key] = price; - if (price != 0.0) - { - key = new ?(quoteAsset, baseAsset); - ??[key] = 1.0 / price; - } - } - } - - public bool TryGetCrossRate(string fromAsset, string toAsset, out double crossRate) - { - if (fromAsset == toAsset) - { - crossRate = 1.0; - return true; - } - ? key = new ?(fromAsset, toAsset); - if (??.TryGetValue(key, out crossRate)) - { - return !double.IsNaN(crossRate); - } - return false; - } - - public void Dispose() - { - ??.Clear(); - } - } - public sealed class DateTimeRange : IXElementSerialization, IComparable - { - private const string ?? = "RangeSelector"; - - [CompilerGenerated] - private Period ??; - - [CompilerGenerated] - private Period? ??; - - [CompilerGenerated] - private DateTimeRangeType ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private Connection ??; - - public Period Period - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = period; - } - } - - public Period? EndOffset - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = period; - } - } - - public DateTimeRangeType RangeType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTimeRangeType; - } - } - - public DateTime From - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - public DateTime To - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - public Connection TimeSourceConnection - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DateTimeRange() - { - } - - public DateTimeRange(Period period) - : this() - { - SetRange(period); - } - - public DateTimeRange(Period period, DateTimeRangeType dateTimeRangeType) - : this() - { - SetRange(period, dateTimeRangeType); - } - - public DateTimeRange(Period period, Period endOffset, DateTimeRangeType dateTimeRangeType) - : this() - { - ?(period, endOffset, dateTimeRangeType); - } - - public DateTimeRange(DateTime from, DateTime to) - : this() - { - SetRange(from, to); - } - - public DateTimeRange(DateTimeRange original) - : this() - { - RangeType = original.RangeType; - Period = original.Period; - EndOffset = original.EndOffset; - From = original.From; - To = original.To; - Update(); - } - - public void SetRange(Period period) - { - if (RangeType == DateTimeRangeType.Custom) - { - throw new ArgumentException(); - } - Period = period; - Update(); - } - - public void SetRange(Period period, DateTimeRangeType rangeType) - { - if (rangeType == DateTimeRangeType.Custom) - { - throw new ArgumentException(); - } - RangeType = rangeType; - Period = period; - Update(); - } - - private void ?(Period P_0, Period P_1, DateTimeRangeType P_2) - { - if (P_2 == DateTimeRangeType.Custom) - { - throw new ArgumentException(); - } - RangeType = P_2; - Period = P_0; - EndOffset = P_1; - Update(); - } - - public void SetRange(DateTime from, DateTime to) - { - if (!?(from, to)) - { - throw new ArgumentOutOfRangeException(); - } - From = from; - To = to; - RangeType = DateTimeRangeType.Custom; - } - - public void Update() - { - if (RangeType != DateTimeRangeType.Custom) - { - (DateTime from, DateTime to) tuple = ?(Period, EndOffset, RangeType, TimeSourceConnection); - DateTime item = tuple.from; - DateTime item2 = tuple.to; - From = item; - To = item2; - } - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - XElement xElement2 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - RangeType = (DateTimeRangeType)xElement2.ToInt(); - } - XElement xElement3 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - if (xElement3 != null) - { - Period period = default(Period); - period.FromXElement(xElement3, deserializationInfo); - Period = period; - } - XElement xElement4 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - XElement xElement5 = xElement4.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - if (xElement5 != null) - { - Period value = default(Period); - value.FromXElement(xElement5, deserializationInfo); - EndOffset = value; - } - } - if (RangeType != DateTimeRangeType.Custom) - { - Update(); - return; - } - XElement xElement6 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement6 != null) - { - From = xElement6.ToDateTime(toUTC: true); - } - XElement xElement7 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement7 != null) - { - To = xElement7.ToDateTime(toUTC: true); - } - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)RangeType)); - xElement.Add(Period.ToXElement()); - if (EndOffset.HasValue) - { - XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement2.Add(EndOffset.Value.ToXElement()); - xElement.Add(xElement2); - } - if (RangeType == DateTimeRangeType.Custom) - { - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), From)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), To)); - } - return xElement; - } - - private static (DateTime from, DateTime to) ?(Period P_0, Period? P_1, DateTimeRangeType P_2, Connection P_3) - { - return ?(P_0, P_1, P_2, DayOfWeek.Monday, P_3); - } - - private static (DateTime from, DateTime to) ?(Period P_0, Period? P_1, DateTimeRangeType P_2, DayOfWeek P_3, Connection P_4) - { - DateTime dateTime = Core.Instance.TimeUtils.DateTimeUtcNow; - if (P_4 != null) - { - dateTime = P_4.ServerTime; - } - DateTime item = dateTime; - DateTime item2 = dateTime; - switch (P_2) - { - case DateTimeRangeType.FixedStart: - switch (P_0.BasePeriod) - { - case BasePeriod.Tick: - item = item.AddTicks(P_0.PeriodMultiplier); - break; - case BasePeriod.Second: - { - double num = dateTime.TimeOfDay.TotalSeconds % (double)P_0.PeriodMultiplier; - item = dateTime.AddSeconds(0.0 - num); - item2 = item.AddTicks(P_0.Ticks); - break; - } - case BasePeriod.Minute: - { - dateTime = dateTime.TrimSeconds(); - double num3 = dateTime.TimeOfDay.TotalMinutes % (double)P_0.PeriodMultiplier; - item = dateTime.AddMinutes(0.0 - num3); - item2 = item.AddTicks(P_0.Ticks); - break; - } - case BasePeriod.Hour: - { - dateTime = dateTime.TrimSeconds(); - double num2 = dateTime.TimeOfDay.TotalHours % (double)P_0.PeriodMultiplier; - item = dateTime.AddHours(0.0 - num2); - item2 = item.AddTicks(P_0.Ticks); - break; - } - case BasePeriod.Day: - item = dateTime.TrimSeconds().Date.AddDays(-(P_0.PeriodMultiplier - 1)); - item2 = item.AddDays(P_0.PeriodMultiplier); - break; - case BasePeriod.Week: - { - DateTime dateTime2 = dateTime.TrimSeconds(); - while (dateTime2.DayOfWeek != P_3) - { - dateTime2 = dateTime2.AddDays(-1.0); - } - item = dateTime2.Date; - item2 = item.AddDays(7 * P_0.PeriodMultiplier); - break; - } - case BasePeriod.Month: - item = new DateTime(dateTime.Year, dateTime.Month, 1, 0, 0, 0, DateTimeKind.Utc).AddMonths(-(P_0.PeriodMultiplier - 1)); - item2 = item.AddMonths(P_0.PeriodMultiplier); - break; - case BasePeriod.Year: - item = new DateTime(dateTime.Year, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddYears(-(P_0.PeriodMultiplier - 1)); - item2 = item.AddYears(P_0.PeriodMultiplier); - break; - } - break; - case DateTimeRangeType.Slide: - item = dateTime.AddTicks(-P_0.Ticks); - break; - } - if (P_1.HasValue) - { - item = item.AddTicks(-P_1.Value.Ticks); - item2 = item2.AddTicks(-P_1.Value.Ticks); - } - return (from: item, to: item2); - } - - private bool ?(DateTime P_0, DateTime P_1) - { - return P_1.Ticks >= P_0.Ticks; - } - - public string ToShortDateString() - { - return Core.Instance.TimeUtils.GetFormatedDate(From.ToSelectedTimeZone()) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Core.Instance.TimeUtils.GetFormatedDate(To.ToSelectedTimeZone()); - } - - [NotPublished] - public static bool operator ==(DateTimeRange dateTimeRange1, DateTimeRange dateTimeRange2) - { - return dateTimeRange1.Equals(dateTimeRange2); - } - - [NotPublished] - public static bool operator !=(DateTimeRange dateTimeRange1, DateTimeRange dateTimeRange2) - { - return !dateTimeRange1.Equals(dateTimeRange2); - } - - public int CompareTo(object obj) - { - if (!(obj is DateTimeRange dateTimeRange)) - { - return 0; - } - int num = RangeType.CompareTo(dateTimeRange.RangeType); - if (num != 0) - { - return num; - } - if (RangeType == DateTimeRangeType.Custom) - { - num = From.CompareTo(dateTimeRange.From); - if (num != 0) - { - return num; - } - num = To.CompareTo(dateTimeRange.To); - if (num != 0) - { - return num; - } - } - else - { - num = Period.CompareTo(dateTimeRange.Period); - if (num != 0) - { - return num; - } - } - return 0; - } - - public override bool Equals(object obj) - { - if (!(obj is DateTimeRange dateTimeRange)) - { - return false; - } - bool flag = RangeType == dateTimeRange.RangeType; - if (!flag) - { - return flag; - } - if (RangeType == DateTimeRangeType.Custom) - { - flag = From == dateTimeRange.From; - if (!flag) - { - return flag; - } - flag = To == dateTimeRange.To; - if (!flag) - { - return flag; - } - } - else - { - flag = Period == dateTimeRange.Period; - if (!flag) - { - return flag; - } - flag = EndOffset == dateTimeRange.EndOffset; - if (!flag) - { - return flag; - } - } - return true; - } - - public override int GetHashCode() - { - int hashCode = RangeType.GetHashCode(); - if (RangeType == DateTimeRangeType.Custom) - { - return hashCode ^ (From.GetHashCode() ^ To.GetHashCode()); - } - if (EndOffset.HasValue) - { - return hashCode ^ (Period.GetHashCode() ^ (EndOffset.GetHashCode() * 397)); - } - return hashCode ^ Period.GetHashCode(); - } - } - public enum DateTimeRangeType - { - Slide, - FixedStart, - Custom - } - public class DealTicketLimiter - { - private readonly TimeSpan ??; - - private readonly object ??; - - private bool ??; - - public DealTicketLimiter(TimeSpan delay) - { - ?? = delay; - ?? = new object(); - ?? = true; - } - - public bool AllowDealTicket(TimeSpan? currentDelay = null) - { - lock (??) - { - if (!??) - { - return false; - } - ?? = false; - Task.Delay(currentDelay ?? ??).ContinueWith((Task P_0) => ?? = true); - return true; - } - } - - [CompilerGenerated] - private bool ?(Task P_0) - { - return ?? = true; - } - } - public class EntityLifecycleEventArgs : EventArgs - { - [CompilerGenerated] - private readonly EntityLifecycle ??; - - public EntityLifecycle Lifecycle - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - } - public class FibonacciLevelOptions : ICloneable, IXElementSerialization - { - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private Color ??; - - [CompilerGenerated] - private Font ??; - - [CompilerGenerated] - private ColorStyleWidth ??; - - [CompilerGenerated] - private int[] ??; - - public double Level - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool IsEnabled - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool UseCustom - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Color CaptionFontColor - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Font CaptionFont - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public ColorStyleWidth Line - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int[] screenPoints - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public FibonacciLevelOptions() - { - UseCustom = false; - screenPoints = new int[4]; - } - - public FibonacciLevelOptions(double level) - : this() - { - Level = level; - } - - public virtual FibonacciLevelOptions Clone() - { - return new FibonacciLevelOptions - { - UseCustom = UseCustom, - IsEnabled = IsEnabled, - Line = (Line.Clone() as ColorStyleWidth), - CaptionFontColor = CaptionFontColor, - CaptionFont = CaptionFont, - Level = Level - }; - } - - private object ?() - { - return Clone(); - } - - object ICloneable.Clone() - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(); - } - - public virtual XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Level)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), UseCustom)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsEnabled)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CaptionFontColor.ToArgb())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CaptionFont.FontFamily.Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CaptionFont.Size)); - xElement.Add(Line.ToXElement()); - int[] array = screenPoints; - foreach (int num in array) - { - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num)); - } - return xElement; - } - - public virtual void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - Level = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToDouble(); - UseCustom = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); - IsEnabled = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); - CaptionFontColor = Color.FromArgb(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt()); - CaptionFont = new Font(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString(), (float)element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToDouble(), GraphicsUnit.Pixel); - Line = new ColorStyleWidth(); - Line.FromXElement(element, deserializationInfo); - List list = new List(); - foreach (XElement item in element.Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - list.Add(item.ToInt()); - } - screenPoints = list.ToArray(); - } - } - public class FormatSettings - { - [CompilerGenerated] - private bool ??; - - public bool DisplayQuantityInLots - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - } - public static class GlobalSettings - { - [CompilerGenerated] - private static bool ??; - - public static bool AbbreviateCryptoPrices - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - } - public abstract class HistoryItemBarCreator - { - protected Period targetPeriod; - - [CompilerGenerated] - private Period ??; - - public Period HistoryPeriod - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - protected HistoryItemBarCreator(Period targetPeriod) - { - this.targetPeriod = targetPeriod; - } - - protected virtual DateTime FindNearestDateTimeFromUnixStartTime(DateTime targetDateTime, long sessionOffset) - { - long num = 621355968000000000L; - long num2 = (targetDateTime.Ticks - (num + sessionOffset)) / targetPeriod.Ticks; - return new DateTime(num + sessionOffset + num2 * targetPeriod.Ticks, targetDateTime.Kind); - } - - public static HistoryItemBarCreator CreateHistoryAggregator(Period targetPeriod) - { - return targetPeriod.BasePeriod switch - { - BasePeriod.Second => new ?(targetPeriod), - BasePeriod.Minute => new ?(targetPeriod), - BasePeriod.Hour => new ?(targetPeriod), - BasePeriod.Day => new ?(targetPeriod), - BasePeriod.Week => new ?(targetPeriod), - BasePeriod.Month => new ?(targetPeriod), - BasePeriod.Year => new ?(targetPeriod), - _ => null, - }; - } - - public abstract void FindBarBorders(DateTime dateTime, long sessionOffset, out long leftBorder, out long rightBorder); - } -} -namespace ? -{ - internal sealed class ? : HistoryItemBarCreator - { - public ?(Period P_0) - : base(P_0) - { - } - - public override void FindBarBorders(DateTime dateTime, long sessionOffset, out long leftBorder, out long rightBorder) - { - DateTime dateTime2 = dateTime; - if (base.HistoryPeriod.BasePeriod == BasePeriod.Day) - { - if (targetPeriod.PeriodMultiplier > 1) - { - long num = dateTime.TimeOfDay.Ticks - 864000000000L; - dateTime2 = dateTime.AddTicks(-num); - dateTime2 = FindNearestDateTimeFromUnixStartTime(dateTime2, sessionOffset).AddTicks(num); - } - } - else if (targetPeriod.PeriodMultiplier > 1) - { - dateTime2 = FindNearestDateTimeFromUnixStartTime(dateTime, sessionOffset); - } - DateTime dateTime3 = dateTime2.AddDays(targetPeriod.PeriodMultiplier); - leftBorder = dateTime2.Ticks; - rightBorder = dateTime3.Ticks - 1; - } - } - internal sealed class ? : HistoryItemBarCreator - { - public ?(Period P_0) - : base(P_0) - { - } - - public override void FindBarBorders(DateTime dateTime, long sessionOffset, out long leftBorder, out long rightBorder) - { - DateTime dateTime2 = ((targetPeriod.PeriodMultiplier == 1 && sessionOffset == 0L) ? new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour, 0, 0, dateTime.Kind) : FindNearestDateTimeFromUnixStartTime(dateTime, sessionOffset)); - DateTime dateTime3 = dateTime2.AddHours(targetPeriod.PeriodMultiplier); - leftBorder = dateTime2.Ticks; - rightBorder = dateTime3.Ticks - 1; - } - } - internal sealed class ? : HistoryItemBarCreator - { - public ?(Period P_0) - : base(P_0) - { - } - - public override void FindBarBorders(DateTime dateTime, long sessionOffset, out long leftBorder, out long rightBorder) - { - DateTime dateTime2 = ((targetPeriod.PeriodMultiplier == 1 && sessionOffset == 0L) ? new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour, dateTime.Minute, 0, dateTime.Kind) : FindNearestDateTimeFromUnixStartTime(dateTime, sessionOffset)); - DateTime dateTime3 = dateTime2.AddMinutes(targetPeriod.PeriodMultiplier); - leftBorder = dateTime2.Ticks; - rightBorder = dateTime3.Ticks - 1; - } - } - internal sealed class ? : HistoryItemBarCreator - { - public ?(Period P_0) - : base(P_0) - { - } - - public override void FindBarBorders(DateTime dateTime, long sessionOffset, out long leftBorder, out long rightBorder) - { - DateTime dateTime3; - if (base.HistoryPeriod.BasePeriod != BasePeriod.Month) - { - DateTime dateTime2 = dateTime.AddHours(12.0); - while (dateTime2.Day > 1) - { - dateTime2 = dateTime2.AddDays(-1.0); - } - dateTime3 = dateTime2.AddHours(-12.0); - } - else - { - long num = (dateTime.Day - 1) * 864000000000L + dateTime.TimeOfDay.Ticks; - DateTime targetDateTime = dateTime.AddTicks(-num); - dateTime3 = FindNearestDateTimeFromUnixStartTime(targetDateTime, sessionOffset).AddTicks(num); - } - DateTime dateTime4 = dateTime3; - dateTime4 = dateTime4.AddMonths(targetPeriod.PeriodMultiplier); - leftBorder = dateTime3.Ticks; - rightBorder = dateTime4.Ticks - 1; - } - - protected override DateTime FindNearestDateTimeFromUnixStartTime(DateTime targetDateTime, long sessionOffset) - { - DateTime dateTime = new DateTime(621355968000000000L, DateTimeKind.Utc); - while (dateTime <= targetDateTime) - { - dateTime = dateTime.AddMonths(targetPeriod.PeriodMultiplier); - } - return dateTime.AddMonths(-targetPeriod.PeriodMultiplier); - } - } - internal sealed class ? : HistoryItemBarCreator - { - public ?(Period P_0) - : base(P_0) - { - } - - public override void FindBarBorders(DateTime dateTime, long sessionOffset, out long leftBorder, out long rightBorder) - { - DateTime dateTime2 = ((targetPeriod.PeriodMultiplier == 1) ? new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour, dateTime.Minute, dateTime.Second, dateTime.Kind) : FindNearestDateTimeFromUnixStartTime(dateTime, sessionOffset)); - DateTime dateTime3 = dateTime2.AddSeconds(targetPeriod.PeriodMultiplier); - leftBorder = dateTime2.Ticks; - rightBorder = dateTime3.Ticks - 1; - } - } - internal sealed class ? : HistoryItemBarCreator - { - public ?(Period P_0) - : base(P_0) - { - } - - public override void FindBarBorders(DateTime dateTime, long sessionOffset, out long leftBorder, out long rightBorder) - { - DateTime dateTime3; - if (base.HistoryPeriod.BasePeriod != BasePeriod.Week) - { - DateTime dateTime2 = dateTime.AddHours(12.0); - while (dateTime2.DayOfWeek != DayOfWeek.Monday) - { - dateTime2 = dateTime2.AddDays(-1.0); - } - dateTime3 = dateTime2.AddHours(-12.0); - } - else - { - dateTime3 = FindNearestDateTimeFromUnixStartTime(dateTime, sessionOffset).AddTicks(dateTime.TimeOfDay.Ticks); - } - DateTime dateTime4 = dateTime3.AddDays(targetPeriod.PeriodMultiplier * 7); - leftBorder = dateTime3.Ticks; - rightBorder = dateTime4.Ticks - 1; - } - - protected override DateTime FindNearestDateTimeFromUnixStartTime(DateTime targetDateTime, long sessionOffset) - { - DateTime dateTime = new DateTime(621355968000000000L, DateTimeKind.Utc); - dateTime = dateTime.AddDays(-((int)(dateTime.DayOfWeek + 6) % 7)); - long num = (targetDateTime.Ticks - (dateTime.Ticks + sessionOffset)) / targetPeriod.Ticks; - return new DateTime(dateTime.Ticks + sessionOffset + num * targetPeriod.Ticks, targetDateTime.Kind); - } - } - internal sealed class ? : HistoryItemBarCreator - { - public ?(Period P_0) - : base(P_0) - { - } - - public override void FindBarBorders(DateTime dateTime, long sessionOffset, out long leftBorder, out long rightBorder) - { - DateTime dateTime2 = dateTime.AddHours(12.0); - while (dateTime2.Month > 1) - { - dateTime2 = dateTime2.AddMonths(-1); - } - while (dateTime2.Day > 1) - { - dateTime2 = dateTime2.AddDays(-1.0); - } - DateTime dateTime3 = dateTime2.AddHours(-12.0); - DateTime dateTime4 = dateTime3; - for (int i = 0; i < targetPeriod.PeriodMultiplier; i++) - { - dateTime4 = dateTime4.AddDays(DateTime.IsLeapYear(dateTime2.Year) ? 366 : 365); - } - leftBorder = dateTime3.Ticks; - rightBorder = dateTime4.Ticks - 1; - } - } -} -namespace TradingPlatform.BusinessLayer.Utils -{ - public static class HistoryStepsCalculator - { - public static List> GetSteps(DateTime from, DateTime to, BasePeriod basePeriod, int multiplier, ISessionsContainer sessionsContainer, TimeZone timezone) - { - List> list = new List>(); - try - { - long sessionOffset = sessionsContainer.GetSessionOffset(timezone, basePeriod == BasePeriod.Week, applyNegativeSignForInDaySession: false); - long num = Period.TicksInBasePeriod(basePeriod) * multiplier; - long num2 = from.Ticks / num * num + sessionOffset; - long num3; - for (num3 = (to.Ticks / num + 1) * num + sessionOffset; num3 < to.Ticks; num3 += num) - { - } - if (num3 > to.Ticks) - { - while (num3 - num > to.Ticks) - { - num3 -= num; - } - } - while (num2 > from.Ticks) - { - num2 -= num; - } - if (num2 < from.Ticks) - { - for (; num2 + num < from.Ticks; num2 += num) - { - } - } - switch (basePeriod) - { - case BasePeriod.Month: - num2 = new DateTime(from.Year, from.Month, 1, 0, 0, 0, DateTimeKind.Utc).AddTicks(sessionOffset).Ticks; - num3 = new DateTime(to.Year, to.Month, 1, 0, 0, 0, DateTimeKind.Utc).AddMonths(1).AddTicks(sessionOffset).Ticks; - break; - case BasePeriod.Year: - num2 = new DateTime(from.Year, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddTicks(sessionOffset).Ticks; - num3 = new DateTime(to.Year, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddYears(1).AddTicks(sessionOffset).Ticks; - break; - } - DateTime date = new DateTime(num2, DateTimeKind.Utc); - while (date.Ticks < num3) - { - Interval item = GetNextStep(date, basePeriod, multiplier); - date = item.To; - if (sessionsContainer != null) - { - TimeSpan timeSpan = SessionsExtensions.?(item.From, sessionsContainer.TimeZone); - if (timeSpan != TimeSpan.Zero) - { - item = new Interval(item.From - timeSpan, item.To - timeSpan); - } - } - list.Add(item); - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - return list; - } - - public static Interval GetNextStep(DateTime date, BasePeriod basePeriod, int multiplier) - { - long value = Period.TicksInBasePeriod(basePeriod) * multiplier; - DateTime dateTime = date; - DateTime to = basePeriod switch - { - BasePeriod.Month => AddMonths(dateTime, multiplier), - BasePeriod.Year => dateTime.AddYears(multiplier), - _ => date.AddTicks(value), - }; - return new Interval(dateTime, to); - } - - /// - /// https://stackoverflow.com/questions/3060381/datetime-addmonths-adding-only-month-not-days - /// ????????: - /// (29 Feb).AddMonth(1) = 29 March - /// - public static DateTime AddMonths(DateTime date, int monthsCount) - { - if (date.Day != DateTime.DaysInMonth(date.Year, date.Month)) - { - return date.AddMonths(monthsCount); - } - return date.AddDays(1.0).AddMonths(monthsCount).AddDays(-1.0); - } - } - public readonly struct Interval : IEquatable> where T : IComparable - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func, bool> ??; - - public static Func, T> ??; - - public static Func, T> ??; - - internal bool ?(Interval P_0) - { - return !P_0.IsEmpty; - } - - internal T ?(Interval P_0) - { - return P_0.Min; - } - - internal T ?(Interval P_0) - { - return P_0.Max; - } - } - - [CompilerGenerated] - private readonly T ??; - - [CompilerGenerated] - private readonly T ??; - - public T From - { - [CompilerGenerated] - get - { - return ??; - } - } - - public T To - { - [CompilerGenerated] - get - { - return ??; - } - } - - public T Min - { - get - { - if (!IsReversal) - { - return From; - } - return To; - } - } - - public T Max - { - get - { - if (!IsReversal) - { - return To; - } - return From; - } - } - - public bool IsReversal => From.CompareTo(To) > 0; - - public bool IsEmpty => From.CompareTo(To) == 0; - - public static Interval Default => new Interval(default(T), default(T)); - - public Interval(T from, T to) - { - ?? = from; - ?? = to; - } - - public Interval Reverse() - { - return new Interval(To, From); - } - - public bool Contains(T value) - { - ref T reference = ref value; - T val = default(T); - if (val == null) - { - val = reference; - reference = ref val; - } - T min = Min; - if (reference.CompareTo(min) < 0) - { - return false; - } - ref T reference2 = ref value; - val = default(T); - if (val == null) - { - val = reference2; - reference2 = ref val; - } - T max = Max; - if (reference2.CompareTo(max) > 0) - { - return false; - } - return true; - } - - public Interval Intersect(Interval other) - { - T val = default(T); - T to = default(T); - if (Contains(other.Min)) - { - val = other.Min; - to = (Contains(other.Max) ? other.Max : Max); - } - else if (Contains(other.Max)) - { - val = Min; - to = other.Max; - } - else if (other.Contains(Min) && other.Contains(Max)) - { - return this; - } - return new Interval(val, to); - } - - public IEnumerable> Subtract(IEnumerable> intervals) - { - if (IsEmpty) - { - yield break; - } - if (!intervals.Any()) - { - yield return this; - yield break; - } - Interval interval = this; - Interval[] array = (from P_0 in intervals.Select(((Interval)interval).Intersect) - where !P_0.IsEmpty - orderby P_0.Min, P_0.Max descending - select P_0).ToArray(); - T val = Min; - Interval[] array2 = array; - T val2; - for (int num = 0; num < array2.Length; num++) - { - Interval interval2 = array2[num]; - if (interval2 == this) - { - yield break; - } - ref T reference = ref val; - val2 = default(T); - if (val2 == null) - { - val2 = reference; - reference = ref val2; - } - T max = Max; - if (reference.CompareTo(max) == 0) - { - yield break; - } - ref T reference2 = ref val; - val2 = default(T); - if (val2 == null) - { - val2 = reference2; - reference2 = ref val2; - } - T max2 = interval2.Max; - if (reference2.CompareTo(max2) > 0) - { - continue; - } - ref T reference3 = ref val; - val2 = default(T); - if (val2 == null) - { - val2 = reference3; - reference3 = ref val2; - } - T min = interval2.Min; - if (reference3.CompareTo(min) >= 0) - { - ref T reference4 = ref val; - val2 = default(T); - if (val2 == null) - { - val2 = reference4; - reference4 = ref val2; - } - T max3 = interval2.Max; - if (reference4.CompareTo(max3) < 0) - { - val = interval2.Max; - continue; - } - } - Interval interval3 = new Interval(val, interval2.Min); - val = interval2.Max; - yield return interval3; - } - ref T reference5 = ref val; - val2 = default(T); - if (val2 == null) - { - val2 = reference5; - reference5 = ref val2; - } - T max4 = Max; - if (reference5.CompareTo(max4) != 0) - { - yield return new Interval(val, Max); - } - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(13, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(From, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(To, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public bool Equals(Interval other) - { - if (EqualityComparer.Default.Equals(From, other.From)) - { - return EqualityComparer.Default.Equals(To, other.To); - } - return false; - } - - public override bool Equals(object obj) - { - if (obj is Interval other) - { - return Equals(other); - } - return false; - } - - public override int GetHashCode() - { - return HashCode.Combine(EqualityComparer.Default.GetHashCode(From), EqualityComparer.Default.GetHashCode(To)); - } - - public static bool operator ==(Interval left, Interval right) - { - return left.Equals(right); - } - - public static bool operator !=(Interval left, Interval right) - { - return !left.Equals(right); - } - } - public class LimitedCollection : ICollection, IEnumerable, IEnumerable - { - public const int DEFAULT_CAPACITY = 100; - - private readonly IList ??; - - [CompilerGenerated] - private readonly int ??; - - public int Capacity - { - [CompilerGenerated] - get - { - return ??; - } - } - - public bool IsFull => Count == Capacity; - - public int Count => ??.Count; - - bool ICollection.IsReadOnly => false; - - public LimitedCollection(int capacity = 100) - { - ?? = new List(capacity); - ?? = capacity; - } - - public void Add(T item) - { - lock (??) - { - if (IsFull) - { - ??.Remove(??[0]); - } - ??.Add(item); - } - } - - public void Clear() - { - ??.Clear(); - } - - public bool Contains(T item) - { - return ??.Contains(item); - } - - public bool Remove(T item) - { - return ??.Remove(item); - } - - public void CopyTo(T[] array, int arrayIndex) - { - ??.CopyTo(array, arrayIndex); - } - - public IEnumerator GetEnumerator() - { - lock (??) - { - return new List(??).GetEnumerator(); - } - } - - private IEnumerator ?() - { - return GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(); - } - } - [Serializable] - public class LineOptions : IXElementSerialization, ICloneable, IEquatable - { - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ?? = true; - - [CompilerGenerated] - private bool ?? = true; - - [CompilerGenerated] - private bool ?? = true; - - [CompilerGenerated] - private Font ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private int ?? = 10; - - [CompilerGenerated] - private Color ??; - - [CompilerGenerated] - private LineStyle ??; - - public bool Enabled - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool WithCheckBox - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool WithNumeric - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool WithColor - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Font Font - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int Width - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int MaximumWidth - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Color Color - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public LineStyle LineStyle - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Enabled)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), WithCheckBox)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), WithNumeric)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), WithColor)); - xElement.Add(Font.ToXElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Width)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MaximumWidth)); - xElement.Add(Color.ToXElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)LineStyle)); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - Enabled = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); - WithCheckBox = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); - WithNumeric = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); - WithColor = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); - Font = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToFont(); - Width = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt(); - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - MaximumWidth = xElement.ToInt(); - } - Color = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToColor(); - LineStyle = (LineStyle)element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt(); - } - - public object Clone() - { - LineOptions lineOptions = new LineOptions - { - Color = Color, - Enabled = Enabled, - LineStyle = LineStyle, - Width = Width, - WithCheckBox = WithCheckBox, - WithColor = WithColor, - WithNumeric = WithNumeric, - MaximumWidth = MaximumWidth - }; - if (Font != null) - { - lineOptions.Font = (Font)Font.Clone(); - } - return lineOptions; - } - - public bool Equals(LineOptions other) - { - if (other == null) - { - return false; - } - if (this == other) - { - return true; - } - if (Enabled == other.Enabled && WithCheckBox == other.WithCheckBox && WithNumeric == other.WithNumeric && WithColor == other.WithColor && object.Equals(Font, other.Font) && Width == other.Width && MaximumWidth == other.MaximumWidth && Color.Equals(other.Color)) - { - return LineStyle == other.LineStyle; - } - return false; - } - - public override bool Equals(object obj) - { - if (obj == null) - { - return false; - } - if (this == obj) - { - return true; - } - if (obj.GetType() != GetType()) - { - return false; - } - return Equals((LineOptions)obj); - } - - public override int GetHashCode() - { - HashCode hashCode = default(HashCode); - hashCode.Add(Enabled); - hashCode.Add(WithCheckBox); - hashCode.Add(WithNumeric); - hashCode.Add(WithColor); - hashCode.Add(Font); - hashCode.Add(Width); - hashCode.Add(MaximumWidth); - hashCode.Add(Color); - hashCode.Add((int)LineStyle); - return hashCode.ToHashCode(); - } - } -} -namespace ? -{ - internal class ? : IEnumerable, IEnumerable - { - private readonly Dictionary ??; - - private readonly List ??; - - private readonly Dictionary ??; - - private readonly Dictionary ??; - - public virtual int Count => ??.Count; - - public virtual ? this[? P_0] - { - get - { - if (P_0 != null && ?? != null && ??.ContainsKey(P_0)) - { - return ??[P_0]; - } - return default(?); - } - set - { - if (!??.ContainsKey(val)) - { - this.?(val, val2); - return; - } - ??[val] = val2; - ??[??[val]] = val2; - } - } - - public virtual ICollection Keys => ??.Keys; - - public virtual ICollection Values => ??.Values; - - public ?() - { - ?? = new Dictionary(); - ?? = new List(); - ?? = new Dictionary(); - ?? = new Dictionary(); - } - - public static ? ?() - { - return new ?(); - } - - private void ?(int P_0) - { - while (P_0 <= ??.Count) - { - ? val = ??[P_0]; - ??[P_0 - 1] = val; - ??[val] = P_0 - 1; - P_0++; - } - ??.Remove(P_0 - 1); - } - - private int ?(? P_0, ? P_1) - { - ??.Add(P_0, P_1); - ??.Add(P_1); - int num = ??.Count - 1; - ??.Add(P_0, num); - ??.Add(num, P_0); - return num; - } - - private void ?(int P_0) - { - ??.RemoveAt(P_0); - ? key = ??[P_0]; - ??.Remove(key); - ??.Remove(key); - ??.Remove(P_0); - ?(P_0 + 1); - } - - public virtual ? ?(int P_0) - { - return ??[P_0]; - } - - public virtual ?[] ?() - { - ?[] array = new ?[??.Count]; - int num = 0; - foreach (? value in ??.Values) - { - array[num++] = value; - } - return array; - } - - public virtual int ?(? P_0, ? P_1) - { - return this.?(P_0, P_1); - } - - public virtual void ?(? P_0) - { - if (??.ContainsKey(P_0)) - { - ??.Remove(P_0); - int num = ??[P_0]; - ??.RemoveAt(num); - ??.Remove(P_0); - ??.Remove(num); - ?(num + 1); - } - } - - public virtual void ?(int P_0) - { - ?(P_0); - } - - public virtual void ?(int P_0, int P_1) - { - ??.RemoveRange(P_0, P_1); - for (int i = P_0; i < P_0 + P_1; i++) - { - ? key = ??[i]; - ??.Remove(key); - ??.Remove(key); - ??.Remove(i); - } - while (P_0 < ??.Count) - { - ? val = ??[P_0 + P_1]; - if (val != null) - { - ??[P_0] = val; - ??[val] = P_0; - } - P_0++; - } - for (int j = ??.Count; j < ??.Count + P_1; j++) - { - ??.Remove(j); - } - } - - public virtual void ?(? P_0) - { - ?(??.IndexOf(P_0)); - } - - public virtual ? ?(int P_0) - { - return ??[P_0]; - } - - public virtual void ?() - { - ??.Clear(); - ??.Clear(); - ??.Clear(); - ??.Clear(); - } - - public virtual bool ?(? P_0) - { - return ??.ContainsKey(P_0); - } - - public virtual bool ?(? P_0) - { - return ??.ContainsValue(P_0); - } - - public virtual IEnumerator GetEnumerator() - { - return ??.GetEnumerator(); - } - - private IEnumerator ?() - { - return GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(); - } - - public virtual bool ?(? P_0, out ? P_1) - { - return ??.TryGetValue(P_0, out P_1); - } - } - internal class ? : ? - { - private readonly object ??; - - public override int Count - { - get - { - lock (??) - { - return base.Count; - } - } - } - - public override ? this[? P_0] - { - get - { - lock (??) - { - return base[P_0]; - } - } - set - { - lock (??) - { - base[val] = val2; - } - } - } - - public override ICollection Keys - { - get - { - lock (??) - { - return base.Keys; - } - } - } - - public override ICollection Values - { - get - { - lock (??) - { - return base.Values; - } - } - } - - public ?() - { - ?? = new object(); - } - - public override ? ?(int P_0) - { - lock (??) - { - return base.?(P_0); - } - } - - public override ?[] ?() - { - lock (??) - { - return base.?(); - } - } - - public override int ?(? P_0, ? P_1) - { - lock (??) - { - return base.?(P_0, P_1); - } - } - - public override void ?(? P_0) - { - lock (??) - { - base.?(P_0); - } - } - - public override void ?(int P_0) - { - lock (??) - { - base.?(P_0); - } - } - - public override void ?(int P_0, int P_1) - { - lock (??) - { - base.?(P_0, P_1); - } - } - - public override void ?(? P_0) - { - lock (??) - { - base.?(P_0); - } - } - - public override ? ?(int P_0) - { - lock (??) - { - return base.?(P_0); - } - } - - public override void ?() - { - lock (??) - { - base.?(); - } - } - - public override bool ?(? P_0) - { - lock (??) - { - return base.?(P_0); - } - } - - public override bool ?(? P_0) - { - lock (??) - { - return base.?(P_0); - } - } - - public override IEnumerator GetEnumerator() - { - lock (??) - { - return base.GetEnumerator(); - } - } - - public override bool ?(? P_0, out ? P_1) - { - lock (??) - { - return base.?(P_0, out P_1); - } - } - } -} -namespace TradingPlatform.BusinessLayer.Utils -{ - public class Map : IEnumerable>, IEnumerable - { - private readonly Dictionary ??; - - private readonly Dictionary ??; - - public Map() - { - ?? = new Dictionary(); - ?? = new Dictionary(); - } - - public void Add(T1 item1, T2 item2) - { - ??.Add(item1, item2); - ??.Add(item2, item1); - } - - public void Remove(T1 item1, T2 item2) - { - ??.Remove(item1); - ??.Remove(item2); - } - - public void Clear() - { - ??.Clear(); - ??.Clear(); - } - - public bool TryGetDirect(T1 key, out T2 value) - { - return ??.TryGetValue(key, out value); - } - - public bool TryGetReverse(T2 key, out T1 value) - { - return ??.TryGetValue(key, out value); - } - - public bool ContainsDirect(T1 key) - { - return ??.ContainsKey(key); - } - - public bool ContainsReverse(T2 key) - { - return ??.ContainsKey(key); - } - - public IEnumerator> GetEnumerator() - { - return ??.GetEnumerator(); - } - - private IEnumerator ?() - { - return ((IEnumerable)??).GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(); - } - } - public class MinotauroFibonacciLevelOptions : FibonacciLevelOptions - { - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private Color ??; - - [CompilerGenerated] - private Color ??; - - [CompilerGenerated] - private string ??; - - public bool ShowExtension - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool ShowExtensionLine - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool ShowBaseLevel - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string BaseLevelText - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double ExtensionLevel - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Color ExtensionBackColor - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Color ExtensionBorderColor - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string ExtensionLabel - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public MinotauroFibonacciLevelOptions(double level) - : base(level) - { - ShowBaseLevel = true; - ShowExtensionLine = true; - } - - public MinotauroFibonacciLevelOptions() - { - ShowExtensionLine = true; - } - - public override FibonacciLevelOptions Clone() - { - return new MinotauroFibonacciLevelOptions - { - UseCustom = base.UseCustom, - Line = base.Line, - CaptionFontColor = base.CaptionFontColor, - CaptionFont = base.CaptionFont, - Level = base.Level, - ShowExtension = ShowExtension, - ShowExtensionLine = ShowExtensionLine, - ShowBaseLevel = ShowBaseLevel, - ExtensionLevel = ExtensionLevel, - ExtensionBackColor = ExtensionBackColor, - ExtensionBorderColor = ExtensionBorderColor, - ExtensionLabel = ExtensionLabel, - BaseLevelText = BaseLevelText - }; - } - - public override XElement ToXElement() - { - XElement xElement = base.ToXElement(); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ShowExtension)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ShowExtensionLine)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ShowBaseLevel)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExtensionLevel)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExtensionBackColor.ToArgb())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExtensionBorderColor.ToArgb())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExtensionLabel)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), BaseLevelText)); - return xElement; - } - - public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - base.FromXElement(element, deserializationInfo); - ShowExtension = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); - ShowExtensionLine = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); - ShowBaseLevel = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); - ExtensionLevel = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToDouble(); - ExtensionBackColor = Color.FromArgb(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt()); - ExtensionBorderColor = Color.FromArgb(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt()); - ExtensionLabel = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString(); - BaseLevelText = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString(); - } - } - public class DotNetNaturalSortComparer : IComparer - { - private readonly StringComparison ??; - - private readonly IComparer ??; - - private const byte ?? = 0; - - private const byte ?? = 1; - - private const byte ?? = 2; - - private const byte ?? = 3; - - public DotNetNaturalSortComparer(StringComparison stringComparison) - { - ?? = stringComparison; - } - - public DotNetNaturalSortComparer(IComparer stringComparer) - { - ?? = stringComparer; - } - - public int Compare(string str1, string str2) - { - if (str1 == str2) - { - return 0; - } - if (str1 == null) - { - return -1; - } - if (str2 == null) - { - return 1; - } - int length = str1.Length; - int length2 = str2.Length; - int num = 0; - int num2 = 0; - int num12; - while (true) - { - int i = num; - byte b = 0; - for (; i < length; i++) - { - byte b2 = ?(str1[i]); - if (b == 0) - { - b = b2; - } - else if (b != b2) - { - break; - } - } - int j = num2; - byte b3 = 0; - for (; j < length2; j++) - { - byte b4 = ?(str2[j]); - if (b3 == 0) - { - b3 = b4; - } - else if (b3 != b4) - { - break; - } - } - int num3 = b.CompareTo(b3); - if (num3 != 0) - { - return num3; - } - if (b == 0) - { - return 0; - } - int num4 = i - num; - int num5 = j - num2; - if (b == 2) - { - int num6 = Math.Max(num4, num5); - int num7 = num6 - num4; - int num8 = num6 - num5; - for (int k = 0; k < num6; k++) - { - char c = ((k < num7) ? '0' : str1[num + k - num7]); - char value = ((k < num8) ? '0' : str2[num2 + k - num8]); - int num9 = c.CompareTo(value); - if (num9 != 0) - { - return num9; - } - } - int num10 = num7.CompareTo(num8); - if (num10 != 0) - { - return num10; - } - } - else if (?? != null) - { - string x = str1.Substring(num, num4); - string y = str2.Substring(num2, num5); - int num11 = ??.Compare(x, y); - if (num11 != 0) - { - return num11; - } - } - else - { - int length3 = Math.Min(num4, num5); - num12 = string.Compare(str1, num, str2, num2, length3, ??); - if (num12 == 0) - { - num12 = num4 - num5; - } - if (num12 != 0) - { - break; - } - } - num = i; - num2 = j; - } - return num12; - } - - private static byte ?(char P_0) - { - if (P_0 < 'a') - { - if (P_0 < 'A') - { - if (P_0 < '0' || P_0 > '9') - { - return 1; - } - return 2; - } - if (P_0 > 'Z') - { - return 1; - } - return 3; - } - if (P_0 > 'z') - { - if (P_0 >= '\u0080') - { - if (!char.IsLetter(P_0)) - { - return 1; - } - return 3; - } - return 1; - } - return 3; - } - } - public class PerformedRequestEventArgs : RequestEventArgs - { - [CompilerGenerated] - private readonly object ??; - - public object RequestResult - { - [CompilerGenerated] - get - { - return ??; - } - } - - public PerformedRequestEventArgs(RequestParameters requestParameters, object requestResult) - : base(requestParameters) - { - ?? = requestResult; - } - } - public class PnlAlertsContainer - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal PnlAlertItem ?(PnlAlertItem P_0) - { - return new PnlAlertItem(P_0); - } - } - - [CompilerGenerated] - private PnlAlertItem[] ??; - - public Action OnAlertEnabilityChanged; - - public PnlAlertItem[] PnlAlerts - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public PnlAlertsContainer() - { - PnlAlerts = new PnlAlertItem[0]; - } - - public PnlAlertsContainer Clone() - { - PnlAlertsContainer pnlAlertsContainer = new PnlAlertsContainer(); - if (PnlAlerts.Length != 0) - { - pnlAlertsContainer.PnlAlerts = PnlAlerts.Select((PnlAlertItem P_0) => new PnlAlertItem(P_0)).ToArray(); - } - return pnlAlertsContainer; - } - } - public class PnlAlertItem : ITriggerItem, IEquatable - { - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private Symbol ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private int ??; - - public bool IsChecked - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Symbol Symbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double TargetValue - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double Increment - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int Precision - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public PnlAlertItem() - { - IsChecked = false; - TargetValue = 1.0; - Increment = 1.0; - Precision = 1; - } - - public PnlAlertItem(PnlAlertItem source) - { - IsChecked = source.IsChecked; - Symbol = source.Symbol; - TargetValue = source.TargetValue; - Increment = source.Increment; - Precision = source.Precision; - } - - public bool Equals(PnlAlertItem other) - { - if (other == null) - { - return false; - } - if (other == this) - { - return true; - } - if (Symbol.Equals(other.Symbol)) - { - return TargetValue.Equals(other.TargetValue); - } - return false; - } - } - public class TimeInTradeContainer - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal TimeInTradeItem ?(TimeInTradeItem P_0) - { - return new TimeInTradeItem(P_0); - } - } - - [CompilerGenerated] - private TimeInTradeItem[] ??; - - public Action OnItemEnabilityChanged; - - public TimeInTradeItem[] TimeInTradeItems - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public TimeInTradeContainer() - { - TimeInTradeItems = new TimeInTradeItem[0]; - } - - public TimeInTradeContainer Clone() - { - TimeInTradeContainer timeInTradeContainer = new TimeInTradeContainer(); - if (TimeInTradeItems.Length != 0) - { - timeInTradeContainer.TimeInTradeItems = TimeInTradeItems.Select((TimeInTradeItem P_0) => new TimeInTradeItem(P_0)).ToArray(); - } - return timeInTradeContainer; - } - } - public class TimeInTradeItem : ITriggerItem, IEquatable - { - private bool ??; - - [CompilerGenerated] - private Symbol ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private TimeInTradePlDirection ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private bool ??; - - public bool IsChecked - { - get - { - return ??; - } - set - { - NeedTimeResetToNow = value; - ?? = value; - } - } - - public Symbol Symbol - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int TimeInSeconds - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public TimeInTradePlDirection PLDirection - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DateTime ActivatedTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - public bool NeedTimeResetToNow - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public TimeInTradeItem() - { - } - - public TimeInTradeItem(TimeInTradeItem source) - : this() - { - IsChecked = source.IsChecked; - Symbol = source.Symbol; - TimeInSeconds = source.TimeInSeconds; - PLDirection = source.PLDirection; - ActivatedTime = source.ActivatedTime; - } - - public bool Equals(TimeInTradeItem other) - { - if (other == null) - { - return false; - } - if (other == this) - { - return true; - } - if (IsChecked == other.IsChecked && Symbol.Equals(other.Symbol) && TimeInSeconds.Equals(other.TimeInSeconds)) - { - return PLDirection.Equals(other.PLDirection); - } - return false; - } - - public override bool Equals(object obj) - { - return Equals(obj as TimeInTradeItem); - } - - public void ResetTriggerTime(bool toNow = false) - { - ActivatedTime = (toNow ? Core.Instance.TimeUtils.DateTimeUtcNow : default(DateTime)); - NeedTimeResetToNow = false; - } - } - public interface ITriggerItem - { - bool IsChecked { get; } - - Symbol Symbol { get; } - } - public enum TimeInTradePlDirection - { - [EnumMember(Value = "Any")] - Any, - [EnumMember(Value = "Positive")] - Positive, - [EnumMember(Value = "Negative")] - Negative - } - public class RequestEventArgs : EventArgs - { - [CompilerGenerated] - private readonly RequestParameters ??; - - public RequestParameters RequestParameters - { - [CompilerGenerated] - get - { - return ??; - } - } - - public RequestEventArgs(RequestParameters requestParameters) - { - ?? = requestParameters; - } - } - public class Rss : List, ICloneable, IXElementSerialization - { - public object Clone() - { - Rss rss = new Rss(); - using Enumerator enumerator = GetEnumerator(); - while (enumerator.MoveNext()) - { - RssItem current = enumerator.Current; - rss.Add(current.Clone() as RssItem); - } - return rss; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement == null) - { - if (element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - Add(new RssItem - { - Name = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - Url = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }); - Add(new RssItem - { - Name = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - Url = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }); - Add(new RssItem - { - Name = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - Url = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }); - } - return; - } - foreach (XElement item in xElement?.Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - Add(new RssItem - { - Active = item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(), - Name = item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value, - Url = item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value - }); - } - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - using Enumerator enumerator = GetEnumerator(); - while (enumerator.MoveNext()) - { - RssItem current = enumerator.Current; - XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(xElement2); - xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), current.Active)); - xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), current.Name)); - xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), current.Url)); - } - return xElement; - } - } - [DataContract(Name = "RssItem", Namespace = "TradingPlatform")] - public class RssItem : ICloneable - { - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private string ??; - - private string ??; - - [CompilerGenerated] - private bool ??; - - [DataMember(Name = "Active")] - public bool Active - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Name")] - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Url")] - public string Url - { - get - { - return ??; - } - set - { - if (!(?? == value)) - { - ?? = value; - Subscribed = false; - } - } - } - - public bool Subscribed - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public object Clone() - { - return new RssItem - { - Active = Active, - Name = Name, - Url = Url, - Subscribed = Subscribed - }; - } - } - public class SubscriptionsCache : IDisposable - { - private class ? : IDisposable - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func, bool> ??; - - public static Func, string> ??; - - internal bool ?(KeyValuePair P_0) - { - return P_0.Value > 0; - } - - internal string ?(KeyValuePair P_0) - { - return P_0.Key; - } - } - - private readonly IDictionary ??; - - private readonly object ??; - - public ?() - { - ?? = new Dictionary(); - ?? = new object(); - } - - public bool ?(string P_0) - { - lock (??) - { - ?(P_0); - ??[P_0]++; - return ??[P_0] == 1; - } - } - - public bool ?(string P_0) - { - lock (??) - { - ?(P_0); - ??[P_0] = Math.Max(0, ??[P_0] - 1); - return ??[P_0] == 0; - } - } - - public bool ?(string P_0) - { - lock (??) - { - if (!??.ContainsKey(P_0)) - { - return false; - } - return ??[P_0] > 0; - } - } - - public string[] ?() - { - lock (??) - { - return (from P_0 in ?? - where P_0.Value > 0 - select P_0.Key).ToArray(); - } - } - - private void ?(string P_0) - { - if (!??.ContainsKey(P_0)) - { - ??[P_0] = 0; - } - } - - public void Dispose() - { - lock (??) - { - ??.Clear(); - } - } - } - - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func> ??; - - internal IEnumerable ?(? P_0) - { - return P_0.?(); - } - } - - [CompilerGenerated] - private sealed class ? - { - public string ??; - - internal bool ?(? P_0) - { - return P_0.?(??); - } - } - - private readonly IDictionary ??; - - public SubscriptionsCache() - { - ?? = new Dictionary(); - foreach (SubscribeQuoteType value in Enum.GetValues(typeof(SubscribeQuoteType))) - { - ??[value] = new ?(); - } - } - - public bool AddSubscription(SubscribeQuoteType subscribeQuoteType, string symbolId) - { - return ??[subscribeQuoteType].?(symbolId); - } - - public bool RemoveSubscription(SubscribeQuoteType subscribeQuoteType, string symbolId) - { - return ??[subscribeQuoteType].?(symbolId); - } - - public bool IsSubscribed(SubscribeQuoteType subscribeQuoteType, string symbolId) - { - return ??[subscribeQuoteType].?(symbolId); - } - - public bool HasAnySubscription(string symbolId) - { - return ??.Values.Any((? P_0) => P_0.?(symbolId)); - } - - public string[] FindSubscribedSymbols(SubscribeQuoteType subscribeQuoteType) - { - return ??[subscribeQuoteType].?(); - } - - public string[] FindAllSubscribedSymbols() - { - return ??.Values.SelectMany((? P_0) => P_0.?()).Distinct().ToArray(); - } - - public void Dispose() - { - foreach (? value in ??.Values) - { - value.Dispose(); - } - } - } - public enum TableBaseType - { - Numeric, - String, - Date - } - public enum TableConditionType - { - [Description("=")] - Equal, - [Description("!=")] - NonEqual, - [Description("Contains")] - Present, - [Description("Not contains")] - NotPresent, - [Description(">")] - More, - [Description(">=")] - MoreEqual, - [Description("<")] - Less, - [Description("<=")] - LessEqual, - [Description("Cross")] - Cross, - [Description("Cross Above")] - CrossAbove, - [Description("Cross Below")] - CrossBelow - } - public class UpdatableDataSource - { - private T ??; - - private DateTime ??; - - private readonly Func ??; - - private readonly TimeSpan ??; - - private readonly object ??; - - public UpdatableDataSource(Func updateFunc, TimeSpan expirationPeriod) - { - ?? = updateFunc; - ?? = expirationPeriod; - ?? = new object(); - } - - public bool TryGetData(out T value, CancellationToken cancellation) - { - ?(cancellation); - return TryGetData(out value); - } - - public bool TryGetData(out T value) - { - value = ??; - return !EqualityComparer.Default.Equals(value, default(T)); - } - - private void ?(CancellationToken P_0) - { - if (?? == null) - { - return; - } - lock (??) - { - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - if (dateTimeUtcNow - ?? < ??) - { - return; - } - try - { - ?? = ??(P_0); - } - catch - { - } - finally - { - ?? = dateTimeUtcNow; - } - } - } - } - public class VolumeAnalysisParameters - { - [CompilerGenerated] - private VolumeAnalysisPluginType ??; - - [CompilerGenerated] - private object ??; - - [CompilerGenerated] - private object ??; - - [CompilerGenerated] - private SymbolVolumeType ??; - - public Action RefreshChart; - - [CompilerGenerated] - private ISessionsContainer ??; - - [CompilerGenerated] - private TimeZone ??; - - public VolumeAnalysisPluginType Type - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public object Parameter - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public object Chart - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SymbolVolumeType SymbolVolumeType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public ISessionsContainer SessionsContainer - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public TimeZone CurrentTimezone - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - } - public enum VolumeAnalysisPluginType - { - Cluster, - TimeStatistics, - TimeHistogram, - LeftProfile, - RightProfile, - StepProfile, - PowerTrades, - VWAP, - VIPAnalysis - } -} -namespace TradingPlatform.BusinessLayer.Utils.UserTradesLocalStorage -{ - public class UsersTradesStorage : DataStorage - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func, bool> ??; - - public static Func ??; - - public static Func ??; - - internal bool ?(Interval P_0) - { - return !P_0.IsEmpty; - } - - internal string ?(MessageTrade P_0) - { - return P_0.TradeId; - } - - internal MessageTrade ?(MessageTrade P_0) - { - return P_0; - } - } - - [CompilerGenerated] - private sealed class ? - { - public UsersTradesStorage ??; - - public UserTradesInterval ??; - - internal void ?() - { - ??.??.Save(??); - } - } - - [CompilerGenerated] - private sealed class ? - { - public Interval ??; - - internal Interval ?(Interval P_0) - { - return P_0.Intersect(??); - } - } - - [CompilerGenerated] - private sealed class ? - { - public Trade ??; - - public UsersTradesStorage ??; - - internal void ?() - { - DateTime dateTime = ??.DateTime.AddTicks(1L); - if (??.DateTime <= ??.??) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(74, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(??.Id); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(??.DateTime.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo.InvariantCulture)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(??.??.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo.InvariantCulture)); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); - Interval interval = new Interval(??.DateTime.AddTicks(-1L), ??.DateTime.AddTicks(1L)); - UserTradesInterval userTradesInterval = ??.??.Load(interval); - Dictionary dictionary = userTradesInterval.Trades.ToDictionary(UsersTradesStorage.?.??.?, UsersTradesStorage.?.??.?); - MessageTrade messageTrade = ??.BuildMessage(); - dictionary[messageTrade.TradeId] = messageTrade; - LoggerManager loggers2 = Core.Instance.Loggers; - defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(72, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(userTradesInterval.Trades.Count()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(dictionary.Count); - loggers2.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); - ??.??.Save(new UserTradesInterval - { - Trades = dictionary.Values, - Interval = interval - }); - } - else - { - ??.??.Save(new UserTradesInterval - { - Trades = new MessageTrade[1] { ??.BuildMessage() }, - Interval = new Interval(??.??, dateTime) - }); - ??.?? = dateTime; - } - } - } - - private static readonly Type ??; - - private readonly IUserTradesLocalStorage ??; - - private readonly string ??; - - private DateTime ??; - - public bool IsRealtimeCollectingAllowed => !string.IsNullOrEmpty(??); - - static UsersTradesStorage() - { - try - { - ?? = AssemblyLoader.LoadTypes(Path.Combine(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), typeof(IUserTradesLocalStorage), null, SearchOption.AllDirectories)?.FirstOrDefault(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - public UsersTradesStorage(IUserTradesLocalStorage storage, string localFilePath, string connectionId) - : base(storage, localFilePath) - { - ?? = storage; - ?? = connectionId; - ?? = Core.Instance.TimeUtils.DateTimeUtcNow; - if (IsRealtimeCollectingAllowed) - { - Core.Instance.TradeAdded += ?; - } - } - - public override void Dispose() - { - Core.Instance.TradeAdded -= ?; - base.Dispose(); - } - - public static UsersTradesStorage Create(string connectionString, string connectionId) - { - if (?? == null) - { - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - IUserTradesLocalStorage obj = Activator.CreateInstance(??) as IUserTradesLocalStorage; - if (obj == null) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(30, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(??); - throw new InvalidOperationException(defaultInterpolatedStringHandler.ToStringAndClear()); - } - string directoryName = Path.GetDirectoryName(connectionString); - if (!Directory.Exists(directoryName)) - { - Directory.CreateDirectory(directoryName); - } - return new UsersTradesStorage(obj, connectionString, connectionId); - } - - public void Save(UserTradesInterval historyInterval) - { - CheckDisposed(); - PushAction(delegate - { - ??.Save(historyInterval); - }); - } - - public IList Load(Interval requestParameters, out List> historyParametersForServerRequest) - { - CheckDisposed(); - List list = new List(); - historyParametersForServerRequest = new List>(); - UsersTradesStorageInfo info = ??.GetInfo(); - if (!info.StoredIntervals.Any()) - { - historyParametersForServerRequest.Add(requestParameters); - return list; - } - Interval ?? = requestParameters; - Interval[] collection = ??.Subtract(info.StoredIntervals).ToArray(); - historyParametersForServerRequest.AddRange(collection); - Interval[] array = (from P_0 in info.StoredIntervals - select P_0.Intersect(??) into P_0 - where !P_0.IsEmpty - select P_0).ToArray(); - foreach (Interval interval in array) - { - UserTradesInterval item = ??.Load(interval); - list.Add(item); - } - return list; - } - - private void ?(Trade P_0) - { - if (P_0.ConnectionId != ??) - { - return; - } - PushAction(delegate - { - DateTime to = P_0.DateTime.AddTicks(1L); - if (P_0.DateTime <= ??) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(74, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.Id); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.DateTime.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo.InvariantCulture)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(??.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo.InvariantCulture)); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); - Interval interval = new Interval(P_0.DateTime.AddTicks(-1L), P_0.DateTime.AddTicks(1L)); - UserTradesInterval userTradesInterval = ??.Load(interval); - Dictionary dictionary = userTradesInterval.Trades.ToDictionary(UsersTradesStorage.?.??.?, UsersTradesStorage.?.??.?); - MessageTrade messageTrade = P_0.BuildMessage(); - dictionary[messageTrade.TradeId] = messageTrade; - LoggerManager loggers2 = Core.Instance.Loggers; - defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(72, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(userTradesInterval.Trades.Count()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(dictionary.Count); - loggers2.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); - ??.Save(new UserTradesInterval - { - Trades = dictionary.Values, - Interval = interval - }); - } - else - { - ??.Save(new UserTradesInterval - { - Trades = new MessageTrade[1] { P_0.BuildMessage() }, - Interval = new Interval(??, to) - }); - ?? = to; - } - }); - } - } - public class UsersTradesStorageInfo - { - [CompilerGenerated] - private List> ??; - - public List> StoredIntervals - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public UsersTradesStorageInfo() - { - StoredIntervals = new List>(); - } - } -} -namespace TradingPlatform.BusinessLayer.Utils.UpdatesProvider -{ - public class DifferenceObserver - { - [CompilerGenerated] - private ApplyDifferencePredicate ??; - - private readonly IDictionary> ??; - - public ApplyDifferencePredicate ApplyDifferencePredicate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DifferenceObserver() - { - ?? = new Dictionary>(); - } - - public void RegisterType(Type type, params string[] propertyNamesToObserve) - { - List list = new List(); - ??[type] = list; - PropertyInfo[] properties = type.GetProperties(); - foreach (PropertyInfo propertyInfo in properties) - { - if (propertyInfo.CanRead && propertyInfo.CanWrite && (propertyNamesToObserve.Length == 0 || propertyNamesToObserve.Contains(propertyInfo.Name))) - { - list.Add(propertyInfo); - } - } - } - - public IEnumerable GetDifference(T entity1, T entity2, bool updateEntity1 = false) - { - Type typeFromHandle = typeof(T); - if (!??.TryGetValue(typeFromHandle, out var value)) - { - yield break; - } - foreach (PropertyInfo item in value) - { - object? value2 = item.GetValue(entity1); - object value3 = item.GetValue(entity2); - if (!object.Equals(value2, value3)) - { - if (updateEntity1 && (ApplyDifferencePredicate?.Invoke(item.Name, value3) ?? true)) - { - item.SetValue(entity1, value3); - } - yield return item.Name; - } - } - } - - public void UpdateEntity(T entity1, T entity2) - { - Type typeFromHandle = typeof(T); - if (!??.TryGetValue(typeFromHandle, out var value)) - { - return; - } - foreach (PropertyInfo item in value) - { - object? value2 = item.GetValue(entity1); - object value3 = item.GetValue(entity2); - if (!object.Equals(value2, value3)) - { - ApplyDifferencePredicate applyDifferencePredicate = ApplyDifferencePredicate; - if (applyDifferencePredicate == null || applyDifferencePredicate(item.Name, value3)) - { - item.SetValue(entity1, value3); - } - } - } - } - } - public delegate bool ApplyDifferencePredicate(string propertyName, object propertyValue); - public class UpdatesProvider - { - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - private IDictionary ??; - - private readonly object ??; - - private readonly DifferenceObserver ??; - - [CompilerGenerated] - private bool ??; - - public TValue[] Items - { - get - { - lock (??) - { - return ??.Values.ToArray(); - } - } - } - - public bool UpdateItem - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public ApplyDifferencePredicate ApplyDifferencePredicate - { - get - { - return ??.ApplyDifferencePredicate; - } - set - { - ??.ApplyDifferencePredicate = value; - } - } - - public event Action ItemAdded - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public event Action ItemUpdated - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public event Action ItemRemoved - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public UpdatesProvider(IDictionary items, params string[] propertyNamesToObserve) - { - ?? = new Dictionary(items); - ?? = new object(); - ?? = new DifferenceObserver(); - ??.RegisterType(typeof(TValue), propertyNamesToObserve); - UpdateItem = true; - } - - public void ProcessItems(IDictionary newCache) - { - newCache = new Dictionary(newCache); - lock (??) - { - IEnumerable enumerable = newCache.Keys.Except(??.Keys); - IEnumerable enumerable2 = ??.Keys.Except(newCache.Keys); - IEnumerable enumerable3 = ??.Keys.Intersect(newCache.Keys); - foreach (TKey item in enumerable) - { - ?(newCache[item]); - } - foreach (TKey item2 in enumerable2) - { - ?(??[item2]); - } - foreach (TKey item3 in enumerable3) - { - TValue entity = ??[item3]; - TValue val = newCache[item3]; - if (??.GetDifference(entity, val, UpdateItem).ToArray().Any()) - { - ?(val); - } - } - ?? = newCache; - } - } - - public void ProcessNewItem(TKey key, TValue newItem) - { - Action action = null; - lock (??) - { - if (??.TryGetValue(key, out var value)) - { - if (!??.GetDifference(value, newItem, UpdateItem).Any()) - { - return; - } - action = ?; - } - else - { - action = ?; - } - ??[key] = newItem; - } - action(newItem); - } - - public void RemoveItem(TKey key, TValue item) - { - lock (??) - { - if (!??.ContainsKey(key)) - { - return; - } - ??.Remove(key); - } - ?(item); - } - - public bool TryGetValue(TKey key, out TValue value) - { - lock (??) - { - return ??.TryGetValue(key, out value); - } - } - - private void ?(TValue P_0) - { - try - { - ???.Invoke(P_0); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - private void ?(TValue P_0) - { - try - { - ???.Invoke(P_0); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - private void ?(TValue P_0) - { - try - { - ???.Invoke(P_0); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - } -} -namespace TradingPlatform.BusinessLayer.Utils.TradingProtection -{ - public class TradingProtector : ICustomizable - { - [CompilerGenerated] - private bool ??; - - private Period ??; - - private int ??; - - private readonly ConcurrentQueue ??; - - private TimeSpan ??; - - public bool Enabled - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Period Period - { - get - { - return ??; - } - set - { - ?? = value; - ?? = ??.Duration; - } - } - - public int Limit - { - get - { - return ??; - } - set - { - ?? = Math.Max(0, value); - } - } - - public IList Settings - { - get - { - SettingItemRelationVisibility relation = new SettingItemRelationVisibility(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), true); - List list = new List(); - list.Add(new SettingItemBooleanSwitcher(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Enabled) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - SortIndex = 5 - }); - list.Add(new SettingItemPeriod(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Period) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - SortIndex = 10, - ExcludedPeriods = new BasePeriod[1], - Relation = relation - }); - list.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Limit) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - Minimum = 0, - SortIndex = 20, - Relation = relation - }); - return list; - } - set - { - Period = value.GetValueOrDefault(Period, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - Limit = value.GetValueOrDefault(Limit, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - Enabled = value.GetValueOrDefault(Enabled, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - Period = value.GetValueOrDefault(Period, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - Limit = value.GetValueOrDefault(Limit, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - internal TradingProtector() - { - Enabled = true; - Period = Period.SECOND1; - Limit = 10; - ?? = new ConcurrentQueue(); - } - - public bool IsOperationAllowed() - { - if (!Enabled) - { - return true; - } - bool num = ??.Count < Limit; - if (num) - { - ??.Enqueue(Core.Instance.TimeUtils.DateTimeUtcNow); - } - return num; - } - - internal void ?() - { - if (Enabled && ??.Ticks > 0) - { - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - DateTime result; - while (??.TryPeek(out result) && dateTimeUtcNow - result > ??) - { - ??.TryDequeue(out var _); - } - } - } - } -} -namespace TradingPlatform.BusinessLayer.Utils.TaskSchedulers -{ - public class DegreeOfParallelismTaskScheduler : TaskScheduler, IDisposable - { - [CompilerGenerated] - private readonly int ??; - - private List ??; - - private readonly object ??; - - private int ??; - - public sealed override int MaximumConcurrencyLevel - { - [CompilerGenerated] - get - { - return ??; - } - } - - public DegreeOfParallelismTaskScheduler(int maxDegreeOfParallelism) - { - if (maxDegreeOfParallelism < 1) - { - throw new ArgumentOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ?? = maxDegreeOfParallelism; - ?? = new List(); - ?? = new object(); - ?? = 0; - } - - protected sealed override void QueueTask(Task task) - { - lock (??) - { - if (?? == null) - { - return; - } - ??.Add(task); - if (?? >= MaximumConcurrencyLevel) - { - return; - } - ??++; - } - ThreadPool.UnsafeQueueUserWorkItem(delegate - { - try - { - Task task2; - while (?(out task2)) - { - try - { - if (task2 != null) - { - TryExecuteTask(task2); - } - } - catch - { - } - } - } - finally - { - ??--; - } - }, null); - } - - protected sealed override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) - { - if (taskWasPreviouslyQueued) - { - if (TryDequeue(task)) - { - return TryExecuteTask(task); - } - return false; - } - return TryExecuteTask(task); - } - - protected sealed override bool TryDequeue(Task task) - { - lock (??) - { - return ???.Remove(task) ?? false; - } - } - - protected sealed override IEnumerable GetScheduledTasks() - { - return ???.ToArray(); - } - - public void Dispose() - { - lock (??) - { - ?? = null; - } - } - - [CompilerGenerated] - private bool ?(out Task P_0) - { - P_0 = null; - lock (??) - { - if (?? == null || ??.Count == 0) - { - return false; - } - P_0 = ??[0]; - ??.RemoveAt(0); - return true; - } - } - - [CompilerGenerated] - private void ?(object? P_0) - { - try - { - Task task; - while (?(out task)) - { - try - { - if (task != null) - { - TryExecuteTask(task); - } - } - catch - { - } - } - } - finally - { - ??--; - } - } - } -} -namespace TradingPlatform.BusinessLayer.Utils.Sounds -{ - public static class Sound - { - private static class ? - { - public const string ?? = "connectionFinished.wav"; - - public const string ?? = "connectionLost.wav"; - - public const string ?? = "orderFilled.wav"; - - public const string ?? = "orderRejected.wav"; - - public const string ?? = "PositionClosed.wav"; - - public const string ?? = "DefaultAlert.wav"; - - public const string ?? = "OrderCreated.wav"; - - public const string ?? = "Update.wav"; - } - - public static string ConnectionFinished; - - public static string ConnectionLost; - - public static string OrderCreatedCancelledReplaced; - - public static string OrderFilled; - - public static string OrderRejected; - - public static string PositionClosed; - - public static string DefaultAlert; - - public static string UpdateAvailable; - - [CompilerGenerated] - private static readonly Dictionary ??; - - public static Dictionary Defaults - { - [CompilerGenerated] - get - { - return ??; - } - } - - static Sound() - { - ConnectionFinished = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - ConnectionLost = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - OrderCreatedCancelledReplaced = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - OrderFilled = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - OrderRejected = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - PositionClosed = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - DefaultAlert = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - UpdateAvailable = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - ?? = new Dictionary - { - [ConnectionFinished] = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - [ConnectionLost] = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - [OrderCreatedCancelledReplaced] = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - [OrderFilled] = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - [OrderRejected] = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - [PositionClosed] = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - [DefaultAlert] = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - [UpdateAvailable] = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }; - } - } - public class SoundItem : IXElementSerialization - { - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - public bool Enabled - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public string CurrentPath - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SoundItem() - { - } - - public SoundItem(string name) - { - Enabled = true; - Name = name; - CurrentPath = Sound.Defaults[name]; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - Enabled = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); - Name = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; - CurrentPath = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Enabled)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CurrentPath)); - return xElement; - } - } -} -namespace TradingPlatform.BusinessLayer.Utils.Storage -{ - public interface IOrdersHistoryLocalStorage : ILocalStorage - { - void Save(OrdersHistoryInterval interval); - - OrdersHistoryInterval Load(Interval interval); - - void Delete(Interval interval); - - OrdersHistoryStorageInfo GetInfo(); - } - public class OrdersHistoryInterval - { - [CompilerGenerated] - private Interval ??; - - [CompilerGenerated] - private IEnumerable ??; - - public Interval Interval - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IEnumerable OrdersHistory - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - } - public sealed class OrdersHistoryStorage : DataStorage - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func, bool> ??; - - internal bool ?(Interval P_0) - { - return !P_0.IsEmpty; - } - } - - [CompilerGenerated] - private sealed class ? - { - public OrdersHistoryStorage ??; - - public OrdersHistoryInterval ??; - - internal void ?() - { - ??.??.Save(??); - } - } - - [CompilerGenerated] - private sealed class ? - { - public Interval ??; - - internal Interval ?(Interval P_0) - { - return P_0.Intersect(??); - } - } - - private static readonly Type ??; - - private readonly IOrdersHistoryLocalStorage ??; - - static OrdersHistoryStorage() - { - try - { - ?? = AssemblyLoader.LoadTypes(Path.Combine(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), typeof(IOrdersHistoryLocalStorage), null, SearchOption.AllDirectories)?.FirstOrDefault(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - public OrdersHistoryStorage(IOrdersHistoryLocalStorage storage, string localFilePath, string connectionId) - : base(storage, localFilePath) - { - ?? = storage; - } - - public static OrdersHistoryStorage Create(string connectionString, string connectionId) - { - if (?? == null) - { - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - IOrdersHistoryLocalStorage obj = Activator.CreateInstance(??) as IOrdersHistoryLocalStorage; - if (obj == null) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(30, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(??); - throw new InvalidOperationException(defaultInterpolatedStringHandler.ToStringAndClear()); - } - string directoryName = Path.GetDirectoryName(connectionString); - if (!Directory.Exists(directoryName)) - { - Directory.CreateDirectory(directoryName); - } - return new OrdersHistoryStorage(obj, connectionString, connectionId); - } - - public void Save(OrdersHistoryInterval historyInterval) - { - CheckDisposed(); - PushAction(delegate - { - ??.Save(historyInterval); - }); - } - - public IList Load(Interval requestParameters, out List> historyParametersForServerRequest) - { - CheckDisposed(); - List list = new List(); - historyParametersForServerRequest = new List>(); - OrdersHistoryStorageInfo info = ??.GetInfo(); - if (!info.StoredIntervals.Any()) - { - historyParametersForServerRequest.Add(requestParameters); - return list; - } - Interval ?? = requestParameters; - Interval[] collection = ??.Subtract(info.StoredIntervals).ToArray(); - historyParametersForServerRequest.AddRange(collection); - Interval[] array = (from P_0 in info.StoredIntervals - select P_0.Intersect(??) into P_0 - where !P_0.IsEmpty - select P_0).ToArray(); - foreach (Interval interval in array) - { - OrdersHistoryInterval item = ??.Load(interval); - list.Add(item); - } - return list; - } - } - public sealed class OrdersHistoryStorageInfo - { - [CompilerGenerated] - private List> ??; - - public List> StoredIntervals - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public OrdersHistoryStorageInfo() - { - StoredIntervals = new List>(); - } - } - public abstract class DataStorage : ActionBufferedProcessor, IDisposable - { - [CompilerGenerated] - private sealed class ? - { - public DataStorage ??; - - public Action ??; - - internal void ?() - { - if (!??.??) - { - ???.Invoke(); - } - } - } - - [CompilerGenerated] - private sealed class ? - { - public DataStorage ??; - - public Action ??; - - public ManualResetEventSlim ??; - - internal void ?() - { - try - { - if (!??.??) - { - ???.Invoke(); - } - } - finally - { - ??.Set(); - } - } - } - - private readonly ILocalStorage ??; - - private readonly List ??; - - private readonly object ??; - - private bool ??; - - protected DataStorage(ILocalStorage storage, string localFilePath) - { - ?? = storage ?? throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - ??.Connect(localFilePath); - ?? = new List(); - ?? = new object(); - Start(); - } - - public virtual void Dispose() - { - CheckDisposed(); - ?? = true; - try - { - Clear(); - WaitAllMessagesProcess(); - Stop(); - ??.Disconnect(); - lock (??) - { - foreach (ManualResetEventSlim item in ??) - { - item.Set(); - } - ??.Clear(); - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - protected void CheckDisposed() - { - if (!??) - { - return; - } - throw new ObjectDisposedException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - - protected void PushAction(Action action) - { - Push(delegate - { - if (!??) - { - action?.Invoke(); - } - }); - } - - protected void WaitForAction(Action action) - { - ManualResetEventSlim ?? = new ManualResetEventSlim(initialState: false); - lock (??) - { - ??.Add(??); - } - Push(delegate - { - try - { - if (!??) - { - action?.Invoke(); - } - } - finally - { - ??.Set(); - } - }); - ??.Wait(); - lock (??) - { - ??.Remove(??); - } - } - } - public interface ILocalStorage - { - void Connect(string connectionString); - - void Disconnect(); - } - public interface IUserTradesLocalStorage : ILocalStorage - { - void Save(UserTradesInterval interval); - - UserTradesInterval Load(Interval interval); - - void Delete(Interval interval); - - UsersTradesStorageInfo GetInfo(); - } - public class UserTradesInterval - { - [CompilerGenerated] - private Interval ??; - - [CompilerGenerated] - private IEnumerable ??; - - public Interval Interval - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IEnumerable Trades - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - } -} -namespace TradingPlatform.BusinessLayer.Utils.Storage.InMemory -{ - public class QuotesInMemoryStorage where TQuote : MessageQuote - { - [CompilerGenerated] - private sealed class ? - { - public Interval ??; - - internal bool ?(TQuote P_0) - { - return ??.Contains(P_0.Time); - } - } - - [CompilerGenerated] - private readonly int ??; - - private readonly List ??; - - private readonly TimeSpan ??; - - private const int ?? = 1000; - - private int ??; - - public int MaxCapacity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public QuotesInMemoryStorage(TimeSpan desiredDepth) - { - ?? = new List(); - ?? = desiredDepth; - MaxCapacity = 100000; - } - - public void Put(TQuote item) - { - try - { - if (??++ >= 1000) - { - ?? = 0; - ?(item); - } - ??.Add(item); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - private TQuote[] ?() - { - try - { - return ??.ToArray(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - return null; - } - - public bool TryGet(Interval interval, out TQuote[] items, out Interval remainingInterval) - { - remainingInterval = Interval.Default; - items = Array.Empty(); - TQuote[] array = ?(); - TQuote val = ((array != null) ? array.FirstOrDefault() : null); - if (val == null) - { - return false; - } - if (interval.To <= val.Time) - { - return false; - } - items = array.Where((TQuote P_0) => interval.Contains(P_0.Time)).ToArray(); - if (interval.From < val.Time) - { - remainingInterval = new Interval(interval.From, val.Time); - } - return true; - } - - private void ?(TQuote P_0) - { - if (??.Count <= 1) - { - return; - } - int num = 0; - foreach (TQuote item in ??) - { - if (P_0.Time - item.Time > ??) - { - num++; - continue; - } - break; - } - num--; - if (num >= 1) - { - num = Math.Max(??.Count - MaxCapacity, num); - ??.RemoveRange(0, num); - } - } - } -} -namespace TradingPlatform.BusinessLayer.Utils.Limitation -{ - public class Limiter : IDisposable - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal ? ?(Limit P_0) - { - return new ?(P_0); - } - } - - [CompilerGenerated] - private sealed class ? - { - public RequestType ??; - - internal bool ?(? P_0) - { - return P_0.?(??); - } - } - - private readonly ?[] ??; - - private readonly Timer ??; - - public Limiter(LimitationMetadata metadata) - { - ?? = metadata.Limits.Select((Limit P_0) => new ?(P_0)).ToArray(); - ?? = new Timer(?, null, TimeSpan.FromMilliseconds(100.0), TimeSpan.FromMilliseconds(100.0)); - } - - public void Wait(RequestType requestType, CancellationToken cancellationToken) - { - ?[] array = ??.Where((? P_0) => P_0.?(requestType)).ToArray(); - for (int num = 0; num < array.Length; num++) - { - array[num].?(cancellationToken); - } - } - - public void Dispose() - { - ??.Change(-1, -1); - ??.Dispose(); - } - - private void ?(object P_0) - { - ?[] array = ??; - for (int i = 0; i < array.Length; i++) - { - array[i].?(); - } - } - } -} -namespace ? -{ - internal class ? - { - private readonly ? ??; - - private readonly HashSet ??; - - public ?(Limit P_0) - { - ? obj; - if (P_0.Interval != LimitInterval.FloatingWindow) - { - ? ?2 = new ?(P_0.Period, P_0.Value); - obj = ?2; - } - else - { - ? ?2 = new ?(P_0.Period, P_0.Value); - obj = ?2; - } - ?? = obj; - HashSet hashSet = new HashSet(); - RequestType[] requestTypes = P_0.RequestTypes; - foreach (RequestType item in requestTypes) - { - hashSet.Add(item); - } - ?? = hashSet; - } - - public void ?(CancellationToken P_0) - { - ??.?(P_0); - } - - public void ?() - { - ??.?(); - } - - public bool ?(RequestType P_0) - { - return ??.Contains(P_0); - } - } - internal class ? : ? - { - private readonly Period ??; - - private readonly int ??; - - private DateTime ??; - - private readonly ManualResetEvent ??; - - private int ??; - - public ?(Period P_0, int P_1) - { - ?? = P_0; - ?? = P_1; - ?(); - ?? = new ManualResetEvent(initialState: false); - } - - public void ?(CancellationToken P_0) - { - if (?? < Interlocked.Increment(ref ??)) - { - ??.Reset(); - WaitHandle.WaitAny(new WaitHandle[2] { ??, P_0.WaitHandle }); - if (!P_0.IsCancellationRequested) - { - ?(P_0); - } - } - } - - public void ?() - { - if (!(Core.Instance.TimeUtils.DateTimeUtcNow < ??)) - { - ?(); - ?? = 0; - ??.Set(); - } - } - - private void ?() - { - ?? = Core.Instance.TimeUtils.DateTimeUtcNow.CeilingTo(??); - } - } - internal class ? : ? - { - private class ? - { - [CompilerGenerated] - private readonly DateTime ??; - - private readonly ManualResetEventSlim ??; - - public DateTime ExpirationTime - { - [CompilerGenerated] - get - { - return ??; - } - } - - public ?(DateTime P_0) - { - ?? = P_0; - ?? = new ManualResetEventSlim(); - } - - public void ?() - { - ??.Set(); - } - - public void ?(CancellationToken P_0) - { - ??.Wait(P_0); - } - } - - private readonly Period ??; - - private readonly int ??; - - private readonly Queue ??; - - private readonly object ??; - - public ?(Period P_0, int P_1) - { - ?? = P_0; - ?? = P_1; - ?? = new Queue(); - ?? = new object(); - } - - public void ?(CancellationToken P_0) - { - ? result; - lock (??) - { - if (??.Count < ??) - { - ??.Enqueue(new ?(Core.Instance.TimeUtils.DateTimeUtcNow + ??.Duration)); - return; - } - ??.TryPeek(out result); - } - if (result != null) - { - result.?(P_0); - if (!P_0.IsCancellationRequested) - { - ?(P_0); - } - } - } - - public void ?() - { - lock (??) - { - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - ? result; - while (??.Count > 0 && ??.TryPeek(out result) && !(result.ExpirationTime > dateTimeUtcNow)) - { - ??.Dequeue(); - result.?(); - } - } - } - } - internal interface ? - { - void ?(CancellationToken P_0); - - void ?(); - } -} -namespace TradingPlatform.BusinessLayer.Utils.Extensions -{ - public static class GuidExtensions - { - public static string ToShortString(this Guid guid) - { - return Regex.Replace(Convert.ToBase64String(guid.ToByteArray()), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - } - public static class RulesManagerExtensions - { - public static bool IsAllowedBySymbol(this RulesManager rulesManager, Symbol symbol, string ruleName) - { - if (symbol != null) - { - if (rulesManager.IsAllowed(ruleName, symbol).Status != TradingOperationStatus.Allowed) - { - if (symbol != null) - { - return symbol.State == BusinessObjectState.Fake; - } - return false; - } - return true; - } - return false; - } - } - public static class TimeSpanExtensions - { - public static string ToReadable(this TimeSpan timespan) - { - if (timespan.Ticks <= 0) - { - return null; - } - if (timespan.Days > 365) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 2); - defaultInterpolatedStringHandler.AppendFormatted(timespan.Days / 365); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(timespan.Days % 365); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - if (timespan.Days > 0) - { - return timespan.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (timespan.Hours > 0) - { - return timespan.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (timespan.Minutes > 0) - { - return timespan.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return timespan.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - - public static string ToReadableLong(this TimeSpan timespan) - { - if (timespan.Ticks <= 0) - { - return null; - } - StringBuilder stringBuilder = new StringBuilder(); - if (timespan.Days > 365) - { - StringBuilder stringBuilder2 = stringBuilder; - StringBuilder stringBuilder3 = stringBuilder2; - StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(4, 2, stringBuilder2); - handler.AppendFormatted(timespan.Days / 365); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - handler.AppendFormatted(timespan.Days % 365); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - stringBuilder3.Append(ref handler); - } - if (timespan.Days > 0 && timespan.Days < 365) - { - StringBuilder stringBuilder2 = stringBuilder; - StringBuilder stringBuilder4 = stringBuilder2; - StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(2, 1, stringBuilder2); - handler.AppendFormatted(timespan.Days); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - stringBuilder4.Append(ref handler); - } - if (timespan.Hours > 0) - { - StringBuilder stringBuilder2 = stringBuilder; - StringBuilder stringBuilder5 = stringBuilder2; - StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(2, 1, stringBuilder2); - handler.AppendFormatted(timespan.Hours); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - stringBuilder5.Append(ref handler); - } - if (timespan.Minutes > 0) - { - StringBuilder stringBuilder2 = stringBuilder; - StringBuilder stringBuilder6 = stringBuilder2; - StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(2, 1, stringBuilder2); - handler.AppendFormatted(timespan.Minutes); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - stringBuilder6.Append(ref handler); - } - if (timespan.Seconds > 0) - { - StringBuilder stringBuilder2 = stringBuilder; - StringBuilder stringBuilder7 = stringBuilder2; - StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(1, 1, stringBuilder2); - handler.AppendFormatted(timespan.Seconds); - handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - stringBuilder7.Append(ref handler); - } - return stringBuilder.ToString(); - } - - public static TimeSpan ConvertTimeZone(this TimeSpan timeSpan, TimeZoneInfo sourceTimeZone, TimeZoneInfo destinationTimeZone) - { - return TimeZoneInfo.ConvertTime(new DateTime(DateTime.UtcNow.Date.Ticks + timeSpan.Ticks, DateTimeKind.Unspecified), sourceTimeZone, destinationTimeZone).TimeOfDay; - } - } -} -namespace TradingPlatform.BusinessLayer.Utils.EqualityComparers -{ - public class BusinessObjectEqualityComparer : IEqualityComparer - { - public bool Equals(BusinessObject x, BusinessObject y) - { - if (x == y) - { - return true; - } - if (x == null) - { - return false; - } - if (y == null) - { - return false; - } - if (x.GetType() != y.GetType()) - { - return false; - } - if (x.ConnectionId == y.ConnectionId && x.State == y.State) - { - return x.UniqueId == y.UniqueId; - } - return false; - } - - public int GetHashCode(BusinessObject obj) - { - return (int)(((uint)(((obj.ConnectionId != null) ? obj.ConnectionId.GetHashCode() : 0) * 397) ^ (uint)obj.State) * 397) ^ ((obj.UniqueId != null) ? obj.UniqueId.GetHashCode() : 0); - } - } - public class ListEqualityComparer : IEqualityComparer> - { - private readonly IEqualityComparer ??; - - public ListEqualityComparer(IEqualityComparer itemEqualityComparer) - { - ?? = itemEqualityComparer; - } - - public bool Equals(IList x, IList y) - { - if (x == y) - { - return true; - } - if (x == null) - { - return false; - } - if (y == null) - { - return false; - } - if (x.GetType() != y.GetType()) - { - return false; - } - if (x.Count != y.Count) - { - return false; - } - for (int i = 0; i < x.Count; i++) - { - TItem x2 = x[i]; - TItem y2 = y[i]; - if (!??.Equals(x2, y2)) - { - return false; - } - } - return true; - } - - public int GetHashCode(IList list) - { - int num = list.Count.GetHashCode(); - foreach (TItem item in list) - { - num = (num * 397) ^ ??.GetHashCode(item); - } - return num; - } - } - public class PropertyInfoEqualityComparer : IEqualityComparer - { - public bool Equals(PropertyInfo x, PropertyInfo y) - { - if ((object)x == y) - { - return true; - } - if ((object)x == null) - { - return false; - } - if ((object)y == null) - { - return false; - } - if (x.GetType() != y.GetType()) - { - return false; - } - return object.Equals(x.Name, y.Name); - } - - public int GetHashCode(PropertyInfo obj) - { - return obj.Name.GetHashCode(); - } - } - public class SettingItemNameEqualityComparer : IEqualityComparer - { - public bool Equals(SettingItem x, SettingItem y) - { - if (x == y) - { - return true; - } - if (x == null) - { - return false; - } - if (y == null) - { - return false; - } - if (x.GetType() != y.GetType()) - { - return false; - } - return x.Name == y.Name; - } - - public int GetHashCode(SettingItem obj) - { - if (obj.Name == null) - { - return 0; - } - return obj.Name.GetHashCode(); - } - } - public class UniqueIdEqualityComparer : IEqualityComparer - { - public bool Equals(IUniqueID x, IUniqueID y) - { - if (x == y) - { - return true; - } - if (x == null) - { - return false; - } - if (y == null) - { - return false; - } - if (x.GetType() != y.GetType()) - { - return false; - } - return x.UniqueId == y.UniqueId; - } - - public int GetHashCode(IUniqueID obj) - { - if (obj.UniqueId == null) - { - return 0; - } - return obj.UniqueId.GetHashCode(); - } - } -} -namespace TradingPlatform.BusinessLayer.Utils.Comparers -{ - public class TimeInForceComparer : IComparer - { - public int Compare(TimeInForce x, TimeInForce y) - { - return ?(x) - ?(y); - } - - private static int ?(TimeInForce P_0) - { - return P_0 switch - { - TimeInForce.GTC => 0, - TimeInForce.Day => 1, - _ => 10, - }; - } - } -} -namespace TradingPlatform.BusinessLayer.Settings.OTP -{ - public class OTPHolder : IXElementSerialization, ICloneable - { - [CompilerGenerated] - private string ??; - - public Action Callback; - - public string OTPValue - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public void RequestOTP(string title, string text) - { - Core.Instance.RequestOTP(this, title, text); - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OTPValue)); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - OTPValue = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; - } - - public object Clone() - { - return new OTPHolder - { - OTPValue = OTPValue - }; - } - } - [Serializable] - [DataContract] - public sealed class SettingItemOTP : SettingItem - { - public override SettingItemType Type => SettingItemType.OTP; - - [DataMember(Name = "Value")] - [ProtoMember(1, IsRequired = true)] - private OTPHolder ValueOTPHolder - { - get - { - return (OTPHolder)value; - } - set - { - value = oTPHolder; - } - } - - public SettingItemOTP() - { - } - - public SettingItemOTP(string name, OTPHolder value, int sortIndex = 0) - : base(name, value, sortIndex) - { - } - - private SettingItemOTP(SettingItemOTP P_0) - : base(P_0) - { - } - - [NotPublished] - public override SettingItem GetCopy() - { - return new SettingItemOTP(this); - } - - [NotPublished] - public static implicit operator OTPHolder(SettingItemOTP item) - { - return (OTPHolder)item.Value; - } - - [NotPublished] - protected override bool IsValueTypeValid(object value) - { - return value is OTPHolder; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - OTPHolder oTPHolder = new OTPHolder(); - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - oTPHolder.FromXElement(xElement, deserializationInfo); - ValueOTPHolder = oTPHolder; - } - } - } -} -namespace TradingPlatform.BusinessLayer.Settings.Condition -{ - public sealed class ConditionData : IXElementSerialization - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal ConditionSet ?(ConditionSet P_0) - { - return new ConditionSet(P_0); - } - } - - [CompilerGenerated] - private List ??; - - /// - /// Gets or Sets the groups. - /// - public List ConditionGroups - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public ConditionData() - { - ConditionGroups = new List(); - } - - public ConditionData(ConditionData conditions) - { - ConditionGroups = conditions.ConditionGroups.Select((ConditionSet P_0) => new ConditionSet(P_0)).ToList(); - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (ConditionSet conditionGroup in ConditionGroups) - { - xElement2.Add(conditionGroup.ToXElement()); - } - xElement.Add(xElement2); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement? xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - List list = new List(); - foreach (XElement item in xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Elements()) - { - ConditionSet conditionSet = new ConditionSet(); - conditionSet.FromXElement(item, deserializationInfo); - list.Add(conditionSet); - } - ConditionGroups = list; - } - } - public sealed class ConditionItem : IXElementSerialization - { - [CompilerGenerated] - private ConditionOperandBase ??; - - [CompilerGenerated] - private ConditionOperandBase ??; - - [CompilerGenerated] - private TableConditionType ??; - - public ConditionOperandBase Operand1 - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public ConditionOperandBase Operand2 - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public TableConditionType ConditionType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public ConditionItem() - { - } - - public ConditionItem(ConditionItem conditionItem) - { - ConditionType = conditionItem.ConditionType; - Operand1 = conditionItem.Operand1?.Clone() as ConditionOperandBase; - Operand2 = conditionItem.Operand2?.Clone() as ConditionOperandBase; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - ConditionType = (TableConditionType)Enum.Parse(typeof(TableConditionType), element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString()); - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - XElement element2 = xElement.Elements().FirstOrDefault(); - Operand1 = ConditionOperandBase.CreateFromXml(element2, deserializationInfo); - Operand1.FromXElement(element2, deserializationInfo); - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - XElement element3 = xElement2.Elements().FirstOrDefault(); - Operand2 = ConditionOperandBase.CreateFromXml(element3, deserializationInfo); - Operand2.FromXElement(element3, deserializationInfo); - } - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ConditionType.ToString())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Operand1.ToXElement())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Operand2.ToXElement())); - return xElement; - } - } - public sealed class ConditionSet : IXElementSerialization - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal ConditionItem ?(ConditionItem P_0) - { - return new ConditionItem(P_0); - } - } - - [CompilerGenerated] - private List ??; - - public List ConditionItems - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public ConditionSet() - { - ConditionItems = new List(); - } - - public ConditionSet(ConditionSet conditionSet) - { - ConditionItems = conditionSet.ConditionItems.Select((ConditionItem P_0) => new ConditionItem(P_0)).ToList(); - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - List list = new List(); - foreach (XElement item in element.Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - ConditionItem conditionItem = new ConditionItem(); - conditionItem.FromXElement(item, deserializationInfo); - list.Add(conditionItem); - } - ConditionItems = list; - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (ConditionItem conditionItem in ConditionItems) - { - xElement.Add(conditionItem.ToXElement()); - } - return xElement; - } - } - public abstract class ConditionOperandBase : IXElementSerialization, IComparable, ICloneable - { - protected const string XML_TYPE = "Type"; - - public abstract string Name { get; } - - public abstract ConditionOperandBaseType ValueType { get; } - - public static ConditionOperandBase CreateFromXml(XElement element, DeserializationInfo deserializationInfo) - { - string text = element?.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value; - if (text != null) - { - switch (text.Length) - { - case 19: - switch (text[14]) - { - case 't': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new OperandCustomString(); - case 'y': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new OperandCustomSymbol(); - } - break; - case 21: - switch (text[7]) - { - case 'C': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new OperandCustomSelector(); - case 'O': - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new OperandObjectProperty(); - } - break; - case 17: - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new OperandCustomDate(); - case 20: - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new OperandCustomAccount(); - case 29: - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return new OperandObjectPropertySelector(); - } - } - return null; - } - - public abstract object Clone(); - - public int CompareTo(object obj) - { - return Name.CompareTo((obj as ConditionOperandBase)?.Name); - } - - public abstract void FromXElement(XElement element, DeserializationInfo deserializationInfo); - - public abstract XElement ToXElement(); - } - public sealed class OperandCustomString : ConditionOperandBase - { - [CompilerGenerated] - private string ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override ConditionOperandBaseType ValueType => ConditionOperandBaseType.String; - - public string Value - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public OperandCustomString() - { - } - - public OperandCustomString(OperandCustomString operandCustomString) - { - Value = operandCustomString.Value; - } - - public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - Value = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value ?? string.Empty; - } - - public override XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Value)); - return xElement; - } - - public override object Clone() - { - return new OperandCustomString(this); - } - } - public sealed class OperandCustomDate : ConditionOperandBase - { - private const string ?? = "ddMMyyyy HH:mm:ss.ffffff"; - - [CompilerGenerated] - private DateTime ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override ConditionOperandBaseType ValueType => ConditionOperandBaseType.Date; - - public DateTime Value - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public OperandCustomDate() - { - } - - public OperandCustomDate(OperandCustomDate operandCustomDate) - { - Value = operandCustomDate.Value; - } - - public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - Value = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToDateTime(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? default(DateTime); - } - - public override XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Value.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo.InvariantCulture))); - return xElement; - } - - public override object Clone() - { - return new OperandCustomDate(this); - } - } - public sealed class OperandObjectProperty : ConditionOperandBase - { - private string ??; - - private ConditionOperandBaseType ??; - - public override string Name => ??; - - public override ConditionOperandBaseType ValueType => ??; - - public OperandObjectProperty() - { - } - - public OperandObjectProperty(string name, ConditionOperandBaseType valueType) - { - ?? = name; - ?? = valueType; - } - - public OperandObjectProperty(OperandObjectProperty operandCustomDate) - { - ?? = operandCustomDate.Name; - ?? = operandCustomDate.ValueType; - } - - public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - ?? = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; - ?? = (ConditionOperandBaseType)element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt(); - } - - public override XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)ValueType)); - return xElement; - } - - public override object Clone() - { - return new OperandObjectProperty(this); - } - } - public sealed class OperandCustomSymbol : ConditionOperandBase - { - [CompilerGenerated] - private Symbol ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override ConditionOperandBaseType ValueType => ConditionOperandBaseType.Symbol; - - public Symbol Value - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public OperandCustomSymbol() - { - } - - public OperandCustomSymbol(OperandCustomSymbol operandCustomDate) - { - Value = operandCustomDate.Value; - } - - public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - SymbolInfo empty = SymbolInfo.Empty; - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - empty.FromXElement(xElement, deserializationInfo); - if (!(empty == BusinessObjectInfo.Empty) && !(empty == SymbolInfo.Empty)) - { - Value = Core.Instance.GetSymbol(empty); - } - } - } - - public override XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); - xElement.Add((Value?.CreateInfo() ?? BusinessObjectInfo.Empty).ToXElement()); - return xElement; - } - - public override object Clone() - { - return new OperandCustomSymbol(this); - } - } - public sealed class OperandCustomAccount : ConditionOperandBase - { - [CompilerGenerated] - private Account ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override ConditionOperandBaseType ValueType => ConditionOperandBaseType.Account; - - public Account Value - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public OperandCustomAccount() - { - } - - public OperandCustomAccount(OperandCustomAccount operandCustomDate) - { - Value = operandCustomDate.Value; - } - - public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - SymbolInfo empty = SymbolInfo.Empty; - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - empty.FromXElement(xElement, deserializationInfo); - if (!(empty == BusinessObjectInfo.Empty) && !(empty == SymbolInfo.Empty)) - { - Value = Core.Instance.GetAccount(empty); - } - } - } - - public override XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); - xElement.Add((Value?.CreateInfo() ?? BusinessObjectInfo.Empty).ToXElement()); - return xElement; - } - - public override object Clone() - { - return new OperandCustomAccount(this); - } - } - public sealed class OperandCustomSelector : ConditionOperandBase - { - [CompilerGenerated] - private SelectItem ??; - - public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public override ConditionOperandBaseType ValueType => ConditionOperandBaseType.Selector; - - public SelectItem SelectedItem - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public OperandCustomSelector() - { - } - - public OperandCustomSelector(OperandCustomSelector operandCustomSelector) - { - SelectedItem = operandCustomSelector.SelectedItem; - } - - public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - string value = xElement.Value; - if (int.TryParse(value, out var result)) - { - SelectedItem = new SelectItem(string.Empty, result); - } - else - { - SelectedItem = new SelectItem(string.Empty, value); - } - } - } - - public override XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); - string content = string.Empty; - if (SelectedItem == null) - { - content = string.Empty; - } - else if (SelectedItem.Value is int || SelectedItem.Value is Enum) - { - content = ((int)(object)SelectedItem.Value).ToString(); - } - else if (SelectedItem.Value != null) - { - content = SelectedItem.Value.ToString(); - } - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), content)); - return xElement; - } - - public override object Clone() - { - return new OperandCustomSelector(this); - } - } - public sealed class OperandObjectPropertySelector : ConditionOperandBase - { - private string ??; - - public List Items; - - public override string Name => ??; - - public override ConditionOperandBaseType ValueType => ConditionOperandBaseType.Selector; - - public OperandObjectPropertySelector() - { - } - - public OperandObjectPropertySelector(string name, List items) - { - ?? = name; - Items = items; - } - - public OperandObjectPropertySelector(OperandObjectPropertySelector operandCustomDate) - { - ?? = operandCustomDate.Name; - Items = operandCustomDate.Items; - } - - public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - ?? = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; - } - - public override XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); - return xElement; - } - - public override object Clone() - { - return new OperandObjectPropertySelector(this); - } - } - public enum ConditionOperandBaseType - { - Numeric, - Date, - String, - Symbol, - Account, - Selector - } - [Serializable] - [DataContract] - public sealed class SettingItemCondition : SettingItem - { - [CompilerGenerated] - private List ??; - - public override SettingItemType Type => SettingItemType.Condition; - - public List AvailableOperands - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Value")] - private ConditionData ValueConditionData - { - get - { - return Value as ConditionData; - } - set - { - Value = conditionData; - } - } - - public SettingItemCondition() - { - } - - public SettingItemCondition(string name, object value, List operands, int sortIndex = 0) - : base(name, value, sortIndex) - { - AvailableOperands = operands; - } - - private SettingItemCondition(SettingItemCondition P_0) - : base(P_0) - { - AvailableOperands = new List(P_0.AvailableOperands); - } - - public override SettingItem GetCopy() - { - return new SettingItemCondition(this); - } - - protected override bool IsValueTypeValid(object value) - { - return value is ConditionData; - } - - protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) - { - ConditionData conditionData = new ConditionData(); - conditionData.FromXElement(element, deserializationInfo); - value = conditionData; - } - } -} -namespace TradingPlatform.BusinessLayer.Settings.Comparers -{ - public class SettingItemNameComparer : IEqualityComparer - { - public bool Equals(SettingItem x, SettingItem y) - { - if (x == y) - { - return true; - } - if (x == null) - { - return false; - } - if (y == null) - { - return false; - } - if (x.GetType() != y.GetType()) - { - return false; - } - return string.Equals(x.Name, y.Name, StringComparison.InvariantCulture); - } - - public int GetHashCode(SettingItem obj) - { - if (obj.Name == null) - { - return 0; - } - return StringComparer.InvariantCulture.GetHashCode(obj.Name); - } - } -} -namespace TradingPlatform.BusinessLayer.Native -{ - /// - /// Specifies constants that define which mouse button was pressed. - /// - [Flags] - public enum NativeMouseButtons - { - /// - /// No mouse button was pressed. - /// - None = 0, - /// - /// The left mouse button was pressed. - /// - Left = 0x100000, - /// - /// The right mouse button was pressed. - /// - Right = 0x200000, - /// - /// The middle mouse button was pressed. - /// - Middle = 0x400000, - /// - /// The first XButton was pressed. - /// - XButton1 = 0x800000, - /// - /// The second XButton was pressed. - /// - XButton2 = 0x1000000 - } - public class NativeMouseEventArgs - { - [CompilerGenerated] - private readonly NativeMouseButtons ??; - - [CompilerGenerated] - private readonly int ??; - - [CompilerGenerated] - private readonly int ??; - - [CompilerGenerated] - private readonly int ??; - - [CompilerGenerated] - private readonly int ??; - - [CompilerGenerated] - private bool ??; - - public NativeMouseButtons Button - { - [CompilerGenerated] - get - { - return ??; - } - } - - public int Clicks - { - [CompilerGenerated] - get - { - return ??; - } - } - - public int X - { - [CompilerGenerated] - get - { - return ??; - } - } - - public int Y - { - [CompilerGenerated] - get - { - return ??; - } - } - - public int Delta - { - [CompilerGenerated] - get - { - return ??; - } - } - - public Point Location => new Point(X, Y); - - /// - /// Gets or sets a value indicating whether the event was handled. - /// true to bypass the control's default handling; otherwise, false to also pass the event along to the default control handler. - /// - public bool Handled - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public NativeMouseEventArgs(NativeMouseButtons button, int clicks, int x, int y, int delta) - { - ?? = x; - ?? = y; - ?? = clicks; - ?? = button; - ?? = delta; - } - } -} -namespace TradingPlatform.BusinessLayer.Modules -{ - public abstract class OrderPlacingStrategy : ExecutionEntity - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - internal bool ?(SettingItem P_0) - { - return P_0.VisibilityMode != VisibilityMode.Hidden; - } - - internal string ?(SettingItem P_0) - { - return P_0.ToString(); - } - } - - [CompilerGenerated] - private sealed class ? - { - public DateTime ??; - - public DateTime ??; - - internal bool ?(LoggerEvent P_0) - { - return P_0.Date > ??; - } - - internal bool ?(LoggerEvent P_0) - { - return P_0.Date < ??; - } - } - - private OrderPlacingStrategyState ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - public readonly DateTime CreationTime; - - private readonly List ??; - - [CompilerGenerated] - private PlaceOrderRequestParameters ??; - - public OrderPlacingStrategyState State - { - get - { - return ??; - } - private set - { - ?? = orderPlacingStrategyState; - ???.Invoke(??); - } - } - - public PlaceOrderRequestParameters LastPlaceRequest - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public event Action StateChanged - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - /// - /// Event occurred when write a new log - /// - public event Action NewLog - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public OrderPlacingStrategy() - { - CreationTime = Core.Instance.TimeUtils.DateTimeUtcNow; - ?? = new List(); - } - - public TradingOperationResult PlaceOrder(PlaceOrderRequestParameters placeOrderRequest) - { - if (State != OrderPlacingStrategyState.Ready) - { - return TradingOperationResult.CreateError(placeOrderRequest.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - try - { - State = OrderPlacingStrategyState.Processing; - LastPlaceRequest = placeOrderRequest; - Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - OnPlaceOrder(placeOrderRequest.Clone() as PlaceOrderRequestParameters); - } - catch (TaskCanceledException) - { - } - catch (OperationCanceledException) - { - } - catch (AggregateException ex3) when (ex3.InnerException is TaskCanceledException) - { - } - catch (Exception exception) - { - Exception ex4 = exception.GetInnerExceptionsRecursive().Last(); - string text = base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ex4.Message; - Log(text, StrategyLoggingLevel.Error); - State = OrderPlacingStrategyState.Error; - placeOrderRequest.Symbol.ConnectionCache.Push(MessageDealTicket.CreateRefuseDealTicket(text)); - return TradingOperationResult.CreateError(placeOrderRequest.RequestId, text); - } - finally - { - if (State == OrderPlacingStrategyState.Processing) - { - State = OrderPlacingStrategyState.Finished; - Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - return TradingOperationResult.CreateSuccess(placeOrderRequest.RequestId); - } - - public void Cancel() - { - if (State != OrderPlacingStrategyState.Processing) - { - return; - } - try - { - State = OrderPlacingStrategyState.Cancelling; - OnCancel(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - State = OrderPlacingStrategyState.Cancelled; - } - } - - public void Remove() - { - Core.Instance.OrderPlacingStrategies.?(this); - } - - public override void Dispose() - { - if (State == OrderPlacingStrategyState.Processing) - { - Cancel(); - } - ??.Clear(); - base.Dispose(); - } - - public virtual string FormatParameters() - { - return string.Join(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), from P_0 in Settings - where P_0.VisibilityMode != VisibilityMode.Hidden - select P_0.ToString()); - } - - /// - /// Get logs from the strategy for specified date range - /// - /// - /// - /// - public LoggerEvent[] GetLogs(DateTime from, DateTime to) - { - return (from P_0 in ?? - where P_0.Date > @from - where P_0.Date < to - select P_0).ToArray(); - } - - protected abstract void OnPlaceOrder(PlaceOrderRequestParameters placeOrderRequest); - - protected abstract void OnCancel(); - - /// - /// Write log message - /// - /// - /// - protected void Log(string message, StrategyLoggingLevel level = StrategyLoggingLevel.Info) - { - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - LoggingLevel type = LoggingLevel.System; - switch (level) - { - case StrategyLoggingLevel.Trading: - type = LoggingLevel.Trading; - break; - case StrategyLoggingLevel.Error: - type = LoggingLevel.Error; - break; - } - LoggerEvent loggerEvent = new LoggerEvent - { - Date = dateTimeUtcNow, - Event = message, - Type = type - }; - ??.Add(loggerEvent); - ???.Invoke(loggerEvent); - } - } - public enum OrderPlacingStrategyState - { - Ready, - Processing, - Finished, - Cancelling, - Cancelled, - Error - } -} -namespace TradingPlatform.BusinessLayer.Modules.PlaceOrderStrategies -{ - public sealed class OrderPlacingStrategyInfo : ScriptInfo, IComparable - { - [CompilerGenerated] - private string ??; - - public string ObsoleteText - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - internal OrderPlacingStrategyInfo(ConstructorInfo P_0, ScriptCreationType P_1, string P_2, string P_3) - : base(P_0, P_1, P_2, P_3) - { - } - - protected override void Initialize(string relativePath, string assemblyName) - { - using OrderPlacingStrategy orderPlacingStrategy = ctor.Invoke(null) as OrderPlacingStrategy; - base.Name = orderPlacingStrategy.Name; - base.Description = orderPlacingStrategy.Description; - base.Version = orderPlacingStrategy.Version; - base.Settings = orderPlacingStrategy.Settings as List; - base.Key = new ScriptKey(base.ScriptCreationType, relativePath, assemblyName, base.Name); - if (orderPlacingStrategy.GetType().GetCustomAttributes(typeof(ObsoleteAttribute), inherit: true).FirstOrDefault() is ObsoleteAttribute obsoleteAttribute) - { - ObsoleteText = obsoleteAttribute.Message; - } - } - - internal OrderPlacingStrategy ?() - { - OrderPlacingStrategy orderPlacingStrategy = ctor?.Invoke(null) as OrderPlacingStrategy; - if (orderPlacingStrategy != null) - { - orderPlacingStrategy.Key = base.Key; - } - return orderPlacingStrategy; - } - - public int CompareTo(object obj) - { - if (!(obj is OrderPlacingStrategyInfo orderPlacingStrategyInfo)) - { - return 0; - } - return string.Compare(base.Key.ToString(), orderPlacingStrategyInfo.Key.ToString(), StringComparison.Ordinal); - } - } -} -namespace TradingPlatform.BusinessLayer.LocalOrders -{ - public class LocalOrder : BindableEntity, IOrder, ITradingObject, IUniqueID, IDisposable - { - public class OrderTypeRules - { - private readonly IDictionary ??; - - private ? ??; - - internal OrderTypeRules() - { - ?? = new Dictionary(); - } - - public void SetRule(string ruleName, T value) - { - ? ? = new ?(ruleName, value); - ??[ruleName] = ?; - ?(?); - } - - internal void ?(? P_0) - { - ?? = P_0; - foreach (Rule value in ??.Values) - { - ?(value); - } - } - - private void ?(Rule P_0) - { - if (?? != null) - { - if (??.Rules.?(P_0.Name)) - { - ??.Rules[P_0.Name] = P_0; - } - else - { - ??.Rules.?(P_0.Name, P_0); - } - } - } - } - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private readonly Account ??; - - private readonly Symbol ??; - - [CompilerGenerated] - private readonly Side ??; - - private readonly OrderType ??; - - [CompilerGenerated] - private TimeInForce ??; - - [CompilerGenerated] - private readonly string ??; - - [CompilerGenerated] - private OrderStatus ??; - - [CompilerGenerated] - private DateTime ??; - - private double ??; - - private double ??; - - private double ??; - - private double ??; - - private string ??; - - [CompilerGenerated] - private AdditionalInfoCollection ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private readonly OrderTypeRules ??; - - public string UniqueId => Id; - - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - public Account Account - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public Symbol Symbol - { - get - { - return ??; - } - init - { - ?? = value; - if (OrderType != null) - { - OrderType.ConnectionId = Symbol.ConnectionId; - } - } - } - - public Side Side - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public OrderType OrderType - { - get - { - return ??; - } - init - { - ?? = value; - if (OrderType != null) - { - OrderType.ConnectionId = Symbol?.ConnectionId; - Rules.?(OrderType); - } - } - } - - public string OrderTypeId => OrderType?.Id; - - public TimeInForce TimeInForce - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string GroupId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public OrderStatus Status - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = orderStatus; - } - } - - public DateTime LastUpdateTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - public double TotalQuantity - { - get - { - return ??; - } - set - { - SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public double Price - { - get - { - return ??; - } - set - { - SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public double TriggerPrice - { - get - { - return ??; - } - set - { - SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public double TrailOffset - { - get - { - return ??; - } - set - { - SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public string Comment - { - get - { - return ??; - } - set - { - SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public string PositionId => null; - - public SlTpHolder StopLoss => null; - - public SlTpHolder TakeProfit => null; - - public SlTpHolder[] StopLossItems => Array.Empty(); - - public SlTpHolder[] TakeProfitItems => Array.Empty(); - - public string ConnectionId => Symbol?.ConnectionId; - - public DateTime ExpirationTime => default(DateTime); - - public BusinessObjectState State => BusinessObjectState.Normal; - - public double RemainingQuantity => TotalQuantity; - - public double FilledQuantity => 0.0; - - public string OriginalStatus => null; - - public double AverageFillPrice => double.NaN; - - public AdditionalInfoCollection AdditionalInfo - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public OrderTypeRules Rules - { - [CompilerGenerated] - get - { - return ??; - } - } - - public event Action Updated - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public LocalOrder() - { - ?? = new OrderTypeRules(); - base.PropertyChanged += ?; - } - - public void Dispose() - { - base.PropertyChanged -= ?; - } - - private void ?(object P_0, PropertyChangedEventArgs P_1) - { - LastUpdateTime = Core.Instance.TimeUtils.DateTimeUtcNow; - ?(); - } - - public override string ToString() - { - double price = (double.IsNaN(TriggerPrice) ? Price : TriggerPrice); - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 7); - defaultInterpolatedStringHandler.AppendFormatted(Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderType.Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(TimeInForce.Format(ExpirationTime)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Symbol.FormatQuantity(TotalQuantity)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Symbol); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Symbol.FormatPrice(price)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Account); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - internal void ?(ModifyOrderRequestParameters P_0) - { - TimeInForce = P_0.TimeInForce; - ?? = P_0.Quantity; - ?? = P_0.Price; - ?? = P_0.TriggerPrice; - ?? = P_0.TrailOffset; - ?? = P_0.Comment; - AdditionalInfo?.?(P_0.AdditionalParameters); - ?(); - } - - private void ?() - { - ???.Invoke(this); - } - } - public class LocalOrderEventArgs : EntityLifecycleEventArgs - { - [CompilerGenerated] - private readonly LocalOrder ??; - - public LocalOrder LocalOrder - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - } - public class LocalOrdersManager : IDisposable, IEnumerable, IEnumerable - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func, string> ??; - - internal string ?(KeyValuePair P_0) - { - return P_0.Key; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Connection ??; - - internal bool ?(KeyValuePair P_0) - { - return P_0.Value.ConnectionId == ??.Id; - } - } - - private readonly IDictionary ??; - - private readonly object ??; - - [CompilerGenerated] - private EventHandler ??; - - public event EventHandler Updated - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - public LocalOrdersManager() - { - ?? = new Dictionary(); - ?? = new object(); - } - - public void Initialize() - { - Core.Instance.Connections.ConnectionStateChanged += ?; - } - - public string AddOrder(LocalOrder localOrder) - { - localOrder.Id = Guid.NewGuid().ToShortString(); - lock (??) - { - ??.Add(localOrder.Id, localOrder); - } - localOrder.Updated += ?; - ?(localOrder, EntityLifecycle.Created); - return localOrder.Id; - } - - public bool RemoveOrder(string orderId) - { - LocalOrder value; - lock (??) - { - if (??.TryGetValue(orderId, out value)) - { - ??.Remove(orderId); - } - } - if (value == null) - { - return false; - } - value.Updated -= ?; - value.Dispose(); - ?(value, EntityLifecycle.Removed); - return true; - } - - public bool TryHandleTradingOperationRequest(TradingRequestParameters requestParameters, out TradingOperationResult result) - { - result = null; - if (!(requestParameters is ModifyOrderRequestParameters modifyOrderRequestParameters)) - { - if (requestParameters is CancelOrderRequestParameters cancelOrderRequestParameters) - { - return ?(cancelOrderRequestParameters, out result); - } - return false; - } - return ?(modifyOrderRequestParameters, out result); - } - - private bool ?(ModifyOrderRequestParameters P_0, out TradingOperationResult P_1) - { - P_1 = null; - if (!?(P_0.OrderId, out var localOrder)) - { - return false; - } - localOrder.?(P_0); - P_1 = TradingOperationResult.CreateSuccess(P_0.RequestId); - return true; - } - - private bool ?(CancelOrderRequestParameters P_0, out TradingOperationResult P_1) - { - bool flag = RemoveOrder(P_0.OrderId); - P_1 = (flag ? TradingOperationResult.CreateSuccess(P_0.RequestId) : TradingOperationResult.CreateError(P_0.RequestId, string.Empty)); - return flag; - } - - public void Dispose() - { - Core.Instance.Connections.ConnectionStateChanged -= ?; - lock (??) - { - foreach (LocalOrder value in ??.Values) - { - value.Updated -= ?; - } - ??.Clear(); - } - } - - private void ?(object P_0, ConnectionStateChangedEventArgs P_1) - { - if (P_1.NewState != ConnectionState.Disconnected && P_1.NewState != ConnectionState.ConnectionLost) - { - return; - } - Connection ?? = P_0 as Connection; - if (?? == null) - { - return; - } - List list; - lock (??) - { - list = (from keyValuePair in ?? - where keyValuePair.Value.ConnectionId == ??.Id - select keyValuePair.Key).ToList(); - } - foreach (string item in list) - { - RemoveOrder(item); - } - } - - private bool ?(string P_0, out LocalOrder P_1) - { - P_1 = null; - lock (??) - { - ??.TryGetValue(P_0, out P_1); - } - return P_1 != null; - } - - private void ?(IOrder P_0) - { - if (P_0 is LocalOrder localOrder) - { - ?(localOrder, EntityLifecycle.Changed); - } - } - - private void ?(LocalOrder P_0, EntityLifecycle P_1) - { - ???.InvokeSafely(this, new LocalOrderEventArgs - { - LocalOrder = P_0, - Lifecycle = P_1 - }); - } - - public IEnumerator GetEnumerator() - { - lock (??) - { - return ??.Values.GetEnumerator(); - } - } - - private IEnumerator ?() - { - return GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - //ILSpy generated this explicit interface implementation from .override directive in ? - return this.?(); - } - } -} -namespace TradingPlatform.BusinessLayer.Licence -{ - public sealed class LicenceItem - { - [CompilerGenerated] - private readonly string ??; - - [CompilerGenerated] - private readonly string ??; - - [CompilerGenerated] - private readonly DateTime ??; - - [CompilerGenerated] - private readonly DateTime ??; - - public string LicenceKey - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public string Value - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public DateTime StartDate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public DateTime EndDate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - } -} -namespace ? -{ - internal sealed class ? : JsonConverter - { - private const string ?? = "StartDateTicks"; - - private const string ?? = "EndDateTicks"; - - public override LicenceItem Read(ref Utf8JsonReader reader, Type type, JsonSerializerOptions options) - { - string text = null; - string licenceKey = string.Empty; - string value = null; - DateTime startDate = default(DateTime); - DateTime endDate = default(DateTime); - while (reader.Read()) - { - JsonTokenType tokenType = reader.TokenType; - switch (tokenType) - { - case JsonTokenType.EndObject: - return new LicenceItem - { - LicenceKey = licenceKey, - Value = value, - StartDate = startDate, - EndDate = endDate - }; - case JsonTokenType.PropertyName: - text = reader.GetString(); - break; - case JsonTokenType.String: - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - value = reader.GetString(); - } - } - else - { - licenceKey = reader.GetString(); - } - break; - case JsonTokenType.Number: - if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - if (text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - endDate = new DateTime(reader.GetInt64(), DateTimeKind.Utc); - } - } - else - { - startDate = new DateTime(reader.GetInt64(), DateTimeKind.Utc); - } - break; - default: - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(20, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(tokenType); - throw new ArgumentOutOfRangeException(defaultInterpolatedStringHandler.ToStringAndClear()); - } - case JsonTokenType.None: - case JsonTokenType.StartObject: - case JsonTokenType.StartArray: - case JsonTokenType.EndArray: - case JsonTokenType.Comment: - case JsonTokenType.True: - case JsonTokenType.False: - case JsonTokenType.Null: - break; - } - } - return null; - } - - public override void Write(Utf8JsonWriter writer, LicenceItem value, JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value.LicenceKey); - writer.WriteString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value.LicenceKey); - writer.WriteNumber(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value.StartDate.Ticks); - writer.WriteNumber(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value.EndDate.Ticks); - writer.WriteEndObject(); - } - } -} -namespace TradingPlatform.BusinessLayer.Licence -{ - /// - /// Constants for licence keys - /// - public static class CoreLicenceKeys - { - public const string BASIC_PACKAGE = "BASIC_PACKAGE"; - - public const string PREMIUM_PACKAGE = "PREMIUM_PACKAGE"; - - public const string PREMIUM_PLUS_PACKAGE = "PREMIUM_PLUS_PACKAGE"; - - public const string ALL_IN_ONE_PACKAGE = "ALLINONE_PACKAGE"; - - public const string CRYPTO_PACKAGE = "CRYPTO_PACKAGE"; - - public const string CRYPTO_INDIA_PACKAGE = "CRYPTO_INDIA_PACKAGE"; - - public const string VOLUMEANALYSIS_PACKAGE = "VOLUMEANALYSIS_PACKAGE"; - - public const string POWERTRADES_PACKAGE = "POWERTRADES_PACKAGE"; - - public const string DOMSURFACE_PACKAGE = "DOMSURFACE_PACKAGE"; - - public const string ORDERFLOW_PACKAGE = "ORDERFLOW_PACKAGE"; - - public const string TPOCHART_PACKAGE = "TPOCHART_PACKAGE"; - - public const string MULTI_ASSET_PACKAGE = "MULTI_ASSET_PACKAGE"; - - public const string OPTIONS_PACKAGE = "OPTIONS_PACKAGE"; - - public const string CUSTOMER = "CUSTOMER"; - - public const string PROP_LICENSE = "PROP_LICENSE"; - - public const string MIRROR_TRADING = "MIRROR_TRADING"; - - public const string TRADING_SIGNAL_PACKAGE = "TRADING_SIGNAL_PACKAGE"; - - public const string EXTENDED_HISTOR?_PACKAGE = "EXTENDED_HISTOR?_PACKAGE "; - - public const string QUANTOWER_LITE = "QUANTOWER_LITE"; - - public const string QUANTOWER_ADVANCED_EQUITY = "QUANTOWER_ADVANCED_EQUITY"; - - public const string QUANTOWER_ADVANCED_INDICES = "QUANTOWER_ADVANCED_INDICES"; - - public const string QUANTOWER_ADVANCED_COMMODITY = "QUANTOWER_ADVANCED_COMMODITY"; - - public const string QUANTOWER_ADVANCED_EQUITY_COMMODITIES = "QUANTOWER_ADVANCED_EQUITY_COMMODITIES"; - - public const string TRUEDATA_NSECD_PACKAGE = "TRUEDATA_NSECD_PACKAGE"; - - public const string TRUEDATA_NSECM_PACKAGE = "TRUEDATA_NSECM_PACKAGE"; - - public const string TRUEDATA_NSEFO_PACKAGE = "TRUEDATA_NSEFO_PACKAGE"; - - public const string TRUEDATA_MCX_PACKAGE = "TRUEDATA_MCX_PACKAGE"; - - public const string TRUEDATA_VELOCITY = "TRUEDATA_VELOCITY"; - - public const string CEDROMARKETDATA_PACKAGE = "CEDROMARKETDATA_PACKAGE"; - - public static string GetRuleDescription(string ruleId) - { - if (ruleId != null) - { - switch (ruleId.Length) - { - case 14: - { - char c = ruleId[0]; - if (c != 'C') - { - switch (c) - { - case 'M': - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 'Q': - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - break; - } - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - goto IL_0363; - } - case 20: - { - char c = ruleId[0]; - if (c != 'C') - { - if (c != 'P' || !(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - goto IL_0363; - } - case 19: - switch (ruleId[0]) - { - case 'M': - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 'P': - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - break; - case 15: - switch (ruleId[0]) - { - case 'P': - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 'O': - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - break; - case 16: - switch (ruleId[0]) - { - case 'A': - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 'T': - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - break; - case 22: - switch (ruleId[0]) - { - case 'V': - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 'T': - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - break; - case 17: - switch (ruleId[0]) - { - case 'O': - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 'T': - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - break; - case 13: - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 18: - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 8: - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 12: - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 25: - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 26: - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 28: - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 37: - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 23: - { - if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - IL_0363: - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - } - return ruleId; - } - } - /// - /// User licences info store - /// - public sealed class LicencesManager : IDisposable, ICustomizable - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func ??; - - internal bool ?(LicenceItem P_0) - { - return P_0.LicenceKey != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - - internal string ?(LicenceItem P_0) - { - return P_0.LicenceKey; - } - - internal bool ?(LicenceItem P_0) - { - return P_0.EndDate >= Core.Instance.TimeUtils.DateTimeUtcNow; - } - } - - private const string ?? = "https://gateway.accounts.quantower.com/"; - - private const string ?? = "refresh_token"; - - [CompilerGenerated] - private EventHandler ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - private ConnectionState ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private UserInfo ??; - - [CompilerGenerated] - private string ??; - - private IDictionary ??; - - private HttpClient ??; - - private HttpClient ??; - - private Timer ??; - - private string ??; - - private string ??; - - private string ??; - - private string ??; - - private LicenceItem ??; - - private LicenceItem ??; - - private LicenceItem ??; - - private LicenceItem ??; - - private LicenceItem ??; - - private LicenceItem ??; - - private LicenceItem ??; - - private LicenceItem ??; - - private LicenceItem ??; - - /// - /// Current state of connection to licence server - /// - public ConnectionState State - { - get - { - return ??; - } - private set - { - if (?? != connectionState) - { - LicenseManagerEventArgs e = new LicenseManagerEventArgs(??, connectionState); - ?? = connectionState; - ???.InvokeSafely(this, e); - } - } - } - - public string LastErrorText - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - /// - /// Current connected user info - /// - public UserInfo CurrentUser - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = userInfo; - } - } - - public string AccessToken - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public IList Settings - { - get - { - return new List - { - new SettingItemPassword(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new PasswordHolder(??, SavePassword: true, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())) - }; - } - set - { - foreach (SettingItem item in value) - { - if (!(item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - continue; - } - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - if (!string.IsNullOrEmpty(?? = (item.Value as PasswordHolder)?.Password)) - { - Task.Factory.StartNew(delegate - { - if (State == ConnectionState.Disconnected && !string.IsNullOrEmpty(??)) - { - State = ConnectionState.Connecting; - ?(); - } - }).Wait(); - } - else if (item.Value is PasswordHolder { FailedToRestorePassword: not false }) - { - LastErrorText = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Error); - State = ConnectionState.Disconnected; - } - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - } - } - } - - /// - /// All active licences that user have - /// - public IEnumerable AllLicenceItems => ??.Values; - - public event EventHandler StateChanged - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - public event Action LicenceRulesUpdated - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - public event Action LicenceCheckError - { - [CompilerGenerated] - add - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Combine(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - [CompilerGenerated] - remove - { - Action action = ??; - Action action2; - do - { - action2 = action; - Action value2 = (Action)Delegate.Remove(action2, value); - action = Interlocked.CompareExchange(ref ??, value2, action2); - } - while ((object)action != action2); - } - } - - internal LicencesManager() - { - ?? = ConnectionState.Disconnected; - ?? = new LicenceItem - { - LicenceKey = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), - StartDate = DateTime.UtcNow.AddDays(-10.0), - EndDate = DateTime.UtcNow.AddYears(100) - }; - ?? = new LicenceItem - { - LicenceKey = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - StartDate = DateTime.UtcNow.AddDays(-10.0), - EndDate = DateTime.UtcNow.AddYears(100) - }; - ?? = new LicenceItem - { - LicenceKey = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - StartDate = DateTime.UtcNow.AddDays(-10.0), - EndDate = DateTime.UtcNow.AddYears(100) - }; - ?? = new LicenceItem - { - LicenceKey = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - StartDate = DateTime.UtcNow.AddDays(-10.0), - EndDate = DateTime.UtcNow.AddYears(100) - }; - ?? = new LicenceItem - { - LicenceKey = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - StartDate = DateTime.UtcNow.AddDays(-10.0), - EndDate = DateTime.UtcNow.AddYears(100) - }; - ?? = new LicenceItem - { - LicenceKey = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - StartDate = DateTime.UtcNow.AddDays(-10.0), - EndDate = DateTime.UtcNow.AddYears(100) - }; - ?? = new LicenceItem - { - LicenceKey = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - StartDate = DateTime.UtcNow.AddDays(-10.0), - EndDate = DateTime.UtcNow.AddYears(100) - }; - ?? = new LicenceItem - { - LicenceKey = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - StartDate = DateTime.UtcNow.AddDays(-10.0), - EndDate = DateTime.UtcNow.AddYears(100) - }; - ?? = new LicenceItem - { - LicenceKey = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - StartDate = DateTime.UtcNow.AddDays(-10.0), - EndDate = DateTime.UtcNow.AddYears(100) - }; - } - - internal void ?() - { - ?? = new ReadOnlyDictionary(new Dictionary()); - ?? = new HttpClient(new HttpClientHandler - { - ServerCertificateCustomValidationCallback = ? - }); - ?? = new HttpClient(new HttpClientHandler - { - ServerCertificateCustomValidationCallback = ? - }); - } - - public void Dispose() - { - ?(); - if (?? != null) - { - ??.Dispose(); - ?? = null; - } - if (?? != null) - { - ??.Dispose(); - ?? = null; - } - } - - public void ConnectToAuthServer() - { - if (State != ConnectionState.Disconnected) - { - return; - } - LastErrorText = null; - try - { - ?? = ?(); - if (string.IsNullOrEmpty(??)) - { - throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - AccessToken = string.Empty; - ?? = string.Empty; - ?? = string.Empty; - OidcClient oidcClient = ?(); - LoginRequest request = new LoginRequest - { - BrowserDisplayMode = DisplayMode.Visible, - BrowserTimeout = 300 - }; - LoginResult result = oidcClient.LoginAsync(request).Result; - State = ConnectionState.Connecting; - AccessToken = result.AccessToken; - ?? = result.RefreshToken; - ?? = result.IdentityToken; - if (result.IsError) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + result.Error, LoggingLevel.Error); - State = ConnectionState.Disconnected; - return; - } - UserInfoResult result2 = oidcClient.GetUserInfoAsync(AccessToken).Result; - if (result2.IsError) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + result2.Error, LoggingLevel.Error); - } - else - { - CurrentUser = new UserInfo(result2.Claims); - } - ?? = ?(); - if (string.IsNullOrEmpty(??)) - { - throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ?(); - ?(); - State = ConnectionState.Connected; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - LastErrorText = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ex.Message; - State = ConnectionState.Disconnected; - } - } - - public void Disconnect() - { - if (State != ConnectionState.Connected) - { - return; - } - State = ConnectionState.Disconnecting; - try - { - OidcClient oidcClient = ?(); - LogoutRequest request = new LogoutRequest - { - IdTokenHint = ?? - }; - oidcClient.LogoutAsync(request).Wait(); - ?(); - ?? = null; - LastErrorText = null; - State = ConnectionState.Disconnected; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - State = ConnectionState.Disconnected; - } - } - - /// - /// Check that user have licence - /// - public LicenceItem GetLicenceRuleItem(string itemKey) - { - if (Encryptor.UnicDeviceId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || Encryptor.UnicDeviceId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || Encryptor.UnicDeviceId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - return ??; - } - ??.TryGetValue(itemKey, out var value); - return value; - } - - public void OnLicenceCheckError(string errorText, string licenceItemKey) - { - ??.InvokeSafely(errorText, licenceItemKey); - } - - private void ?() - { - if (?? == null) - { - ?? = new Timer(?); - ??.Change(TimeSpan.Zero, TimeSpan.FromMinutes(2.0)); - } - } - - private void ?(object P_0) - { - try - { - ?(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - private void ?() - { - ImmutableDictionary immutableDictionary = (from P_0 in ?() - where P_0.LicenceKey != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - select P_0).ToImmutableDictionary((LicenceItem P_0) => P_0.LicenceKey); - if (?(??, immutableDictionary)) - { - ?? = new ReadOnlyDictionary(immutableDictionary); - ???.Invoke(); - } - } - - private void ?() - { - LastErrorText = null; - try - { - AccessToken = string.Empty; - ?? = string.Empty; - ?? = ?(); - OidcClient oidcClient = ?(); - RefreshTokenResult result = oidcClient.RefreshTokenAsync(??).Result; - if (result.IsError) - { - LastErrorText = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + result.Error, LoggingLevel.Error); - ?(); - State = ConnectionState.Disconnected; - return; - } - AccessToken = result.AccessToken; - ?? = result.RefreshToken; - ?? = result.IdentityToken; - UserInfoResult result2 = oidcClient.GetUserInfoAsync(AccessToken).Result; - if (result2.IsError) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + result2.Error, LoggingLevel.Error); - } - else - { - CurrentUser = new UserInfo(result2.Claims); - } - ?? = ?(); - ?(); - ?(); - State = ConnectionState.Connected; - } - catch (Exception ex) - { - WebException ex2 = ex.GetInnerExceptionsRecursive().OfType().FirstOrDefault(); - if (ex2 != null && ex2.Status == WebExceptionStatus.ConnectFailure) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - else - { - ?(); - } - LastErrorText = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ex.Message; - Core.Instance.Loggers.Log(ex); - State = ConnectionState.Disconnected; - } - } - - private string ?() - { - try - { - UriBuilder uriBuilder = new UriBuilder(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - Path = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }; - if (Dns.GetHostAddresses(uriBuilder.Host).Contains(IPAddress.Loopback)) - { - throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - HttpResponseMessage result = ??.GetAsync(uriBuilder.Uri).Result; - if (result.IsSuccessStatusCode) - { - ? result2 = result.Content.ReadFromJsonAsync>().Result; - if (result2.IsSuccess) - { - return result2.Value; - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); - } - return null; - } - - private string ?() - { - try - { - UriBuilder uriBuilder = new UriBuilder(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - Path = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }; - if (Dns.GetHostAddresses(uriBuilder.Host).Contains(IPAddress.Loopback)) - { - throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - HttpResponseMessage result = ??.GetAsync(uriBuilder.Uri).Result; - if (result.IsSuccessStatusCode) - { - ?> result2 = result.Content.ReadFromJsonAsync>>().Result; - if (!result2.IsSuccess) - { - return null; - } - if (!result2.Value.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value)) - { - return null; - } - return value; - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); - } - return null; - } - - private IEnumerable ?() - { - try - { - UriBuilder uriBuilder = new UriBuilder(??) - { - Path = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }; - if (Dns.GetHostAddresses(uriBuilder.Host).Contains(IPAddress.Loopback)) - { - throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ??.SetBearerToken(AccessToken); - HttpResponseMessage result = ??.GetAsync(uriBuilder.Uri).Result; - if (result.IsSuccessStatusCode) - { - JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions(); - jsonSerializerOptions.Converters.Add(new ?()); - return result.Content.ReadFromJsonAsync(jsonSerializerOptions).Result; - } - if (result.StatusCode == HttpStatusCode.Unauthorized) - { - UriBuilder uriBuilder2 = new UriBuilder(??) - { - Path = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }; - HttpResponseMessage result2 = ??.GetAsync(uriBuilder2.Uri).Result; - if (!result2.IsSuccessStatusCode) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(17, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(result2.StatusCode); - throw new Exception(defaultInterpolatedStringHandler.ToStringAndClear()); - } - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (State == ConnectionState.Connected) - { - ?(); - ?(); - } - } - else if (result.StatusCode == HttpStatusCode.NotFound) - { - throw new Exception(HttpStatusCode.NotFound.ToString()); - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ex.Message, LoggingLevel.Error); - } - return ???.Values.Where((LicenceItem P_0) => P_0.EndDate >= Core.Instance.TimeUtils.DateTimeUtcNow).ToArray() ?? Array.Empty(); - } - - private void ?() - { - AccessToken = null; - CurrentUser = null; - ?? = new ReadOnlyDictionary(new Dictionary()); - ???.Invoke(); - ?(); - } - - private void ?() - { - if (?? != null) - { - ??.Dispose(); - ?? = null; - } - } - - private OidcClient ?() - { - int value = 55650; - try - { - value = TcpIpHelper.GetRandomUnusedPort; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(31, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); - defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(17, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(value); - string text = defaultInterpolatedStringHandler.ToStringAndClear(); - string[] value2 = new string[5] - { - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }; - return new OidcClient(new OidcClientOptions - { - Authority = ??, - ClientId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - ClientSecret = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - RedirectUri = text, - PostLogoutRedirectUri = text, - Scope = string.Join(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value2), - Browser = new ?(false, value) - { - ?? = Core.Instance.OAuthBrowserCreator - }, - ClockSkew = TimeSpan.FromMinutes(5.0) + (Core.Instance.TimeUtils.DateTimeUtcNow - DateTime.UtcNow).Duration() - }); - } - - private bool ?(HttpRequestMessage P_0, X509Certificate2 P_1, X509Chain P_2, SslPolicyErrors P_3) - { - if (P_1.Issuer == P_1.Subject) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - return false; - } - return P_3 == SslPolicyErrors.None; - } - - private static bool ?(IDictionary P_0, IDictionary P_1) - { - if (P_0.Count != P_1.Count) - { - return true; - } - foreach (string key in P_0.Keys) - { - if (!P_0.TryGetValue(key, out var value)) - { - return true; - } - if (!P_1.TryGetValue(key, out var value2)) - { - return true; - } - if (value.StartDate != value2.StartDate) - { - return true; - } - if (value.EndDate != value2.EndDate) - { - return true; - } - if (value.Value != value2.Value) - { - return true; - } - } - return false; - } - - [CompilerGenerated] - private void ?() - { - if (State == ConnectionState.Disconnected && !string.IsNullOrEmpty(??)) - { - State = ConnectionState.Connecting; - ?(); - } - } - } - public class LicenseManagerEventArgs : EventArgs - { - [CompilerGenerated] - private readonly ConnectionState ??; - - [CompilerGenerated] - private readonly ConnectionState ??; - - public ConnectionState PreviousState - { - [CompilerGenerated] - get - { - return ??; - } - } - - public ConnectionState NewState - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal LicenseManagerEventArgs(ConnectionState P_0, ConnectionState P_1) - { - ?? = P_0; - ?? = P_1; - } - } -} -namespace ? -{ - internal class ? - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private ? ??; - - [JsonPropertyName("ErrorText")] - public string ErrorText - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = text; - } - } - - [JsonPropertyName("isSuccess")] - public bool IsSuccess - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = flag; - } - } - - [JsonPropertyName("value")] - public ? Value - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = val; - } - } - } -} -namespace TradingPlatform.BusinessLayer.Licence -{ - public interface IOAuthBrowserControl - { - event Action BrowserClosed; - - event Action Navigated; - - void ShowBrowser(string url, bool allowOpenNewWindow); - - void CloseBrowser(); - } - public interface IOAuthBrowserCreator - { - IOAuthBrowserControl CreateBrowser(bool showBrowserWindow); - } - public abstract class LoopbackBase : IDisposable - { - protected readonly TaskCompletionSource taskSource; - - public LoopbackBase() - { - taskSource = new TaskCompletionSource(); - } - - public abstract Task WaitForCallbackAsync(CancellationToken token); - - public void CancelWaiting() - { - if (taskSource.TrySetCanceled()) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - } - } - - public virtual void Dispose() - { - } - } - /// - /// The loopback http listener without kestrel. - /// - public sealed class LoopbackHttpListenerWithoutKestrel : LoopbackBase, IDisposable - { - [CompilerGenerated] - private sealed class ? - { - public LoopbackHttpListenerWithoutKestrel ??; - - public CancellationToken ??; - - internal void ?() - { - ??.?(); - } - - internal void ?() - { - Task.Delay(TimeSpan.FromMinutes(30.0), ??).Wait(??); - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - ??.taskSource.SetException(new TimeoutException()); - } - } - - private readonly HttpListener ??; - - /// - /// Initializes a new instance of the class. - /// - /// The port. - public LoopbackHttpListenerWithoutKestrel(int port) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(18, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(port); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - string text = defaultInterpolatedStringHandler.ToStringAndClear(); - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + text, LoggingLevel.Verbose); - ?? = new HttpListener(); - ??.Prefixes.Add(text); - ??.Start(); - } - - /// - /// Dispose - /// - public override void Dispose() - { - Task.Run(async delegate - { - await Task.Delay(500); - ??.Stop(); - ??.Close(); - }); - } - - private void ?(string P_0, HttpListenerResponse P_1) - { - using Stream stream = P_1.OutputStream; - try - { - P_1.StatusCode = 200; - P_1.ContentType = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - string s = string.Format(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - byte[] bytes = Encoding.UTF8.GetBytes(s); - P_1.ContentLength64 = bytes.Length; - stream.WriteAsync(bytes, 0, bytes.Length); - taskSource.TrySetResult(P_0); - } - catch - { - P_1.StatusCode = 400; - } - } - - private void ?() - { - try - { - HttpListenerContext context = ??.GetContext(); - if (context.Request.HttpMethod == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || context.Request.HttpMethod == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - string query = context.Request.Url.Query; - NameValueCollection nameValueCollection = HttpUtility.ParseQueryString(query); - if (nameValueCollection.AllKeys.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - _ = nameValueCollection[3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()]; - } - ?(query, context.Response); - } - else if (context.Request.HttpMethod == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - if (context.Request.ContentType.Equals(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), StringComparison.OrdinalIgnoreCase)) - { - using (StreamReader streamReader = new StreamReader(context.Request.InputStream, Encoding.UTF8)) - { - string text = streamReader.ReadToEnd(); - ?(text, context.Response); - return; - } - } - context.Response.StatusCode = 415; - } - else - { - context.Response.StatusCode = 405; - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - /// - /// Wait for callback asynchronously. - /// - /// The token. - /// ]]> - public override Task WaitForCallbackAsync(CancellationToken token) - { - token.Register(base.CancelWaiting); - Task.Factory.StartNew(delegate - { - ?(); - }, token); - Task.Factory.StartNew(delegate - { - Task.Delay(TimeSpan.FromMinutes(30.0), token).Wait(token); - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - taskSource.SetException(new TimeoutException()); - }, token); - return taskSource.Task; - } - - [CompilerGenerated] - private async Task? ?() - { - await Task.Delay(500); - ??.Stop(); - ??.Close(); - } - } - public sealed class LoopbackRedirects : LoopbackBase, IDisposable - { - [CompilerGenerated] - private sealed class ? - { - public CancellationToken ??; - - public LoopbackRedirects ??; - - internal void ?() - { - Task.Delay(TimeSpan.FromMinutes(30.0), ??).Wait(??); - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - ??.taskSource.SetException(new TimeoutException()); - } - } - - private readonly IOAuthBrowserControl ??; - - public LoopbackRedirects(IOAuthBrowserControl browserControl) - { - ?? = browserControl; - ??.Navigated += ?; - } - - public override void Dispose() - { - if (?? != null) - { - ??.Navigated -= ?; - } - } - - private void ?(string P_0) - { - try - { - string query = new Uri(P_0).Query; - NameValueCollection nameValueCollection = HttpUtility.ParseQueryString(query); - if (nameValueCollection.AllKeys.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - _ = nameValueCollection[3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()]; - taskSource.TrySetResult(query); - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - public override Task WaitForCallbackAsync(CancellationToken token) - { - token.Register(base.CancelWaiting); - Task.Factory.StartNew(delegate - { - Task.Delay(TimeSpan.FromMinutes(30.0), token).Wait(token); - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - taskSource.SetException(new TimeoutException()); - }, token); - return taskSource.Task; - } - } -} -namespace ? -{ - internal class ? : IdentityModel.OidcClient.Browser.IBrowser - { - [CompilerGenerated] - private sealed class ? - { - public LoopbackBase ??; - - internal void ?() - { - ???.CancelWaiting(); - } - } - - internal IOAuthBrowserCreator ??; - - private readonly int ??; - - private readonly bool ??; - - public ?(bool P_0, int? P_1 = null) - { - ?? = P_0; - if (!P_1.HasValue) - { - ?? = TcpIpHelper.GetRandomUnusedPort; - } - else - { - ?? = P_1.Value; - } - } - - public async Task InvokeAsync(BrowserOptions options, CancellationToken cancellationToken = default(CancellationToken)) - { - IOAuthBrowserControl iOAuthBrowserControl = ?(options.StartUrl); - LoopbackBase ?? = null; - if (options.EndUrl.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - ?? = new LoopbackHttpListenerWithoutKestrel(??); - } - else - { - ?? = new LoopbackRedirects(iOAuthBrowserControl); - } - if (iOAuthBrowserControl != null) - { - iOAuthBrowserControl.BrowserClosed += delegate - { - ???.CancelWaiting(); - }; - } - try - { - string text = await ??.WaitForCallbackAsync(cancellationToken); - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + text, LoggingLevel.Verbose); - if (string.IsNullOrWhiteSpace(text)) - { - return new BrowserResult - { - ResultType = BrowserResultType.UnknownError, - Error = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() - }; - } - return new BrowserResult - { - Response = text, - ResultType = BrowserResultType.Success - }; - } - catch (TimeoutException ex) - { - return new BrowserResult - { - ResultType = BrowserResultType.Timeout, - Error = ex.Message - }; - } - catch (TaskCanceledException ex2) - { - return new BrowserResult - { - ResultType = BrowserResultType.UserCancel, - Error = ex2.Message - }; - } - catch (Exception ex3) - { - return new BrowserResult - { - ResultType = BrowserResultType.UnknownError, - Error = ex3.Message - }; - } - finally - { - iOAuthBrowserControl?.CloseBrowser(); - ??.Dispose(); - } - } - - private IOAuthBrowserControl ?(string P_0) - { - if (?? == null) - { - ?(P_0); - return null; - } - IOAuthBrowserControl iOAuthBrowserControl = ??.CreateBrowser(!P_0.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); - iOAuthBrowserControl.ShowBrowser(P_0, ??); - return iOAuthBrowserControl; - } - - private static void ?(string P_0) - { - try - { - Process.Start(P_0); - } - catch - { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - P_0 = P_0.Replace(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - Process.Start(new ProcessStartInfo(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0) - { - CreateNoWindow = true - }); - return; - } - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - Process.Start(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0); - return; - } - if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - { - Process.Start(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0); - return; - } - throw; - } - } - } -} -namespace TradingPlatform.BusinessLayer.Licence -{ - public static class TcpIpHelper - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - internal bool ?(TcpConnectionInformation P_0) - { - return P_0.State != TcpState.Closed; - } - - internal int ?(TcpConnectionInformation P_0) - { - return P_0.LocalEndPoint.Port; - } - - internal int ?(IPEndPoint P_0) - { - return P_0.Port; - } - - internal int ?(IPEndPoint P_0) - { - return P_0.Port; - } - } - - private static readonly Random ??; - - public static int GetRandomUnusedPort - { - get - { - IPGlobalProperties iPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties(); - IEnumerable first = from P_0 in iPGlobalProperties.GetActiveTcpConnections() - where P_0.State != TcpState.Closed - select P_0.LocalEndPoint.Port; - IPEndPoint[] activeTcpListeners = iPGlobalProperties.GetActiveTcpListeners(); - first = first.Union(activeTcpListeners.Select((IPEndPoint P_0) => P_0.Port)); - IPEndPoint[] activeUdpListeners = iPGlobalProperties.GetActiveUdpListeners(); - first = first.Union(activeUdpListeners.Select((IPEndPoint P_0) => P_0.Port)); - int num = 49152; - int num2 = 65535; - int[] array = Enumerable.Range(num, num2 - num + 1).Except(first).ToArray(); - if (!array.Any()) - { - throw new ApplicationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - int num3 = ??.Next(0, array.Length - 1); - return array[num3]; - } - } - - static TcpIpHelper() - { - ?? = new Random(); - } - } - public class UserInfo - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - public string Email - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - public string UserId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - public UserInfo(IEnumerable claims) - { - foreach (Claim claim in claims) - { - if (claim.Type == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - UserId = claim.Value; - } - if (claim.Type == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - Name = claim.Value; - } - if (claim.Type == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - Email = claim.Value; - } - } - } - } -} -namespace TradingPlatform.BusinessLayer.DataBinding -{ - [AttributeUsage(AttributeTargets.Property)] - public class BindableAttribute : Attribute - { - [CompilerGenerated] - private readonly string ??; - - public string Alias - { - [CompilerGenerated] - get - { - return ??; - } - } - - public BindableAttribute(string alias) - { - ?? = alias; - } - } - public abstract class BindableEntity : IBindableEntity, INotifyPropertyChanged - { - [CompilerGenerated] - private sealed class ? - { - public BindableEntity ??; - - public string ??; - - internal void ?(object? _, NotifyCollectionChangedEventArgs P_1) - { - ??.?(??, P_1); - } - } - - public const string SYMBOL = "symbol"; - - public const string ACCOUNT = "account"; - - public const string ACCOUNTS = "accounts"; - - public const string ORDER_TYPE = "orderType"; - - public const string SIDE = "side"; - - public const string QUANTITY = "quantity"; - - public const string PRICE = "price"; - - public const string TRIGGER_PRICE = "triggerPrice"; - - public const string CONNECTION_ID = "connectionId"; - - public const string CONNECTIONS = "connections"; - - public const string CONNECTION = "connection"; - - public const string EXCHANGES = "exchanges"; - - public const string EXCHANGE = "exchange"; - - public const string CONTAINERS = "containers"; - - public const string CONTAINER = "container"; - - public const string VISIBLE = "visible"; - - public const string ENABLED = "enabled"; - - public const string CHECKED = "checked"; - - public const string HIDDEN = "hidden"; - - public const string ERROR = "error"; - - public const string WARNING = "warning"; - - public const string ORDER = "order"; - - public const string POSITION = "position"; - - public const string GROSS_PNL = "grossPnl"; - - public const string FEE = "fee"; - - public const string NET_PNL = "netPnl"; - - public const string STOP_LOSS = "stopLoss"; - - public const string TAKE_PROFIT = "takeProfit"; - - public const string BRACKET = "bracket"; - - public const string IS_TRAILING = "isTrailing"; - - public const string IS_TRAILING_ALLOWED = "isTrailingAllowed"; - - public const string TICKS = "ticks"; - - public const string PERIOD = "period"; - - public const string SELECTED_ITEM = "selectedItem"; - - public const string ITEMS = "items"; - - public const string SETTINGS = "settings"; - - public const string COMMAND = "command"; - - public const string CANCEL_COMMAND = "cancelCommand"; - - public const string CLOSE_COMMAND = "closeCommand"; - - public const string ADD_COMMAND = "addCommand"; - - public const string EDIT_COMMAND = "editCommand"; - - public const string DELETE_COMMAND = "deleteCommand"; - - public const string SELECT_COMMAND = "selectCommand"; - - public const string SAVE_COMMAND = "saveCommand"; - - public const string CLEAR_COMMAND = "clearAllCommand"; - - public const string APPLY_COMMAND = "applyCommand"; - - public const string DISCARD_COMMAND = "discardCommand"; - - public const string CHANGED_COMMAND = "changedCommand"; - - public const string VALUE = "value"; - - public const string TEXT = "text"; - - public const string LABEL = "label"; - - public const string TOOLTIP = "tooltip"; - - public const string MAXIMUM = "maximum"; - - public const string MINIMUM = "minimum"; - - public const string INCREMENT = "increment"; - - public const string DECIMAL_PLACES = "decimalPlaces"; - - public const string DIMENSION = "dimension"; - - public const string LINK_TEXT = "linkText"; - - public const string STEPS_COUNT = "stepsCount"; - - public const string CURRENT_STEP = "currentStep"; - - public const string WIDTH = "width"; - - public const string IS_SLIM_MODE_ENABLED = "isSlimModeEnabled"; - - public const string COLOR = "color"; - - public const string FOREGROUND_COLOR = "foregroundColor"; - - public const string BACKGROUND_COLOR = "backgroundColor"; - - public const string FORMAT = "format"; - - public const string INDEX = "index"; - - public const string SHOW = "show"; - - public const string SHOW_TOOLBAR = "showToolbar"; - - public const string IS_ACTIVE = "isActive"; - - public const string MULTIPLIER = "multiplier"; - - public const string NAME = "name"; - - public const string DESCRIPTION = "description"; - - public const string FROM = "from"; - - public const string TO = "to"; - - public const string TYPE = "type"; - - public const string START = "start"; - - public const string END = "end"; - - public const string DAY = "day"; - - public const string TIMEZONE = "timeZone"; - - public const string IS_VALID = "isValid"; - - public const string DATE = "date"; - - public const string DIRECTION = "direction"; - - public const string PROGRESS = "progress"; - - public const string COUNT = "count"; - - public const string IS_ALLOWED = "isAllowed"; - - public const string IS_LOADING = "isLoading"; - - public const string FILTRATION = "filtration"; - - public const string COLUMNS = "columns"; - - public const string ROWS = "rows"; - - private static readonly BusinessObjectEqualityComparer ?? = new BusinessObjectEqualityComparer(); - - private static readonly ListEqualityComparer ?? = new ListEqualityComparer(EqualityComparer.Default); - - private static readonly ListEqualityComparer ?? = new ListEqualityComparer(EqualityComparer.Default); - - private static readonly UniqueIdEqualityComparer ?? = new UniqueIdEqualityComparer(); - - private readonly Lazy> ?? = new Lazy>(); - - [CompilerGenerated] - private PropertyChangedEventHandler ??; - - public event PropertyChangedEventHandler PropertyChanged - { - [CompilerGenerated] - add - { - PropertyChangedEventHandler propertyChangedEventHandler = ??; - PropertyChangedEventHandler propertyChangedEventHandler2; - do - { - propertyChangedEventHandler2 = propertyChangedEventHandler; - PropertyChangedEventHandler value2 = (PropertyChangedEventHandler)Delegate.Combine(propertyChangedEventHandler2, value); - propertyChangedEventHandler = Interlocked.CompareExchange(ref ??, value2, propertyChangedEventHandler2); - } - while ((object)propertyChangedEventHandler != propertyChangedEventHandler2); - } - [CompilerGenerated] - remove - { - PropertyChangedEventHandler propertyChangedEventHandler = ??; - PropertyChangedEventHandler propertyChangedEventHandler2; - do - { - propertyChangedEventHandler2 = propertyChangedEventHandler; - PropertyChangedEventHandler value2 = (PropertyChangedEventHandler)Delegate.Remove(propertyChangedEventHandler2, value); - propertyChangedEventHandler = Interlocked.CompareExchange(ref ??, value2, propertyChangedEventHandler2); - } - while ((object)propertyChangedEventHandler != propertyChangedEventHandler2); - } - } - - protected bool SetValue(ref T storage, T value, IEqualityComparer comparer = null, [CallerMemberName] string propertyName = null) - { - if (IsValueEquals(storage, value, comparer)) - { - return false; - } - ?(storage, propertyName); - storage = value; - OnPropertyChanged(propertyName); - ?(storage, propertyName); - return true; - } - - protected bool IsValueEquals(T oldValue, T newValue, IEqualityComparer comparer = null) - { - if (comparer != null) - { - return comparer.Equals(oldValue, newValue); - } - T val = ((oldValue != null) ? oldValue : newValue); - return (val is Symbol) ? ??.Equals(oldValue as BusinessObject, newValue as BusinessObject) : ((val is IUniqueID) ? ??.Equals(oldValue as IUniqueID, newValue as IUniqueID) : ((val is IList) ? ??.Equals(oldValue as IList, newValue as IList) : ((!(val is IList)) ? EqualityComparer.Default.Equals(oldValue, newValue) : ??.Equals(oldValue as IList, newValue as IList)))); - } - - private void ?(? P_0, string P_1) - { - if (P_0 is INotifyCollectionChanged notifyCollectionChanged && P_1 != null && ??.Value.TryRemove(P_1, out var value)) - { - notifyCollectionChanged.CollectionChanged -= value; - } - } - - private void ?(? P_0, string P_1) - { - if (P_0 is INotifyCollectionChanged notifyCollectionChanged && P_1 != null) - { - NotifyCollectionChangedEventHandler value = delegate(object? _, NotifyCollectionChangedEventArgs e) - { - this.?(P_1, e); - }; - if (??.Value.TryAdd(P_1, value)) - { - notifyCollectionChanged.CollectionChanged += value; - } - } - } - - protected void OnPropertyChanged(string propertyName) - { - ?(new PropertyChangedEventArgs(propertyName)); - } - - private void ?(string P_0, NotifyCollectionChangedEventArgs P_1) - { - ?(new CollectionChangedEventArgs(P_0, P_1)); - } - - private void ?(PropertyChangedEventArgs P_0) - { - ???.InvokeSafely(this, P_0); - } - } - public class Binding : IDisposable - { - internal class ? - { - [CompilerGenerated] - private sealed class ? - { - public List ??; - - internal List ?(Type _) - { - return ??; - } - - internal List ?(Type _, List P_1) - { - return ??; - } - } - - [CompilerGenerated] - private readonly IBindableEntity ??; - - [CompilerGenerated] - private readonly string ??; - - [CompilerGenerated] - private readonly Type ??; - - private readonly PropertyInfo ??; - - private static readonly ConcurrentDictionary> ??; - - private static readonly PropertyInfoEqualityComparer ??; - - public IBindableEntity Entity - { - [CompilerGenerated] - get - { - return ??; - } - } - - public string PropertyName - { - [CompilerGenerated] - get - { - return ??; - } - } - - public Type PropertyType - { - [CompilerGenerated] - get - { - return ??; - } - } - - static ?() - { - ?? = new ConcurrentDictionary>(); - ?? = new PropertyInfoEqualityComparer(); - } - - public ?(IBindableEntity P_0, string P_1) - { - ?? = P_0; - ?? = P_1; - foreach (PropertyInfo item in ?(Entity.GetType())) - { - if (!((item.GetCustomAttribute()?.Alias ?? item.Name) != P_1)) - { - ?? = item.Name; - ?? = item.PropertyType; - ?? = item; - break; - } - } - if (?? == null) - { - throw new BindingPropertyMissingException(P_1); - } - } - - public object ?() - { - try - { - if (?? == null || !??.CanRead) - { - return null; - } - return ???.GetValue(Entity); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - return null; - } - - public void ?(object P_0) - { - try - { - if (!(?? == null) && ??.CanWrite) - { - ??.SetValue(Entity, P_0); - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(11, 2); - defaultInterpolatedStringHandler.AppendFormatted(PropertyName); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Entity.GetType()); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - private static List ?(Type P_0) - { - if (??.TryGetValue(P_0, out var value)) - { - return value; - } - List ?? = new List(); - Type type = P_0; - do - { - PropertyInfo[] properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); - ??.AddRange(properties); - type = type.BaseType; - } - while (type != null); - ?? = ??.Distinct(??).ToList(); - ??.AddOrUpdate(P_0, (Type _) => ??, (Type _, List list) => ??); - return ??; - } - } - - [StructLayout(LayoutKind.Auto)] - [CompilerGenerated] - private struct ? - { - public Binding ??; - - public IList ??; - - public NotifyCollectionChangedEventArgs ??; - } - - [CompilerGenerated] - private readonly ? ??; - - [CompilerGenerated] - private readonly ? ??; - - [CompilerGenerated] - private Queue ??; - - [CompilerGenerated] - private Predicate ??; - - [CompilerGenerated] - private Func ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - [CompilerGenerated] - private Action ??; - - private bool ??; - - internal ? Accessor1 - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal ? Accessor2 - { - [CompilerGenerated] - get - { - return ??; - } - } - - internal Queue ConvertersQueue - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = queue; - } - } - - internal Predicate Predicate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = predicate; - } - } - - internal Func ItemsFactory - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = func; - } - } - - internal Action RemoveItemCallback - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = action; - } - } - - internal Action ClearItemsCallback - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = action; - } - } - - internal Action ApplyCallback - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = action; - } - } - - public Binding(IBindableEntity entity1, string propertyName1, IBindableEntity entity2, string propertyName2) - { - if (entity1 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (entity2 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - ?? = new ?(entity1, propertyName1); - ?? = new ?(entity2, propertyName2); - Accessor1.Entity.PropertyChanged += ?; - Accessor2.Entity.PropertyChanged += ?; - } - - private void ?(object P_0, PropertyChangedEventArgs P_1) - { - ? ? = ((P_0 == Accessor1.Entity) ? Accessor1 : Accessor2); - ? ?2 = ((P_0 == Accessor1.Entity) ? Accessor2 : Accessor1); - if (? == null || ?2 == null || P_1.PropertyName != ?.PropertyName || (Predicate != null && !Predicate(?.Entity))) - { - return; - } - try - { - if (!??) - { - ?? = true; - if (P_1 is CollectionChangedEventArgs e && ?2.?() is IList list) - { - this.?(?, list, e); - } - else - { - this.?(?, ?2); - } - } - } - finally - { - ?? = false; - } - } - - internal Binding ?(? P_0, ? P_1) - { - object obj = P_0.?(); - if (ConvertersQueue == null || !ConvertersQueue.Any()) - { - P_1.?(obj); - return this; - } - object convertedValue = obj; - foreach (IBindingValueConverter item in ConvertersQueue) - { - if (!item.TryConvert(convertedValue, P_0.PropertyType, P_0.Entity, out convertedValue)) - { - return this; - } - } - P_1.?(convertedValue); - ApplyCallback?.InvokeSafely(); - return this; - } - - private Binding ?(? P_0, IList P_1, CollectionChangedEventArgs P_2) - { - ? ? = default(?); - ?.?? = this; - ?.?? = P_1; - ?.?? = P_2.CollectionChangedArgs; - switch (?.??.Action) - { - case NotifyCollectionChangedAction.Add: - foreach (object newItem in ?.??.NewItems) - { - ?(newItem, ref ?); - } - break; - case NotifyCollectionChangedAction.Move: - { - object value = ?.??[?.??.OldStartingIndex]; - ?.??.RemoveAt(?.??.OldStartingIndex); - ?.??.Insert(?.??.NewStartingIndex, value); - break; - } - case NotifyCollectionChangedAction.Remove: - ?(ref ?); - break; - case NotifyCollectionChangedAction.Replace: - ?(ref ?); - foreach (object newItem2 in ?.??.NewItems) - { - ?(newItem2, ref ?); - } - break; - case NotifyCollectionChangedAction.Reset: - ClearItemsCallback?.InvokeSafely(); - ?.??.Clear(); - break; - default: - throw new ArgumentOutOfRangeException(); - } - return this; - } - - internal bool ?(object P_0) - { - if (Accessor1.Entity != P_0) - { - return Accessor2.Entity == P_0; - } - return true; - } - - public void Dispose() - { - Accessor1.Entity.PropertyChanged -= ?; - Accessor2.Entity.PropertyChanged -= ?; - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(18, 3); - defaultInterpolatedStringHandler.AppendFormatted(Accessor1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Accessor2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(ConvertersQueue?.Count); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - [CompilerGenerated] - private void ?(object P_0, ref ? P_1) - { - object value = ItemsFactory?.Invoke(P_0) ?? P_0; - P_1.??.Insert(P_1.??.NewStartingIndex, value); - } - - [CompilerGenerated] - private void ?(ref ? P_0) - { - object obj = P_0.??[P_0.??.OldStartingIndex]; - P_0.??.RemoveAt(P_0.??.OldStartingIndex); - RemoveItemCallback?.Invoke(obj); - } - } - public static class BindingExtensions - { - public static Binding WithConvertor(this Binding binding, IBindingValueConverter converter) - { - if (binding.ConvertersQueue == null) - { - Queue queue = (binding.ConvertersQueue = new Queue()); - } - binding.ConvertersQueue.Enqueue(converter); - return binding; - } - - public static Binding WithPredicate(this Binding binding, Predicate predicate) - { - binding.Predicate = predicate; - return binding; - } - - public static Binding WithItemsFactory(this Binding binding, Func itemsFactory) - { - binding.ItemsFactory = itemsFactory; - return binding; - } - - public static Binding WithRemoveItemCallback(this Binding binding, Action removeItemCallback) - { - binding.RemoveItemCallback = removeItemCallback; - return binding; - } - - public static Binding WithClearItemsCallback(this Binding binding, Action clearItemsCallback) - { - binding.ClearItemsCallback = clearItemsCallback; - return binding; - } - - public static Binding WithApplyCallback(this Binding binding, Action applyCallback) - { - binding.ApplyCallback = applyCallback; - return binding; - } - - public static Binding ApplyValue(this Binding binding) - { - return binding.?(binding.Accessor2, binding.Accessor1); - } - } - public class CollectionChangedEventArgs : PropertyChangedEventArgs - { - [CompilerGenerated] - private readonly NotifyCollectionChangedEventArgs ??; - - public NotifyCollectionChangedEventArgs CollectionChangedArgs - { - [CompilerGenerated] - get - { - return ??; - } - } - - public CollectionChangedEventArgs(string propertyName, NotifyCollectionChangedEventArgs collectionChangedArgs) - : base(propertyName) - { - ?? = collectionChangedArgs; - } - } -} -namespace ? -{ - internal class ? : IDisposable - { - [CompilerGenerated] - private sealed class ? - { - public IBindableEntity ??; - - internal bool ?(Binding P_0) - { - return P_0.?(??); - } - } - - private IBindableEntity ??; - - private readonly IList ??; - - public ?(IBindableEntity P_0) - { - ?? = P_0; - ?? = new List(); - } - - public Binding ?(IBindableEntity P_0, string P_1) - { - return ?(P_0, P_1, ??, P_1); - } - - public Binding ?(IBindableEntity P_0, string P_1, string P_2) - { - return ?(P_0, P_1, ??, P_2); - } - - public Binding ?(IBindableEntity P_0, string P_1, IBindableEntity P_2, string P_3) - { - try - { - Binding binding = new Binding(P_0, P_1, P_2, P_3); - ??.Add(binding); - return binding; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - return null; - } - - public void ?(IBindableEntity P_0) - { - if (P_0 == null) - { - return; - } - try - { - foreach (Binding item in ??.Where((Binding binding) => binding.?(P_0)).ToList()) - { - ??.Remove(item); - item.Dispose(); - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - - public void Dispose() - { - ?? = null; - foreach (Binding item in ??) - { - item.Dispose(); - } - } - } -} -namespace TradingPlatform.BusinessLayer.DataBinding -{ - public interface IBindableEntity : INotifyPropertyChanged - { - } - public interface IBindingValueConverter - { - bool TryConvert(object value, Type valueType, IBindableEntity source, out object convertedValue); - } - public interface ICommandBindableEntity : IBindableEntity, INotifyPropertyChanged - { - ICommand Command { get; set; } - } -} -namespace TradingPlatform.BusinessLayer.DataBinding.Mvvm -{ - public abstract class BindableView : BindableEntity, IBindableView, IDisposable - { - private IBindableEntity ??; - - private ? ??; - - public IBindableEntity BindingContext - { - get - { - return ??; - } - set - { - ?? = value; - ???.Dispose(); - if (?? == null) - { - return; - } - ?? = new ?(??); - try - { - BindContext(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - } - - protected virtual void BindContext() - { - } - - public Binding Bind(string propertyName) - { - return ??.?(this, propertyName); - } - - public Binding Bind(string propertyName1, string propertyName2) - { - return ??.?(this, propertyName1, propertyName2); - } - - public Binding Bind(IBindableEntity entity1, string propertyName) - { - return ??.?(entity1, propertyName, propertyName); - } - - public Binding Bind(IBindableEntity entity1, string propertyName1, string propertyName2) - { - return ??.?(entity1, propertyName1, propertyName2); - } - - public Binding Bind(IBindableEntity entity1, string propertyName1, IBindableEntity entity2, string propertyName2) - { - return ??.?(entity1, propertyName1, entity2, propertyName2); - } - - public void Unbind(IBindableEntity entity) - { - ??.?(entity); - } - - public virtual void Dispose() - { - BindingContext = null; - } - } - public interface IBindableView : IDisposable - { - IBindableEntity BindingContext { get; set; } - } -} -namespace TradingPlatform.BusinessLayer.DataBinding.Extensions -{ - public static class CommandBindableEntityExtensions - { - public static void TryExecuteCommand(this ICommandBindableEntity entity, object parameter = null) - { - entity.TryExecuteCommand(entity.Command, parameter); - } - - public static void TryExecuteCommand(this IBindableEntity entity, ICommand command, object parameter = null) - { - try - { - if (command != null) - { - if (parameter == null) - { - parameter = entity; - } - if (command.CanExecute(parameter)) - { - command.Execute(parameter); - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - } -} -namespace TradingPlatform.BusinessLayer.DataBinding.Exceptions -{ - public class BindingException : Exception - { - protected BindingException(string message) - : base(message) - { - } - } - public class BindingPropertyMissingException : BindingException - { - public BindingPropertyMissingException(string propertyAlias) - : base(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + propertyAlias + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - { - } - } -} -namespace TradingPlatform.BusinessLayer.DataBinding.Converters -{ - public class DateTimeTimeSpanConverter : IBindingValueConverter - { - public bool TryConvert(object value, Type valueType, IBindableEntity source, out object convertedValue) - { - convertedValue = null; - if (value is DateTime dateTime) - { - convertedValue = dateTime.TimeOfDay; - return true; - } - if (value is TimeSpan value2) - { - convertedValue = default(DateTime).Add(value2); - return true; - } - return false; - } - } - public class DoubleDecimalConverter : IBindingValueConverter - { - public bool TryConvert(object value, Type valueType, IBindableEntity source, out object convertedValue) - { - convertedValue = null; - if (value is double num) - { - if (!(num <= -7.922816251426434E+28)) - { - if (num >= 7.922816251426434E+28) - { - convertedValue = decimal.MaxValue; - return true; - } - convertedValue = (decimal)num; - return true; - } - convertedValue = decimal.MinValue; - return true; - } - if (value is decimal num2) - { - convertedValue = (double)num2; - return true; - } - return false; - } - } - public class IntDecimalConverter : IBindingValueConverter - { - public bool TryConvert(object value, Type valueType, IBindableEntity source, out object convertedValue) - { - convertedValue = null; - if (!(value is int num)) - { - if (value is decimal val) - { - decimal val2 = Math.Max(val, -2147483648m); - val2 = Math.Min(val2, 2147483647m); - convertedValue = (int)val2; - return true; - } - return false; - } - convertedValue = (decimal)num; - return true; - } - } - public class LongDecimalConverter : IBindingValueConverter - { - public bool TryConvert(object value, Type valueType, IBindableEntity source, out object convertedValue) - { - convertedValue = null; - if (!(value is long num)) - { - if (value is decimal val) - { - decimal val2 = Math.Max(val, -9223372036854775808m); - val2 = Math.Min(val2, 9223372036854775807m); - convertedValue = (long)val2; - return true; - } - return false; - } - convertedValue = (decimal)num; - return true; - } - } - public class SettingItemToStringConverter : IBindingValueConverter - { - public bool TryConvert(object value, Type valueType, IBindableEntity source, out object convertedValue) - { - convertedValue = null; - if (!(source is SettingItem settingItem)) - { - return false; - } - convertedValue = settingItem.Value?.ToString() ?? settingItem.Text; - return true; - } - } - public class StringToLocalizedStringConverter : IBindingValueConverter - { - public bool TryConvert(object value, Type valueType, IBindableEntity source, out object convertedValue) - { - convertedValue = null; - if (source is IBindableView) - { - return false; - } - if (!(value is string text)) - { - return false; - } - convertedValue = loc._(text, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return true; - } - } - public class ValueConverter : IBindingValueConverter - { - private readonly Func ??; - - public ValueConverter(Func convertDelegate) - { - ?? = convertDelegate ?? throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - - public bool TryConvert(object value, Type valueType, IBindableEntity source, out object convertedValue) - { - convertedValue = null; - if (valueType != typeof(TValue)) - { - return false; - } - if (value is TValue arg) - { - convertedValue = ??(arg); - } - else - { - convertedValue = ??(default(TValue)); - } - return true; - } - } -} -namespace TradingPlatform.BusinessLayer.DataBinding.Commands -{ - public class BindingCommand : ICommand - { - private readonly Action ??; - - private readonly Predicate ??; - - [CompilerGenerated] - private EventHandler ??; - - public event EventHandler CanExecuteChanged - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - public BindingCommand(Action action, Predicate canExecutePredicate = null) - { - ?? = action; - ?? = canExecutePredicate; - } - - public bool CanExecute(object parameter) - { - return ???.Invoke(parameter) ?? (?? != null); - } - - public void Execute(object parameter) - { - try - { - ???.Invoke(parameter); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - } -} -namespace ? -{ - internal class ? - { - [CompilerGenerated] - private sealed class ? - { - public string ??; - - internal bool ?(? P_0) - { - return P_0.Regex.Match(??).Success; - } - } - - private static readonly IList ?? = new List - { - new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), - new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - }; - - public void ?(SettingItem P_0) - { - IList value = P_0.GetValue>(); - SettingItem itemByName = value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - SettingItem itemByName2 = value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - string text = itemByName.Value.ToString(); - foreach (? item in ??) - { - if (item.Regex.Match(text).Success) - { - itemByName.Value = text.Replace(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + item.OldName, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + item.NewName); - itemByName2.Value = item.NewName; - break; - } - } - } - - public string ?(string P_0) - { - ? ?2 = ??.FirstOrDefault((? ?3) => ?3.Regex.Match(P_0).Success); - if (?2 == null) - { - return P_0; - } - return P_0.Replace(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ?2.OldName, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ?2.NewName); - } - } - internal class ? - { - [CompilerGenerated] - private readonly string ??; - - [CompilerGenerated] - private readonly string ??; - - [CompilerGenerated] - private readonly Regex ??; - - public string OldName - { - [CompilerGenerated] - get - { - return ??; - } - } - - public string NewName - { - [CompilerGenerated] - get - { - return ??; - } - } - - public Regex Regex - { - [CompilerGenerated] - get - { - return ??; - } - } - - public ?(string P_0, string P_1) - { - ?? = P_0; - ?? = P_1; - ?? = new Regex(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + OldName + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } -} -namespace TradingPlatform.BusinessLayer.VolumeAnalysis.Storage -{ - public interface IVolumeAnalysisLocalStorage : ILocalStorage - { - void Save(VolumeAnalysisInterval volumeAnalysisInterval); - - VolumeAnalysisInterval Load(VolumeAnalysisDescription description, Interval interval); - - void Delete(VolumeAnalysisDescription description, Interval interval); - - VolumeAnalysisStorageInfo GetInfo(VolumeAnalysisDescription description); - } - public class VolumeAnalysisDescription - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private Period? ??; - - [CompilerGenerated] - private bool ??; - - public string SymbolId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Period? Period - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool IncludePriceLevels - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public VolumeAnalysisDescription(string symbolId, Period? period, bool includePriceLevels) - { - SymbolId = symbolId; - Period = period; - IncludePriceLevels = includePriceLevels; - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(6, 3); - defaultInterpolatedStringHandler.AppendFormatted(SymbolId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Period); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(IncludePriceLevels); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - public class VolumeAnalysisInterval - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal int ?(VolumeAnalysisData P_0) - { - return P_0.PriceLevels.Count; - } - } - - [CompilerGenerated] - private VolumeAnalysisDescription ??; - - [CompilerGenerated] - private Interval ??; - - [CompilerGenerated] - private IList ??; - - public VolumeAnalysisDescription Description - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Interval Interval - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IList VolumeAnalysis - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(32, 4); - defaultInterpolatedStringHandler.AppendFormatted(Description); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Interval); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(VolumeAnalysis.Count); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(VolumeAnalysis.Sum((VolumeAnalysisData P_0) => P_0.PriceLevels.Count)); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - public class VolumeAnalysisStorage : DataStorage - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func, bool> ??; - - internal bool ?(Interval P_0) - { - return !P_0.IsEmpty; - } - } - - [CompilerGenerated] - private sealed class ? - { - public Interval ??; - - public VolumeAnalysisByPeriodRequestParameters ??; - - internal VolumeAnalysisByPeriodRequestParameters ?(Interval P_0) - { - if (P_0 == ??) - { - return ??; - } - VolumeAnalysisByPeriodRequestParameters copy = ??.Copy; - copy.FromTime = P_0.From; - copy.ToTime = P_0.To; - return copy; - } - - internal Interval ?(Interval P_0) - { - return P_0.Intersect(??); - } - } - - [CompilerGenerated] - private sealed class ? - { - public VolumeAnalysisStorage ??; - - public VolumeAnalysisInterval ??; - - internal void ?() - { - ??.??.Save(??); - } - - internal void ?() - { - ??.??.Save(??); - } - } - - [CompilerGenerated] - private sealed class ? - { - public VolumeAnalysisStorage ??; - - public VolumeAnalysisDescription ??; - - public Interval ??; - - internal void ?() - { - ??.??.Delete(??, ??); - } - - internal void ?() - { - ??.??.Delete(??, ??); - } - } - - private readonly IVolumeAnalysisLocalStorage ??; - - private static readonly Type ??; - - public VolumeAnalysisStorage(IVolumeAnalysisLocalStorage storage, string localFilePath) - : base(storage, localFilePath) - { - ?? = storage; - } - - public IList Load(VolumeAnalysisByPeriodRequestParameters requestParameters, out List parametersForServerRequest) - { - CheckDisposed(); - List list = new List(); - parametersForServerRequest = new List(); - if (requestParameters == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - VolumeAnalysisDescription description = requestParameters.ToDescription(); - VolumeAnalysisStorageInfo info = ??.GetInfo(description); - if (info.StoredIntervals.Count == 0) - { - parametersForServerRequest.Add(requestParameters); - return list; - } - Interval ?? = requestParameters.Interval; - Interval[] source = ??.Subtract(info.StoredIntervals).ToArray(); - parametersForServerRequest.AddRange(source.Select(delegate(Interval P_0) - { - if (!(P_0 == ??)) - { - VolumeAnalysisByPeriodRequestParameters copy = requestParameters.Copy; - copy.FromTime = P_0.From; - copy.ToTime = P_0.To; - return copy; - } - return requestParameters; - })); - Interval[] array = (from P_0 in info.StoredIntervals - select P_0.Intersect(??) into P_0 - where !P_0.IsEmpty - select P_0).ToArray(); - foreach (Interval interval in array) - { - VolumeAnalysisInterval item = ??.Load(description, interval); - list.Add(item); - } - return list; - } - - public void Save(VolumeAnalysisInterval volumeAnalysisInterval, bool wait = false) - { - CheckDisposed(); - if (wait) - { - WaitForAction(delegate - { - ??.Save(volumeAnalysisInterval); - }); - } - else - { - PushAction(delegate - { - ??.Save(volumeAnalysisInterval); - }); - } - } - - public void Delete(VolumeAnalysisDescription description, Interval interval, bool wait = false) - { - CheckDisposed(); - if (wait) - { - WaitForAction(delegate - { - ??.Delete(description, interval); - }); - } - else - { - PushAction(delegate - { - ??.Delete(description, interval); - }); - } - } - - public VolumeAnalysisStorageInfo GetInfo(VolumeAnalysisDescription description) - { - CheckDisposed(); - return ??.GetInfo(description); - } - - static VolumeAnalysisStorage() - { - try - { - ?? = AssemblyLoader.LoadTypes(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), typeof(IVolumeAnalysisLocalStorage), null, SearchOption.AllDirectories)?.FirstOrDefault(); - } - catch - { - } - } - - public static VolumeAnalysisStorage Create(string connectionString) - { - if (?? == null) - { - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - IVolumeAnalysisLocalStorage obj = Activator.CreateInstance(??) as IVolumeAnalysisLocalStorage; - if (obj == null) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(30, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(??); - throw new InvalidOperationException(defaultInterpolatedStringHandler.ToStringAndClear()); - } - string directoryName = Path.GetDirectoryName(connectionString); - if (!Directory.Exists(directoryName)) - { - Directory.CreateDirectory(directoryName); - } - return new VolumeAnalysisStorage(obj, connectionString); - } - } - public class VolumeAnalysisStorageInfo - { - [CompilerGenerated] - private List> ??; - - public List> StoredIntervals - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public VolumeAnalysisStorageInfo() - { - StoredIntervals = new List>(); - } - } -} -namespace TradingPlatform.BusinessLayer.PowerTrades -{ - public interface IPowerTradesBaseSettings - { - double MinTradeVolume { get; } - - double MaxTradeVolume { get; } - - double TotalVolume { get; } - - double TimeInterval { get; } - - double BasisVolumeInterval { get; } - - int MaxZoneHeight { get; } - - int MinZoneHeight { get; } - - double DeltaFilter { get; } - - double BasisRatioFilter { get; } - } - public interface IPowerTradesHistoryItem : IHistoryItem, ICloneable - { - double Cumulative { get; } - - double Delta { get; } - - double DeltaPercent { get; } - - double MaxPrice { get; } - - double MinPrice { get; } - - double BasisRatioPercent { get; } - - DateTime LeftTime { get; } - - DateTime RightTime { get; } - } -} -namespace TradingPlatform.BusinessLayer.Media.Messengers -{ - public interface IMessenger : ICustomizable - { - string Name { get; } - - void SendMessage(MessengerMessage message, CancellationToken cancellationToken); - } - public static class Messenger - { - public const string TELEGRAM = "Telegram"; - - public const string EMAIL = "Email"; - } - public class MessengerMessage - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - public string Title - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Text - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - } - public class MessengersManager : ICustomizable, IDisposable - { - private readonly Dictionary ??; - - public IMessenger Telegram => this[3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()]; - - public IMessenger Email => this[3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()]; - - public IMessenger[] All => ??.Values.ToArray(); - - public IMessenger this[string name] - { - get - { - if (!TryGetMessenger(name, out var messenger)) - { - return null; - } - return messenger; - } - } - - public IList Settings - { - get - { - List list = new List(); - IMessenger[] all = All; - foreach (IMessenger messenger in all) - { - list.Add(new SettingItemGroup(messenger.Name, messenger.Settings)); - } - return list; - } - set - { - foreach (SettingItem item in value) - { - if (item is SettingItemGroup { Value: IList value2 } settingItemGroup && TryGetMessenger(settingItemGroup.Name, out var messenger)) - { - messenger.Settings = value2; - } - } - } - } - - internal MessengersManager() - { - ?? = new Dictionary(); - } - - internal void ?() - { - try - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (TypeWrapper item in AssemblyLoader.LoadTypes(Const.MESSENGERS_PATH, typeof(IMessenger), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SearchOption.AllDirectories)) - { - Type type = item; - try - { - if (!type.IsAbstract) - { - if (!(Activator.CreateInstance(type) is IMessenger messenger)) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + type.Name); - } - else if (??.ContainsKey(messenger.Name)) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + messenger.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - else - { - ??.Add(messenger.Name, messenger); - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(26, 2); - defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(??.Count); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); - } - catch (Exception ex2) - { - Core.Instance.Loggers.Log(ex2); - } - finally - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public bool TryGetMessenger(string messengerName, out IMessenger messenger) - { - return ??.TryGetValue(messengerName, out messenger); - } - - public void Dispose() - { - ??.Clear(); - } - } -} -namespace TradingPlatform.BusinessLayer.Serialization -{ - public interface IXElementSerialization - { - XElement ToXElement(); - - void FromXElement(XElement element, DeserializationInfo deserializationInfo); - } - /// - /// ??????? ??? ????????? - /// - [ProtoContract] - public class SnapshotData : IXElementSerialization - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func> ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - internal bool ?(Account P_0) - { - return !(P_0 is CryptoAccount); - } - - internal MessageAccount ?(Account P_0) - { - return ((IMessageBuilder)P_0).BuildMessage(); - } - - internal MessageCryptoAccount ?(CryptoAccount P_0) - { - return ((IMessageBuilder)P_0).BuildMessage(); - } - - internal IEnumerable ?(CryptoAccount P_0) - { - return P_0.Balances; - } - - internal MessageCryptoAssetBalances ?(CryptoAssetBalances P_0) - { - return P_0.BuildMessage(); - } - - internal MessageAsset ?(Asset P_0) - { - return ((IMessageBuilder)P_0).BuildMessage(); - } - - internal MessageExchange ?(Exchange P_0) - { - return ((IMessageBuilder)P_0).BuildMessage(); - } - - internal MessageSymbol ?(Symbol P_0) - { - return ((IMessageBuilder)P_0).BuildMessage(); - } - - internal DayBar ?(Symbol P_0) - { - return ((IMessageBuilder)P_0).BuildMessage(); - } - - internal MessageOpenOrder ?(Order P_0) - { - return P_0.BuildMessage(); - } - - internal MessageOpenPosition ?(Position P_0) - { - return P_0.BuildMessage(); - } - - internal MessageOpenDeliveredAsset ?(DeliveredAsset P_0) - { - return P_0.BuildMessage(); - } - - internal MessageSessionsContainer ?(SessionsContainer P_0) - { - return P_0.BuildMessage(); - } - } - - [CompilerGenerated] - private IEnumerable ??; - - [CompilerGenerated] - private IEnumerable ??; - - [CompilerGenerated] - private IEnumerable ??; - - [CompilerGenerated] - private IEnumerable ??; - - [CompilerGenerated] - private IEnumerable ??; - - [CompilerGenerated] - private IEnumerable ??; - - [CompilerGenerated] - private IEnumerable ??; - - [CompilerGenerated] - private IEnumerable ??; - - [CompilerGenerated] - private IEnumerable ??; - - [CompilerGenerated] - private IEnumerable ??; - - [CompilerGenerated] - private IEnumerable ??; - - [CompilerGenerated] - private IEnumerable ??; - - [ProtoMember(1)] - public IEnumerable AccountMessages - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = enumerable; - } - } - - [ProtoMember(2)] - public IEnumerable SymbolMessages - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = enumerable; - } - } - - [ProtoMember(3)] - public IEnumerable AssetsMessages - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = enumerable; - } - } - - [ProtoMember(4)] - public IEnumerable ExchangeMessages - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = enumerable; - } - } - - [ProtoMember(5)] - public IEnumerable DayBars - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = enumerable; - } - } - - [ProtoMember(7)] - public IEnumerable AssetBalances - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = enumerable; - } - } - - [ProtoMember(8)] - public IEnumerable CryptoAccounts - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = enumerable; - } - } - - [ProtoMember(9)] - public IEnumerable PositionMessages - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = enumerable; - } - } - - [ProtoMember(10)] - public IEnumerable OpenOrdersMessages - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = enumerable; - } - } - - [ProtoMember(11)] - public IEnumerable OpenDeliveredAssetMessages - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = enumerable; - } - } - - [ProtoMember(12)] - public IEnumerable OptionSeries - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = enumerable; - } - } - - [ProtoMember(13)] - public IEnumerable SessionsContainers - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = enumerable; - } - } - - public SnapshotData() - { - AccountMessages = new List(); - OpenOrdersMessages = new List(); - PositionMessages = new List(); - OpenDeliveredAssetMessages = new List(); - CryptoAccounts = new List(); - AssetBalances = new List(); - OptionSeries = new List(); - SessionsContainers = new List(); - } - - public static SnapshotData Create(IEnumerable symbolItems, IEnumerable uniqueAssets, IEnumerable uniqueExchanges, IEnumerable dayBars, IEnumerable accounts, IEnumerable cryptoAccounts, IEnumerable assetBalances, IEnumerable messageOptionSeries, IEnumerable sessionsData, IDictionary idsMap, IDictionary idsMap1) - { - foreach (KeyValuePair item in idsMap) - { - item.Value.Id = item.Key; - } - foreach (KeyValuePair item2 in idsMap1) - { - item2.Value.SymbolId = item2.Key; - } - return Create(symbolItems, uniqueAssets, uniqueExchanges, dayBars, accounts, cryptoAccounts, assetBalances, messageOptionSeries, sessionsData); - } - - public static SnapshotData Create(IEnumerable symbolItems, IEnumerable uniqueAssets, IEnumerable uniqueExchanges, IEnumerable dayBars, IEnumerable accounts, IEnumerable cryptoAccounts, IEnumerable assetBalances, IEnumerable messageOptionSeries, IEnumerable sessionsData) - { - return new SnapshotData - { - SymbolMessages = symbolItems, - DayBars = dayBars, - AssetsMessages = uniqueAssets, - ExchangeMessages = uniqueExchanges, - AccountMessages = accounts, - CryptoAccounts = cryptoAccounts, - AssetBalances = assetBalances, - OptionSeries = messageOptionSeries, - SessionsContainers = sessionsData - }; - } - - public static SnapshotData Create(Connection connection) - { - return new SnapshotData - { - AccountMessages = (from P_0 in connection.BusinessObjects.Accounts - where !(P_0 is CryptoAccount) - select ((IMessageBuilder)P_0).BuildMessage()).ToArray(), - CryptoAccounts = (from P_0 in connection.BusinessObjects.Accounts.OfType() - select ((IMessageBuilder)P_0).BuildMessage()).ToArray(), - AssetBalances = (from P_0 in connection.BusinessObjects.Accounts.OfType().SelectMany((CryptoAccount P_0) => P_0.Balances) - select P_0.BuildMessage()).ToArray(), - AssetsMessages = connection.BusinessObjects.Assets.Select((Asset P_0) => ((IMessageBuilder)P_0).BuildMessage()).ToArray(), - ExchangeMessages = connection.BusinessObjects.Exchanges.Select((Exchange P_0) => ((IMessageBuilder)P_0).BuildMessage()).ToArray(), - SymbolMessages = connection.BusinessObjects.Symbols.Select((Symbol P_0) => ((IMessageBuilder)P_0).BuildMessage()).ToArray(), - DayBars = connection.BusinessObjects.Symbols.Select((Symbol P_0) => ((IMessageBuilder)P_0).BuildMessage()).ToArray(), - OpenOrdersMessages = connection.BusinessObjects.Orders.Select((Order P_0) => P_0.BuildMessage()).ToArray(), - PositionMessages = connection.BusinessObjects.Positions.Select((Position P_0) => P_0.BuildMessage()).ToArray(), - OpenDeliveredAssetMessages = connection.BusinessObjects.DeliveredAssets.Select((DeliveredAsset P_0) => P_0.BuildMessage()).ToArray(), - SessionsContainers = connection.??.TradingSessions.Values.Select((SessionsContainer P_0) => P_0.BuildMessage()).ToArray() - }; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - List list = new List(); - foreach (XElement item in xElement.Elements()) - { - MessageAsset messageAsset = new MessageAsset(); - messageAsset.FromXElement(item, deserializationInfo); - list.Add(messageAsset); - } - AssetsMessages = list; - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - List list2 = new List(); - foreach (XElement item2 in xElement2.Elements()) - { - MessageExchange messageExchange = new MessageExchange(); - messageExchange.FromXElement(item2, deserializationInfo); - list2.Add(messageExchange); - } - ExchangeMessages = list2; - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - List list3 = new List(); - foreach (XElement item3 in xElement3.Elements()) - { - MessageAccount messageAccount = new MessageAccount(); - messageAccount.FromXElement(item3, deserializationInfo); - list3.Add(messageAccount); - } - AccountMessages = list3; - } - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - string name = typeof(MessageSymbol).Name; - List list4 = new List(); - foreach (XElement item4 in xElement4.Elements()) - { - try - { - MessageSymbol messageSymbol = new MessageSymbol(string.Empty); - if (item4.Name == name) - { - messageSymbol.FromXElement(item4, deserializationInfo); - } - else - { - XElement xElement5 = item4.Element(name); - if (xElement5 != null) - { - messageSymbol.FromXElement(xElement5, deserializationInfo); - } - } - list4.Add(messageSymbol); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - SymbolMessages = list4; - } - XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement6 != null) - { - List list5 = new List(); - foreach (XElement item5 in xElement6.Elements()) - { - MessageOptionSerie messageOptionSerie = new MessageOptionSerie(); - messageOptionSerie.FromXElement(item5, deserializationInfo); - list5.Add(messageOptionSerie); - } - OptionSeries = list5; - } - XElement xElement7 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement7 != null) - { - List list6 = new List(); - foreach (XElement item6 in xElement7.Elements()) - { - DayBar dayBar = new DayBar(string.Empty, Core.Instance.TimeUtils.DateTimeUtcNow); - dayBar.FromXElement(item6, deserializationInfo); - list6.Add(dayBar); - } - DayBars = list6; - } - XElement xElement8 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement8 != null) - { - List list7 = new List(); - foreach (XElement item7 in xElement8.Elements()) - { - MessageCryptoAccount messageCryptoAccount = new MessageCryptoAccount(); - messageCryptoAccount.FromXElement(item7, deserializationInfo); - list7.Add(messageCryptoAccount); - } - CryptoAccounts = list7; - } - XElement xElement9 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement9 != null) - { - List list8 = new List(); - foreach (XElement item8 in xElement9.Elements()) - { - MessageCryptoAssetBalances messageCryptoAssetBalances = new MessageCryptoAssetBalances(); - messageCryptoAssetBalances.FromXElement(item8, deserializationInfo); - list8.Add(messageCryptoAssetBalances); - } - AssetBalances = list8; - } - XElement xElement10 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement10 != null) - { - List list9 = new List(); - foreach (XElement item9 in xElement10.Elements()) - { - MessageOpenOrder messageOpenOrder = new MessageOpenOrder(); - messageOpenOrder.FromXElement(item9, deserializationInfo); - list9.Add(messageOpenOrder); - } - OpenOrdersMessages = list9; - } - XElement xElement11 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement11 != null) - { - List list10 = new List(); - foreach (XElement item10 in xElement11.Elements()) - { - MessageOpenPosition messageOpenPosition = new MessageOpenPosition(); - messageOpenPosition.FromXElement(item10, deserializationInfo); - list10.Add(messageOpenPosition); - } - PositionMessages = list10; - } - XElement xElement12 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement12 != null) - { - List list11 = new List(); - foreach (XElement item11 in xElement12.Elements()) - { - MessageOpenDeliveredAsset messageOpenDeliveredAsset = new MessageOpenDeliveredAsset(); - messageOpenDeliveredAsset.FromXElement(item11, deserializationInfo); - list11.Add(messageOpenDeliveredAsset); - } - OpenDeliveredAssetMessages = list11; - } - XElement xElement13 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement13 == null) - { - return; - } - List list12 = new List(); - foreach (XElement item12 in xElement13.Elements()) - { - MessageSessionsContainer messageSessionsContainer = new MessageSessionsContainer(); - messageSessionsContainer.FromXElement(item12, deserializationInfo); - list12.Add(messageSessionsContainer); - } - SessionsContainers = list12; - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), typeof(SnapshotData).Name)); - XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (MessageAsset assetsMessage in AssetsMessages) - { - xElement2.Add(assetsMessage.ToXElement()); - } - xElement.Add(xElement2); - XElement xElement3 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (MessageExchange exchangeMessage in ExchangeMessages) - { - xElement3.Add(exchangeMessage.ToXElement()); - } - xElement.Add(xElement3); - XElement xElement4 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - XElement xElement5 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (MessageAccount accountMessage in AccountMessages) - { - if (accountMessage is MessageCryptoAccount) - { - xElement5.Add(accountMessage.ToXElement()); - } - else - { - xElement4.Add(accountMessage.ToXElement()); - } - } - xElement.Add(xElement4); - xElement.Add(xElement5); - XElement xElement6 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (MessageSymbol symbolMessage in SymbolMessages) - { - xElement6.Add(symbolMessage.ToXElement()); - } - xElement.Add(xElement6); - XElement xElement7 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (MessageOptionSerie item in OptionSeries) - { - xElement7.Add(item.ToXElement()); - } - xElement.Add(xElement7); - XElement xElement8 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (DayBar dayBar in DayBars) - { - xElement8.Add(dayBar.ToXElement()); - } - xElement.Add(xElement8); - XElement xElement9 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (MessageCryptoAssetBalances assetBalance in AssetBalances) - { - xElement9.Add(assetBalance.ToXElement()); - } - xElement.Add(xElement9); - XElement xElement10 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (MessageOpenOrder openOrdersMessage in OpenOrdersMessages) - { - xElement10.Add(openOrdersMessage.ToXElement()); - } - xElement.Add(xElement10); - XElement xElement11 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (MessageOpenPosition positionMessage in PositionMessages) - { - xElement11.Add(positionMessage.ToXElement()); - } - xElement.Add(xElement11); - XElement xElement12 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (MessageOpenDeliveredAsset openDeliveredAssetMessage in OpenDeliveredAssetMessages) - { - xElement12.Add(openDeliveredAssetMessage.ToXElement()); - } - xElement.Add(xElement12); - XElement xElement13 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (MessageSessionsContainer sessionsContainer in SessionsContainers) - { - xElement13.Add(sessionsContainer.ToXElement()); - } - xElement.Add(xElement13); - return xElement; - } - } - public class DeserializationInfo - { - [CompilerGenerated] - private double ??; - - private readonly Func ??; - - public double Version - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - private DeserializationInfo() - { - Version = 1.0; - } - - public DeserializationInfo(Func fabric) - : this() - { - ?? = fabric; - } - - public IXElementSerialization CreateObject(XElement node) - { - try - { - return ???.Invoke(node); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex.Message, LoggingLevel.Verbose); - return null; - } - } - } - public static class Serializer - { - private const double ?? = 1.3; - - /// - /// Version 1.1: ?????????? ????? ?????? ? ??????????: ????? ???????? ????????? ???????? - /// - public const double VERSION_NEW_CONNECTIONS_SCHEMA = 1.1; - - public const double VERSION_CHANGE_ENCRYPTION_KEY_SCHEMA = 1.2; - - public const double VERSION_CHANGE_DATE_TIME_SERIALIZATION_FORMAT = 1.3; - - public const double VERSION_CHANGE_HOTKEYS_SETTING_ITEM_CLASS_NAME = 1.4; - - public const string CORE_SERIALIZATION_NAMESPACE_NAME = "TradingPlatform"; - - public static bool SerializeXML(string filePath, List list) - { - try - { - XElement xElement = ?(list); - if (xElement != null) - { - xElement.Save(filePath); - return true; - } - return false; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - return false; - } - } - - public static bool SerializeXML(Stream stream, List list) - { - try - { - XElement xElement = ?(list); - if (xElement != null) - { - xElement.Save(stream); - return true; - } - return false; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - return false; - } - } - - public static List DeserializeXML(string filePath, out double version, Func fabric) - { - List result = new List(); - version = 1.3; - if (string.IsNullOrEmpty(filePath)) - { - return result; - } - if (!File.Exists(filePath)) - { - return result; - } - FileStream fileStream = null; - try - { - fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); - result = DeserializeXML(fileStream, out version, fabric); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - fileStream?.Close(); - } - return result; - } - - public static List DeserializeXML(Stream stream, out double version, Func fabric) - { - List list = new List(); - version = 1.3; - if (stream == null) - { - return list; - } - try - { - XElement xElement = XElement.Load(stream); - DeserializationInfo deserializationInfo = new DeserializationInfo(fabric); - if (double.TryParse(xElement.Attribute(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value, NumberStyles.Float, CultureInfo.InvariantCulture, out version)) - { - deserializationInfo.Version = version; - } - foreach (XElement item in xElement.Nodes()) - { - IXElementSerialization iXElementSerialization = DeserializeNode(item, deserializationInfo); - if (iXElementSerialization != null) - { - list.Add(iXElementSerialization); - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - return list; - } - - public static IEnumerable DeserializeXML(XElement element, DeserializationInfo info) - { - foreach (XElement item in element.Nodes()) - { - IXElementSerialization iXElementSerialization = DeserializeNode(item, info); - if (iXElementSerialization != null) - { - yield return iXElementSerialization; - } - } - } - - public static IXElementSerialization DeserializeNode(XElement node, DeserializationInfo info) - { - try - { - IXElementSerialization iXElementSerialization = info.CreateObject(node); - iXElementSerialization?.FromXElement(node, info); - return iXElementSerialization; - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - return null; - } - - private static XElement ?(List P_0) - { - try - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new XAttribute(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1.3)); - for (int i = 0; i < P_0.Count; i++) - { - try - { - xElement.Add(P_0[i].ToXElement()); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - return xElement; - } - catch (Exception ex2) - { - Core.Instance.Loggers.Log(ex2); - return null; - } - } - } - [ProtoContract] - public sealed class TypedObjectSurrogate : TypedObjectSurrogate - { - [CompilerGenerated] - private T ??; - - [ProtoIgnore] - public override object ObjectValue => Value; - - [ProtoMember(1)] - public T Value - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public TypedObjectSurrogate() - { - } - - public TypedObjectSurrogate(T value) - { - Value = value; - } - } - [ProtoContract] - public abstract class TypedObjectSurrogate - { - [ProtoIgnore] - public abstract object ObjectValue { get; } - - public static object CreateSurrogate(T value) - { - if (value == null) - { - return new TypedObjectSurrogate(); - } - Type type = value.GetType(); - if (type == typeof(T)) - { - return new TypedObjectSurrogate(value); - } - return Activator.CreateInstance(typeof(TypedObjectSurrogate<>).MakeGenericType(type), value); - } - } -} -namespace TradingPlatform.BusinessLayer.Abstractions -{ - public interface IVwapHistoryItem : IHistoryItem, ICloneable - { - /// - /// - /// - int RangeIndex { get; } - - /// - /// - /// - new DateTime TimeLeft { get; } - - /// - /// Get VWAP value - /// - double Value { get; } - - /// - /// - /// - double STDCoefficient { get; } - - /// - /// - /// - double CumulativeVolume { get; } - - /// - /// - /// - double CumulativePriceMVolume { get; } - - /// - /// - /// - double MPDCoefficient { get; } - } -} -namespace TradingPlatform.BusinessLayer.Abstractions.Misc -{ - public interface ITaskSchedulerProvider - { - TaskScheduler TaskScheduler { get; } - } -} -namespace TradingPlatform.BusinessLayer.Integration -{ - public interface IBrowser - { - string BrowserTitle { get; set; } - - Size BrowerSize { get; set; } - - event BrowserEventHandler Navigated; - - event BrowserEventHandler Closed; - - void Show(); - - void Close(); - - void Navigate(string address); - } - public delegate void BrowserEventHandler(IBrowser browser, BrowserEventArgs e); - public interface IBrowserFactory - { - IBrowser CreateBrowser(string url = null); - } - public interface IHistoryVendor : IVendor - { - HistoryMetadata GetHistoryMetadata(CancellationToken cancelationToken); - - IList LoadHistory(HistoryRequestParameters requestParameters); - } - public interface IMessageBuilder where TMessage : Message - { - TMessage BuildMessage(); - } - public interface INeedSymbolToPocess - { - string SymbolId { get; } - } - public interface IQuoteVendor : IVendor - { - void SubscribeSymbol(SubscribeQuotesParameters parameters); - - void UnSubscribeSymbol(SubscribeQuotesParameters parameters); - } - public interface ISymbolVendor : IVendor - { - bool AllowNonFixedList { get; } - - IList GetSessions(CancellationToken token); - - IList GetExchanges(CancellationToken token); - - IList GetAssets(CancellationToken token); - - IList GetSymbols(CancellationToken token); - - MessageSymbolTypes GetSymbolTypes(CancellationToken token); - - IList GetSymbolGroups(CancellationToken token); - - MessageSymbol GetNonFixedSymbol(GetSymbolRequestParameters requestParameters); - - IList SearchSymbols(SearchSymbolsRequestParameters requestParameters); - - IList GetFutureContracts(GetFutureContractsRequestParameters requestParameters); - - IList GetOptionSeries(GetOptionSeriesRequestParameters requestParameters); - - IList GetStrikes(GetStrikesRequestParameters requestParameters); - } - public interface ITradingVendor : IVendor - { - LimitationMetadata GetLimitationMetadata(); - - IList GetAccounts(CancellationToken token); - - IList GetCryptoAssetBalances(CancellationToken token); - - IList GetRules(CancellationToken token); - - IList GetAccountOperations(CancellationToken token); - - IList GetAllowedOrderTypes(CancellationToken token); - - IList GetPendingOrders(CancellationToken token); - - IList GetPositions(CancellationToken token); - - TradesHistoryMetadata GetTradesMetadata(); - - IList GetTrades(TradesHistoryRequestParameters parameters); - - void GetTrades(TradesHistoryRequestParameters parameters, AccountTradesLoadingCallback callback); - - IList GetOrdersHistory(OrdersHistoryRequestParameters parameters); - - PnL CalculatePnL(PnLRequestParameters parameters); - - TradingOperationResult PlaceOrder(PlaceOrderRequestParameters parameters); - - TradingOperationResult PlaceMultiOrder(PlaceMultiOrderOrderRequestParameters parameters); - - TradingOperationResult ModifyOrder(ModifyOrderRequestParameters parameters); - - TradingOperationResult CancelOrder(CancelOrderRequestParameters parameters); - - TradingOperationResult ClosePosition(ClosePositionRequestParameters parameters); - - MarginInfo GetMarginInfo(OrderRequestParameters orderRequestParameters); - - IList GetReportsMetaData(CancellationToken token); - - Report GenerateReport(ReportRequestParameters reportRequestParameters); - } - public interface IVendor - { - string Key { get; set; } - - event EventHandler NewMessage; - - ConnectionResult Connect(ConnectRequestParameters connectRequestParameters); - - void Disconnect(); - - void OnConnected(CancellationToken token); - - PingResult Ping(); - - void PushMessage(Message msg); - - void SendCustomRequest(RequestParameters parameters); - } - public interface IVolumeAnalysisVendor : IVendor - { - VolumeAnalysisMetadata GetVolumeAnalysisMetadata(); - - VendorVolumeAnalysisByPeriodResponse LoadVolumeAnalysis(VolumeAnalysisByPeriodRequestParameters requestParameters); - } - public class BrowserEventArgs : EventArgs - { - [CompilerGenerated] - private string ??; - - public string Url - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public BrowserEventArgs(string url = null) - { - Url = url; - } - } - public class ConnectionLogger - { - private readonly ILogger ??; - - public ConnectionLogger(string vendorName, string connectionId) - { - string outputFolderPath = Path.Combine(Const.LOGS_FOLDER_PATH, vendorName, connectionId); - ?? = Core.Instance.Loggers.GetLogger(new LoggerConfig - { - LoggerName = connectionId, - OutputFolderPath = outputFolderPath, - Scope = LoggerScope.General - }); - } - - public void Log(string message) - { - ???.Log(message, Core.Instance.TimeUtils.DateTimeUtcNow, LoggingLevel.Verbose); - } - - public void Dispose() - { - ???.Dispose(); - } - } - /// - /// Vendor connection respond bundle - /// - [ProtoContract] - public sealed class ConnectionResult : ICloneable - { - [CompilerGenerated] - private ConnectionState ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private IList ??; - - /// - /// The connection status - /// - [ProtoMember(1)] - public ConnectionState State - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// The respond message - /// - [ProtoMember(2)] - public string Message - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(3)] - public bool Cancelled - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IList UpdatedSettings - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public static ConnectionResult CreateFail(string message, IList updatedSettings = null) - { - return new ConnectionResult - { - State = ConnectionState.Fail, - Message = message, - UpdatedSettings = updatedSettings - }; - } - - public static ConnectionResult CreateSuccess(string message = "", IList updatedSettings = null) - { - return new ConnectionResult - { - State = ConnectionState.Connected, - Message = message, - UpdatedSettings = updatedSettings - }; - } - - public static ConnectionResult CreateCancelled(string message = "") - { - return new ConnectionResult - { - State = ConnectionState.Fail, - Message = message, - Cancelled = true - }; - } - - public object Clone() - { - return new ConnectionResult - { - State = State, - Message = Message, - Cancelled = Cancelled - }; - } - } - [ProtoContract] - public sealed class ConnectRequestParameters : RequestParameters - { - [CompilerGenerated] - private IList ??; - - [CompilerGenerated] - private IBrowserFactory ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private IProgress ??; - - public override RequestType Type => RequestType.Connect; - - [ProtoMember(1)] - public IList ConnectionSettings - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = list; - } - } - - public IBrowserFactory BrowserFactory - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = browserFactory; - } - } - - public string ConnectionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - public IProgress ConnectingProgress - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = progress; - } - } - - public ConnectRequestParameters() - { - } - - public ConnectRequestParameters(IList connectionSettings) - { - ConnectionSettings = connectionSettings; - } - } -} -namespace ? -{ - internal class ? : BufferedProcessor - { - public int ??; - - private readonly Dictionary ??; - - public Action ??; - - public Func> ??; - - public ?() - { - ?? = new Dictionary(); - } - - public void ?() - { - ProcessTreadsCount = ??; - } - - protected override void Process(DayBarMessageGenerationParameters subject) - { - try - { - CancellationToken token; - lock (??) - { - if (??.TryGetValue(subject.SymbolId, out var value)) - { - value.Cancel(); - } - value = new CancellationTokenSource(); - ??[subject.SymbolId] = value; - token = value.Token; - } - if (!token.IsCancellationRequested) - { - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - HistoryRequestParameters arg = new HistoryRequestParameters - { - SymbolId = subject.SymbolId, - FromTime = dateTimeUtcNow.Date.AddDays(0L - (long)subject.DayToLoadCount).AddMilliseconds(-1.0), - ToTime = dateTimeUtcNow, - Aggregation = new HistoryAggregationTime(new Period(BasePeriod.Day, 1), subject.UpdateHistoryType), - CancellationToken = token - }; - IList list = ???.Invoke(arg); - if (list != null && list.Count != 0 && !token.IsCancellationRequested) - { - ? ?2 = new ?(subject.SymbolId) - { - UpdateHistoryType = subject.UpdateHistoryType - }; - ?2.?(token, subject.SymbolId, list); - ???.Invoke(?2); - ??.Remove(subject.SymbolId); - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - subject?.Callback?.Invoke(); - } - } - - protected internal override void Clear() - { - foreach (CancellationTokenSource value in ??.Values) - { - value.Cancel(); - } - base.Clear(); - } - } -} -namespace TradingPlatform.BusinessLayer.Integration -{ - public abstract class DayBarMessageCreator : IDayBarUpdate, IDisposable - { - public Action PushMessage; - - private protected ConcurrentDictionary ??; - - private bool ??; - - public virtual void Initialize() - { - ?? = new ConcurrentDictionary(); - } - - public void TryCreateEmptyDb(string symbol, HistoryType updateType) - { - if (!??.TryGetValue(symbol, out var value)) - { - value = new ?(symbol) - { - UpdateHistoryType = updateType - }; - ??[symbol] = value; - } - PushMessage?.Invoke(value.LastDayBar); - } - - public DayBar ProcessQuote(Quote quote1) - { - if (!??.TryGetValue(quote1.SymbolId, out var value)) - { - return null; - } - return value.ProcessQuote(quote1); - } - - public DayBar ProcessLast(Last last) - { - if (!??.TryGetValue(last.SymbolId, out var value)) - { - return null; - } - return value.ProcessLast(last); - } - - public DayBar ProcessMark(Mark mark) - { - if (!??.TryGetValue(mark.SymbolId, out var value)) - { - return null; - } - return value.ProcessMark(mark); - } - - public abstract void CreateDbFromHistory(string symbol, HistoryType updateType, Action callback = null); - - public void CheckIfNeedUpdate() - { - if (??) - { - return; - } - ?? = true; - try - { - foreach (KeyValuePair item in new Dictionary(??)) - { - string key = item.Key; - ? value = item.Value; - if ((Core.Instance.TimeUtils.DateTimeUtcNow - value.LastDayBarCreationTime).TotalDays > 1.0) - { - CreateDbFromHistory(key, value.UpdateHistoryType); - } - } - } - finally - { - ?? = false; - } - } - - public virtual void Dispose() - { - ???.Clear(); - } - } -} -namespace ? -{ - internal class ? : IDayBarUpdate - { - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private HistoryType ??; - - [CompilerGenerated] - private DayBar ??; - - public DateTime LastDayBarCreationTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dateTime; - } - } - - public HistoryType UpdateHistoryType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = historyType; - } - } - - internal string SymbolId => LastDayBar?.SymbolId; - - internal DayBar LastDayBar - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dayBar; - } - } - - internal ?(string P_0) - { - LastDayBar = new DayBar(P_0, Core.Instance.TimeUtils.DateTimeUtcNow); - } - - internal void ?(CancellationToken P_0, string P_1, IList P_2) - { - DayBar dayBar = null; - try - { - if (P_0.IsCancellationRequested || P_2 == null || !P_2.Any()) - { - return; - } - IHistoryItem historyItem = P_2[P_2.Count - 1]; - if (historyItem == null) - { - return; - } - TimeSpan timeSpan = Core.Instance.TimeUtils.DateTimeUtcNow - historyItem.TimeLeft; - LastDayBarCreationTime = historyItem.TimeLeft.AddDays((int)timeSpan.TotalDays); - dayBar = new DayBar(P_1, Core.Instance.TimeUtils.DateTimeUtcNow) - { - Open = historyItem[PriceType.Open], - High = historyItem[PriceType.High], - Low = historyItem[PriceType.Low], - Volume = historyItem[PriceType.Volume], - QuoteAssetVolume = historyItem[PriceType.QuoteAssetVolume] - }; - if (UpdateHistoryType == HistoryType.Last) - { - dayBar.Trades = (long)historyItem[PriceType.Ticks]; - } - else - { - dayBar.Ticks = (long)historyItem[PriceType.Ticks]; - } - if (P_2.Count > 1) - { - dayBar.PreviousClose = P_2[P_2.Count - 2][PriceType.Close]; - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - LastDayBar = dayBar; - } - - public DayBar ProcessQuote(Quote quote1) - { - DayBar lastDayBar = LastDayBar; - if (lastDayBar == null) - { - return null; - } - if (UpdateHistoryType switch - { - HistoryType.Ask => ?(lastDayBar, quote1.Ask) ? 1 : 0, - HistoryType.Bid => ?(lastDayBar, quote1.Bid) ? 1 : 0, - HistoryType.Midpoint => ?(lastDayBar, (quote1.Ask + quote1.Bid) / 2.0) ? 1 : 0, - _ => 0, - } == 0) - { - return null; - } - return lastDayBar; - } - - public DayBar ProcessLast(Last last) - { - bool flag = false; - DayBar lastDayBar = LastDayBar; - if (lastDayBar == null) - { - return null; - } - if (UpdateHistoryType == HistoryType.Last) - { - flag = ?(lastDayBar, last.Price); - } - if (!flag) - { - return null; - } - return lastDayBar; - } - - public DayBar ProcessMark(Mark mark) - { - bool flag = false; - DayBar lastDayBar = LastDayBar; - if (lastDayBar == null) - { - return null; - } - if (UpdateHistoryType == HistoryType.Mark) - { - flag = ?(lastDayBar, mark.Price); - } - if (!flag) - { - return null; - } - return lastDayBar; - } - - private static bool ?(DayBar P_0, double P_1) - { - bool result = false; - if (double.IsNaN(P_0.High) || P_0.High < P_1) - { - P_0.High = P_1; - result = true; - } - if (double.IsNaN(P_0.Low) || P_0.Low > P_1) - { - P_0.Low = P_1; - result = true; - } - return result; - } - } -} -namespace TradingPlatform.BusinessLayer.Integration -{ - public class DayBarMessageFromHistoryCreator : DayBarMessageCreator - { - private const int ?? = 5; - - public Func> LoadHistory; - - [CompilerGenerated] - private Action ??; - - public int GenerationThreadsCount; - - private readonly ? ??; - - public Action CorrectDayBar - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DayBarMessageFromHistoryCreator() - { - ?? = new ?(); - GenerationThreadsCount = 3; - } - - public override void Initialize() - { - base.Initialize(); - ??.?? = LoadHistory; - ??.?? = GenerationThreadsCount; - ??.?? = ?; - ??.?(); - ??.Start(); - } - - public override void CreateDbFromHistory(string symbol, HistoryType updateType, Action callback = null) - { - DayBarMessageGenerationParameters subject = new DayBarMessageGenerationParameters - { - SymbolId = symbol, - UpdateHistoryType = updateType, - DayToLoadCount = 5u, - Callback = callback - }; - ??.Push(subject); - } - - private void ?(? P_0) - { - DayBar lastDayBar = P_0.LastDayBar; - CorrectDayBar?.Invoke(lastDayBar); - ??[P_0.SymbolId] = P_0; - PushMessage?.Invoke(lastDayBar); - } - - public override void Dispose() - { - ???.Stop(); - base.Dispose(); - } - } - public class DayBarMessageGenerationParameters - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private HistoryType ??; - - [CompilerGenerated] - private uint ??; - - [CompilerGenerated] - private Action ??; - - public string SymbolId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public HistoryType UpdateHistoryType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public uint DayToLoadCount - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Action Callback - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - } - public interface IDayBarUpdate - { - DayBar ProcessQuote(Quote quote1); - - DayBar ProcessLast(Last last); - - DayBar ProcessMark(Mark mark); - } - /// - /// Ping state dictum - /// - public enum PingEnum - { - /// - /// Ping signals connected - /// - Connected, - /// - /// Ping signals disconnected - /// - Disconnected - } - public enum VolumeAnalysisAvailability - { - NotAvailable, - Available - } - /// - /// The asset formatting description. - /// - public class AssetFormattingDescription : FormattingDescription - { - private readonly string ??; - - private readonly bool ??; - - /// - /// Initializes a new instance of the class. - /// - /// The asset id. - /// The value. - /// If true, add currency name. - public AssetFormattingDescription(string assetId, double value, bool addCurrencyName = true) - : base(value) - { - ?? = assetId; - ?? = addCurrencyName; - } - - protected override bool IsValueValid(double value) - { - if (!double.IsNaN(value)) - { - return base.IsValueValid(value); - } - return false; - } - - protected override string FormatValue(double value) - { - Asset asset = Core.Instance.Connections[base.ConnectionId]?.BusinessObjects?.Assets.FirstOrDefault((Asset P_0) => P_0.Id == ??); - if (asset == null) - { - return value.Format(); - } - if (!??) - { - return asset.FormatPrice(value); - } - return asset.FormatPriceWithCurrency(value); - } - - [CompilerGenerated] - private bool ?(Asset P_0) - { - return P_0.Id == ??; - } - } - public class DateTimeFormattingDescription : FormattingDescription - { - public DateTimeFormattingDescription(DateTime dateTime) - : base(dateTime) - { - } - - protected override string FormatValue(DateTime value) - { - return Core.Instance.TimeUtils.ConvertFromUTCToSelectedTimeZone(value).ToString(Core.Instance.TimeUtils.CultureInfo); - } - } - public abstract class FormattingDescription : IFormattingDescription - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private readonly bool ??; - - private readonly TValue ??; - - public string ConnectionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool AllowFormatDefaultValue - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - protected virtual TValue DefaultValue => default(TValue); - - protected FormattingDescription(TValue value) - { - ?? = value; - } - - public string GetFormattedData() - { - if (!IsValueValid(??)) - { - return string.Empty; - } - return FormatValue(??); - } - - protected virtual bool IsValueValid(TValue value) - { - if (!AllowFormatDefaultValue) - { - return !object.Equals(DefaultValue, ??); - } - return true; - } - - protected abstract string FormatValue(TValue value); - } - public interface IFormattingDescription - { - string ConnectionId { get; set; } - - string GetFormattedData(); - } - public class OffsetFormattingDescription : FormattingDescription - { - private readonly string ??; - - public OffsetFormattingDescription(double offset, string symbolId) - : base(offset) - { - ?? = symbolId; - } - - protected override bool IsValueValid(double value) - { - if (!double.IsNaN(value)) - { - return base.IsValueValid(value); - } - return false; - } - - protected override string FormatValue(double value) - { - Symbol symbol = Core.Instance.Connections[base.ConnectionId]?.BusinessObjects?.Symbols?.FirstOrDefault((Symbol P_0) => P_0.Id == ??); - if (symbol == null) - { - return value.ToString(CultureInfo.InvariantCulture); - } - return symbol.FormatOffset(value, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - - [CompilerGenerated] - private bool ?(Symbol P_0) - { - return P_0.Id == ??; - } - } - public class OrderTypeNameFormattingDescription : FormattingDescription - { - public OrderTypeNameFormattingDescription(string orderTypeId) - : base(orderTypeId) - { - } - - protected override string FormatValue(string value) - { - return Core.Instance.GetOrderType(value, base.ConnectionId)?.Name ?? value; - } - } - public class PriceFormattingDescription : FormattingDescription - { - private readonly string ??; - - public PriceFormattingDescription(double price, string symbolId) - : base(price) - { - ?? = symbolId; - } - - protected override bool IsValueValid(double value) - { - if (!double.IsNaN(value)) - { - return base.IsValueValid(value); - } - return false; - } - - protected override string FormatValue(double value) - { - Symbol symbol = Core.Instance.Connections[base.ConnectionId]?.BusinessObjects?.Symbols?.FirstOrDefault((Symbol P_0) => P_0.Id == ??); - if (symbol != null) - { - return symbol.FormatPrice(value); - } - return value.ToString(CultureInfo.InvariantCulture); - } - - [CompilerGenerated] - private bool ?(Symbol P_0) - { - return P_0.Id == ??; - } - } - public class SlTpHolderFormattingDescription : FormattingDescription - { - private readonly string ??; - - public SlTpHolderFormattingDescription(SlTpHolder slTpHolder, string symbolId) - : base(slTpHolder) - { - ?? = symbolId; - } - - protected override string FormatValue(SlTpHolder value) - { - Symbol symbol = Core.Instance.Connections[base.ConnectionId]?.BusinessObjects?.Symbols?.FirstOrDefault((Symbol P_0) => P_0.Id == ??); - return value.Format(symbol); - } - - [CompilerGenerated] - private bool ?(Symbol P_0) - { - return P_0.Id == ??; - } - } - public class SymbolNameFormattingDescription : FormattingDescription - { - public SymbolNameFormattingDescription(string symbolId) - : base(symbolId) - { - } - - protected override string FormatValue(string value) - { - return Core.Instance.GetSymbol(new GetSymbolRequestParameters - { - SymbolId = value - }, base.ConnectionId, NonFixedListDownload.IgnoreDownload)?.Name ?? value; - } - } - public class VolumeFormattingDescription : FormattingDescription - { - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - private readonly string ??; - - public bool DisplayQuantityInLots - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool AbbreviateVolumes - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public VolumeFormattingDescription(double volume, string symbolId) - : base(volume) - { - ?? = symbolId; - } - - protected override bool IsValueValid(double value) - { - if (!double.IsNaN(value)) - { - return base.IsValueValid(value); - } - return false; - } - - protected override string FormatValue(double value) - { - Symbol symbol = Core.Instance.Connections[base.ConnectionId]?.?(new GetSymbolRequestParameters - { - SymbolId = ?? - }, NonFixedListDownload.IgnoreDownload); - if (symbol != null) - { - return symbol.FormatQuantity(value, DisplayQuantityInLots, AbbreviateVolumes); - } - return value.ToString(CultureInfo.InvariantCulture); - } - } - /// - /// Mediates a history meta data with available data types and intervals on vendor side - /// - [ProtoContract] - public sealed class HistoryMetadata - { - [CompilerGenerated] - private string[] ??; - - [CompilerGenerated] - private Period[] ??; - - [CompilerGenerated] - private BasePeriod[] ??; - - [CompilerGenerated] - private HistoryType[] ??; - - [CompilerGenerated] - private HistoryType[] ??; - - [CompilerGenerated] - private Period[] ??; - - [CompilerGenerated] - private BasePeriod[] ??; - - [CompilerGenerated] - private TimeSpan ??; - - [CompilerGenerated] - private TimeSpan ??; - - [CompilerGenerated] - private TimeSpan ??; - - [CompilerGenerated] - private TimeSpan ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [ProtoMember(1)] - public string[] AllowedAggregations - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(2)] - public Period[] AllowedPeriodsHistoryAggregationTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(3)] - public BasePeriod[] AllowedBasePeriodsHistoryAggregationTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(4)] - public HistoryType[] AllowedHistoryTypesHistoryAggregationTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(5)] - public HistoryType[] AllowedHistoryTypesHistoryAggregationTick - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(6)] - public Period[] AllowedPeriodsHistoryAggregationTimeStatistics - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(7)] - public BasePeriod[] AllowedBasePeriodsHistoryAggregationTimeStatistics - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(8)] - public TimeSpan DownloadingStep_Tick - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(9)] - public TimeSpan DownloadingStep_Second - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(10)] - public TimeSpan DownloadingStep_Minute - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(11)] - public TimeSpan DownloadingStep_Day - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(12)] - public int DegreeOfParallelism - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(13, IsRequired = true)] - public bool UseHistoryLocalCache - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(14)] - public bool BuildUncompletedBars - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(15)] - public bool ServerSideTickDirectionAvailable - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - internal HistoryMetadata Copy => new HistoryMetadata(this); - - public HistoryMetadata() - { - AllowedAggregations = Array.Empty(); - AllowedPeriodsHistoryAggregationTime = Array.Empty(); - AllowedHistoryTypesHistoryAggregationTime = Array.Empty(); - AllowedHistoryTypesHistoryAggregationTick = Array.Empty(); - AllowedBasePeriodsHistoryAggregationTime = Array.Empty(); - AllowedPeriodsHistoryAggregationTimeStatistics = Array.Empty(); - AllowedBasePeriodsHistoryAggregationTimeStatistics = Array.Empty(); - DownloadingStep_Tick = TimeSpan.FromDays(10.0); - DownloadingStep_Second = TimeSpan.FromDays(10.0); - DownloadingStep_Minute = TimeSpan.FromDays(1000.0); - DownloadingStep_Day = TimeSpan.FromDays(10000.0); - DegreeOfParallelism = Environment.ProcessorCount; - UseHistoryLocalCache = true; - BuildUncompletedBars = false; - ServerSideTickDirectionAvailable = false; - } - - public HistoryMetadata(HistoryMetadata historyMetadata) - { - AllowedAggregations = new string[historyMetadata.AllowedAggregations.Length]; - Array.Copy(historyMetadata.AllowedAggregations, AllowedAggregations, historyMetadata.AllowedAggregations.Length); - AllowedPeriodsHistoryAggregationTime = new Period[historyMetadata.AllowedPeriodsHistoryAggregationTime.Length]; - Array.Copy(historyMetadata.AllowedPeriodsHistoryAggregationTime, AllowedPeriodsHistoryAggregationTime, AllowedPeriodsHistoryAggregationTime.Length); - AllowedBasePeriodsHistoryAggregationTime = new BasePeriod[historyMetadata.AllowedBasePeriodsHistoryAggregationTime.Length]; - Array.Copy(historyMetadata.AllowedBasePeriodsHistoryAggregationTime, AllowedBasePeriodsHistoryAggregationTime, historyMetadata.AllowedBasePeriodsHistoryAggregationTime.Length); - AllowedHistoryTypesHistoryAggregationTime = new HistoryType[historyMetadata.AllowedHistoryTypesHistoryAggregationTime.Length]; - Array.Copy(historyMetadata.AllowedHistoryTypesHistoryAggregationTime, AllowedHistoryTypesHistoryAggregationTime, historyMetadata.AllowedHistoryTypesHistoryAggregationTime.Length); - AllowedHistoryTypesHistoryAggregationTick = new HistoryType[historyMetadata.AllowedHistoryTypesHistoryAggregationTick.Length]; - Array.Copy(historyMetadata.AllowedHistoryTypesHistoryAggregationTick, AllowedHistoryTypesHistoryAggregationTick, historyMetadata.AllowedHistoryTypesHistoryAggregationTick.Length); - AllowedPeriodsHistoryAggregationTimeStatistics = new Period[historyMetadata.AllowedPeriodsHistoryAggregationTimeStatistics.Length]; - Array.Copy(historyMetadata.AllowedPeriodsHistoryAggregationTimeStatistics, AllowedPeriodsHistoryAggregationTimeStatistics, AllowedPeriodsHistoryAggregationTimeStatistics.Length); - AllowedBasePeriodsHistoryAggregationTimeStatistics = new BasePeriod[historyMetadata.AllowedBasePeriodsHistoryAggregationTimeStatistics.Length]; - Array.Copy(historyMetadata.AllowedBasePeriodsHistoryAggregationTimeStatistics, AllowedBasePeriodsHistoryAggregationTimeStatistics, historyMetadata.AllowedBasePeriodsHistoryAggregationTimeStatistics.Length); - DownloadingStep_Tick = historyMetadata.DownloadingStep_Tick; - DownloadingStep_Second = historyMetadata.DownloadingStep_Second; - DownloadingStep_Minute = historyMetadata.DownloadingStep_Minute; - DownloadingStep_Day = historyMetadata.DownloadingStep_Day; - DegreeOfParallelism = historyMetadata.DegreeOfParallelism; - UseHistoryLocalCache = historyMetadata.UseHistoryLocalCache; - BuildUncompletedBars = historyMetadata.BuildUncompletedBars; - ServerSideTickDirectionAvailable = historyMetadata.ServerSideTickDirectionAvailable; - } - - internal TimeSpan ?(HistoryAggregation P_0) - { - Period getPeriod = P_0.GetPeriod; - int basePeriod = (int)getPeriod.BasePeriod; - TimeSpan timeSpan; - long val; - if (basePeriod >= 4) - { - timeSpan = DownloadingStep_Day; - val = getPeriod.Ticks / Period.DAY1.Ticks; - } - else if (basePeriod >= 2) - { - timeSpan = DownloadingStep_Minute; - val = getPeriod.Ticks / Period.MIN1.Ticks; - } - else - { - if (basePeriod < 1) - { - if (getPeriod.BasePeriod == BasePeriod.Tick && getPeriod.PeriodMultiplier != 1) - { - return TimeSpan.Zero; - } - return DownloadingStep_Tick; - } - timeSpan = DownloadingStep_Second; - val = getPeriod.Ticks / Period.SECOND1.Ticks; - } - return TimeSpan.FromTicks(Math.Min(timeSpan.Ticks * Math.Max(val, 1L), 31536000000000000L)); - } - } - public static class SymbolDefaultDescriptions - { - public static string GetDefaultDescription(string symbolName) - { - switch (?.?(symbolName)) - { - case 1620419802u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1350845065u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 68008159u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2335563927u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3889859125u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2018644614u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3962463764u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 4116658238u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1624907770u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1887691111u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2942542223u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2151569089u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1839836162u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1078471552u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2087596954u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1637628082u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3233654154u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2238471692u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3649218711u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2360299262u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 24114034u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1615521271u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 429890879u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1265226235u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 191367025u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1679457057u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2483540628u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3039026436u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3661938870u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2516370071u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2850936713u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 659044693u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 4232868562u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1045659265u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3789443832u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 641760120u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 988355861u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 4281617233u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 80800563u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 350375300u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 839191917u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1999194261u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 4244775404u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 4014714260u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2928008062u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1825504590u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2037013095u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1280195859u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1328771369u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3606328198u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2515488773u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 957338138u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3685275323u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 173045139u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1934807510u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 124375746u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2429247009u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3501247908u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3298783647u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 4058670711u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3554264809u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2716707914u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3352170512u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 457013197u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 320108201u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1750896523u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2305573784u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2228121868u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3638868887u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1208142671u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3002305103u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2349949438u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 13764210u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 419541055u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2636366975u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1254876411u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1814557834u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 181017201u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2585813309u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1669107233u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2473190804u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3651589046u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2506020247u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2840586889u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 94341894u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 648694869u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 4222518738u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 714960562u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1035309441u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 978006037u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2357959268u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2496842966u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3711978256u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2491396094u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3371260840u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2634575795u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3652951536u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3030116563u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3436039563u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3021718053u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 284478568u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2411620006u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3350668061u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2073801205u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1905909567u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2441366352u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 4221599727u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2436215740u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1801439256u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2518774546u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2500097719u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3342045897u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3519432546u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2416749392u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3552124516u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2003830314u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2238933702u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 612031836u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2823409836u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 408419246u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3233745107u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2336395862u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1006372052u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 804040855u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 347237120u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3799182549u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1932694036u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2852934106u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 984865474u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1255225665u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3213535021u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1838176045u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2687288967u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3602322474u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3517448641u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 287284361u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3471409855u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1306488298u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3509434492u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2952591452u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 4217526264u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 422909761u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2371299268u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 168257872u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 394422474u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1343306773u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1926913222u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3775114597u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2016932178u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1069676081u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3499941520u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 4011922870u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3346963607u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3498891434u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 698744176u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 44668826u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3991148999u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3661345779u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1183670000u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2497369850u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3183129029u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 18060235u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2213786847u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3985953508u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 4169618513u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3517981331u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3921296083u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2246776758u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1307284877u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1724953394u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1471925664u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1427930923u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 701623346u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 4194627902u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3296676779u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 4130881864u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2291264053u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2637100485u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 420402725u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2268114475u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2739153357u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 510157801u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1229808796u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2526228103u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 206975631u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3884664239u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2392630576u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3379624205u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 850190540u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3436469264u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 637122682u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 468120478u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1508096022u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1651264960u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2633683452u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 1648225525u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2706260476u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 401975857u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 78441955u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 2746663082u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 4007212653u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 628962940u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3134998797u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - case 3513957278u: - if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) - { - break; - } - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - return string.Empty; - } - } - public class MarginInfo - { - [CompilerGenerated] - private readonly SettingItem[] ??; - - public SettingItem[] Parameters - { - [CompilerGenerated] - get - { - return ??; - } - } - - public MarginInfo(SettingItem[] parameters) - { - ?? = parameters; - } - } - [ProtoContract] - public abstract class CustomMessage : Message, IBufferedProcessorValue, IConnectionBindedObject - { - [CompilerGenerated] - private string ??; - - public string ConnectionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - public abstract int MessageId { get; } - - public override MessageType Type => MessageType.Custom; - - public int Key => MessageId; - } - public enum MessageType - { - Account, - Symbol, - OpenOrder, - CloseOrder, - OpenPosition, - ClosePosition, - Trade, - Quote, - Level2, - Last, - DayBar, - Asset, - Custom, - DOM, - Exchange, - ReportMetadata, - SymbolTypes, - OrderHistory, - Rule, - DealTicket, - SymbolGroup, - CryptoAssetBalances, - CryptoAccount, - OptionSerie, - SymbolInfo, - Session, - OpenDeliveredAsset, - CloseDeliveredAsset, - CorporateAction, - AccountOperation, - ClosedPosition, - Mark, - NewsHeadline, - TradingSignal, - RemoveTradingSignal - } - public enum QuotePriceType - { - Bid, - Ask - } - public sealed class LicenceMessageRule : MessageRule - { - public override MessageType Type => MessageType.Rule; - - public LicenceMessageRule() - { - if (!?.?(Assembly.GetCallingAssembly().Location)) - { - throw new Exception(); - } - } - } - [Serializable] - [DataContract(Name = "Message", Namespace = "TradingPlatform")] - [KnownType(typeof(CustomMessage))] - [KnownType(typeof(MessageAccount))] - [KnownType(typeof(MessageAsset))] - [KnownType(typeof(MessageCloseOrder))] - [KnownType(typeof(MessageClosePosition))] - [KnownType(typeof(MessageExchange))] - [KnownType(typeof(MessageSymbol))] - [KnownType(typeof(MessageSymbolTypes))] - [KnownType(typeof(MessageOpenOrder))] - [KnownType(typeof(MessageOpenPosition))] - [KnownType(typeof(MessageReportType))] - [KnownType(typeof(MessageTrade))] - [KnownType(typeof(MessageQuote))] - [KnownType(typeof(MessageDealTicket))] - [KnownType(typeof(MessageRule))] - [KnownType(typeof(MessageOrderHistory))] - [ProtoContract] - [ProtoInclude(1, typeof(MessageAsset))] - [ProtoInclude(2, typeof(MessageAccount))] - [ProtoInclude(3, typeof(MessageSymbolInfo))] - [ProtoInclude(4, typeof(MessageSymbolTypes))] - [ProtoInclude(5, typeof(MessageExchange))] - [ProtoInclude(6, typeof(MessageQuote))] - [ProtoInclude(7, typeof(MessageOpenOrder))] - [ProtoInclude(8, typeof(MessageCloseOrder))] - [ProtoInclude(9, typeof(MessageOpenPosition))] - [ProtoInclude(10, typeof(MessageClosePosition))] - [ProtoInclude(11, typeof(MessageTrade))] - [ProtoInclude(12, typeof(MessageSessionsContainer))] - [ProtoInclude(13, typeof(MessageOptionSerie))] - [ProtoInclude(14, typeof(MessageCryptoAssetBalances))] - [ProtoInclude(15, typeof(MessageOpenDeliveredAsset))] - [ProtoInclude(16, typeof(CustomMessage))] - public abstract class Message - { - public abstract MessageType Type { get; } - - public override string ToString() - { - return Type.ToString(); - } - } - [DataContract(Name = "Account", Namespace = "TradingPlatform")] - [ProtoContract] - [ProtoInclude(1000, typeof(MessageCryptoAccount))] - public class MessageAccount : Message, IXElementSerialization - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private NettingType ??; - - [CompilerGenerated] - private List ??; - - public override MessageType Type => MessageType.Account; - - [DataMember(Name = "ID")] - [ProtoMember(1)] - public string AccountId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Name")] - [ProtoMember(2)] - public string AccountName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "AssetId")] - [ProtoMember(3)] - public string AssetId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Balance")] - [ProtoMember(4)] - public double Balance - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(5)] - public NettingType NettingType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(6)] - public List AccountAdditionalInfo - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public MessageAccount() - { - NettingType = NettingType.Undefined; - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(25, 4); - defaultInterpolatedStringHandler.AppendFormatted(Type); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(AccountId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(AccountName); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Balance); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AccountId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AccountName)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AssetId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Balance)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)NettingType)); - XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (AccountAdditionalInfo != null) - { - foreach (AdditionalInfoItem item in AccountAdditionalInfo) - { - xElement2.Add(item.ToXElement()); - } - } - xElement.Add(xElement2); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - AccountId = xElement.Value; - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - AccountName = xElement2.Value; - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - AssetId = xElement3.Value; - } - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - Balance = xElement4.ToDouble(); - } - XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement5 != null) - { - NettingType = (NettingType)xElement5.ToInt(); - } - XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement6 == null) - { - return; - } - AccountAdditionalInfo = new List(); - foreach (XElement item in xElement6.Elements()) - { - AdditionalInfoItem additionalInfoItem = new AdditionalInfoItem(); - additionalInfoItem.FromXElement(item, deserializationInfo); - AccountAdditionalInfo.Add(additionalInfoItem); - } - } - } - public sealed class MessageAccountOperation : Message - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private IList ??; - - [CompilerGenerated] - private AccountOperationUpdateHandler ??; - - [CompilerGenerated] - private AccountOperationConfirmationHandler ??; - - [CompilerGenerated] - private AccountOperationExecuteHandler ??; - - public override MessageType Type => MessageType.AccountOperation; - - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string ButtonText - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IList Settings - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public AccountOperationUpdateHandler UpdateHandler - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public AccountOperationConfirmationHandler BuildConfirmationHandler - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public AccountOperationExecuteHandler ExecuteHandler - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public MessageAccountOperation() - { - Settings = new List(); - } - - public override string ToString() - { - return Name ?? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); - } - } - [DataContract(Name = "Asset", Namespace = "TradingPlatform")] - [ProtoContract] - public sealed class MessageAsset : Message, IXElementSerialization - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private double ??; - - private string ??; - - public override MessageType Type => MessageType.Asset; - - /// - /// Asset id bearer - /// - [DataMember(Name = "Id")] - [ProtoMember(1)] - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Asset name bearer - /// - [DataMember(Name = "Name")] - [ProtoMember(2)] - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Asset description - /// - [DataMember(Name = "Description")] - [ProtoMember(3)] - public string Description - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "MinimumChange")] - [ProtoMember(4)] - public double MinimumChange - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "ISO")] - [ProtoMember(5)] - public string IsoCode - { - get - { - return ?? ?? Name; - } - set - { - ?? = value; - } - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 3); - defaultInterpolatedStringHandler.AppendFormatted(Type); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Id); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Description)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MinimumChange)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsoCode)); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - Id = xElement.Value; - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - Name = xElement2.Value; - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - Description = xElement3.Value; - } - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - MinimumChange = xElement4.ToDouble(); - } - XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement5 != null) - { - IsoCode = xElement5.Value; - } - } - } - [DataContract(Name = "MessageCloseDeliveredAsset", Namespace = "TradingPlatform")] - [ProtoContract] - public sealed class MessageCloseDeliveredAsset : Message - { - [CompilerGenerated] - private string ??; - - public override MessageType Type => MessageType.CloseDeliveredAsset; - - [DataMember(Name = "Id")] - [ProtoMember(1)] - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(6, 2); - defaultInterpolatedStringHandler.AppendFormatted(Type); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Id); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - public class MessageClosedPosition : MessageOpenPosition - { - [CompilerGenerated] - private double ??; - - public override MessageType Type => MessageType.ClosedPosition; - - public double LastTradedPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public MessageClosedPosition(string symbolId) - : base(symbolId) - { - } - } - [DataContract(Name = "CloseOrder", Namespace = "TradingPlatform")] - [ProtoContract] - public sealed class MessageCloseOrder : Message - { - [CompilerGenerated] - private string ??; - - public override MessageType Type => MessageType.CloseOrder; - - [DataMember(Name = "OrderId")] - [ProtoMember(1)] - public string OrderId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(6, 2); - defaultInterpolatedStringHandler.AppendFormatted(Type); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderId); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - [DataContract(Name = "ClosePosition", Namespace = "TradingPlatform")] - [ProtoContract] - public sealed class MessageClosePosition : Message - { - [CompilerGenerated] - private string ??; - - public override MessageType Type => MessageType.ClosePosition; - - [DataMember(Name = "PositionId")] - [ProtoMember(1)] - public string PositionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(6, 2); - defaultInterpolatedStringHandler.AppendFormatted(Type); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(PositionId); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - [DataContract(Name = "CorporateAction", Namespace = "TradingPlatform")] - [ProtoContract] - public sealed class MessageCorporateAction : Message, INeedSymbolToPocess - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private CorporateActionType ??; - - public override MessageType Type => MessageType.CorporateAction; - - [DataMember(Name = "CorporateActionId")] - [ProtoMember(1)] - public string CorporateActionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "DateTime")] - [ProtoMember(2)] - public DateTime DateTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "InstrumentSymbol")] - [ProtoMember(3)] - public string SymbolId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Details")] - [ProtoMember(4)] - public string Details - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(5)] - public CorporateActionType CorporateActionType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - } - [DataContract(Name = "CryptoAccount", Namespace = "TradingPlatform")] - [ProtoContract] - public sealed class MessageCryptoAccount : MessageAccount - { - public override MessageType Type => MessageType.CryptoAccount; - } - [DataContract(Name = "CryptoAssetBalances", Namespace = "TradingPlatform")] - [ProtoContract] - public sealed class MessageCryptoAssetBalances : Message, IXElementSerialization, IEquatable - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private GetAvailableBalanceHandler ??; - - public override MessageType Type => MessageType.CryptoAssetBalances; - - [DataMember(Name = "AccountId")] - [ProtoMember(1)] - public string AccountId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Asset id bearer - /// - [DataMember(Name = "AssetId")] - [ProtoMember(2)] - public string AssetId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "TotalBalance")] - [ProtoMember(3)] - public double TotalBalance - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "AvailableBalance")] - [ProtoMember(4)] - public double AvailableBalance - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "ReservedBalance")] - [ProtoMember(5)] - public double ReservedBalance - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "TotalInUSD")] - [ProtoMember(6)] - public double TotalInUSD - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "TotalInBTC")] - [ProtoMember(7)] - public double TotalInBTC - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Debt")] - [ProtoMember(8)] - public double Debt - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Equity")] - [ProtoMember(9)] - public double Equity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "EquityInBTC")] - [ProtoMember(10)] - public double EquityInBTC - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public GetAvailableBalanceHandler AvailableBalanceHandler - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AccountId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AssetId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TotalBalance)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AvailableBalance)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ReservedBalance)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TotalInUSD)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TotalInBTC)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Debt)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Equity)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), EquityInBTC)); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - AccountId = xElement.Value; - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - AssetId = xElement2.Value; - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - TotalBalance = xElement3.ToDouble(); - } - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - AvailableBalance = xElement4.ToDouble(); - } - XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement5 != null) - { - ReservedBalance = xElement5.ToDouble(); - } - XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement6 != null) - { - TotalInUSD = xElement6.ToDouble(); - } - XElement xElement7 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement7 != null) - { - TotalInBTC = xElement7.ToDouble(); - } - XElement xElement8 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement8 != null) - { - Debt = xElement8.ToDouble(); - } - XElement xElement9 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement9 != null) - { - Equity = xElement9.ToDouble(); - } - XElement xElement10 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement10 != null) - { - EquityInBTC = xElement10.ToDouble(); - } - } - - public bool Equals(MessageCryptoAssetBalances other) - { - if (other == null) - { - return false; - } - if (this == other) - { - return true; - } - if (AccountId == other.AccountId && AssetId == other.AssetId && TotalBalance.Equals(other.TotalBalance) && AvailableBalance.Equals(other.AvailableBalance) && ReservedBalance.Equals(other.ReservedBalance) && TotalInUSD.Equals(other.TotalInUSD) && TotalInBTC.Equals(other.TotalInBTC) && Debt.Equals(other.Debt) && Equity.Equals(other.Equity) && EquityInBTC.Equals(other.EquityInBTC)) - { - return object.Equals(AvailableBalanceHandler, other.AvailableBalanceHandler); - } - return false; - } - - public override bool Equals(object obj) - { - if (this != obj) - { - if (obj is MessageCryptoAssetBalances other) - { - return Equals(other); - } - return false; - } - return true; - } - - public override int GetHashCode() - { - HashCode hashCode = default(HashCode); - hashCode.Add(AccountId); - hashCode.Add(AssetId); - hashCode.Add(TotalBalance); - hashCode.Add(AvailableBalance); - hashCode.Add(ReservedBalance); - hashCode.Add(TotalInUSD); - hashCode.Add(TotalInBTC); - hashCode.Add(Debt); - hashCode.Add(Equity); - hashCode.Add(EquityInBTC); - hashCode.Add(AvailableBalanceHandler); - return hashCode.ToHashCode(); - } - } - public delegate bool GetAvailableBalanceHandler(string assetId, OrderRequestParameters requestParameters, out double availableBalance); - [DataContract(Name = "DealTicket", Namespace = "TradingPlatform")] - public sealed class MessageDealTicket : Message - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private DealTicketType ??; - - public override MessageType Type => MessageType.DealTicket; - - [DataMember(Name = "Header")] - public string Header - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - [DataMember(Name = "Description")] - public string Description - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - [DataMember(Name = "DealTicketType")] - public DealTicketType DealTicketType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = dealTicketType; - } - } - - public MessageDealTicket(string header, string description = "", DealTicketType dealTicketType = DealTicketType.Info) - { - Header = header; - Description = description; - DealTicketType = dealTicketType; - } - - public static MessageDealTicket CreateInfoDealTicket(string header, string text) - { - return new MessageDealTicket(header, text); - } - - public static MessageDealTicket CreateRefuseDealTicket(string refuse) - { - return CreateRefuseDealTicket(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), refuse); - } - - public static MessageDealTicket CreateRefuseDealTicket(string header, string refuse) - { - return new MessageDealTicket(header, refuse, DealTicketType.Refuse); - } - } - [DataContract(Name = "Exchange", Namespace = "TradingPlatform")] - [ProtoContract] - public sealed class MessageExchange : Message, IXElementSerialization - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private string ??; - - public override MessageType Type => MessageType.Exchange; - - [DataMember(Name = "ExchangeId")] - [ProtoMember(1)] - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "ExchangeName")] - [ProtoMember(2)] - public string ExchangeName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "SortIndex")] - [ProtoMember(3)] - public int SortIndex - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string SessionsContainerId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(13, 3); - defaultInterpolatedStringHandler.AppendFormatted(Type); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Id); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(ExchangeName); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExchangeName)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SortIndex)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SessionsContainerId)); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - Id = xElement.Value; - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - ExchangeName = xElement2.Value; - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - SortIndex = xElement3.ToInt(); - } - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - SessionsContainerId = xElement4.Value; - } - } - } - public class MessageNewsHeadline : Message - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private IEnumerable ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - public override MessageType Type => MessageType.NewsHeadline; - - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DateTime CreationDate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Title - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IEnumerable SymbolsIds - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Category - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string SourceLink - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string SubscribeId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - } - [DataContract(Name = "MessageOpenDeliveredAsset", Namespace = "TradingPlatform")] - [ProtoContract] - public class MessageOpenDeliveredAsset : Message, INeedSymbolToPocess, IXElementSerialization - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private List ??; - - public override MessageType Type => MessageType.OpenDeliveredAsset; - - [DataMember(Name = "Id")] - [ProtoMember(1)] - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "AccountId")] - [ProtoMember(2)] - public string AccountId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "SymbolId")] - [ProtoMember(3)] - public string SymbolId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Quantity")] - [ProtoMember(4)] - public double Quantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Status")] - [ProtoMember(5)] - public string Status - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "CreationTime")] - [ProtoMember(6)] - public DateTime CreationTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(7)] - public List AdditionalInfoItems - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AccountId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SymbolId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Quantity)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Status)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CreationTime)); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - Id = xElement.Value; - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - AccountId = xElement2.Value; - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - SymbolId = xElement3.Value; - } - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - Quantity = xElement4.ToDouble(); - } - XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement5 != null) - { - Status = xElement5.Value; - } - XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement6 != null) - { - CreationTime = xElement6.ToDateTime(toUTC: true); - } - } - } - [DataContract(Name = "OpenOrder", Namespace = "TradingPlatform")] - [ProtoContract] - [ProtoInclude(23, typeof(MessageOrderHistory))] - public class MessageOpenOrder : Message, INeedSymbolToPocess, IXElementSerialization - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private Side ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private TimeInForce ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private OrderStatus ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private readonly List ??; - - [CompilerGenerated] - private readonly List ??; - - [CompilerGenerated] - private List ??; - - public override MessageType Type => MessageType.OpenOrder; - - [DataMember(Name = "OrderId")] - [ProtoMember(1)] - public string OrderId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "GroupId")] - [ProtoMember(2)] - public string GroupId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "PositionId")] - [ProtoMember(3)] - public string PositionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "AccountId")] - [ProtoMember(4)] - public string AccountId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "TotalQuantity")] - [ProtoMember(5)] - public double TotalQuantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "FilledQuantity")] - [ProtoMember(6)] - public double FilledQuantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Side")] - [ProtoMember(7)] - public Side Side - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Comment")] - [ProtoMember(8)] - public string Comment - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "LastUpdateTime")] - [ProtoMember(9)] - public DateTime LastUpdateTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "InstrumentSymbol")] - [ProtoMember(10)] - public string SymbolId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - [DataMember(Name = "OrderTypeId")] - [ProtoMember(11)] - public string OrderTypeId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Tif")] - [ProtoMember(12)] - public TimeInForce TimeInForce - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "ExpirationTime")] - [ProtoMember(13)] - public DateTime ExpirationTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Price")] - [ProtoMember(14)] - public double Price - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "TriggerPrice")] - [ProtoMember(15)] - public double TriggerPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "TrailOffset")] - [ProtoMember(16)] - public double TrailOffset - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Status")] - [ProtoMember(17)] - public OrderStatus Status - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "OriginalStatus")] - [ProtoMember(18)] - public string OriginalStatus - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "AverageFillPrice")] - [ProtoMember(19)] - public double AverageFillPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public SlTpHolder StopLoss - { - get - { - return StopLossItems.FirstOrDefault(); - } - set - { - if (value == null) - { - StopLossItems.Clear(); - } - else if (StopLossItems.Any()) - { - StopLossItems[0] = value; - } - else - { - StopLossItems.Add(value); - } - } - } - - public SlTpHolder TakeProfit - { - get - { - return TakeProfitItems.FirstOrDefault(); - } - set - { - if (value == null) - { - TakeProfitItems.Clear(); - } - else if (TakeProfitItems.Any()) - { - TakeProfitItems[0] = value; - } - else - { - TakeProfitItems.Add(value); - } - } - } - - [ProtoMember(20)] - public List StopLossItems - { - [CompilerGenerated] - get - { - return ??; - } - } - - [ProtoMember(21)] - public List TakeProfitItems - { - [CompilerGenerated] - get - { - return ??; - } - } - - [ProtoMember(22)] - public List AdditionalInfoItems - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - internal MessageOpenOrder() - { - Price = double.NaN; - TriggerPrice = double.NaN; - TrailOffset = double.NaN; - AverageFillPrice = double.NaN; - ?? = new List(); - ?? = new List(); - } - - public MessageOpenOrder(string symbolId) - : this() - { - SymbolId = symbolId; - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(41, 6); - defaultInterpolatedStringHandler.AppendFormatted(Type); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(SymbolId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Price); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderTypeId); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public string Format() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(13, 8); - defaultInterpolatedStringHandler.AppendFormatted(OrderId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(SymbolId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(AccountId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderTypeId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(FilledQuantity); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(TotalQuantity); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Status); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OrderId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GroupId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), PositionId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AccountId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TotalQuantity)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), FilledQuantity)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Side)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Comment)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LastUpdateTime)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SymbolId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OrderTypeId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)TimeInForce)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExpirationTime)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Price)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TriggerPrice)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TrailOffset)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)Status)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OriginalStatus)); - XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - foreach (AdditionalInfoItem additionalInfoItem in AdditionalInfoItems) - { - xElement2.Add(additionalInfoItem.ToXElement()); - } - xElement.Add(xElement2); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - OrderId = xElement.Value; - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - GroupId = xElement2.Value; - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - PositionId = xElement3.Value; - } - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - AccountId = xElement4.Value; - } - XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement5 != null) - { - TotalQuantity = xElement5.ToDouble(); - } - XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement6 != null) - { - FilledQuantity = xElement6.ToDouble(); - } - XElement xElement7 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement7 != null) - { - Side = (Side)xElement7.ToInt(); - } - XElement xElement8 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement8 != null) - { - Comment = xElement8.Value; - } - XElement xElement9 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement9 != null) - { - LastUpdateTime = xElement9.ToDateTime(toUTC: true); - } - XElement xElement10 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement10 != null) - { - SymbolId = xElement10.Value; - } - XElement xElement11 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement11 != null) - { - OrderTypeId = xElement11.Value; - } - XElement xElement12 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement12 != null) - { - TimeInForce = (TimeInForce)xElement12.ToInt(); - } - XElement xElement13 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement13 != null) - { - ExpirationTime = xElement13.ToDateTime(toUTC: true); - } - XElement xElement14 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement14 != null) - { - Price = xElement14.ToDouble(); - } - XElement xElement15 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement15 != null) - { - TriggerPrice = xElement15.ToDouble(); - } - XElement xElement16 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement16 != null) - { - TrailOffset = xElement16.ToDouble(); - } - XElement xElement17 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement17 != null) - { - Status = (OrderStatus)xElement17.ToInt(); - } - XElement xElement18 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement18 != null) - { - OriginalStatus = xElement18.Value; - } - XElement xElement19 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement19 == null) - { - return; - } - List list = new List(); - foreach (XElement item in xElement19.Elements()) - { - AdditionalInfoItem additionalInfoItem = new AdditionalInfoItem(); - additionalInfoItem.FromXElement(item, deserializationInfo); - list.Add(additionalInfoItem); - } - AdditionalInfoItems = list; - } - } - [DataContract(Name = "OpenPosition", Namespace = "TradingPlatform")] - [ProtoContract] - public class MessageOpenPosition : Message, INeedSymbolToPocess, IXElementSerialization - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private Side ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private List ??; - - public override MessageType Type => MessageType.OpenPosition; - - [DataMember(Name = "PositionId")] - [ProtoMember(1)] - public string PositionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "OpenPrice")] - [ProtoMember(2)] - public double OpenPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "OpenTime")] - [ProtoMember(3)] - public DateTime OpenTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Quantity")] - [ProtoMember(4)] - public double Quantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Side")] - [ProtoMember(5)] - public Side Side - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Comment")] - [ProtoMember(6)] - public string Comment - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "AccountId")] - [ProtoMember(7)] - public string AccountId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "InstrumentSymbol")] - [ProtoMember(8)] - public string SymbolId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - [DataMember(Name = "OpenOrderId")] - [ProtoMember(9)] - public string OpenOrderId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "LiquidationPrice")] - [ProtoMember(10)] - public double LiquidationPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public List AdditionalInfoItems - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - internal MessageOpenPosition() - { - LiquidationPrice = double.NaN; - } - - public MessageOpenPosition(string symbolId) - : this() - { - SymbolId = symbolId; - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(30, 4); - defaultInterpolatedStringHandler.AppendFormatted(Type); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(PositionId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OpenPrice); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(SymbolId); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), PositionId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OpenPrice)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OpenTime)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Quantity)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Side)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Comment)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AccountId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SymbolId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OpenOrderId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LiquidationPrice)); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - PositionId = xElement.Value; - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - OpenPrice = xElement2.ToDouble(); - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - OpenTime = xElement3.ToDateTime(toUTC: true); - } - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - Quantity = xElement4.ToDouble(); - } - XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement5 != null) - { - Side = (Side)xElement5.ToInt(); - } - XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement6 != null) - { - Comment = xElement6.Value; - } - XElement xElement7 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement7 != null) - { - AccountId = xElement7.Value; - } - XElement xElement8 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement8 != null) - { - SymbolId = xElement8.Value; - } - XElement xElement9 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement9 != null) - { - OpenOrderId = xElement9.Value; - } - XElement xElement10 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement10 != null) - { - LiquidationPrice = xElement10.ToDouble(); - } - } - } - [DataContract(Name = "OptionSerie", Namespace = "TradingPlatform")] - [ProtoContract] - public class MessageOptionSerie : Message, IXElementSerialization - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private OptionSerieType ??; - - public override MessageType Type => MessageType.OptionSerie; - - [ProtoMember(1)] - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(2)] - public DateTime ExpirationDate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(3)] - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(4)] - public string UnderlierId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(5)] - public string ExchangeId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(6)] - public OptionSerieType SerieType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(25, 3); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(UnderlierId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(ExpirationDate.ToShortDateString()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExpirationDate)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), UnderlierId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)SerieType)); - return xElement; - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - Id = xElement.ToString(); - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - ExpirationDate = xElement2.ToDateTime(); - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - Name = xElement3.Value; - } - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - UnderlierId = xElement4.Value; - } - XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement5 != null) - { - SerieType = (OptionSerieType)xElement5.ToInt(); - } - } - } - [DataContract(Name = "OrderHistory", Namespace = "TradingPlatform")] - [ProtoContract] - public sealed class MessageOrderHistory : MessageOpenOrder - { - public override MessageType Type => MessageType.OrderHistory; - - private MessageOrderHistory() - { - base.AverageFillPrice = double.NaN; - } - - public MessageOrderHistory(string symbolId) - : base(symbolId) - { - base.AverageFillPrice = double.NaN; - } - - public MessageOrderHistory(MessageOpenOrder order) - : base(order.SymbolId) - { - base.OrderId = order.OrderId; - base.AccountId = order.AccountId; - base.OrderTypeId = order.OrderTypeId; - base.Price = order.Price; - base.TriggerPrice = order.TriggerPrice; - base.TrailOffset = order.TrailOffset; - base.FilledQuantity = order.FilledQuantity; - base.TotalQuantity = order.TotalQuantity; - base.Side = order.Side; - base.TimeInForce = order.TimeInForce; - base.ExpirationTime = order.ExpirationTime; - base.PositionId = order.PositionId; - base.GroupId = order.GroupId; - base.Comment = order.Comment; - base.LastUpdateTime = order.LastUpdateTime; - base.StopLoss = order.StopLoss; - base.TakeProfit = order.TakeProfit; - base.Status = order.Status; - base.OriginalStatus = order.OriginalStatus; - base.AverageFillPrice = order.AverageFillPrice; - } - } - public class MessageRemoveTradingSignal : Message - { - [CompilerGenerated] - private string ??; - - public override MessageType Type => MessageType.RemoveTradingSignal; - - public string TradingSignalId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public MessageRemoveTradingSignal(string tradingSignalId) - { - TradingSignalId = tradingSignalId; - } - } - [DataContract(Name = "MessageReportType", Namespace = "TradingPlatform")] - public sealed class MessageReportType : Message - { - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private List ??; - - [DataMember(Name = "Id")] - public int Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Name")] - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Parameters")] - public List Parameters - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override MessageType Type => MessageType.ReportMetadata; - - public MessageReportType() - { - Parameters = new List(); - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 3); - defaultInterpolatedStringHandler.AppendFormatted(Type); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Id); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - [DataContract(Name = "Rule", Namespace = "TradingPlatform")] - public class MessageRule : Message - { - [CompilerGenerated] - private readonly string ??; - - [CompilerGenerated] - private readonly string ??; - - [CompilerGenerated] - private readonly string ??; - - [CompilerGenerated] - private readonly string ??; - - [CompilerGenerated] - private readonly object ??; - - public override MessageType Type => MessageType.Rule; - - [DataMember(Name = "Name")] - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - [DataMember(Name = "AccountId")] - public string AccountId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - [DataMember(Name = "InstrumentId")] - public string SymbolId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - [DataMember(Name = "OrderTypeId")] - public string OrderTypeId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - [DataMember(Name = "Value")] - public object Value - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public MessageRule() - { - Name = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); - AccountId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); - SymbolId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); - OrderTypeId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(15, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Name); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Value); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - [ProtoContract] - public class MessageSessionsContainer : Message, IXElementSerialization - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private HolidayInfo[] ??; - - [CompilerGenerated] - private SessionsSet[] ??; - - public override MessageType Type => MessageType.Session; - - [ProtoMember(1)] - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(2)] - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(3)] - public string Description - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(4)] - public HolidayInfo[] Holidays - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(5)] - public SessionsSet[] SessionsSets - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - Id = xElement.Value; - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - Name = xElement2.Value; - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - Description = xElement3.Value; - } - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - List list = new List(); - foreach (XElement item in xElement4.Elements()) - { - HolidayInfo holidayInfo = new HolidayInfo(); - holidayInfo.FromXElement(item, deserializationInfo); - list.Add(holidayInfo); - } - Holidays = list.ToArray(); - } - XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement5 == null) - { - return; - } - List list2 = new List(); - foreach (XElement item2 in xElement5.Elements()) - { - SessionsSet sessionsSet = new SessionsSet(); - sessionsSet.FromXElement(item2, deserializationInfo); - list2.Add(sessionsSet); - } - SessionsSets = list2.ToArray(); - } - - public XElement ToXElement() - { - XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Description)); - XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (Holidays != null) - { - HolidayInfo[] holidays = Holidays; - foreach (HolidayInfo holidayInfo in holidays) - { - xElement2.Add(holidayInfo.ToXElement()); - } - } - xElement.Add(xElement2); - XElement xElement3 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - SessionsSet[] sessionsSets = SessionsSets; - foreach (SessionsSet sessionsSet in sessionsSets) - { - xElement3.Add(sessionsSet.ToXElement()); - } - xElement.Add(xElement3); - return xElement; - } - } - [DataContract(Name = "Instrument", Namespace = "TradingPlatform")] - [ProtoContract] - public sealed class MessageSymbol : MessageSymbolInfo, IXElementSerialization, INeedSymbolToPocess - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal AdditionalInfoItem ?(AdditionalInfoItem P_0) - { - return (AdditionalInfoItem)P_0.Clone(); - } - } - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private TimeSpan ??; - - [CompilerGenerated] - private SymbolQuotingType ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private List ??; - - [CompilerGenerated] - private NettingType ??; - - [CompilerGenerated] - private SymbolVolumeType ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private DeltaCalculationType ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private HistoryMetadata ??; - - [CompilerGenerated] - private VolumeAnalysisMetadata ??; - - public override MessageType Type => MessageType.Symbol; - - [DataMember(Name = "productID")] - [ProtoMember(100)] - public string ProductAssetId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "quotingCurrencyID")] - [ProtoMember(105)] - public string QuotingCurrencyAssetID - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "quoteDelay")] - [ProtoMember(110)] - public TimeSpan QuoteDelay - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "quotingType")] - [ProtoMember(115)] - public SymbolQuotingType QuotingType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "lotSize")] - [ProtoMember(120)] - public double LotSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "instrumentAdditionalInfo")] - [ProtoMember(130)] - public List SymbolAdditionalInfo - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "nettingType")] - [ProtoMember(135)] - public NettingType NettingType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "VolumeType")] - [ProtoMember(145)] - public SymbolVolumeType VolumeType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "allowCalculateRealtimeTicks")] - [ProtoMember(150)] - public bool AllowCalculateRealtimeTicks - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "allowCalculateRealtimeTrades")] - [ProtoMember(155)] - public bool AllowCalculateRealtimeTrades - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "allowCalculateRealtimeVolume")] - [ProtoMember(160)] - public bool AllowCalculateRealtimeVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "allowCalculateRealtimeChange")] - [ProtoMember(165)] - public bool AllowCalculateRealtimeChange - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "allowAbbreviatePriceByTickSize")] - [ProtoMember(170)] - public bool AllowAbbreviatePriceByTickSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "notionalValueStep")] - [ProtoMember(175)] - public double NotionalValueStep - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "deltaCalculationType")] - [ProtoMember(180)] - public DeltaCalculationType DeltaCalculationType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "minVolumeAnalysisTickSize")] - [ProtoMember(183)] - public double MinVolumeAnalysisTickSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(185)] - public DateTime MaturityDate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - string INeedSymbolToPocess.SymbolId => base.UnderlierId; - - [DataMember(Name = "SessionsContainerId")] - [ProtoMember(186)] - public string SessionsContainerId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "HistoryMetadata")] - [ProtoMember(187)] - public HistoryMetadata HistoryMetadata - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(188)] - public VolumeAnalysisMetadata VolumeAnalysisMetadata - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - private MessageSymbol() - { - } - - public MessageSymbol(string symbolId) - : base(symbolId) - { - } - - public MessageSymbol(MessageSymbol origin) - : base(origin) - { - ProductAssetId = origin.ProductAssetId; - QuotingCurrencyAssetID = origin.QuotingCurrencyAssetID; - QuoteDelay = origin.QuoteDelay; - QuotingType = origin.QuotingType; - LotSize = origin.LotSize; - SymbolAdditionalInfo = ((origin.SymbolAdditionalInfo != null) ? new List(origin.SymbolAdditionalInfo.Select((AdditionalInfoItem P_0) => (AdditionalInfoItem)P_0.Clone())) : null); - NettingType = origin.NettingType; - base.GroupId = origin.GroupId; - VolumeType = origin.VolumeType; - AllowCalculateRealtimeTicks = origin.AllowCalculateRealtimeTicks; - AllowCalculateRealtimeTrades = origin.AllowCalculateRealtimeTrades; - AllowCalculateRealtimeVolume = origin.AllowCalculateRealtimeVolume; - AllowCalculateRealtimeChange = origin.AllowCalculateRealtimeChange; - AllowAbbreviatePriceByTickSize = origin.AllowAbbreviatePriceByTickSize; - NotionalValueStep = origin.NotionalValueStep; - DeltaCalculationType = origin.DeltaCalculationType; - MinVolumeAnalysisTickSize = origin.MinVolumeAnalysisTickSize; - MaturityDate = origin.MaturityDate; - SessionsContainerId = origin.SessionsContainerId; - HistoryMetadata = origin.HistoryMetadata; - VolumeAnalysisMetadata = origin.VolumeAnalysisMetadata; - } - - protected override void InitialState() - { - base.InitialState(); - NettingType = NettingType.Undefined; - AllowCalculateRealtimeTicks = true; - AllowCalculateRealtimeTrades = true; - AllowCalculateRealtimeVolume = true; - AllowCalculateRealtimeChange = true; - AllowAbbreviatePriceByTickSize = false; - LotSize = 1.0; - NotionalValueStep = 1.0; - MinVolumeAnalysisTickSize = double.NaN; - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(16, 3); - defaultInterpolatedStringHandler.AppendFormatted(Type); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.Id); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(base.Name); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - - public override XElement ToXElement() - { - XElement xElement = base.ToXElement(); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ProductAssetId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), QuotingCurrencyAssetID)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), QuoteDelay.ToString())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)QuotingType).ToString())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LotSize)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), NotionalValueStep)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)NettingType).ToString())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)base.HistoryType).ToString())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)VolumeType).ToString())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)DeltaCalculationType).ToString())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MinVolumeAnalysisTickSize)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AllowCalculateRealtimeTicks)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AllowCalculateRealtimeTrades)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AllowCalculateRealtimeVolume)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AllowCalculateRealtimeChange)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AllowAbbreviatePriceByTickSize)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MaturityDate)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SessionsContainerId)); - if (base.FutureContractType.HasValue) - { - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)base.FutureContractType.Value).ToString())); - } - return xElement; - } - - public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - base.FromXElement(element, deserializationInfo); - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - ProductAssetId = xElement.Value; - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - QuotingCurrencyAssetID = xElement2.Value; - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - QuoteDelay = xElement3.ToTimeSpan(); - } - element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - NettingType = (NettingType)xElement4.ToInt(); - } - XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement5 != null) - { - QuotingType = (SymbolQuotingType)xElement5.ToInt(); - } - XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement6 != null) - { - LotSize = xElement6.ToDouble(); - } - XElement xElement7 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement7 != null) - { - NotionalValueStep = xElement7.ToDouble(); - } - XElement xElement8 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement8 != null) - { - base.HistoryType = (HistoryType)xElement8.ToInt(); - } - XElement xElement9 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement9 != null) - { - VolumeType = (SymbolVolumeType)xElement9.ToInt(); - } - XElement xElement10 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement10 != null) - { - DeltaCalculationType = (DeltaCalculationType)xElement10.ToInt(); - } - XElement xElement11 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement11 != null) - { - MinVolumeAnalysisTickSize = xElement11.ToDouble(); - } - XElement xElement12 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement12 != null) - { - AllowCalculateRealtimeTicks = xElement12.ToBool(); - } - XElement xElement13 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement13 != null) - { - AllowCalculateRealtimeTrades = xElement13.ToBool(); - } - XElement xElement14 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement14 != null) - { - AllowCalculateRealtimeVolume = xElement14.ToBool(); - } - XElement xElement15 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement15 != null) - { - AllowCalculateRealtimeChange = xElement15.ToBool(); - } - XElement xElement16 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement16 != null) - { - AllowAbbreviatePriceByTickSize = xElement16.ToBool(); - } - XElement xElement17 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement17 != null) - { - MaturityDate = xElement17.ToDateTime(); - } - XElement xElement18 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement18 != null) - { - SessionsContainerId = xElement18.Value; - } - XElement xElement19 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement19 != null) - { - base.FutureContractType = (FutureContractType)xElement19.ToInt(); - } - } - } - public class MessageSymbolGroup : Message - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private int ??; - - public override MessageType Type => MessageType.SymbolGroup; - - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string GroupName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int SortIndex - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(13, 3); - defaultInterpolatedStringHandler.AppendFormatted(Type); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Id); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(GroupName); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - [DataContract(Name = "Instrument", Namespace = "TradingPlatform")] - [ProtoContract] - [ProtoInclude(1000, typeof(MessageSymbol))] - public class MessageSymbolInfo : Message, IXElementSerialization - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private SymbolType ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private OptionType ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private HistoryType ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private AvailableDerivatives ??; - - [CompilerGenerated] - private AvailableDerivatives ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private FutureContractType? ??; - - [CompilerGenerated] - private string[] ??; - - [CompilerGenerated] - private List ??; - - public override MessageType Type => MessageType.SymbolInfo; - - [DataMember(Name = "id")] - [ProtoMember(5)] - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - internal set - { - ?? = text; - } - } - - [DataMember(Name = "name")] - [ProtoMember(10)] - public string Name - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "description")] - [ProtoMember(15)] - public string Description - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "type")] - [ProtoMember(20)] - public SymbolType SymbolType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "ExchangeId")] - [ProtoMember(25)] - public string ExchangeId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "lotStep")] - [ProtoMember(30)] - public double LotStep - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "minLot")] - [ProtoMember(35)] - public double MinLot - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "maxLot")] - [ProtoMember(40)] - public double MaxLot - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "underlierName")] - [ProtoMember(45)] - public string Root - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "optionType")] - [ProtoMember(50)] - public OptionType OptionType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "strikePrice")] - [ProtoMember(55)] - public double StrikePrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "expirationDate")] - [ProtoMember(60)] - public DateTime ExpirationDate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "HistoryType")] - [ProtoMember(70)] - public HistoryType HistoryType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "lastTradingDate")] - [ProtoMember(80)] - public DateTime LastTradingDate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "AvailableFutures")] - [ProtoMember(85)] - public AvailableDerivatives AvailableFutures - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "AvailableOptions")] - [ProtoMember(86)] - public AvailableDerivatives AvailableOptions - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "underlierId")] - [ProtoMember(90)] - public string UnderlierId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "optionSerieId")] - [ProtoMember(95)] - public string OptionSerieId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(96)] - public string GroupId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(97)] - public FutureContractType? FutureContractType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(98)] - public string[] AvailableOptionsExchanges - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "variableTickList")] - [ProtoMember(125)] - public List VariableTickList - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - protected MessageSymbolInfo() - { - InitialState(); - } - - public MessageSymbolInfo(string symbolId) - : this() - { - Id = symbolId; - } - - public MessageSymbolInfo(MessageSymbolInfo origin) - : this() - { - Fill(origin); - } - - protected virtual void InitialState() - { - ExchangeId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - AvailableFutures = AvailableDerivatives.None; - AvailableOptions = AvailableDerivatives.None; - MinLot = 1.0; - MaxLot = 2147483647.0; - LotStep = 1.0; - } - - public void Fill(MessageSymbolInfo messageSymbolInfo) - { - Id = messageSymbolInfo.Id; - Name = messageSymbolInfo.Name; - Description = messageSymbolInfo.Description; - SymbolType = messageSymbolInfo.SymbolType; - ExchangeId = messageSymbolInfo.ExchangeId; - LotStep = messageSymbolInfo.LotStep; - MinLot = messageSymbolInfo.MinLot; - MaxLot = messageSymbolInfo.MaxLot; - Root = messageSymbolInfo.Root; - OptionType = messageSymbolInfo.OptionType; - StrikePrice = messageSymbolInfo.StrikePrice; - ExpirationDate = messageSymbolInfo.ExpirationDate; - HistoryType = messageSymbolInfo.HistoryType; - LastTradingDate = messageSymbolInfo.LastTradingDate; - AvailableFutures = messageSymbolInfo.AvailableFutures; - AvailableOptions = messageSymbolInfo.AvailableOptions; - UnderlierId = messageSymbolInfo.UnderlierId; - OptionSerieId = messageSymbolInfo.OptionSerieId; - FutureContractType = messageSymbolInfo.FutureContractType; - VariableTickList = ((messageSymbolInfo.VariableTickList != null) ? new List(messageSymbolInfo.VariableTickList) : null); - } - - public virtual XElement ToXElement() - { - XElement xElement = new XElement(GetType().Name); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Description)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)SymbolType).ToString())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExchangeId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LotStep)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MinLot)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MaxLot)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Root)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)AvailableFutures).ToString())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)AvailableOptions).ToString())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), UnderlierId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OptionSerieId)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)OptionType).ToString())); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), StrikePrice)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExpirationDate)); - xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LastTradingDate)); - XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (VariableTickList != null && VariableTickList.Count > 0) - { - for (int i = 0; i < VariableTickList.Count; i++) - { - xElement2.Add(VariableTickList[i].ToXElement()); - } - } - xElement.Add(xElement2); - return xElement; - } - - public virtual void FromXElement(XElement element, DeserializationInfo deserializationInfo) - { - XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement != null) - { - Id = xElement.Value; - } - XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement2 != null) - { - Name = xElement2.Value; - } - XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement3 != null) - { - Description = xElement3.Value; - } - XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement4 != null) - { - SymbolType = (SymbolType)xElement4.ToInt(); - } - XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement5 != null) - { - ExchangeId = xElement5.Value; - } - XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement6 != null) - { - LotStep = xElement6.ToDouble(); - } - XElement xElement7 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement7 != null) - { - MaxLot = xElement7.ToDouble(); - } - XElement xElement8 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement8 != null) - { - MinLot = xElement8.ToDouble(); - } - XElement xElement9 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement9 != null) - { - Root = xElement9.Value; - } - XElement xElement10 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement10 != null) - { - AvailableFutures = (AvailableDerivatives)xElement10.ToInt(); - } - XElement xElement11 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement11 != null) - { - AvailableOptions = (AvailableDerivatives)xElement11.ToInt(); - } - XElement xElement12 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement12 != null) - { - UnderlierId = xElement12.Value; - } - XElement xElement13 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement13 != null) - { - OptionSerieId = xElement13.Value; - } - XElement xElement14 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement14 != null) - { - OptionType = (OptionType)xElement14.ToInt(); - } - XElement xElement15 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement15 != null) - { - StrikePrice = xElement15.ToDouble(); - } - XElement xElement16 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement16 != null) - { - ExpirationDate = xElement16.ToDateTime(); - } - XElement xElement17 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement17 != null) - { - LastTradingDate = xElement17.ToDateTime(); - } - XElement xElement18 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (xElement18 == null) - { - return; - } - List list = new List(); - foreach (XElement item in xElement18.Elements()) - { - VariableTick variableTick = new VariableTick(); - variableTick.FromXElement(item, deserializationInfo); - list.Add(variableTick); - } - VariableTickList = list; - } - } - [DataContract(Name = "InstrumentTypes", Namespace = "TradingPlatform")] - [ProtoContract] - public sealed class MessageSymbolTypes : Message - { - [CompilerGenerated] - private IList ??; - - public override MessageType Type => MessageType.SymbolTypes; - - [ProtoMember(1)] - public IList SymbolTypes - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - } - [DataContract(Name = "Trade", Namespace = "TradingPlatform")] - [ProtoContract] - public sealed class MessageTrade : Message, INeedSymbolToPocess - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private Side ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private PnLItem ??; - - [CompilerGenerated] - private PnLItem ??; - - [CompilerGenerated] - private PnLItem ??; - - [CompilerGenerated] - private PositionImpactType ??; - - public override MessageType Type => MessageType.Trade; - - [DataMember(Name = "TradeId")] - [ProtoMember(1)] - public string TradeId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "OrderId")] - [ProtoMember(2)] - public string OrderId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "PositionId")] - [ProtoMember(3)] - public string PositionId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Price")] - [ProtoMember(4)] - public double Price - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Quantity")] - [ProtoMember(5)] - public double Quantity - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Side")] - [ProtoMember(6)] - public Side Side - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "AccountId")] - [ProtoMember(7)] - public string AccountId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "InstrumentSymbol")] - [ProtoMember(8)] - public string SymbolId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "DateTime")] - [ProtoMember(9)] - public DateTime DateTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Comment")] - [ProtoMember(10)] - public string Comment - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "OrderType")] - [ProtoMember(11)] - public string OrderTypeId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "GrossPnl")] - [ProtoMember(12)] - public PnLItem GrossPnl - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "NetPnl")] - [ProtoMember(13)] - public PnLItem NetPnl - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [DataMember(Name = "Fee")] - [ProtoMember(14)] - public PnLItem Fee - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - [ProtoMember(15)] - public PositionImpactType PositionImpactType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public override string ToString() - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(28, 4); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(SymbolId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Side); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(Quantity); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(OrderId); - return defaultInterpolatedStringHandler.ToStringAndClear(); - } - } - public class MessageTradingSignal : Message - { - [CompilerGenerated] - private readonly string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private Side ??; - - [CompilerGenerated] - private OrderTypeBehavior ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - public override MessageType Type => MessageType.TradingSignal; - - public string Id - { - [CompilerGenerated] - get - { - return ??; - } - } - - public string Ticker - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Root - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string VendorName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Side Side - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public OrderTypeBehavior OrderTypeBehavior - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double EntryPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double TargetPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double StopPrice - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double Confidence - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DateTime Published - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DateTime Updated - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DateTime ExpiresAt - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Duration - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Status - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Description - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Details - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string Source - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public MessageTradingSignal(string id) - { - ?? = id; - } - - public override string ToString() - { - return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Side.ToString().ToUpperInvariant() + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + (Ticker ?? Root); - } - } - public abstract class MultiVendor : Vendor - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func> ??; - - public static Func, IEnumerable> ??; - - public static Func, IEnumerable> ??; - - public static Func, IEnumerable> ??; - - public static Func, IEnumerable> ??; - - public static Func, TimeSpan> ??; - - public static Func, TimeSpan> ??; - - public static Func, TimeSpan> ??; - - public static Func, bool> ??; - - public static Func, bool> ??; - - public static Func ??; - - public static Func ??; - - public static Func ??; - - internal bool ?(IVendor P_0) - { - return P_0 is Vendor; - } - - internal bool ?(ISymbolVendor P_0) - { - return P_0.AllowNonFixedList; - } - - internal IEnumerable ?(MessageSymbolTypes P_0) - { - return P_0.SymbolTypes; - } - - internal IEnumerable ?(KeyValuePair P_0) - { - return P_0.Value.AllowedAggregations; - } - - internal IEnumerable ?(KeyValuePair P_0) - { - return P_0.Value.AllowedPeriodsHistoryAggregationTime; - } - - internal IEnumerable ?(KeyValuePair P_0) - { - return P_0.Value.AllowedHistoryTypesHistoryAggregationTime; - } - - internal IEnumerable ?(KeyValuePair P_0) - { - return P_0.Value.AllowedHistoryTypesHistoryAggregationTick; - } - - internal TimeSpan ?(KeyValuePair P_0) - { - return P_0.Value.DownloadingStep_Day; - } - - internal TimeSpan ?(KeyValuePair P_0) - { - return P_0.Value.DownloadingStep_Minute; - } - - internal TimeSpan ?(KeyValuePair P_0) - { - return P_0.Value.DownloadingStep_Tick; - } - - internal bool ?(KeyValuePair P_0) - { - return P_0.Value.BuildUncompletedBars; - } - - internal bool ?(KeyValuePair P_0) - { - return P_0.Value.IsVolumeAnalysisAvailable; - } - - internal bool ?(VolumeAnalysisMetadata P_0) - { - return P_0.BuildUncompletedBars; - } - - internal TimeSpan ?(VolumeAnalysisMetadata P_0) - { - return P_0.MaxTicksLoadingPeriod; - } - - internal bool ?(AdditionalInfoItem P_0) - { - return P_0.Id == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - } - } - - [CompilerGenerated] - private sealed class ? - { - public CancellationToken ??; - - internal MessageSymbolTypes ?(ISymbolVendor P_0) - { - return P_0.GetSymbolTypes(??); - } - } - - [CompilerGenerated] - private ITradingVendor ??; - - private readonly Dictionary ??; - - private readonly Dictionary ??; - - private readonly Dictionary ??; - - private readonly Dictionary ??; - - protected readonly List AllVendors; - - private readonly Dictionary ??; - - private readonly Dictionary ??; - - private readonly Dictionary ??; - - private readonly Dictionary ??; - - private readonly Dictionary> ??; - - private readonly Dictionary> ??; - - private readonly Dictionary> ??; - - private readonly Dictionary> ??; - - private readonly Dictionary ??; - - private readonly Dictionary> ??; - - private readonly Dictionary ??; - - private readonly Dictionary> ??; - - private readonly Dictionary ??; - - private readonly Dictionary> ??; - - protected ITradingVendor TradingVendor - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = tradingVendor; - } - } - - /// - /// Confirms allowed nonfixed list by vendor - /// - public override bool AllowNonFixedList - { - get - { - if (??.Count == 0) - { - return base.AllowNonFixedList; - } - return ??.Values.Any((ISymbolVendor P_0) => P_0.AllowNonFixedList); - } - } - - protected MultiVendor() - { - ?? = new Dictionary(); - ?? = new Dictionary(); - ?? = new Dictionary(); - ?? = new Dictionary(); - AllVendors = new List(); - ?? = new Dictionary(); - ?? = new Dictionary(); - ?? = new Dictionary(); - ?? = new Dictionary(); - ?? = new Dictionary>(); - ?? = new Dictionary>(); - ?? = new Dictionary>(); - ?? = new Dictionary>(); - ?? = new Dictionary(); - ?? = new Dictionary>(); - ?? = new Dictionary(); - ?? = new Dictionary>(); - ?? = new Dictionary(); - ?? = new Dictionary>(); - } - - /// - /// Performs a binding with broker or data provider - /// - public override ConnectionResult Connect(ConnectRequestParameters connectRequestParameters) - { - if (AllVendors.Count == 0) - { - return ConnectionResult.CreateFail(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - foreach (IVendor allVendor in AllVendors) - { - try - { - ConnectionResult connectionResult = allVendor.Connect(connectRequestParameters); - if (connectionResult.State == ConnectionState.Fail) - { - return connectionResult; - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex.InnerException ?? ex); - return ConnectionResult.CreateFail(ex.GetMessageRecursive()); - } - } - return ConnectionResult.CreateSuccess(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); - } - - /// - /// Specifies any operation before breaking a connection with broker or data provider - /// - public override void Disconnect() - { - foreach (IVendor allVendor in AllVendors) - { - try - { - allVendor.Disconnect(); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - } - - /// - /// Called when platform finished retreiving all required informations from vendor during connecting - /// - public override void OnConnected(CancellationToken token) - { - foreach (IVendor allVendor in AllVendors) - { - try - { - allVendor.OnConnected(token); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - } - - /// - /// Ping processing before its visualization in the terminal - /// - public override PingResult Ping() - { - PingResult pingResult = new PingResult - { - State = PingEnum.Disconnected - }; - double num = 0.0; - double num2 = 0.0; - foreach (IVendor allVendor in AllVendors) - { - PingResult pingResult2 = allVendor.Ping(); - if (pingResult2.State != PingEnum.Connected) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + allVendor.Key + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - return pingResult2; - } - if (pingResult2.PingTime.HasValue) - { - num = Math.Max(num, pingResult2.PingTime.Value.TotalMilliseconds); - } - if (pingResult2.RoundTripTime.HasValue) - { - num2 = Math.Max(num2, pingResult2.RoundTripTime.Value.TotalMilliseconds); - } - } - pingResult.State = PingEnum.Connected; - pingResult.PingTime = TimeSpan.FromMilliseconds(num); - pingResult.RoundTripTime = TimeSpan.FromMilliseconds(num2); - return pingResult; - } - - public override LimitationMetadata GetLimitationMetadata() - { - if (TradingVendor == null) - { - return base.GetLimitationMetadata(); - } - return TradingVendor.GetLimitationMetadata(); - } - - /// - /// Retrieves an information about available accounts. Yon need to specify at least one account - /// - public override IList GetAccounts(CancellationToken token) - { - return TradingVendor?.GetAccounts(token) ?? base.GetAccounts(token); - } - - public override IList GetRules(CancellationToken token) - { - if (TradingVendor != null) - { - return TradingVendor.GetRules(token); - } - if (AllVendors.Where((IVendor P_0) => P_0 is Vendor).FirstOrDefault() is Vendor vendor) - { - return vendor.GetRules(token); - } - return base.GetRules(token); - } - - public override IList GetCryptoAssetBalances(CancellationToken token) - { - return TradingVendor?.GetCryptoAssetBalances(token) ?? base.GetCryptoAssetBalances(token); - } - - public override IList GetAccountOperations(CancellationToken token) - { - return TradingVendor?.GetAccountOperations(token) ?? base.GetAccountOperations(token); - } - - public override IList GetSessions(CancellationToken token) - { - List list = new List(); - foreach (KeyValuePair item2 in ??) - { - ISymbolVendor value = item2.Value; - foreach (MessageSessionsContainer session in value.GetSessions(token)) - { - MessageSessionsContainer item = ?(value.Key, session); - list.Add(item); - } - } - return list; - } - - /// - /// Retrieves a collection of available exchange markets from vendor - /// - public override IList GetExchanges(CancellationToken token) - { - List list = new List(); - foreach (KeyValuePair item2 in ??) - { - ISymbolVendor value = item2.Value; - foreach (MessageExchange exchange in value.GetExchanges(token)) - { - MessageExchange item = ?(value.Key, exchange); - list.Add(item); - } - } - return list; - } - - /// - /// Retrieves information about available assets. - /// - public override IList GetAssets(CancellationToken token) - { - if (??.Count == 0) - { - return base.GetAssets(token); - } - List list = new List(); - foreach (KeyValuePair item2 in ??) - { - ISymbolVendor value = item2.Value; - foreach (MessageAsset asset in value.GetAssets(token)) - { - MessageAsset item = ?(value.Key, asset); - list.Add(item); - } - } - return list; - } - - /// - /// Retrieves information about available symbols. - /// - public override IList GetSymbols(CancellationToken token) - { - if (??.Count == 0) - { - return base.GetSymbols(token); - } - List list = new List(); - foreach (KeyValuePair item2 in ??) - { - ISymbolVendor value = item2.Value; - foreach (MessageSymbol symbol in value.GetSymbols(token)) - { - MessageSymbol item = ?(value.Key, symbol); - list.Add(item); - } - } - return list; - } - - /// - /// Gets an available symbols types from vendor - /// - public override MessageSymbolTypes GetSymbolTypes(CancellationToken token) - { - if (??.Count == 0) - { - return base.GetSymbolTypes(token); - } - List symbolTypes = ??.Values.Select((ISymbolVendor P_0) => P_0.GetSymbolTypes(token)).SelectMany((MessageSymbolTypes P_0) => P_0.SymbolTypes).Distinct() - .ToList(); - return new MessageSymbolTypes - { - SymbolTypes = symbolTypes - }; - } - - public override IList GetSymbolGroups(CancellationToken token) - { - List list = new List(); - foreach (KeyValuePair item2 in ??) - { - ISymbolVendor value = item2.Value; - foreach (MessageSymbolGroup symbolGroup in value.GetSymbolGroups(token)) - { - MessageSymbolGroup item = ?(value.Key, symbolGroup); - list.Add(item); - } - } - return list; - } - - /// - /// Derives a non fixed symbol from vendor - /// - public override MessageSymbol GetNonFixedSymbol(GetSymbolRequestParameters requestParameters) - { - if (!?(requestParameters.SymbolId, out string text, out ISymbolVendor symbolVendor)) - { - return base.GetNonFixedSymbol(requestParameters); - } - if (!?(text, requestParameters.SymbolId, out var symbolId)) - { - return base.GetNonFixedSymbol(requestParameters); - } - requestParameters.SymbolId = symbolId; - MessageSymbol nonFixedSymbol = symbolVendor.GetNonFixedSymbol(requestParameters); - return ?(text, nonFixedSymbol); - } - - /// - /// Derives a non-fixed list of symbols from vendor - /// - public override IList SearchSymbols(SearchSymbolsRequestParameters requestParameters) - { - if (??.Count == 0) - { - return base.SearchSymbols(requestParameters); - } - List list = new List(); - foreach (KeyValuePair item2 in ??) - { - string key = item2.Key; - ISymbolVendor value = item2.Value; - SearchSymbolsRequestParameters requestParameters2 = requestParameters; - IList exchangeIds = requestParameters.ExchangeIds; - if (exchangeIds != null && exchangeIds.Count > 0) - { - List list2 = new List(); - Map map = ??[key]; - foreach (string exchangeId in requestParameters.ExchangeIds) - { - if (map.TryGetDirect(exchangeId, out var value2)) - { - list2.Add(value2); - } - else - { - list2.Add(exchangeId); - } - } - requestParameters2 = new SearchSymbolsRequestParameters(requestParameters) - { - ExchangeIds = list2 - }; - } - foreach (MessageSymbolInfo item3 in value.SearchSymbols(requestParameters2)) - { - MessageSymbolInfo item = ?(key, item3); - list.Add(item); - } - } - return list; - } - - public override IList GetFutureContracts(GetFutureContractsRequestParameters requestParameters) - { - List list = new List(); - string exchangeId = requestParameters.ExchangeId; - HashSet value2; - if (!string.IsNullOrEmpty(requestParameters.UnderlierId)) - { - string underlierId = requestParameters.UnderlierId; - if (?(underlierId, out string text, out ISymbolVendor symbolVendor) && ?(text, underlierId, out var underlierId2) && ??[text].TryGetDirect(exchangeId, out var value)) - { - requestParameters.ExchangeId = value; - requestParameters.UnderlierId = underlierId2; - foreach (MessageSymbolInfo futureContract in symbolVendor.GetFutureContracts(requestParameters)) - { - MessageSymbolInfo item = ?(text, futureContract); - list.Add(item); - } - } - } - else if (!string.IsNullOrEmpty(requestParameters.Root) && ??.TryGetValue(requestParameters.Root, out value2)) - { - foreach (string item3 in value2) - { - if (!??[item3].TryGetDirect(exchangeId, out var value3)) - { - continue; - } - requestParameters.ExchangeId = value3; - foreach (MessageSymbolInfo futureContract2 in ??[item3].GetFutureContracts(requestParameters)) - { - MessageSymbolInfo item2 = ?(item3, futureContract2); - list.Add(item2); - } - } - } - return list; - } - - public override IList GetOptionSeries(GetOptionSeriesRequestParameters requestParameters) - { - if (!?(requestParameters.UnderlierId, out string text, out ISymbolVendor symbolVendor)) - { - return base.GetOptionSeries(requestParameters); - } - if (!?(text, requestParameters.UnderlierId, out var underlierId)) - { - return base.GetOptionSeries(requestParameters); - } - requestParameters.UnderlierId = underlierId; - if (??[text].TryGetDirect(requestParameters.ExchangeId, out var value)) - { - requestParameters.ExchangeId = value; - } - IList optionSeries = symbolVendor.GetOptionSeries(requestParameters); - List list = new List(); - foreach (MessageOptionSerie item2 in optionSeries) - { - MessageOptionSerie item = ?(text, item2); - list.Add(item); - } - return list; - } - - public override IList GetStrikes(GetStrikesRequestParameters requestParameters) - { - if (!?(requestParameters.UnderlierId, out string text, out ISymbolVendor symbolVendor)) - { - return base.GetStrikes(requestParameters); - } - if (!?(text, requestParameters.UnderlierId, out var underlierId)) - { - return base.GetStrikes(requestParameters); - } - requestParameters.UnderlierId = underlierId; - requestParameters.SerieId = ParseLocalId(text, requestParameters.SerieId); - IList strikes = symbolVendor.GetStrikes(requestParameters); - List list = new List(); - foreach (MessageSymbolInfo item2 in strikes) - { - MessageSymbolInfo item = ?(text, item2); - list.Add(item); - } - return list; - } - - /// - /// Retrieves allowed/supported order types - /// - public override IList GetAllowedOrderTypes(CancellationToken token) - { - return TradingVendor?.GetAllowedOrderTypes(token) ?? base.GetAllowedOrderTypes(token); - } - - /// - /// Retrieves an information about opened orders at the time of connection. - /// - public override IList GetPendingOrders(CancellationToken token) - { - return TradingVendor?.GetPendingOrders(token) ?? base.GetPendingOrders(token); - } - - /// - /// Retrieves an information about positions at the time of connection - /// - public override IList GetPositions(CancellationToken token) - { - return TradingVendor?.GetPositions(token) ?? base.GetPositions(token); - } - - public override TradesHistoryMetadata GetTradesMetadata() - { - return TradingVendor?.GetTradesMetadata() ?? base.GetTradesMetadata(); - } - - /// - /// Gets trades history from server for requested time range - /// - public override IList GetTrades(TradesHistoryRequestParameters parameters) - { - return TradingVendor?.GetTrades(parameters) ?? base.GetTrades(parameters); - } - - public override void GetTrades(TradesHistoryRequestParameters parameters, AccountTradesLoadingCallback callback) - { - if (TradingVendor != null) - { - TradingVendor.GetTrades(parameters, callback); - } - else - { - base.GetTrades(parameters, callback); - } - } - - public override IList GetOrdersHistory(OrdersHistoryRequestParameters parameters) - { - return TradingVendor?.GetOrdersHistory(parameters) ?? base.GetOrdersHistory(parameters); - } - - public override PnL CalculatePnL(PnLRequestParameters parameters) - { - return TradingVendor?.CalculatePnL(parameters) ?? base.CalculatePnL(parameters); - } - - /// - /// Subscribing to quote data: Level1/Level2/Trade - /// - public override void SubscribeSymbol(SubscribeQuotesParameters parameters) - { - if (?(parameters.SymbolId, out string text, out IQuoteVendor quoteVendor) && ?(text, parameters.SymbolId, out var symbolId)) - { - quoteVendor.SubscribeSymbol(new SubscribeQuotesParameters(symbolId, parameters.SubscribeType) - { - CancellationToken = parameters.CancellationToken - }); - } - } - - /// - /// Unsubscribing from quote data: Level1/Level2/Trade - /// - public override void UnSubscribeSymbol(SubscribeQuotesParameters parameters) - { - if (?(parameters.SymbolId, out string text, out IQuoteVendor quoteVendor) && ?(text, parameters.SymbolId, out var symbolId)) - { - quoteVendor.UnSubscribeSymbol(new SubscribeQuotesParameters(symbolId, parameters.SubscribeType) - { - CancellationToken = parameters.CancellationToken - }); - } - } - - /// - /// Gets a list of supported historical intervals and data types by vendor - /// - public override HistoryMetadata GetHistoryMetadata(CancellationToken cancelationToken) - { - Dictionary dictionary = new Dictionary(); - foreach (KeyValuePair item in ??) - { - try - { - HistoryMetadata historyMetadata = item.Value.GetHistoryMetadata(cancelationToken); - dictionary.Add(item.Key, historyMetadata); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex.InnerException ?? ex); - } - } - return new HistoryMetadata - { - AllowedAggregations = dictionary.SelectMany((KeyValuePair P_0) => P_0.Value.AllowedAggregations).Distinct().ToArray(), - AllowedPeriodsHistoryAggregationTime = dictionary.SelectMany((KeyValuePair P_0) => P_0.Value.AllowedPeriodsHistoryAggregationTime).Distinct().ToArray(), - AllowedHistoryTypesHistoryAggregationTime = dictionary.SelectMany((KeyValuePair P_0) => P_0.Value.AllowedHistoryTypesHistoryAggregationTime).Distinct().ToArray(), - AllowedHistoryTypesHistoryAggregationTick = dictionary.SelectMany((KeyValuePair P_0) => P_0.Value.AllowedHistoryTypesHistoryAggregationTick).Distinct().ToArray(), - DownloadingStep_Day = dictionary.Min((KeyValuePair P_0) => P_0.Value.DownloadingStep_Day), - DownloadingStep_Minute = dictionary.Min((KeyValuePair P_0) => P_0.Value.DownloadingStep_Minute), - DownloadingStep_Tick = dictionary.Min((KeyValuePair P_0) => P_0.Value.DownloadingStep_Tick), - BuildUncompletedBars = dictionary.Any((KeyValuePair P_0) => P_0.Value.BuildUncompletedBars) - }; - } - - public override IList LoadHistory(HistoryRequestParameters requestParameters) - { - List result = new List(); - if (!?(requestParameters.SymbolId, out string text, out IHistoryVendor historyVendor)) - { - return result; - } - if (!?(text, requestParameters.SymbolId, out var symbolId)) - { - return result; - } - return historyVendor.LoadHistory(new HistoryRequestParameters(requestParameters) - { - SymbolId = symbolId - }); - } - - public override VolumeAnalysisMetadata GetVolumeAnalysisMetadata() - { - if (??.Count == 0) - { - return base.GetVolumeAnalysisMetadata(); - } - foreach (KeyValuePair item in ??) - { - try - { - VolumeAnalysisMetadata volumeAnalysisMetadata = item.Value.GetVolumeAnalysisMetadata(); - ??.Add(item.Key, volumeAnalysisMetadata); - } - catch (Exception exception) - { - Core.Instance.Loggers.Log(exception.GetMessageRecursive()); - } - } - VolumeAnalysisAvailability volumeAnalysisAvailability = (??.Any((KeyValuePair P_0) => P_0.Value.IsVolumeAnalysisAvailable) ? VolumeAnalysisAvailability.Available : VolumeAnalysisAvailability.NotAvailable); - bool buildUncompletedBars = ??.Values.Any((VolumeAnalysisMetadata P_0) => P_0.BuildUncompletedBars); - TimeSpan maxTicksLoadingPeriod = ??.Values.Max((VolumeAnalysisMetadata P_0) => P_0.MaxTicksLoadingPeriod); - Dictionary dictionary = new Dictionary(); - Dictionary dictionary2 = new Dictionary(); - if (volumeAnalysisAvailability == VolumeAnalysisAvailability.Available) - { - foreach (VolumeAnalysisMetadata value in ??.Values) - { - ?(value.GetDownloadingStepByPeriod(includePriceLevels: false), dictionary); - ?(value.GetDownloadingStepByPeriod(includePriceLevels: true), dictionary2); - } - } - return new VolumeAnalysisMetadata - { - VolumeAnalysisAvailability = volumeAnalysisAvailability, - BuildUncompletedBars = buildUncompletedBars, - MaxTicksLoadingPeriod = maxTicksLoadingPeriod, - DownloadingStepByPeriod = dictionary, - DownloadingLevelsStepByPeriod = dictionary2 - }; - } - - public override VendorVolumeAnalysisByPeriodResponse LoadVolumeAnalysis(VolumeAnalysisByPeriodRequestParameters requestParameters) - { - if (!?(requestParameters.SymbolId, out string text, out IVolumeAnalysisVendor volumeAnalysisVendor)) - { - return null; - } - if (!??.TryGetValue(text, out var value)) - { - return null; - } - if (!value.GetAllowedPeriods(requestParameters.CalculatePriceLevels).Contains(requestParameters.Period)) - { - return null; - } - if (!?(text, requestParameters.SymbolId, out var symbolId)) - { - return null; - } - VolumeAnalysisByPeriodRequestParameters copy = requestParameters.Copy; - copy.SymbolId = symbolId; - return volumeAnalysisVendor.LoadVolumeAnalysis(copy); - } - - /// - /// Prepare and sending order placing request to broker - /// - public override TradingOperationResult PlaceOrder(PlaceOrderRequestParameters parameters) - { - return TradingVendor?.PlaceOrder(parameters) ?? base.PlaceOrder(parameters); - } - - public override TradingOperationResult PlaceMultiOrder(PlaceMultiOrderOrderRequestParameters parameters) - { - return TradingVendor?.PlaceMultiOrder(parameters) ?? base.PlaceMultiOrder(parameters); - } - - /// - /// Sending order modification request to broker - /// - public override TradingOperationResult ModifyOrder(ModifyOrderRequestParameters parameters) - { - return TradingVendor?.ModifyOrder(parameters) ?? base.ModifyOrder(parameters); - } - - /// - /// Sending order cancellation request to broker - /// - public override TradingOperationResult CancelOrder(CancelOrderRequestParameters parameters) - { - return TradingVendor?.CancelOrder(parameters) ?? base.CancelOrder(parameters); - } - - /// - /// Sending position closing request to broker - /// - public override TradingOperationResult ClosePosition(ClosePositionRequestParameters parameters) - { - return TradingVendor?.ClosePosition(parameters) ?? base.ClosePosition(parameters); - } - - public override MarginInfo GetMarginInfo(OrderRequestParameters orderRequestParameters) - { - return TradingVendor?.GetMarginInfo(orderRequestParameters) ?? base.GetMarginInfo(orderRequestParameters); - } - - /// - /// Gets information about available reports from vendor - /// - public override IList GetReportsMetaData(CancellationToken token) - { - return TradingVendor?.GetReportsMetaData(token) ?? base.GetReportsMetaData(token); - } - - /// - /// Called when platform need to generate particular report - /// - public override Report GenerateReport(ReportRequestParameters reportRequestParameters) - { - return TradingVendor?.GenerateReport(reportRequestParameters) ?? base.GenerateReport(reportRequestParameters); - } - - private MessageSessionsContainer ?(string P_0, MessageSessionsContainer P_1) - { - P_1.Id = CreateGlobalId(P_0, P_1.Id); - return P_1; - } - - private MessageExchange ?(string P_0, MessageExchange P_1) - { - if (!??.TryGetValue(P_1.ExchangeName, out var value)) - { - value = new MessageExchange - { - Id = ??.Count.ToString(), - ExchangeName = P_1.ExchangeName - }; - ??.Add(value.ExchangeName, value); - } - if (!string.IsNullOrEmpty(P_1.SessionsContainerId)) - { - value.SessionsContainerId = CreateGlobalId(P_0, P_1.SessionsContainerId); - } - if (!??.TryGetValue(P_0, out var value2)) - { - ??.Add(P_0, value2 = new Map()); - } - if (!value2.ContainsDirect(value.Id)) - { - value2.Add(value.Id, P_1.Id); - } - return value; - } - - private MessageSymbolGroup ?(string P_0, MessageSymbolGroup P_1) - { - if (!??.TryGetValue(P_1.GroupName, out var value)) - { - ??.Add(P_1.GroupName, value = P_1); - } - if (!??.TryGetValue(P_0, out var value2)) - { - ??.Add(P_0, value2 = new Map()); - } - if (!value2.ContainsDirect(value.Id)) - { - value2.Add(value.Id, P_1.Id); - } - return value; - } - - private MessageSymbolInfo ?(string P_0, MessageSymbolInfo P_1) - { - if (!??.TryGetValue(P_0, out var value)) - { - return null; - } - if (!value.TryGetReverse(P_1.ExchangeId, out var value2)) - { - return null; - } - MessageSymbolInfo messageSymbolInfo = new MessageSymbolInfo(P_1) - { - Id = CreateGlobalId(P_0, P_1.Id), - ExchangeId = value2 - }; - if (!string.IsNullOrEmpty(messageSymbolInfo.Root)) - { - if (!??.TryGetValue(messageSymbolInfo.Root, out var value3)) - { - ??.Add(messageSymbolInfo.Root, value3 = new HashSet()); - } - value3.Add(P_0); - } - if (!string.IsNullOrEmpty(messageSymbolInfo.UnderlierId)) - { - messageSymbolInfo.UnderlierId = CreateGlobalId(P_0, P_1.UnderlierId); - } - return messageSymbolInfo; - } - - private MessageSymbol ?(string P_0, MessageSymbol P_1) - { - MessageSymbolInfo messageSymbolInfo = ?(P_0, (MessageSymbolInfo)P_1); - MessageSymbol messageSymbol = new MessageSymbol(P_1); - messageSymbol.Fill(messageSymbolInfo); - if (!string.IsNullOrEmpty(messageSymbol.ProductAssetId)) - { - messageSymbol.ProductAssetId = CreateGlobalId(P_0, messageSymbol.ProductAssetId); - } - if (!string.IsNullOrEmpty(messageSymbol.QuotingCurrencyAssetID)) - { - messageSymbol.QuotingCurrencyAssetID = CreateGlobalId(P_0, messageSymbol.QuotingCurrencyAssetID); - } - if (!string.IsNullOrEmpty(messageSymbol.SessionsContainerId)) - { - messageSymbol.SessionsContainerId = CreateGlobalId(P_0, messageSymbol.SessionsContainerId); - } - if (!string.IsNullOrEmpty(messageSymbol.GroupId)) - { - if (!??.TryGetValue(P_0, out var value)) - { - return null; - } - if (!value.TryGetReverse(messageSymbol.GroupId, out var value2)) - { - return null; - } - messageSymbol.GroupId = value2; - } - if (messageSymbol.SymbolAdditionalInfo != null) - { - AdditionalInfoItem additionalInfoItem = messageSymbol.SymbolAdditionalInfo.FirstOrDefault((AdditionalInfoItem additionalInfoItem2) => additionalInfoItem2.Id == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (additionalInfoItem != null && additionalInfoItem.Value != null) - { - additionalInfoItem.Value = CreateGlobalId(P_0, additionalInfoItem.Value.ToString()); - } - } - return messageSymbol; - } - - private MessageAsset ?(string P_0, MessageAsset P_1) - { - P_1.Id = CreateGlobalId(P_0, P_1.Id); - return P_1; - } - - private MessageOptionSerie ?(string P_0, MessageOptionSerie P_1) - { - if (!??.TryGetValue(P_0, out var value)) - { - return null; - } - if (!value.TryGetReverse(P_1.ExchangeId, out var value2)) - { - return null; - } - P_1.Id = CreateGlobalId(P_0, P_1.Id); - P_1.UnderlierId = CreateGlobalId(P_0, P_1.UnderlierId); - P_1.ExchangeId = value2; - return P_1; - } - - private MessageQuote ?(string P_0, MessageQuote P_1) - { - if (!??.TryGetValue(P_0, out var value)) - { - return null; - } - if (!value.TryGetReverse(P_1.SymbolId, out var value2)) - { - return null; - } - P_1.SymbolId = value2; - return P_1; - } - - public override void SendCustomRequest(RequestParameters parameters) - { - foreach (IVendor allVendor in AllVendors) - { - try - { - allVendor.SendCustomRequest(parameters); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - } - - protected void RegisterTradingVendor(ITradingVendor tradingVendor) - { - if (TradingVendor != null) - { - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - TradingVendor = tradingVendor ?? throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - ?(tradingVendor); - } - - protected void RegisterSymbolVendor(ISymbolVendor symbolVendor) - { - ?(symbolVendor.Key, symbolVendor, ??, ??); - } - - protected void RegisterQuoteVendor(IQuoteVendor quoteVendor) - { - ?(quoteVendor.Key, quoteVendor, ??, ??); - } - - protected void RegisterHistoryVendor(IHistoryVendor historyVendor) - { - ?(historyVendor.Key, historyVendor, ??, ??); - } - - protected void RegisterVolumeAnalysisVendor(IVolumeAnalysisVendor volumeAnalysisVendor) - { - ?(volumeAnalysisVendor.Key, volumeAnalysisVendor, ??, ??); - } - - private void ?(string P_0, ? P_1, Dictionary P_2, Dictionary> P_3) where ? : IVendor - { - if (P_1 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - P_2.Add(P_0, P_1); - P_3.Add(P_0, new Map()); - this.?(P_1); - } - - private void ?(? P_0) where ? : IVendor - { - if (P_0 == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - if (!AllVendors.Contains(P_0)) - { - P_0.NewMessage += this.?; - AllVendors.Add(P_0); - } - } - - private void ?(object P_0, VendorEventArgs P_1) - { - if (P_1.Message == null) - { - return; - } - Message message = null; - Message message2 = P_1.Message; - if (!(message2 is MessageExchange messageExchange)) - { - if (!(message2 is MessageSymbolGroup messageSymbolGroup)) - { - if (!(message2 is MessageSymbol messageSymbol)) - { - if (!(message2 is MessageSymbolInfo messageSymbolInfo)) - { - if (!(message2 is MessageAsset messageAsset)) - { - if (!(message2 is MessageOptionSerie messageOptionSerie)) - { - if (message2 is MessageQuote messageQuote) - { - message = ?(P_1.VendorKey, messageQuote); - } - else - { - PushMessage(P_1.Message); - } - } - else - { - message = ?(P_1.VendorKey, messageOptionSerie); - } - } - else - { - message = ?(P_1.VendorKey, messageAsset); - } - } - else - { - message = ?(P_1.VendorKey, messageSymbolInfo); - } - } - else - { - message = ?(P_1.VendorKey, messageSymbol); - } - } - else - { - message = ?(P_1.VendorKey, messageSymbolGroup); - } - } - else - { - message = ?(P_1.VendorKey, messageExchange); - } - if (message != null) - { - PushMessage(message); - } - } - - protected virtual string GetSymbolVendorKey(string globalSymbolId) - { - return ParseVendorKey(globalSymbolId); - } - - protected virtual string GetQuoteVendorKey(string globalSymbolId) - { - return ParseVendorKey(globalSymbolId); - } - - protected virtual string GetHistoryVendorKey(string globalSymbolId) - { - return ParseVendorKey(globalSymbolId); - } - - protected virtual string GetVolumeAnalysisVendorKey(string globalSymbolId) - { - return ParseVendorKey(globalSymbolId); - } - - protected virtual string GetSymbolVendorSymbolId(string vendorKey, string globalSymbolId) - { - return ParseLocalId(vendorKey, globalSymbolId); - } - - protected virtual string GetQuoteVendorSymbolId(string vendorKey, string globalSymbolId) - { - return ParseLocalId(vendorKey, globalSymbolId); - } - - protected virtual string GetHistoryVendorSymbolId(string vendorKey, string globalSymbolId) - { - return ParseLocalId(vendorKey, globalSymbolId); - } - - protected virtual string GetVolumeAnalysisVendorSymbolId(string vendorKey, string globalSymbolId) - { - return ParseLocalId(vendorKey, globalSymbolId); - } - - private bool ?(string P_0, out string P_1, out ISymbolVendor P_2) - { - return ?(P_0, ??, ??, GetSymbolVendorKey, out P_1, out P_2); - } - - private bool ?(string P_0, out string P_1, out IQuoteVendor P_2) - { - return ?(P_0, ??, ??, GetQuoteVendorKey, out P_1, out P_2); - } - - private bool ?(string P_0, out string P_1, out IHistoryVendor P_2) - { - return ?(P_0, ??, ??, GetHistoryVendorKey, out P_1, out P_2); - } - - private bool ?(string P_0, out string P_1, out IVolumeAnalysisVendor P_2) - { - return ?(P_0, ??, ??, GetVolumeAnalysisVendorKey, out P_1, out P_2); - } - - private static bool ?(string P_0, Dictionary P_1, Dictionary P_2, Func P_3, out string P_4, out ? P_5) where ? : IVendor - { - P_4 = null; - P_5 = default(?); - if (P_1.Count == 0) - { - return false; - } - if (P_1.Count == 1) - { - P_4 = P_1.First().Key; - P_5 = P_1.First().Value; - return true; - } - if (!P_2.TryGetValue(P_0, out P_4)) - { - P_4 = P_3(P_0); - if (string.IsNullOrEmpty(P_4)) - { - return false; - } - P_2.Add(P_0, P_4); - } - return P_1.TryGetValue(P_4, out P_5); - } - - private bool ?(string P_0, string P_1, out string P_2) - { - return ?(P_0, P_1, ??[P_0], GetSymbolVendorSymbolId, out P_2); - } - - private bool ?(string P_0, string P_1, out string P_2) - { - return ?(P_0, P_1, ??[P_0], GetQuoteVendorSymbolId, out P_2); - } - - private bool ?(string P_0, string P_1, out string P_2) - { - return ?(P_0, P_1, ??[P_0], GetHistoryVendorSymbolId, out P_2); - } - - private bool ?(string P_0, string P_1, out string P_2) - { - return ?(P_0, P_1, ??[P_0], GetVolumeAnalysisVendorSymbolId, out P_2); - } - - private static bool ?(string P_0, string P_1, Map P_2, Func P_3, out string P_4) - { - if (P_2.TryGetDirect(P_1, out P_4)) - { - return true; - } - P_4 = P_3(P_0, P_1); - if (string.IsNullOrEmpty(P_4)) - { - return false; - } - P_2.Add(P_1, P_4); - return true; - } - - protected virtual string CreateGlobalId(string vendorKey, string localId) - { - return localId + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + vendorKey; - } - - public static string ParseLocalId(string vendorKey, string globalId) - { - string empty = string.Empty; - int num = globalId.IndexOf(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + vendorKey); - if (num == -1) - { - return globalId; - } - return globalId.Substring(0, num); - } - - public static string ParseVendorKey(string globalId) - { - string[] array = globalId.Split(new string[1] { 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() }, StringSplitOptions.RemoveEmptyEntries); - if (array.Length != 2) - { - return string.Empty; - } - return array[1]; - } - - [CompilerGenerated] - internal static void ?(IDictionary P_0, IDictionary P_1) - { - foreach (KeyValuePair item in P_0) - { - if (P_1.ContainsKey(item.Key)) - { - if (item.Value < P_1[item.Key]) - { - P_1[item.Key] = item.Value; - } - } - else - { - P_1[item.Key] = item.Value; - } - } - } - } - public sealed class NewsRealtimeByTimerUpdater : IDisposable - { - private bool ??; - - private readonly Timer ??; - - private readonly ConcurrentDictionary ??; - - private readonly Action ??; - - private readonly Func> ??; - - public NewsRealtimeByTimerUpdater(Action pushMessage, Func> getNews, TimeSpan updatePeriod) - { - ?? = pushMessage; - ?? = getNews; - ?? = new ConcurrentDictionary(); - ?? = new Timer(?, null, updatePeriod, updatePeriod); - } - - public void Dispose() - { - ??.Dispose(); - } - - public void SubscribeNewsUpdates(SubscribeNewsRequestParameters parameters) - { - ??[parameters.SubscribeId] = new ?(parameters.AdditionalParameters) - { - lastRealTimeNewsRequestTime = Core.Instance.TimeUtils.DateTimeUtcNow - }; - } - - public void UnsubscribeNewsUpdates(SubscribeNewsRequestParameters parameters) - { - ??.TryRemove(parameters.SubscribeId, out var _); - } - - private void ?(object P_0) - { - if (??) - { - return; - } - try - { - ?? = true; - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - foreach (KeyValuePair item in ??) - { - IEnumerable enumerable = ??(new GetNewsRequestParameters - { - AdditionalParameters = item.Value.??, - From = item.Value.lastRealTimeNewsRequestTime, - To = dateTimeUtcNow - }); - item.Value.lastRealTimeNewsRequestTime = dateTimeUtcNow; - foreach (MessageNewsHeadline item2 in enumerable) - { - item2.SubscribeId = item.Key; - ??(item2); - } - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - ?? = false; - } - } - } -} -namespace ? -{ - internal sealed class ? - { - public readonly IEnumerable ??; - - [CompilerGenerated] - private DateTime ??; - - public DateTime lastRealTimeNewsRequestTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = dateTime; - } - } - - public ?(IEnumerable P_0) - { - ?? = P_0; - } - } -} -namespace TradingPlatform.BusinessLayer.Integration -{ - public class PingMeter - { - private readonly string ??; - - private readonly Ping ??; - - private readonly Uri ??; - - public PingMeter(string ownerName, string endpoint) - { - ?? = ownerName; - ?? = new Ping(); - ?? = new Uri(endpoint); - } - - public TimeSpan? MeasurePing() - { - try - { - PingReply pingReply = ??.Send(??.Host); - if (pingReply != null && pingReply.Status == IPStatus.Success) - { - return TimeSpan.FromMilliseconds(pingReply.RoundtripTime); - } - Core.Instance.Loggers.Log(?? + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ??.Host); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - return null; - } - } - /// - /// Ping respond bundle - /// - public class PingResult - { - [CompilerGenerated] - private TimeSpan? ??; - - [CompilerGenerated] - private TimeSpan? ??; - - [CompilerGenerated] - private PingEnum ??; - - [CompilerGenerated] - private bool ??; - - /// - /// Ping time - /// - public TimeSpan? PingTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Time spent for single request - /// - public TimeSpan? RoundTripTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Ping state - /// - public PingEnum State - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - /// - /// Disable auto reconnecting - /// - public bool StopReconnecting - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public static PingResult Disconnected() - { - return new PingResult - { - State = PingEnum.Disconnected - }; - } - } - public class ResponseWaiterBase - { - public readonly long RequestId; - - public bool isFinish; - - [CompilerGenerated] - private TimeSpan ??; - - public TimeSpan Elapsed - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = timeSpan; - } - } - - public ResponseWaiterBase(long requestId) - { - RequestId = requestId; - } - - public bool WaitForResponse(TimeSpan timeout, CancellationToken cancellationToken = default(CancellationToken)) - { - Elapsed = TimeSpan.Zero; - Stopwatch stopwatch = new Stopwatch(); - stopwatch.Start(); - while (!isFinish) - { - if (cancellationToken.IsCancellationRequested) - { - return false; - } - Elapsed = stopwatch.Elapsed; - if (timeout < stopwatch.Elapsed) - { - return false; - } - Thread.Sleep(20); - } - return true; - } - } - public class ResponseWaiter : ResponseWaiterBase - { - public T Response; - - public ResponseWaiter(long requestId) - : base(requestId) - { - } - } - public class TradesHistoryMetadata - { - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ?? = true; - - [CompilerGenerated] - private bool ??; - - public bool AllowLocalStorage - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool AllowSingleSymbolLoading - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool AllowReloadFromServer - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool LoadTradesFromCurrentTradingDate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public TradesHistoryMetadata() - { - } - - public TradesHistoryMetadata(TradesHistoryMetadata origin) - : this() - { - AllowLocalStorage = origin.AllowLocalStorage; - AllowSingleSymbolLoading = origin.AllowSingleSymbolLoading; - AllowReloadFromServer = origin.AllowReloadFromServer; - LoadTradesFromCurrentTradingDate = origin.LoadTradesFromCurrentTradingDate; - } - } - public abstract class Vendor : ITradingVendor, IVendor, ISymbolVendor, IQuoteVendor, IHistoryVendor, IVolumeAnalysisVendor - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - internal bool ?(Period P_0) - { - return P_0.BasePeriod == BasePeriod.Tick; - } - - internal int ?(Period P_0) - { - return P_0.PeriodMultiplier; - } - } - - public static readonly string LOGIN_PARAMETER_USER = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - - public static readonly string LOGIN_PARAMETER_PASSWORD = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - - public const string LOGIN_PARAMETER_GROUP = "ConnectionGroup"; - - public const string ADDITIONAL_PARAMETER_GROUP = "AdditionalParametersGroup"; - - public const string REPORT_TYPE_PARAMETER_ACCOUNT = "Account"; - - public const string REPORT_TYPE_PARAMETER_SYMBOL = "Symbol"; - - public const string REPORT_TYPE_PARAMETER_DATETIME_FROM = "From"; - - public const string REPORT_TYPE_PARAMETER_DATETIME_TO = "To"; - - public static readonly string CONNECTION = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); - - public static readonly string CONNECTION_DEMO = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - - public static readonly string CONNECTION_REAL = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - - public const string EMULATOR = "Emulator"; - - public const string MARKET_REPLAY = "Market Replay"; - - public const string TRADING_SIMULATOR = "Trading Simulator"; - - [CompilerGenerated] - private EventHandler ??; - - private string ??; - - /// - /// Confirms allowed non fixed list by vendor - /// - public virtual bool AllowNonFixedList => false; - - public virtual DateTime? ServerTime => null; - - string IVendor.Key - { - get - { - return ??; - } - set - { - ?? = text; - } - } - - public event EventHandler NewMessage - { - [CompilerGenerated] - add - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - [CompilerGenerated] - remove - { - EventHandler eventHandler = ??; - EventHandler eventHandler2; - do - { - eventHandler2 = eventHandler; - EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); - eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); - } - while ((object)eventHandler != eventHandler2); - } - } - - [SpecialName] - private void ?(EventHandler P_0) - { - NewMessage += P_0; - } - - void IVendor.add_NewMessage(EventHandler P_0) - { - //ILSpy generated this explicit interface implementation from .override directive in ? - this.?(P_0); - } - - [SpecialName] - private void ?(EventHandler P_0) - { - NewMessage -= P_0; - } - - void IVendor.remove_NewMessage(EventHandler P_0) - { - //ILSpy generated this explicit interface implementation from .override directive in ? - this.?(P_0); - } - - /// - /// Performs a binding with broker or data provider - /// - public virtual ConnectionResult Connect(ConnectRequestParameters connectRequestParameters) - { - return new ConnectionResult - { - State = ConnectionState.Fail - }; - } - - /// - /// Specifies any operation before breaking a connection with broker or data provider - /// - public virtual void Disconnect() - { - } - - /// - /// Called when platform finished retreiving all required informations from vendor during connecting - /// - public virtual void OnConnected(CancellationToken token) - { - } - - /// - /// Ping processing before its visualization in the terminal - /// - public virtual PingResult Ping() - { - return new PingResult(); - } - - public virtual LimitationMetadata GetLimitationMetadata() - { - return new LimitationMetadata(); - } - - /// - /// Retrieves an information about available accounts. Yon need to specify at least one account - /// - public virtual IList GetAccounts(CancellationToken token) - { - return new List(); - } - - public virtual IList GetRules(CancellationToken token) - { - return new List(); - } - - public virtual IList GetCryptoAssetBalances(CancellationToken token) - { - return new List(); - } - - public virtual IList GetAccountOperations(CancellationToken token) - { - return new List(); - } - - public virtual IList GetSessions(CancellationToken token) - { - return new List(); - } - - /// - /// Retrieves a collection of available exchange markets from vendor - /// - public virtual IList GetExchanges(CancellationToken token) - { - return new List - { - new MessageExchange - { - Id = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - ExchangeName = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), - SortIndex = -1 - } - }; - } - - /// - /// Retrieves information about available assets. - /// - public virtual IList GetAssets(CancellationToken token) - { - return new List(); - } - - public virtual IList GetSymbols(CancellationToken token) - { - return new List(); - } - - /// - /// Retrieves information about available symbols. - /// - public virtual IList GetAllOptionSeries(CancellationToken token) - { - return new List(); - } - - /// - /// Gets an available symbols types from vendor - /// - public virtual MessageSymbolTypes GetSymbolTypes(CancellationToken token) - { - return new MessageSymbolTypes - { - SymbolTypes = new List((SymbolType[])Enum.GetValues(typeof(SymbolType))) - }; - } - - public virtual IList GetSymbolGroups(CancellationToken token) - { - return new List(); - } - - /// - /// Derives a non fixed symbol from vendor - /// - public virtual MessageSymbol GetNonFixedSymbol(GetSymbolRequestParameters requestParameters) - { - return null; - } - - /// - /// Derives a non-fixed list of symbols from vendor - /// - public virtual IList SearchSymbols(SearchSymbolsRequestParameters requestParameters) - { - return new List(); - } - - public virtual IList GetFutureContracts(GetFutureContractsRequestParameters requestParameters) - { - return new List(); - } - - public virtual IList GetOptionSeries(GetOptionSeriesRequestParameters requestParameters) - { - return new List(); - } - - public virtual IList GetStrikes(GetStrikesRequestParameters requestParameters) - { - return new List(); - } - - /// - /// Retrieves an information about opened orders at the time of connection. - /// - public virtual IList GetPendingOrders(CancellationToken token) - { - return new List(); - } - - /// - /// Retrieves an information about positions at the time of connection - /// - public virtual IList GetPositions(CancellationToken token) - { - return new List(); - } - - /// - /// Retrieves an information about closed positions at the time of connection - /// - public virtual IList GetClosedPositions(CancellationToken token) - { - return new List(); - } - - /// - /// Subscribing to quote data: Level1/Level2/Trade - /// - public virtual void SubscribeSymbol(SubscribeQuotesParameters parameters) - { - } - - /// - /// Unsubscribing from quote data: Level1/Level2/Trade - /// - public virtual void UnSubscribeSymbol(SubscribeQuotesParameters parameters) - { - } - - public virtual IList LoadHistory(HistoryRequestParameters requestParameters) - { - return new List(); - } - - /// - /// Gets a list of supported historical intervals and data types by vendor - /// - public virtual HistoryMetadata GetHistoryMetadata(CancellationToken cancellationToken) - { - return new HistoryMetadata(); - } - - public virtual VendorVolumeAnalysisByPeriodResponse LoadVolumeAnalysis(VolumeAnalysisByPeriodRequestParameters requestParameters) - { - return VendorVolumeAnalysisByPeriodResponse.CreateDefault(); - } - - public virtual VolumeAnalysisMetadata GetVolumeAnalysisMetadata() - { - return new VolumeAnalysisMetadata(); - } - - /// - /// Prepare and sending order placing request to broker - /// - public virtual TradingOperationResult PlaceOrder(PlaceOrderRequestParameters parameters) - { - return TradingOperationResult.CreateError(parameters.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - - public virtual TradingOperationResult PlaceMultiOrder(PlaceMultiOrderOrderRequestParameters parameters) - { - return TradingOperationResult.CreateError(parameters.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - - /// - /// Sending order modification request to broker - /// - public virtual TradingOperationResult ModifyOrder(ModifyOrderRequestParameters parameters) - { - return TradingOperationResult.CreateError(parameters.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - - /// - /// Sending order cancellation request to broker - /// - public virtual TradingOperationResult CancelOrder(CancelOrderRequestParameters parameters) - { - return TradingOperationResult.CreateError(parameters.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - - /// - /// Sending position closing request to broker - /// - public virtual TradingOperationResult ClosePosition(ClosePositionRequestParameters parameters) - { - return TradingOperationResult.CreateError(parameters.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - - public virtual MarginInfo GetMarginInfo(OrderRequestParameters orderRequestParameters) - { - return null; - } - - /// - /// Gets information about available reports from vendor - /// - public virtual IList GetReportsMetaData(CancellationToken token) - { - return new List(); - } - - /// - /// Called when platform need to generate particular report - /// - public virtual Report GenerateReport(ReportRequestParameters reportRequestParameters) - { - return new Report(); - } - - public virtual IEnumerable GetNewsProviderSettings(CancellationToken cancellationToken) - { - return Array.Empty(); - } - - public virtual IEnumerable GetNews(GetNewsRequestParameters requestParameters) - { - return Array.Empty(); - } - - public virtual void SubscribeNewsUpdates(SubscribeNewsRequestParameters subscribeNewsRequestParameters) - { - } - - public virtual void UnsubscribeNewsUpdates(SubscribeNewsRequestParameters subscribeNewsRequestParameters) - { - } - - public virtual string GetNewsArticleContent(GetNewsArticleContentRequestParameters requestParameters) - { - return string.Empty; - } - - public virtual IEnumerable GetTradingSignals(CancellationToken cancellationToken) - { - return Array.Empty(); - } - - public virtual TradesHistoryMetadata GetTradesMetadata() - { - return new TradesHistoryMetadata(); - } - - public virtual IList GetTrades(TradesHistoryRequestParameters parameters) - { - return Array.Empty(); - } - - public virtual void GetTrades(TradesHistoryRequestParameters parameters, AccountTradesLoadingCallback callback) - { - callback?.Invoke(GetTrades(parameters), isFinished: true); - } - - public virtual IList GetOrdersHistory(OrdersHistoryRequestParameters parameters) - { - return Array.Empty(); - } - - /// - /// Retrieves allowed/supported order types - /// - public virtual IList GetAllowedOrderTypes(CancellationToken token) - { - return new List(); - } - - public void PushMessage(Message msg) - { - ???.Invoke(this, new VendorEventArgs(??, msg)); - } - - public virtual PnL CalculatePnL(PnLRequestParameters parameters) - { - return null; - } - - public virtual void SendCustomRequest(RequestParameters parameters) - { - } - - protected static ConnectionInfo CreateDefaultConnectionInfo(string name, string vendorName, string logoPath = null, string group = null, bool allowCreateCustomConnections = true, ConnectionState connectionState = ConnectionState.Disconnected, IList settings = null, List links = null, string copyrights = null) - { - return new ConnectionInfo(name, group, vendorName) - { - ConnectionLogoPath = logoPath, - AllowCreateCustomConnections = allowCreateCustomConnections, - ConnectionState = connectionState, - ConnectionSettings = settings, - Links = links, - Copyrights = copyrights - }; - } - - [Conditional("quantower_licences")] - [Conditional("quantower_in_licences")] - [Conditional("quantower_br_licences")] - [Conditional("capfinex_licences")] - [Conditional("roemaker_licences")] - [Conditional("coincidence_licences")] - [Conditional("alpha_trader_licenses")] - [Conditional("vt_terminal_licences")] - [Conditional("quantower_de_licences")] - [Conditional("flowtrade_licences")] - [Conditional("spy_money_licences")] - [Conditional("total_trading_terminal_licences")] - protected void CheckLicenceMultiAssetVendor() - { - if ((Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())) == null && Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) != null) - { - throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - } - - public static bool TryCorrectPeriodForDirectDownload(Period[] allowedPeriods, Period currentPeriod, out Period allowedPeriod) - { - allowedPeriod = currentPeriod; - if (allowedPeriods == null) - { - allowedPeriods = Array.Empty(); - } - if (allowedPeriods.Contains(currentPeriod)) - { - return true; - } - if (currentPeriod.BasePeriod == BasePeriod.Tick) - { - Period[] array = (from P_0 in allowedPeriods - where P_0.BasePeriod == BasePeriod.Tick - orderby P_0.PeriodMultiplier descending - select P_0).ToArray(); - for (int num = 0; num < array.Length; num++) - { - Period period = array[num]; - if (currentPeriod.PeriodMultiplier % period.PeriodMultiplier == 0) - { - allowedPeriod = period; - return true; - } - } - } - else - { - Period[] array = allowedPeriods; - for (int num = 0; num < array.Length; num++) - { - Period period2 = array[num]; - if (currentPeriod.Ticks % period2.Ticks == 0L) - { - allowedPeriod = period2; - return true; - } - } - } - return false; - } - } - public delegate void AccountTradesLoadingCallback(IList messages, bool isFinished); - public class VendorEventArgs : EventArgs - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private Message ??; - - public string VendorKey - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = text; - } - } - - public Message Message - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = message; - } - } - - public VendorEventArgs(string vendorKey, Message message) - { - VendorKey = vendorKey; - Message = message; - } - } - public class VendorInfo - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal SettingItem ?(SettingItem P_0) - { - return P_0.GetCopy(); - } - } - - [CompilerGenerated] - private VendorMetaData ??; - - private readonly IList ??; - - [CompilerGenerated] - private ConnectionInfo[] ??; - - private readonly Type ??; - - private readonly SemaphoreSlim ??; - - public VendorMetaData MetaData - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = vendorMetaData; - } - } - - public SettingItem[] ConnectionParameters => ??.Select((SettingItem P_0) => P_0.GetCopy()).ToArray(); - - public ConnectionInfo[] DefaultConnections - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = array; - } - } - - internal VendorInfo(VendorMetaData P_0, Type P_1) - { - MetaData = P_0; - ?? = P_0.GetConnectionParameters(); - DefaultConnections = P_0.GetDefaultConnections().ToArray(); - ConnectionInfo[] defaultConnections = DefaultConnections; - for (int i = 0; i < defaultConnections.Length; i++) - { - defaultConnections[i].VendorInfo = this; - } - ?? = P_1; - if (P_0.SimultaneousConnectingProcessLimit > 0) - { - ?? = new SemaphoreSlim(P_0.SimultaneousConnectingProcessLimit); - } - } - - internal Vendor ?() - { - return Activator.CreateInstance(??) as Vendor; - } - - internal void ?() - { - ???.Wait(); - } - - internal void ?() - { - ???.Release(); - } - - public override string ToString() - { - return MetaData?.VendorName; - } - } - public class VendorManager - { - private readonly Dictionary ??; - - public VendorInfo[] Vendors => ??.Values.ToArray(); - - public VendorInfo this[string vendorName] - { - get - { - ??.TryGetValue(vendorName, out var value); - return value; - } - } - - internal VendorManager() - { - ?? = new Dictionary(); - } - - internal void ?() - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - if (!Directory.Exists(Const.CUSTOM_VENDORS_PATH)) - { - Directory.CreateDirectory(Const.CUSTOM_VENDORS_PATH); - } - List list = AssemblyLoader.LoadTypes(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), typeof(Vendor), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SearchOption.AllDirectories); - list.AddRange(AssemblyLoader.LoadTypes(Const.CUSTOM_VENDORS_PATH, typeof(Vendor), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SearchOption.AllDirectories)); - if (!list.Any()) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - return; - } - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(38, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(list.Count); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); - foreach (TypeWrapper item in list) - { - Type type = item; - try - { - if (type.IsAbstract) - { - continue; - } - MethodInfo method = type.GetMethod(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), BindingFlags.Static | BindingFlags.Public); - if (!(method != null)) - { - continue; - } - if (method.Invoke(null, null) is VendorMetaData vendorMetaData) - { - if (vendorMetaData == null || string.IsNullOrEmpty(vendorMetaData.VendorName)) - { - LoggerManager loggers2 = Core.Instance.Loggers; - defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(54, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(type); - loggers2.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); - } - else if (??.ContainsKey(vendorMetaData.VendorName)) - { - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + vendorMetaData.VendorName, LoggingLevel.Verbose); - } - else - { - ??.Add(vendorMetaData.VendorName, new VendorInfo(vendorMetaData, type)); - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + vendorMetaData.VendorName + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - } - } - else - { - Core.Instance.Loggers.Log(type.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - } - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - } - Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); - } - - internal void ?() - { - ???.Clear(); - } - } - public class VendorMetaData - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func> ??; - - public static Func> ??; - - internal IList ?() - { - return new List(); - } - - internal IList ?() - { - return new List(); - } - } - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private int ??; - - public Func> GetDefaultConnections; - - /// - /// Gets a settings list from a vendor selection of the setup window - /// - public Func> GetConnectionParameters; - - public string VendorName - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string VendorDescription - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int SimultaneousConnectingProcessLimit - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public VendorMetaData() - { - GetDefaultConnections = () => new List(); - GetConnectionParameters = () => new List(); - } - } - public class VendorHistoryResponse : VendorIntervalResponse> - { - public VendorHistoryResponse(IList data) - : base(data) - { - } - - public VendorHistoryResponse(string errorText) - : base(errorText) - { - } - - public static VendorHistoryResponse CreateSuccess(IList data) - { - return new VendorHistoryResponse(data); - } - - public static VendorHistoryResponse CreateError(string errorText) - { - return new VendorHistoryResponse(errorText); - } - - public static VendorHistoryResponse CreateError(Exception exception) - { - return new VendorHistoryResponse(exception.GetMessageRecursive()); - } - } - public class VendorIntervalResponse : VendorResponse - { - [CompilerGenerated] - private Interval ??; - - public Interval ActualDataInterval - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public VendorIntervalResponse(TData data) - : base(data) - { - } - - public VendorIntervalResponse(string errorText) - : base(errorText) - { - } - } - public class VendorResponse - { - [CompilerGenerated] - private TData ??; - - [CompilerGenerated] - private string ??; - - public TData Data - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public string ErrorText - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public VendorResponse(TData data) - { - Data = data; - } - - public VendorResponse(string errorText) - { - ErrorText = errorText; - } - } - public class VendorVolumeAnalysisByPeriodResponse : VendorIntervalResponse> - { - private VendorVolumeAnalysisByPeriodResponse(IList P_0) - : base(P_0) - { - } - - private VendorVolumeAnalysisByPeriodResponse(string P_0) - : base(P_0) - { - } - - public static VendorVolumeAnalysisByPeriodResponse CreateDefault() - { - return new VendorVolumeAnalysisByPeriodResponse(new List()); - } - - public static VendorVolumeAnalysisByPeriodResponse CreateSuccess(IList data, Interval actualInterval) - { - return new VendorVolumeAnalysisByPeriodResponse(data) - { - ActualDataInterval = actualInterval - }; - } - - public static VendorVolumeAnalysisByPeriodResponse CreateError(string errorText) - { - return new VendorVolumeAnalysisByPeriodResponse(errorText); - } - - public static VendorVolumeAnalysisByPeriodResponse CreateError(Exception exception) - { - return new VendorVolumeAnalysisByPeriodResponse(exception.GetMessageRecursive()); - } - } - public class VendorVolumeAnalysisResponse : VendorIntervalResponse - { - private VendorVolumeAnalysisResponse(VolumeAnalysisData P_0) - : base(P_0) - { - } - - private VendorVolumeAnalysisResponse(string P_0) - : base(P_0) - { - } - - public static VendorVolumeAnalysisResponse CreateDefault() - { - return new VendorVolumeAnalysisResponse(new VolumeAnalysisData()); - } - - public static VendorVolumeAnalysisResponse CreateSuccess(VolumeAnalysisData data, Interval actualInterval) - { - return new VendorVolumeAnalysisResponse(data) - { - ActualDataInterval = actualInterval - }; - } - - public static VendorVolumeAnalysisResponse CreateError(string errorText) - { - return new VendorVolumeAnalysisResponse(errorText); - } - - public static VendorVolumeAnalysisResponse CreateError(Exception exception) - { - return new VendorVolumeAnalysisResponse(exception.GetMessageRecursive()); - } - } - public class VolumeAnalysisByPeriodRequestParameters : VolumeAnalysisRequestParameters - { - [CompilerGenerated] - private Period ??; - - [CompilerGenerated] - private bool ??; - - public override RequestType Type => RequestType.VolumeAnalysisByPeriod; - - public Period Period - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool ForceReload - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public new VolumeAnalysisByPeriodRequestParameters Copy => new VolumeAnalysisByPeriodRequestParameters(this); - - public VolumeAnalysisByPeriodRequestParameters() - { - base.CalculatePriceLevels = false; - } - - internal VolumeAnalysisByPeriodRequestParameters(VolumeAnalysisByPeriodRequestParameters P_0) - : base(P_0) - { - Period = P_0.Period; - ForceReload = P_0.ForceReload; - } - - public VolumeAnalysisDescription ToDescription() - { - return new VolumeAnalysisDescription(base.SymbolId, Period, base.CalculatePriceLevels); - } - } - [ProtoContract] - public class VolumeAnalysisMetadata - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - internal long ?(Period P_0) - { - return P_0.Ticks; - } - } - - [CompilerGenerated] - private readonly VolumeAnalysisAvailability ??; - - private readonly Dictionary ??; - - [CompilerGenerated] - private readonly Dictionary ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private TimeSpan ??; - - public VolumeAnalysisAvailability VolumeAnalysisAvailability - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public Dictionary DownloadingStepByPeriod - { - private get - { - return ??; - } - init - { - ?? = value; - if (DownloadingLevelsStepByPeriod == null || DownloadingLevelsStepByPeriod.Count == 0) - { - DownloadingLevelsStepByPeriod = new Dictionary(value); - } - } - } - - public Dictionary DownloadingLevelsStepByPeriod - { - [CompilerGenerated] - private get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - internal bool IsVolumeAnalysisAvailable - { - get - { - if (VolumeAnalysisAvailability == VolumeAnalysisAvailability.Available) - { - return DownloadingStepByPeriod.Count > 0; - } - return false; - } - } - - public bool BuildUncompletedBars - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public TimeSpan MaxTicksLoadingPeriod - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - internal VolumeAnalysisMetadata Copy => new VolumeAnalysisMetadata - { - VolumeAnalysisAvailability = VolumeAnalysisAvailability, - BuildUncompletedBars = BuildUncompletedBars, - MaxTicksLoadingPeriod = MaxTicksLoadingPeriod, - DownloadingStepByPeriod = new Dictionary(DownloadingStepByPeriod), - DownloadingLevelsStepByPeriod = new Dictionary(DownloadingLevelsStepByPeriod) - }; - - public VolumeAnalysisMetadata() - { - VolumeAnalysisAvailability = VolumeAnalysisAvailability.NotAvailable; - MaxTicksLoadingPeriod = TimeSpan.FromHours(1.0); - DownloadingStepByPeriod = new Dictionary(); - } - - public IDictionary GetDownloadingStepByPeriod(bool includePriceLevels) - { - if (!includePriceLevels) - { - return DownloadingStepByPeriod; - } - return DownloadingLevelsStepByPeriod; - } - - public Period[] GetAllowedPeriods(bool includePriceLevels) - { - return GetDownloadingStepByPeriod(includePriceLevels)?.Keys.OrderByDescending((Period P_0) => P_0.Ticks).ToArray(); - } - - public bool TryFindLargestLoadingPeriod(DateTime from, DateTime to, bool includeLevels, out Period period) - { - return TryFindLargestLoadingPeriod(new Interval(from, to), includeLevels, out period); - } - - public bool TryFindLargestLoadingPeriod(Interval interval, bool includeLevels, out Period period) - { - period = default(Period); - Period[] allowedPeriods = GetAllowedPeriods(includeLevels); - foreach (Period period2 in allowedPeriods) - { - if (interval.Contains(period2)) - { - period = period2; - return true; - } - } - return false; - } - } - public class VolumeAnalysisRequestParameters : RequestParameters - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private DateTime ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private ISessionsContainer ??; - - public override RequestType Type => RequestType.VolumeAnalysis; - - public string SymbolId - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DateTime FromTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public DateTime ToTime - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double MinVolumeAnalysisTickSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public Interval Interval - { - get - { - return new Interval(FromTime, ToTime); - } - set - { - FromTime = value.From; - ToTime = value.To; - } - } - - public bool CalculatePriceLevels - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public ISessionsContainer SessionsContainer - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public VolumeAnalysisRequestParameters Copy => new VolumeAnalysisRequestParameters(this); - - public VolumeAnalysisRequestParameters() - { - CalculatePriceLevels = true; - MinVolumeAnalysisTickSize = double.NaN; - } - - internal VolumeAnalysisRequestParameters(VolumeAnalysisRequestParameters P_0) - { - SymbolId = P_0.SymbolId; - FromTime = P_0.FromTime; - ToTime = P_0.ToTime; - CalculatePriceLevels = P_0.CalculatePriceLevels; - base.CancellationToken = P_0.CancellationToken; - SessionsContainer = P_0.SessionsContainer; - MinVolumeAnalysisTickSize = P_0.MinVolumeAnalysisTickSize; - } - } -} -namespace TradingPlatform.BusinessLayer.Integration.Limitation -{ - public record Limit - { - public Period Period - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public int Value - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public LimitInterval Interval - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - public RequestType[] RequestTypes - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - - [CompilerGenerated] - private readonly Period ??; - - [CompilerGenerated] - private readonly int ??; - - [CompilerGenerated] - private readonly LimitInterval ??; - - [CompilerGenerated] - private readonly RequestType[] ??; - - public Limit(Period Period, int Value, LimitInterval Interval, params RequestType[] RequestTypes) - { - ?? = Period; - ?? = Value; - ?? = Interval; - ?? = RequestTypes; - base..ctor(); - } - - [CompilerGenerated] - public override string ToString() - { - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - if (PrintMembers(stringBuilder)) - { - stringBuilder.Append(' '); - } - stringBuilder.Append('}'); - return stringBuilder.ToString(); - } - - [CompilerGenerated] - protected virtual bool PrintMembers(StringBuilder builder) - { - RuntimeHelpers.EnsureSufficientExecutionStack(); - builder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - builder.Append(Period.ToString()); - builder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - builder.Append(Value.ToString()); - builder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - builder.Append(Interval.ToString()); - builder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - builder.Append(RequestTypes); - return true; - } - - [CompilerGenerated] - public void Deconstruct(out Period Period, out int Value, out LimitInterval Interval, out RequestType[] RequestTypes) - { - Period = this.Period; - Value = this.Value; - Interval = this.Interval; - RequestTypes = this.RequestTypes; - } - } - public class LimitationMetadata - { - [CompilerGenerated] - private readonly IList ??; - - public IList Limits - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - } - public enum LimitInterval - { - FixedCalendar, - FloatingWindow - } -} -namespace ? -{ - internal class ? : IDisposable - { - private class ? - { - private readonly CancellationToken ??; - - private readonly ManualResetEventSlim ??; - - private IList ??; - - public bool IsCancelled => ??.IsCancellationRequested; - - public IList History - { - get - { - return ??; - } - set - { - ?? = list; - ??.Set(); - } - } - - public ?(CancellationToken P_0) - { - ?? = P_0; - ?? = new ManualResetEventSlim(); - } - - public void ?(CancellationToken P_0) - { - WaitHandle.WaitAny(new WaitHandle[2] { ??.WaitHandle, P_0.WaitHandle }); - } - } - - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func ??; - - public static Func ??; - - public static Func> ??; - - public static Func ??; - - internal int ?(HistoryInterval P_0) - { - return P_0.History.Count; - } - - internal DateTime ?(HistoryInterval P_0) - { - return P_0.Interval.From; - } - - internal IEnumerable ?(HistoryInterval P_0) - { - return P_0.History; - } - - internal bool ?(? P_0) - { - return !P_0.IsCancelled; - } - } - - [CompilerGenerated] - private sealed class ? - { - public ? ??; - - public HistoryRequestParameters ??; - - public int ??; - - internal void ?() - { - IList history = null; - try - { - history = ??.?(??); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - lock (??.??) - { - if (??.??.TryGetValue(??, out var value)) - { - ??.??.Remove(??); - foreach (? item in value) - { - item.History = history; - } - } - } - } - } - } - - private readonly HistoryStorage ??; - - private readonly TaskFactory ??; - - private readonly DegreeOfParallelismTaskScheduler ??; - - private readonly ? ??; - - private readonly Dictionary> ??; - - private readonly object ??; - - public static ? ?(? P_0) - { - HistoryStorage historyStorage = null; - if (P_0.AllowLocalStorage) - { - historyStorage = HistoryStorage.Create(P_0.LocalStorageConnectionString); - } - return new ?(P_0.DegreeOfParallelism, P_0.LoadHistoryDelegate, historyStorage); - } - - internal ?(int P_0, ? P_1, HistoryStorage P_2 = null) - { - ?? = new DegreeOfParallelismTaskScheduler(P_0); - ?? = new TaskFactory(??); - ?? = P_1; - ?? = P_2; - ?? = new Dictionary>(); - ?? = new object(); - } - - public IList ?(HistoryRequestParameters P_0) - { - int ?? = ?(P_0); - ? ?2 = new ?(P_0.CancellationToken); - bool flag = false; - lock (??) - { - if (??.TryGetValue(??, out var value)) - { - value.Add(?2); - } - else - { - ??.Add(??, new List { ?2 }); - flag = true; - } - } - if (flag) - { - ??.StartNew(delegate - { - IList history = null; - try - { - history = ?(P_0); - } - catch (Exception ex) - { - Core.Instance.Loggers.Log(ex); - } - finally - { - lock (??) - { - if (??.TryGetValue(??, out var value2)) - { - ??.Remove(??); - foreach (? item in value2) - { - item.History = history; - } - } - } - } - }); - } - ?2.?(P_0.CancellationToken); - return ?2.History ?? new List(); - } - - internal virtual IList ?(HistoryRequestParameters P_0) - { - List result = new List(); - List list = new List(); - List historyParametersForServerRequest = new List(); - if (!P_0.ForceReload && ?? != null) - { - LoggerManager loggers = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(52, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); - IList list2 = ??.Load(P_0, out historyParametersForServerRequest); - if (?(P_0)) - { - return result; - } - list.AddRange(list2); - LoggerManager loggers2 = Core.Instance.Loggers; - defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(75, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(list2.Sum((HistoryInterval historyInterval) => historyInterval.History.Count)); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers2.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); - } - else - { - historyParametersForServerRequest.Add(P_0); - } - foreach (HistoryRequestParameters item in historyParametersForServerRequest) - { - if (?(P_0)) - { - break; - } - LoggerManager loggers3 = Core.Instance.Loggers; - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(50, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers3.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); - DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; - if (!(??(item) is List list3) || ?(P_0)) - { - break; - } - if (item.Aggregation is HistoryAggregationTick && !item.Symbol.HistoryMetadata.ServerSideTickDirectionAvailable) - { - list3.ProcessTickDirection(P_0.CancellationToken); - } - list.Add(new HistoryInterval - { - Description = item.ToDescription(), - Interval = item.Interval, - History = new List(list3) - }); - if (?(item, list3, dateTimeUtcNow, item.Symbol.HistoryMetadata.BuildUncompletedBars)) - { - ???.Save(new HistoryInterval - { - Description = item.ToDescription(), - Interval = item.Interval, - History = list3 - }); - } - LoggerManager loggers4 = Core.Instance.Loggers; - defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(73, 2); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(list3.Count); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - loggers4.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); - } - return list.OrderBy((HistoryInterval historyInterval) => historyInterval.Interval.From).SelectMany((HistoryInterval historyInterval) => historyInterval.History).ToList(); - } - - public void Dispose() - { - ??.Dispose(); - ???.Dispose(); - } - - internal static bool ?(HistoryRequestParameters P_0, List P_1, DateTime P_2, bool P_3) - { - HistoryAggregation aggregation = P_0.Aggregation; - if (!(aggregation is HistoryAggregationTick)) - { - if (!(aggregation is HistoryAggregationTickBars historyAggregationTickBars)) - { - if (!(aggregation is HistoryAggregationTime historyAggregationTime)) - { - if (aggregation is HistoryAggregationTimeStatistics historyAggregationTimeStatistics) - { - return ?(P_0, P_1, P_2, P_3, historyAggregationTimeStatistics.Period); - } - throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.Aggregation.Name); - } - return ?(P_0, P_1, P_2, P_3, historyAggregationTime.Period); - } - if (!P_1.Any()) - { - if (P_3 && (P_2 - P_0.ToTime).TotalSeconds < 60.0) - { - return false; - } - return true; - } - IHistoryItem historyItem = P_1[P_1.Count - 1]; - if (historyItem.TicksLeft <= P_0.ToTime.Ticks && historyItem is HistoryItemBar historyItemBar && historyItemBar.Ticks < historyAggregationTickBars.TicksCount) - { - P_1.Remove(historyItem); - P_0.ToTime = historyItem.TimeLeft; - } - else - { - P_0.ToTime = new DateTime(Math.Max(historyItem.TicksRight, historyItem.TicksLeft + historyAggregationTickBars.TicksCount), DateTimeKind.Utc); - } - return true; - } - TimeSpan timeSpan = TimeSpan.FromSeconds(5.0); - if (P_0.Interval.To < P_2 && P_2 - P_0.Interval.To > timeSpan) - { - return true; - } - if (!P_1.Any()) - { - P_0.Interval = new Interval(P_0.Interval.From, P_0.Interval.To - timeSpan); - return !P_0.Interval.IsReversal; - } - P_0.Interval = new Interval(P_0.Interval.From, P_1.Last().TimeLeft.AddTicks(1L)); - return true; - } - - private static bool ?(HistoryRequestParameters P_0, List P_1, DateTime P_2, bool P_3, Period P_4) - { - if (!P_1.Any()) - { - if (P_0.ToTime.Ticks - P_0.FromTime.Ticks < P_4.Ticks) - { - return false; - } - if (P_3 && (P_2 - P_0.ToTime).TotalSeconds < 60.0) - { - return false; - } - long ticks = P_0.Interval.GetLength().Ticks; - ticks = ticks / P_4.Ticks * P_4.Ticks; - P_0.ToTime = P_0.FromTime.AddTicks(ticks); - return true; - } - IHistoryItem historyItem = P_1[P_1.Count - 1]; - long num = P_4.BasePeriod switch - { - BasePeriod.Month => historyItem.TimeLeft.AddMonths(P_4.PeriodMultiplier).Ticks, - BasePeriod.Year => historyItem.TimeLeft.AddYears(P_4.PeriodMultiplier).Ticks, - _ => historyItem.TicksLeft + P_4.Ticks, - }; - if (historyItem.TicksLeft <= P_0.ToTime.Ticks && num > P_0.ToTime.Ticks + 1) - { - P_1.Remove(historyItem); - P_0.ToTime = historyItem.TimeLeft; - } - else - { - P_0.ToTime = new DateTime(num, DateTimeKind.Utc); - } - return true; - } - - private static int ?(HistoryRequestParameters P_0) - { - HashCode hashCode = default(HashCode); - hashCode.Add(P_0.SymbolId); - hashCode.Add(P_0.Interval); - hashCode.Add(P_0.ForceReload); - hashCode.Add(P_0.Aggregation.Name); - HistoryAggregation aggregation = P_0.Aggregation; - if (!(aggregation is HistoryAggregationTick historyAggregationTick)) - { - if (!(aggregation is HistoryAggregationTickBars historyAggregationTickBars)) - { - if (!(aggregation is HistoryAggregationTime historyAggregationTime)) - { - if (!(aggregation is HistoryAggregationTimeStatistics historyAggregationTimeStatistics)) - { - throw new Exception(P_0.Aggregation.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - hashCode.Add(historyAggregationTimeStatistics.Period); - } - else - { - hashCode.Add(historyAggregationTime.Period); - hashCode.Add(historyAggregationTime.HistoryType); - } - } - else - { - hashCode.Add(historyAggregationTickBars.TicksCount); - hashCode.Add(historyAggregationTickBars.HistoryType); - } - } - else - { - hashCode.Add(historyAggregationTick.HistoryType); - } - return hashCode.ToHashCode(); - } - - private bool ?(HistoryRequestParameters P_0) - { - if (!P_0.CancellationToken.IsCancellationRequested) - { - return false; - } - int key = ?(P_0); - lock (??) - { - if (!??.TryGetValue(key, out var value)) - { - return true; - } - if (value.Any((? ?2) => !?2.IsCancelled)) - { - return false; - } - ??.Remove(key); - return true; - } - } - } - internal delegate IList ?(HistoryRequestParameters P_0); - internal class ? - { - [CompilerGenerated] - private string ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private ? ??; - - [CompilerGenerated] - private bool ??; - - public string LocalStorageConnectionString - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = text; - } - } - - public int DegreeOfParallelism - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = num; - } - } - - public ? LoadHistoryDelegate - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = ?2; - } - } - - public bool AllowLocalStorage - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = flag; - } - } - } -} -namespace TradingPlatform.BusinessLayer.History.Aggregations -{ - public sealed class HistoryAggregationPowerTradesParameters : ICustomizable, ICloneable, IPowerTradesBaseSettings - { - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private int ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double ??; - - [CompilerGenerated] - private double? ??; - - public double MinTradeVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double MaxTradeVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double TotalVolume - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double TimeInterval - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double BasisVolumeInterval - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int MaxZoneHeight - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int MinZoneHeight - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double DeltaFilter - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double BasisRatioFilter - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public double? CustomTickSize - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IList Settings - { - get - { - List list = new List - { - new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MinTradeVolume) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - }, - new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MaxTradeVolume) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - }, - new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TotalVolume) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - }, - new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TimeInterval) - { - Minimum = 0.1, - DecimalPlaces = 1, - Increment = 0.1, - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - }, - new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), BasisVolumeInterval) - { - Minimum = 0.1, - Increment = 0.1, - DecimalPlaces = 1, - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - }, - new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), DeltaFilter) - { - Minimum = 0.0, - Maximum = 100.0, - DecimalPlaces = 0, - Increment = 1.0, - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - }, - new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), BasisRatioFilter) - { - Minimum = 0.0, - Maximum = 100.0, - DecimalPlaces = 2, - Increment = 0.01, - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - }, - new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MaxZoneHeight) - { - Minimum = 1, - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - }, - new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MinZoneHeight) - { - Minimum = 0, - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - } - }; - if (CustomTickSize.HasValue) - { - list.Add(new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CustomTickSize.Value) - { - Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) - }); - } - return list; - } - set - { - SettingsHolder settingsHolder = new SettingsHolder(value); - if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value2) && value2.Value is double minTradeVolume) - { - MinTradeVolume = minTradeVolume; - } - if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2.Value is double maxTradeVolume) - { - MaxTradeVolume = maxTradeVolume; - } - if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2.Value is double totalVolume) - { - TotalVolume = totalVolume; - } - if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2.Value is double timeInterval) - { - TimeInterval = timeInterval; - } - if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2.Value is double basisVolumeInterval) - { - BasisVolumeInterval = basisVolumeInterval; - } - if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2.Value is int maxZoneHeight) - { - MaxZoneHeight = maxZoneHeight; - } - if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2.Value is int minZoneHeight) - { - MinZoneHeight = minZoneHeight; - } - if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2.Value is double deltaFilter) - { - DeltaFilter = deltaFilter; - } - if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2.Value is double basisRatioFilter) - { - BasisRatioFilter = basisRatioFilter; - } - if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2.Value is double value3 && !value3.IsNanOrDefault()) - { - CustomTickSize = value3; - } - } - } - - public object Clone() - { - return new HistoryAggregationPowerTradesParameters - { - TotalVolume = TotalVolume, - BasisRatioFilter = BasisRatioFilter, - BasisVolumeInterval = BasisVolumeInterval, - DeltaFilter = DeltaFilter, - CustomTickSize = CustomTickSize, - MaxTradeVolume = MaxTradeVolume, - MaxZoneHeight = MaxZoneHeight, - MinZoneHeight = MinZoneHeight, - MinTradeVolume = MinTradeVolume, - TimeInterval = TimeInterval - }; - } - } - public sealed class HistoryAggregationVwapParameters : ICustomizable, ICloneable - { - [CompilerGenerated] - private Period? ??; - - [CompilerGenerated] - private HistoryAggregation ??; - - [CompilerGenerated] - private VwapDataType ??; - - [CompilerGenerated] - private VwapPriceType ??; - - [CompilerGenerated] - private VwapStdCalculationType ??; - - [CompilerGenerated] - private TimeZone? ??; - - public Period? Period - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public HistoryAggregation Aggregation - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public VwapDataType DataType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public VwapPriceType PriceType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public VwapStdCalculationType StdCalculationType - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public TimeZone? TimeZone - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IList Settings - { - get - { - List list = new List(); - if (Period.HasValue) - { - list.Add(new SettingItemPeriod(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), Period.Value)); - } - list.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)DataType)); - list.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)PriceType)); - list.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)StdCalculationType)); - if (Aggregation != null) - { - list.Add(new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new List - { - new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Aggregation.Name), - new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Aggregation.Settings) - })); - } - return list; - } - set - { - SettingsHolder settingsHolder = new SettingsHolder(value); - if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), out var value2) && value2.Value is Period value3) - { - Period = value3; - } - if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2?.Value is int dataType) - { - DataType = (VwapDataType)dataType; - } - if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2?.Value is int priceType) - { - PriceType = (VwapPriceType)priceType; - } - if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2?.Value is int stdCalculationType) - { - StdCalculationType = (VwapStdCalculationType)stdCalculationType; - } - if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), out value2) && value2?.Value is IList settings && settings.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value4) && settings.TryGetValue>(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value5)) - { - Aggregation = Core.Instance.HistoryAggregations[value4]; - if (Aggregation != null) - { - Aggregation.Settings = value5; - } - } - } - } - - public HistoryAggregationVwapParameters() - { - } - - public HistoryAggregationVwapParameters(HistoryAggregationVwapParameters original) - { - Period = original.Period; - Aggregation = original.Aggregation?.Clone() as HistoryAggregation; - DataType = original.DataType; - PriceType = original.PriceType; - StdCalculationType = original.StdCalculationType; - TimeZone = original.TimeZone; - } - - public object Clone() - { - return new HistoryAggregationVwapParameters(this); - } - } -} -namespace TradingPlatform.BusinessLayer.History.Storage -{ - public interface IHistoryLocalStorage : ILocalStorage - { - void Save(HistoryInterval interval); - - HistoryInterval Load(HistoryDescription description, Interval interval); - - void Delete(HistoryDescription description, Interval interval); - - HistoryStorageInfo GetInfo(HistoryDescription description, HistoryStorageInfoScope scope); - - List GetAllAvailableHistoryDescriptions(); - - void Vacuum(); - } - [Flags] - public enum HistoryStorageInfoScope - { - StoredIntervals = 1, - ItemsCount = 2, - All = 3 - } - public struct HistoryDescription - { - [CompilerGenerated] - private readonly string ??; - - [CompilerGenerated] - private HistoryAggregation ??; - - public readonly string SymbolId - { - [CompilerGenerated] - get - { - return ??; - } - } - - public HistoryAggregation Aggregation - { - [CompilerGenerated] - readonly get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public HistoryDescription(string symbolId, HistoryAggregation aggregation) - { - ?? = symbolId; - Aggregation = aggregation; - } - } - public class HistoryInterval - { - [CompilerGenerated] - private Interval ??; - - [CompilerGenerated] - private HistoryDescription ??; - - [CompilerGenerated] - private IList ??; - - public Interval Interval - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public HistoryDescription Description - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public IList History - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - } - public class HistoryStorage : DataStorage, IHistoryStorage - { - [Serializable] - [CompilerGenerated] - private sealed class ? - { - public static readonly ? ?? = new ?(); - - public static Func, bool> ??; - - internal bool ?(Interval P_0) - { - return !P_0.IsEmpty; - } - } - - [CompilerGenerated] - private sealed class ? - { - public HistoryRequestParameters ??; - - public HistoryStorage ??; - - public HistoryDescription ??; - - internal HistoryRequestParameters ?(Interval P_0) - { - if (P_0 == ??.Interval) - { - return ??; - } - return new HistoryRequestParameters(??) - { - FromTime = P_0.From, - ToTime = P_0.To - }; - } - - internal Interval ?(Interval P_0) - { - return P_0.Intersect(??.Interval); - } - - internal HistoryInterval ?(Interval P_0) - { - return ??.??.Load(??, P_0); - } - } - - [CompilerGenerated] - private sealed class ? - { - public HistoryStorage ??; - - public HistoryInterval ??; - - internal void ?() - { - ??.??.Save(??); - } - - internal void ?() - { - ??.??.Save(??); - } - } - - [CompilerGenerated] - private sealed class ? - { - public HistoryStorage ??; - - public HistoryDescription ??; - - public Interval ??; - - internal void ?() - { - ??.??.Delete(??, ??); - } - - internal void ?() - { - ??.??.Delete(??, ??); - } - } - - private readonly IHistoryLocalStorage ??; - - private static readonly Type ??; - - public HistoryStorage(IHistoryLocalStorage storage, string localFilePath) - : base(storage, localFilePath) - { - ?? = storage; - } - - public IList Load(HistoryRequestParameters requestParameters, out List historyParametersForServerRequest) - { - CheckDisposed(); - if (requestParameters == null) - { - throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - HistoryDescription ?? = requestParameters.ToDescription(); - HistoryStorageInfo info = ??.GetInfo(??, HistoryStorageInfoScope.StoredIntervals); - if (info.StoredIntervals.Count == 0) - { - historyParametersForServerRequest = new List { requestParameters }; - return new List(); - } - historyParametersForServerRequest = (from P_0 in requestParameters.Interval.Subtract(info.StoredIntervals) - select (P_0 == requestParameters.Interval) ? requestParameters : new HistoryRequestParameters(requestParameters) - { - FromTime = P_0.From, - ToTime = P_0.To - }).ToList(); - return (from P_0 in info.StoredIntervals - select P_0.Intersect(requestParameters.Interval) into P_0 - where !P_0.IsEmpty - select ??.Load(??, P_0)).ToList(); - } - - public void Save(HistoryInterval historyInterval, bool wait = false) - { - CheckDisposed(); - if (wait) - { - WaitForAction(delegate - { - ??.Save(historyInterval); - }); - } - else - { - PushAction(delegate - { - ??.Save(historyInterval); - }); - } - } - - public void Delete(HistoryDescription description, Interval interval, bool wait = false) - { - CheckDisposed(); - if (wait) - { - WaitForAction(delegate - { - ??.Delete(description, interval); - }); - } - else - { - PushAction(delegate - { - ??.Delete(description, interval); - }); - } - } - - public HistoryStorageInfo GetInfo(HistoryDescription description, HistoryStorageInfoScope scope) - { - CheckDisposed(); - return ??.GetInfo(description, scope); - } - - public List GetAllAvailableHistoryDescriptions() - { - CheckDisposed(); - return ??.GetAllAvailableHistoryDescriptions(); - } - - internal void ?() - { - ???.Vacuum(); - } - - static HistoryStorage() - { - try - { - ?? = AssemblyLoader.LoadTypes(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), typeof(IHistoryLocalStorage), null, SearchOption.AllDirectories)?.FirstOrDefault(); - } - catch - { - } - } - - public static HistoryStorage Create(string connectionString) - { - if (?? == null) - { - throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - } - IHistoryLocalStorage obj = Activator.CreateInstance(??) as IHistoryLocalStorage; - if (obj == null) - { - DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(30, 1); - defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); - defaultInterpolatedStringHandler.AppendFormatted(??); - throw new InvalidOperationException(defaultInterpolatedStringHandler.ToStringAndClear()); - } - string directoryName = Path.GetDirectoryName(connectionString); - if (!Directory.Exists(directoryName)) - { - Directory.CreateDirectory(directoryName); - } - return new HistoryStorage(obj, connectionString); - } - } - public class HistoryStorageInfo - { - [CompilerGenerated] - private List> ??; - - [CompilerGenerated] - private int ??; - - public List> StoredIntervals - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public int ItemsCount - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public HistoryStorageInfo() - { - StoredIntervals = new List>(); - } - } - public interface IHistoryStorage - { - IList Load(HistoryRequestParameters requestParameters, out List historyParametersForServerRequest); - - void Save(HistoryInterval historyInterval, bool wait = false); - - void Delete(HistoryDescription description, Interval interval, bool wait = false); - - HistoryStorageInfo GetInfo(HistoryDescription description, HistoryStorageInfoScope scope); - } -} -namespace TradingPlatform.BusinessLayer.Chart -{ - public interface IFixLocationDrawing : IDrawing, ICustomizable - { - int[][] ScreenPoints { get; set; } - - bool IsFixed { get; set; } - } - public interface ILineDrawing : IDrawing, ICustomizable - { - Color Color { get; set; } - - LineStyle Style { get; set; } - - int Width { get; set; } - } - public interface IRotationStepDrawing : IDrawing, ICustomizable - { - double[][] Points { get; set; } - } - /// - /// Access to the chart panel - /// - [Published] - public interface IChart - { - /// - /// Chart panel unique ID - /// - string ID { get; } - - /// - /// Collection of chart windows - /// - IChartWindow[] Windows { get; } - - /// - /// Current X scale value - width of the bar in pixels - /// - int BarsWidth { get; } - - /// - /// Provides time zone of current chart. - /// - TimeZone CurrentTimeZone { get; } - - /// - /// Provides account of current chart. - /// - Account Account { get; } - - /// - /// Provides custom sessions of current chart. - /// - ISessionsContainer CurrentSessionContainer { get; } - - /// - /// Current tick size of the chart - /// - double TickSize { get; } - - /// - /// Main window of the chart - /// - IChartWindow MainWindow { get; } - - /// - /// Current right offset value - /// - int RightOffset { get; } - - /// - /// Collection of chart drawingsCollection - /// - IChartDrawingsCollection Drawings { get; } - - /// - /// The MouseDown event occurs when the mouse button is pressed down - /// - event EventHandler MouseDown; - - /// - /// The MouseUp event occurs when the mouse button is released - /// - event EventHandler MouseUp; - - /// - /// The MouseClick event occurs when the mouse button is clicked - /// - event EventHandler MouseClick; - - /// - /// The MouseMove event occurs when the mouse moving over the chart - /// - event EventHandler MouseMove; - - /// - /// The MouseDown event occurs when the user scrolling mouse wheel - /// - event EventHandler MouseWheel; - - /// - /// The MouseDown event occurs when the mouse enter the chart - /// - event EventHandler MouseEnter; - - /// - /// The MouseDown event occurs when the mouse leave the chart - /// - event EventHandler MouseLeave; - - /// - /// The SettingsChanged event occurs when any settings were changed - /// - event EventHandler SettingsChanged; - - /// - /// The AccountChanged event occurs when the account was changed - /// - event EventHandler AccountChanged; - - /// - /// Force chart redraw - /// - void RedrawBuffer(); - } - /// - /// Access to the chart drawingsCollection collection - /// - [Published] - public interface IChartDrawingsCollection - { - /// - /// The Added events occured, when new chart drawing was added to collection - /// - event Action Added; - - /// - /// The Moved events occured, when chart drawing was moved - /// - event Action Moved; - - /// - /// The Removed events occured, when chart drawing was removed from the collection - /// - event Action Removed; - - /// - /// The SelectionChanged events occured, when selected chart drawing was changed - /// - event Action SelectionChanged; - - /// - /// Add chart drawing to the collection - /// - /// - void Add(IDrawing drawing); - - /// - /// Remove specified chart drawing from collection - /// - /// - void Remove(IDrawing drawing); - - /// - /// Get chart drawing by ID - /// - /// - /// - IDrawing FindById(string drawingId); - - /// - /// Get all chart drawingsCollection assigned to specified symbol - /// - /// - List GetAll(Symbol symbol = null); - } - /// - /// Access to the particular window from chart panel - /// - [Published] - public interface IChartWindow - { - /// - /// Client rectangle of the chart window - /// - Rectangle ClientRectangle { get; } - - /// - /// Determines, whether this window is the main window of the chart - /// - bool IsMainWindow { get; } - - /// - /// Chart window number - /// - int WindowNumber { get; } - - /// - /// Special object, allows you to convert values from x/y scale to Time/Price and back - /// - IChartWindowCoordinatesConverter CoordinatesConverter { get; } - - /// - /// - /// - double YScaleFactor { get; } - } - /// - /// Converter between x/y and Time/Price scales - /// - [Published] - public interface IChartWindowCoordinatesConverter - { - /// - /// Get the DateTime value that is corresponding to specified x coordinate - /// - /// - /// - DateTime GetTime(double x); - - /// - /// Get the Price value that is corresponding to specified y coordinate - /// - /// - /// - double GetPrice(double y); - - /// - /// Get the X coordinate that is corresponding to specified DateTime value - /// - /// - /// - double GetChartX(DateTime dt); - - /// - /// Get the Y coordinate that is corresponding to specified price value - /// - /// - /// - double GetChartY(double price); - - /// - /// Get the bar index that is corresponding to specified DateTime value - /// - /// - /// - double GetBarIndex(DateTime dt); - } - /// - /// Access to the chart drawing - /// - [Published] - public interface IDrawing : ICustomizable - { - DrawingType Type { get; } - - /// - /// Determines, the way how chart drawing was created: manually or programmatically - /// - DrawingCreationMode CreationMode { get; } - - /// - /// Determines, the availability of drawing - only current chart or all charts with same symbol - /// - DrawingAvailability Availability { get; } - - /// - /// The unique ID of the chart drawing - /// - string Id { get; } - - /// - /// Determines, whether chart drawing draws above or below the main chart - /// - bool MoveToBackground { get; set; } - - /// - /// Determines, state of the chart drawing: Locked or Unlocked - /// - DrawingState State { get; set; } - - /// - /// Get time and price of the particular point of the chart drawing - /// - (DateTime, double) GetPoint(int pointIndex); - - /// - /// Set time and price value for particular point of the chart drawing - /// - void SetPoint(int pointIndex, DateTime time, double price); - } - [Published] - public enum DrawingState - { - Unlocked, - Locked - } - [Published] - public enum DrawingSelectionState - { - None, - Hovered, - Selected - } - [Published] - public enum DrawingCreationMode - { - Manually, - Programmatically - } - public enum DrawingCreationType - { - ByMouseClick, - ByMouseMove - } - [Published] - public enum DrawingAvailability - { - CurrentChart, - AllChartsWithSameSymbol - } - public enum IndicatorPosition - { - NewSubWindow = -2, - OnBackChart, - OverChart - } - [Obfuscation(ApplyToMembers = true, Exclude = true)] - public enum DrawingType - { - [Description("Trading tool")] - TradingTool = 0, - [Description("Horizontal line")] - HorizontalLine = 1, - [Description("Vertical line")] - VerticalLine = 2, - [Description("Line")] - Line = 3, - [Description("Rectangle")] - Rectangle = 4, - [Description("Triangle")] - Triangle = 5, - [Description("Poligon")] - Polygon = 6, - [Description("Circle")] - Circle = 7, - [Description("Ellipse")] - Ellipse = 8, - [Description("Andrew's pitchfork")] - AndrewsPitchFork = 9, - [Description("Price channel")] - PriceChannel = 10, - [Description("Fibonacci retracement")] - FibonacciRetracement = 11, - [Description("Fibonacci price expansion")] - FibonacciPriceExpansion = 12, - [Description("Fibonacci arc")] - FibonacciArc = 13, - [Description("Fibonacci spiral")] - FibonacciSpiral = 14, - [Description("Fibonacci ellipse")] - FibonacciEllipse = 15, - [Description("Fibonacci fans")] - FibonacciFans = 16, - [Description("Fibonacci phi-channel")] - FibonacciPhiChannel = 17, - [Description("Fibonacci time extension")] - FibonacciTimeExtension = 18, - [Description("Fibonacci time zone")] - FibonacciTimeZone = 19, - [Description("Gann line")] - GannLine = 20, - [Description("Gann fan")] - GannFan = 21, - [Description("Gann grid")] - GannGrid = 22, - [Description("Ruler")] - InfoLine = 23, - [Description("Symbol")] - Symbol = 24, - [Description("Text")] - Text = 25, - [Description("Up arrow")] - UpArrow = 26, - [Description("Down arrow")] - DownArrow = 27, - [Description("Uncpecified")] - Unspecified = 28, - [Description("Label")] - Label = 29, - [Description("Line by angle")] - LineByAngle = 30, - [Description("Regression channel")] - RegressionChanel = 31, - [Description("ABC Pattern")] - ABCPatern = 32, - [Description("Gartley Butterfly")] - ButterflyGartley = 35, - [Description("Custom profile")] - CustomProfile = 36, - [Description("Line arrow")] - LineArrow = 37, - [Description("Head&Shoulders")] - HeadAndShoulders = 38, - [Description("Gann box")] - GannBox = 39, - [Description("Price targets")] - PriceTargets = 40, - [Description("Flag marker")] - FlagMarker = 41, - [Description("Price marker")] - PriceMarker = 42, - [Description("Note")] - NoteMarker = 43, - [Description("Comment")] - Comment = 44, - [Description("Angled line")] - AngledLine = 45, - [Description("Horizontal alert")] - AlertHorizontalLine = 46, - [Description("Elliot triangle wave")] - ElliotTriangleWave = 47, - [Description("Three drives pattern")] - ThreeDrivesPattern = 48, - [Description("Triangle pattern")] - TrianglePattern = 49, - [Description("TPA Strategy")] - TPAStrategy = 50, - [Description("Anchor VWAP")] - CustomVWAP = 51, - [Description("Whale Splash")] - WhaleSplash = 52, - [Description("Fibonacci time expansion")] - FibonacciTimeExpansion = 53, - [Description("Fibonacci price extension")] - FibonacciPriceExtension = 54, - [Description("Minotauro Fibonacci price extension")] - MinotauroFibonacciPriceExtension = 55, - [Description("Minotauro Move Up")] - MinotauroFibonacciRetracementMoveUp = 56, - [Description("Minotauro Move Down")] - MinotauroFibonacciRetracementMoveDown = 57, - [Description("POC line")] - POCLine = 58, - [Description("Week POC line")] - WeekPOCLine = 59, - [Description("VIP Analysis")] - VIPAnalysis = 60, - [Description("Brush")] - Brush = 61, - [Description("Marker")] - Marker = 62, - [Description("Cross line")] - CrossLine = 63, - [Description("Vertical alert")] - AlertVerticalLine = 64, - [Description("Fixed text")] - FixedText = 65 - } - public class ChartEventArgs : EventArgs - { - [CompilerGenerated] - private readonly Account ??; - - public Account Account - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - init - { - ?? = value; - } - } - } - public class ChartMouseNativeEventArgs : NativeMouseEventArgs - { - [CompilerGenerated] - private readonly IChart ??; - - [CompilerGenerated] - private IChartWindow ??; - - [CompilerGenerated] - private bool ??; - - [CompilerGenerated] - private bool ??; - - public IChart Chart - { - [CompilerGenerated] - get - { - return ??; - } - } - - public IChartWindow Window - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - private set - { - ?? = chartWindow; - } - } - - public bool NeedRedraw - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public bool NeedMouseCapture - { - [CompilerGenerated] - get - { - return ??; - } - [CompilerGenerated] - set - { - ?? = value; - } - } - - public ChartMouseNativeEventArgs(IChart chart, IChartWindow window, NativeMouseEventArgs ev) - : base(ev.Button, ev.Clicks, ev.X, ev.Y, ev.Delta) - { - ?? = chart; - Window = window; - NeedRedraw = false; - } - } - public class DrawingEventArgs : EventArgs - { - public IDrawing Drawing; - - public DrawingEventArgs(IDrawing drawing) - { - Drawing = drawing; - } - } - public class DrawingSelectionEventArgs : DrawingEventArgs - { - public DrawingSelectionState SelectionState; - - public DrawingSelectionEventArgs(IDrawing drawing, DrawingSelectionState state) - : base(drawing) - { - SelectionState = state; - } - } - public interface IChartObjectTemplate - { - string Name { get; } - - string Group { get; } - - IList Settings { get; } - } -} -namespace ? -{ - [CompilerGenerated] - internal sealed class ? - { - internal static uint ?(string P_0) - { - uint num = default(uint); - if (P_0 != null) - { - num = 2166136261u; - for (int i = 0; i < P_0.Length; i++) - { - num = (P_0[i] ^ num) * 16777619; - } - } - return num; - } - } -} -namespace {C306A0DD-1657-4827-8B17-3122184442EB} -{ - [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] - internal class 3E560F35-EA4B-4F47-8302-BE30F80C1E18 - { - [StructLayout(LayoutKind.Explicit, Pack = 1, Size = 39059)] - private struct 2 - { - } - - internal static 2 3/* Not supported: data(F9 DF C9 DB DA CA DE 83 C7 DB C5 9A 86 87 99 85 EF D5 CB CC CE CF D3 CF C6 D6 D4 91 C4 C2 D8 D0 AA FD E9 E5 FB EA AC F9 FB F3 E5 C0 EA EB EB F2 BA EF EA F8 FA F6 F2 FA D3 FF FC FE E1 B7 C7 D9 AB 87 84 86 99 CF B8 BD A3 8F 8C 8E 91 C7 B7 A9 DA AF 8A 98 97 93 95 93 95 B2 9C 9D 99 80 D4 98 A5 AF A1 AF B7 EF A3 BF A6 A6 B2 80 AA AB AB B2 FA B6 B7 BD B7 B9 A5 FD B3 BE BF A4 B8 A3 95 B9 46 44 5F 09 43 40 48 44 44 5A 00 51 54 4E 47 40 7B 57 54 56 49 1F 51 52 56 5A 56 48 16 43 5D 53 46 4E 5E 4C 42 3D 53 44 51 5C 41 46 41 55 41 42 5B 4F 5D 5D 5F 73 70 72 65 33 60 70 64 63 7D 74 06 4B 0B 05 01 1C 09 4D 12 0C 13 08 12 0E 0B 0B 3B 17 14 16 09 5F 19 05 02 1C 02 05 37 3B 38 3A 1D 14 1E 06 02 1A 01 08 1D 02 0E 00 0A 1E 17 0C 09 04 1E 0B 11 12 03 09 1B 10 1B 0E 1E 1E 07 01 E5 F9 F1 E8 E2 E3 E5 E3 ED ED E5 FE F6 E6 E7 EE FB FC FD F7 91 FE CE C8 DE D6 FE D0 DB D2 D5 D6 E9 E4 FD E7 FA FC F5 E0 E0 EC EC C0 E5 E4 EB F0 F4 EF B8 F8 F0 FB BC EE EB FE F2 FE FA B7 F9 E0 99 9F C8 8B 8B CF 8A 9F 8D 8E C0 92 87 8A 81 C5 99 94 96 97 9B 9C 88 94 9D 9D 9F 83 92 92 86 A1 B3 BB AD 88 AD AC A3 B8 AC B7 E0 A0 A8 A3 E4 AA A8 BF BD AB FE AB A5 AD B7 F3 BD A4 A5 A3 F4 B7 4F 0B 4E 5B 41 42 0C 5E 43 4E 45 01 45 48 4A 4B 5F 58 4C 50 51 51 6C 4F 5B 50 55 0B 16 17 67 5C 70 6E 32 29 34 2F 24 24 22 39 3A 21 4E 6E 77 71 75 69 61 58 79 78 6E 78 75 72 64 78 79 79 59 74 04 0A 0F 0C 1C 55 4C 04 0C 0A 14 08 07 0B 0D 1F 1B 0F 11 16 10 51 52 53 3A 1A 03 05 19 05 0D 25 38 24 2B 2C 3D 3C 23 3F 31 0B 29 32 32 28 36 3C 0A 29 37 3A 3B 2C 2F 32 20 14 35 25 1F 39 32 3A 8A 86 88 CF CF C6 C0 8D D6 CC 80 D3 C3 D3 D6 CC DF CD DD 99 D7 D1 DA D2 92 D2 D2 DE C3 C3 94 D4 ED EC FA EC E9 EE F8 E4 ED ED A0 AC A6 E1 E5 EC F6 BB EC F6 BE FC EE F8 F3 E7 F5 B1 F7 F0 F3 E7 8F 8C 89 9D 87 80 82 CD 8D 81 8A 84 85 93 C4 C8 DA 9A D8 9F 9B 88 DC 89 8B 83 95 82 D6 80 9D 81 A2 EB BC A1 AB EF BF AC AF A6 E0 AF A7 AA A1 8D B3 A8 AC B6 AC A6 9D BA B5 A1 B5 B6 B7 A3 BD BA 44 66 49 47 4F 48 49 5F 18 03 49 4F 4F 53 4D 44 56 52 42 5C 5A 1F 4F 48 51 50 55 42 45 51 41 59 66 72 78 68 7C 6E 61 68 76 66 72 40 61 60 76 60 7D 7A 6C 70 71 71 5F 7C 7C 73 64 31 70 7E 7A 71 4A 0A 0F 0E 1C 0A 0B 0C 16 0C 12 41 11 0E 10 0D 5A 08 08 1C 1D 16 1A 14 17 17 50 1F 17 1A 11 55 1A 79 0D 31 3E 20 22 28 2C 37 29 20 2A 67 09 2A 2C 32 36 3E 7E 1E 2A 38 20 32 37 34 1B 38 22 3C C4 CC 88 C8 D8 CA DE CC C5 C6 D3 F1 C3 D5 CD CA DE 9B D7 DF 9E FA C4 CD DD DD D5 DF C2 DE D5 D9 AA C6 E7 FF E7 E1 EB AD C3 F5 E5 F3 E7 E0 E1 D6 F5 EE EA FA FB EC BC ED E0 FA F3 F4 E5 B7 F2 FA 98 CB A5 A8 AD 8E 80 8E 97 8F 81 95 8F 88 8A C5 8E 82 88 9C B2 96 92 98 93 81 9C 88 D6 A0 91 9C AD A3 BC AC AA EF 81 A2 B4 AA AE A6 E6 86 B2 A0 A8 BA BF BC 8E BA AE B4 BD B7 F0 BE B0 F7 98 82 67 6A 7B 46 5B 5D 4F 48 51 03 50 53 4F 44 41 56 1A 5D 57 4B 1E 73 6B 70 73 60 59 5C 46 5B 51 15 47 64 7E 60 60 68 2C 4C 74 66 72 60 61 62 54 60 68 72 77 7D 3E 70 7A 3D 41 7A 7D 61 7A 72 34 58 05 1D 01 07 09 4F 2D 1B 07 11 01 06 03 34 09 0A 15 0F 10 1C 1A 5F 31 12 04 1A 1E 16 56 36 02 10 38 2A 2F 2C 1E 2A 3E 24 2D 27 60 2E 20 67 17 28 35 34 2C 31 3B 3B 7C 10 3D 25 39 3F 31 77 15 23 CF D9 C9 CE CB FF C5 DB CD D7 80 F1 C9 CE CA D1 9A F6 D7 CF D7 D1 DB 9D F3 C5 D5 C3 D7 D0 D1 E5 EF F9 E1 E6 EA AF E3 EB A2 D3 D0 CC C7 B4 C9 C4 C9 F2 FF F7 FF F3 CF F5 FD E1 E4 B1 DB F8 E2 FC 84 8C C8 A8 98 8A 9E 8C 85 86 C0 B1 83 95 8D 8A 9E B6 91 9D 9A 93 99 DD BF 9C 86 98 98 90 D4 B4 BC AE BA A8 A9 AA EC 9D A7 B1 A9 AE A2 8B AB AB BD FB 95 B6 A8 B6 B2 BA F2 92 A6 B4 A4 B6 B3 B0 0A 7B 4D 5B 47 40 48 6C 4F 4C 55 4F 52 07 4B 43 1A 59 59 4B 4D 1F 4C 5C 41 40 55 55 16 55 51 53 65 79 6D 29 61 7F 69 63 6B 6D 67 21 76 68 77 6C 6E 72 77 77 5C 70 70 71 7B 7D 77 74 64 37 56 74 04 0F 1B 2A 06 0E 02 03 07 0F 13 31 03 15 0D 0A 1E 5B 17 1F 5E 32 3D 5D 14 1C 02 51 13 19 02 10 26 24 38 2C 3D 19 2D 21 37 26 60 2E 20 67 27 2A 34 3D 31 3D 3B 31 3F 38 72 3A 3E 25 33 25 22 34 C6 FF D1 D9 CB 8F C3 CB 82 CE CF D7 CF C9 C3 85 DB CD DD CB DF D8 D9 FE DD DE DD DE D2 DE C0 CC AA C8 E0 E8 E0 E1 E9 E1 A2 CA EE E5 E3 FF CB F6 F9 F2 F4 F5 FF EB F3 EF E1 C3 F5 E3 FF F8 F0 C1 93 9B 8D C9 81 89 CC A0 8D 95 89 8F 81 C7 A5 93 9F 89 99 9E 9B B2 93 99 9B 95 99 94 92 D7 B9 9A BC A2 A6 AE EE 8E BA A8 B0 A2 A7 A4 96 A2 B6 AC B5 BF F8 B6 B8 FF 91 B2 B6 BA B6 B8 B3 B3 F4 98 45 5D 41 47 49 0F 6D 5B 47 51 41 46 43 75 41 42 48 5E 4B 4A 57 50 52 1D 7E 5A 5E 54 66 52 46 5C 65 6F 28 66 68 2F 40 64 6C 66 61 73 26 55 61 62 68 7E 6B 6A 77 70 72 4E 7D 66 62 72 73 64 34 65 18 02 0B 0C 1D 4F 0A 02 10 43 14 09 03 47 16 00 1D 09 1D 0A 0D 16 13 13 52 1F 19 1F 13 27 06 1C 29 2E 68 0A 26 2E 22 23 27 2F 10 24 34 2E 2B 21 7A 34 3E 79 2E 2D 35 3E 37 73 33 39 37 39 3A 30 C6 EA DD DD C1 DD C9 CA D0 C6 D3 D2 CF D1 C1 85 FC D2 D6 D0 CA DA 9C F4 DF C3 C5 DD C5 D2 94 E7 EF F8 F8 E6 E0 FC E9 AD CF EC F6 E8 E8 E0 A4 C4 EC FE EA F8 F9 FA D4 F4 F6 F7 F5 FF C1 FE FA F1 85 9C C8 B9 8B 9D 85 82 86 B0 8F 94 94 84 81 96 DA 8B 8A 90 9D 9A 8F DD 94 9C 82 D1 82 9F 91 D5 8B AD A1 BB A3 AE EC A1 AB AD A5 96 AF A9 A0 AA AD B2 B6 BE FE B9 A9 B3 B1 A7 B9 BE B8 9B B1 B4 59 5F 05 5A 5F 5A 4D 5F 47 50 00 4C 43 53 4C 4A 5E 69 5D 55 5F 4B 55 4B 57 13 63 45 44 52 5A 52 7E 63 28 40 60 6B 69 75 50 50 49 21 76 62 76 6C 75 7F 4B 76 6B 6D 7F 78 61 33 60 63 7F 74 71 66 4A 0D 07 1B 4E 1B 04 08 42 31 33 28 46 0B 0D 0B 1F 36 17 1D 1B 5F 1A 12 00 53 04 19 13 57 26 26 03 6B 24 20 20 2A 1F 20 2D 2C 34 29 2F 29 23 65 2A 3E 2A 30 31 3B 11 3E 15 3A 3E 3D 33 2E 74 11 D3 C5 C9 C4 C7 CC E8 D4 CC C2 CD C8 C5 87 D0 D7 DB D8 D3 D0 D0 D8 9C DB D3 D0 C4 DE C4 E4 DB C0 F8 E8 ED A9 FE FD E5 EE E7 CE EF F7 EF E9 E3 A5 DB ED FD EB FF F8 F9 BD D7 FD E6 F4 FA F8 E4 F0 BF 9B 8A 88 80 8B CC 89 87 95 89 80 92 8E 8B 8B DA 92 96 D9 DB BB 93 8A 9C 91 91 9F 92 D7 90 90 BC A2 A9 BD A7 A0 A2 ED AB AD E0 E4 96 A6 B6 A4 B8 B4 B4 B0 BD FF 8F 9C 80 87 A2 B4 B8 B3 87 A1 4F 5B 08 46 48 0F 5C 4C 50 42 42 4E 4A 4E 47 05 69 7A 6A 19 4D 46 4F 49 57 5E 7D 50 4E 5E 59 40 67 2B 7E 68 62 7A 69 2D 64 6C 72 21 72 6F 61 25 7B 78 7B 7C 72 7A 6E 7C 66 7A 7F 7F 36 71 75 76 1E 04 1A 28 19 0A 1F 02 0F 06 40 2E 15 04 0D 09 16 1A 0C 16 0C 3C 14 1C 1C 17 15 51 3B 18 19 10 24 3F 3D 24 6E 00 3F 2E 2B 2F 2C 20 32 28 36 13 35 37 39 2D 37 33 35 29 2B 09 39 36 0C 36 33 05 CF D9 CB CC C0 DB 8C E9 C7 D5 C9 C0 D2 CE CB CB FB C9 D7 D6 D0 FE EE F2 FD FD 90 E1 D3 C5 DD DA EE D8 FC E8 E0 EB ED FF E6 A3 C4 E4 F0 EE E5 F1 F3 F4 F6 D4 F1 E9 F5 F3 F5 B3 D1 E7 F3 E5 F5 F2 8F CB AB 86 80 99 89 9F 85 86 8E 82 83 C8 A0 8C 8C 9E 8A 9E 9B 91 9F 98 A2 96 82 98 99 93 D4 9A AC EB AE A8 BD BB EC 88 8F 82 90 A4 B4 AE AB A1 FA B4 BE F9 AD B3 B3 AA F2 96 9D 90 86 B2 A6 BC 45 4F 08 46 48 0F 5F 44 45 4D 41 4D 06 62 69 64 71 5A 51 4B 57 1F 6E 58 5E 52 44 58 40 52 14 7C 64 6F 6D 71 4C 60 60 61 6B 6D 67 64 74 27 46 64 74 7F 6B 39 58 73 7D 69 56 76 66 78 77 63 7D 7A 04 39 09 1D 0B 4F 03 0B 42 20 08 00 08 00 01 35 1F 09 11 16 1A 5F 13 1B 52 1E 1F 1C 13 19 00 00 27 06 27 24 2B 21 38 38 2F 13 25 33 2F 28 20 65 3C 34 2A 79 13 30 31 38 3C 27 25 3C 05 38 21 27 C9 CE DB 89 DE DD C5 CE C7 D0 80 C7 C9 D5 84 E8 D5 D6 DD D7 CA CA D1 98 E0 93 FC D0 C4 C5 CD 95 DD E2 E4 E5 E7 EE E1 FE D2 F1 E9 E2 E3 A7 CB F6 F9 F2 F4 F5 FF EB F3 EF C2 F6 E2 F8 F9 F3 B4 FA 8C CB A5 A8 DF BF 89 9F 8B 8C 84 C1 89 81 C4 A8 BB C9 B5 96 88 96 92 9A D2 B2 86 94 84 96 93 90 EA A4 AE E9 81 BC AF A4 AE AF A1 B5 A9 B5 8B AB FA 99 B9 B5 BF B1 BF B8 F2 85 BF BD A3 BA B1 83 45 47 5D 44 4B 7F 43 5E 4B 57 49 57 43 07 72 4A 56 4E 55 5C 1E 76 52 59 57 4B 7D 5E 58 52 4D 15 4C 67 67 7E 2E 46 62 69 67 7B 4D 47 4F 27 54 60 68 72 77 7D 5F 7C 7F 78 7E 76 62 70 62 7E 7B 7B 4A 24 1B 0A 07 03 00 0C 16 0C 12 20 10 02 16 04 1D 1E 58 2D 0C 0A 19 5D 20 12 1E 16 13 27 11 07 23 24 2C 69 21 29 6C 00 2D 35 29 2F 21 67 05 33 3F 29 39 3E 3B 14 3D 28 34 3E 31 3F 76 16 30 34 DA DF C1 DF CB 8F E1 C2 D4 CA CE C6 86 E6 D2 C0 C8 DA DF DC 9D F9 DD CE C6 90 E3 DD D9 C0 E5 C6 FE E2 EB E2 DD F8 E5 E3 E5 A3 C9 EF E2 E2 FC C1 F3 ED F1 FD FB ED C8 EF E7 F6 B0 C2 E2 E5 F1 FB 8D 9F 80 C9 A7 81 88 88 9A A5 89 93 95 93 C4 A8 BB DB 88 9C 8C 96 93 99 A1 96 93 9E 98 93 D4 B8 8B EB B8 AC BC A6 A3 A9 83 B5 A5 B3 A7 A0 A1 E5 9E B2 AA BC BD AB B5 B2 BC B2 BC F1 9F B9 B0 B0 52 60 4D 45 5A 41 49 5F 02 60 48 40 48 49 41 49 6A 5E 4A 50 51 5B 1C 52 54 13 7D 70 16 51 5B 47 2A 40 6D 65 7A 61 69 7F 25 70 20 42 6E 66 6A 6B 7F 77 5B 76 7B 79 7A 74 71 7A 75 7F 62 37 7B 73 4A 08 00 08 00 01 09 01 45 10 40 16 0F 03 10 0D 2A 1E 0A 1A 1B 11 08 1C 15 16 50 21 04 1E 17 10 6A 04 3B 2A 27 23 20 2C 36 2C 32 07 27 34 30 65 1F 16 19 79 0E 3A 2E 34 3D 37 03 3D 39 20 74 10 E7 EA 88 F9 CB DD C5 C2 C6 F0 C9 C6 C8 C6 C8 85 FF F6 F9 99 EE DA CE D4 DD D7 E3 C5 D9 D4 DC D4 F9 FF E1 EA AE DC E0 E2 F5 D0 ED EE E9 F3 EC EC F4 FC DC F6 EB FD F0 F8 B2 E0 FD FE F9 E3 FC FC 84 8C BC 90 9E 8A CC 82 84 C3 93 8C 89 88 90 8D 93 95 9F D9 AD 8B 93 9E 9A 92 83 85 9F 94 A7 81 A5 A8 A0 A8 BD BB A5 AE E2 BB E0 93 A3 AB A5 B1 B3 AD BD F9 8D AB AE B8 BC B4 A4 B9 F6 9E BA B1 4F 53 7A 7A 67 0F 7C 48 50 4A 4F 45 03 6C 04 75 5F 49 51 56 5A 1A 78 1D 62 56 42 58 59 53 7D 56 62 62 65 66 65 7A 58 68 6C 68 61 6F 26 54 61 6B 51 72 72 6C 70 3F 4F 78 7C 40 75 7F 7D 78 61 35 39 1B 09 07 4E 2D 28 04 10 06 03 15 0F 08 0A 04 16 5B 35 16 08 1A 11 18 1C 07 50 38 18 13 11 0D 0B 27 24 20 29 2E 38 22 30 17 39 31 23 67 2B 23 7A 11 39 2E 7E 12 33 2B 3B 3D 37 71 17 21 31 27 CB CC CD FA C1 DA DE CE C7 83 D0 D3 CF C4 C1 85 DC D4 CA 99 F4 DE CB 9D FF DC C6 D8 D8 D0 94 F4 FC EE FA E8 E9 EA DC E8 F0 EA EF E5 A6 E8 E2 A5 D0 FA EF B9 D3 F0 EA F4 FC F4 B0 D0 E0 F2 E6 F4 8D 8E BB 81 87 89 98 CD 8D 85 C0 AB 87 90 C4 A8 95 8D 91 97 99 DF BD 8B 97 81 91 96 93 A3 8D 85 AF EB A7 AF EE 9B A9 A8 B6 AB E0 8C A9 B1 AD AB BD FB 99 AF BB AD BD BA B7 80 BF A4 A4 B4 B1 F5 5A 59 41 4A 4B 0F 4A 42 50 03 74 44 43 53 4C 05 77 54 4E 50 50 58 1C 7C 44 56 42 50 51 52 64 50 78 62 67 6D 2E 60 6A 2D 56 66 65 75 6E 27 49 6A 6C 72 76 7E 3E 5E 6A 78 60 72 77 74 45 7F 7D 73 1E 4B 07 0F 4E 3B 09 08 16 0B 40 2C 09 11 0D 0B 1D 5B 39 0F 1B 0D 1D 1A 17 27 09 01 13 57 1B 13 6A 07 21 39 3D 6F 01 22 34 2A 2E 26 66 06 32 20 28 3A 3F 3C 0D 30 29 2F 31 36 70 21 24 3E 37 30 8A CD C7 DB 8E E3 C5 DD D1 83 ED CE D0 CE CA C2 9A FA CE DC CC DE DB D8 E2 D6 C2 D8 D9 D3 94 DA EC AB C4 E0 FE FC AC C0 ED F5 E9 EF E1 A7 C5 F3 FF E9 F9 FE FB CC F4 F4 F4 E7 B0 FE F0 B7 D8 FC 9A 98 C8 A4 81 99 85 83 85 C3 A1 97 83 95 85 82 9F B3 91 8A 8A 90 8E 94 91 92 9C D1 A0 98 98 94 BE A2 A4 A0 BA B6 9F 99 86 93 A5 B3 AF A8 A0 93 B5 B7 B9 AD B7 B3 B5 A9 AB 83 B5 A3 BF B8 B0 86 45 5E 5A 4A 4B 5C 0C 5D 50 4A 43 44 55 07 42 4A 48 1B 70 6F 7F 53 50 1D 5A 5A 43 45 59 45 4D 7D 63 78 7C 66 7C 76 2C 7D 67 71 69 6E 62 43 6D 76 6A 77 79 60 3E 72 73 79 77 33 3D 31 36 6B 34 56 05 07 07 1B 4E 52 4C 24 0C 07 09 02 07 13 0B 17 37 1A 16 18 19 1A 0E 47 52 1A 1E 18 02 1E 15 19 23 31 29 3D 27 20 22 63 6C 6D 09 2F 22 2E 27 24 2E 34 2A 14 3F 31 3D 3A 37 21 6A 71 3F 39 3D 21 C3 CA C4 C0 D4 CA C8 8D D1 D6 C3 C2 C3 D4 D7 C3 CF D7 D4 C0 D7 D1 D8 D4 D1 D2 C4 DE C4 F9 D5 D8 EF DB E4 E8 ED EA C3 FF E6 E6 F2 D2 F2 F5 E5 F1 FF FC E1 D4 FF F1 FD FA F7 E1 AA B1 FF F9 FD E1 83 8A 84 80 94 8E 98 84 8D 8D CE CF C8 B7 88 84 99 9E B7 8B 9A 9A 8E AE 86 81 91 85 93 90 8D B8 AB A5 A9 AE AB BD F6 ED AB AD A9 B5 AF A6 A8 AC A0 BE BC F9 AD AA BF BE B7 A0 A3 B7 A3 BB B8 AC 6C 4A 41 45 4B 4B 0C 59 4D 03 49 4F 4F 53 4D 44 56 52 42 5C 1E 4C 5F 4F 5B 43 44 11 11 10 48 69 24 6F 64 65 68 7D 63 60 52 62 74 69 72 68 54 64 6E 73 7E 70 72 7A 4F 69 60 72 64 74 71 6E 59 74 04 0A 0F 0C 1C 55 4C 04 0C 0A 14 08 07 0B 0D 1F 1B 0F 11 16 10 51 52 53 21 07 02 10 02 12 13 0C 07 2A 26 28 29 2A 3E 77 62 2A 2E 28 32 2E 25 29 33 21 3D 3D 7E 2C 29 3E 31 36 23 22 30 22 38 39 D3 D8 DC DB CF DB C9 CA DB ED C1 CC C3 D4 D0 D7 DB CF DD DE C7 D6 D2 DB DD 9D C8 DC DA FC D1 CC AA F9 ED F8 FB EA FF F9 AC A3 D2 E4 F7 F2 E1 F6 EE D2 FC B9 A3 BF A7 BD C1 F6 FE F5 FF F9 F3 B5 99 84 9D 9B 8D 8A CC D0 C2 B7 88 84 94 82 C4 8C 89 DB 96 96 DE 8F 9D 8F 97 9D 84 D1 98 96 99 90 AE AE B8 AC A0 AB A9 A3 B6 8A B4 A4 AB B7 A5 B7 BF B5 AC 90 AA BA B1 AE F2 B2 A2 B6 A3 BA B1 BB 5E 0B 45 5C 5D 5B 0C 4E 4D 4D 54 40 4F 49 57 05 5B 4F 18 55 5B 5E 4F 49 12 5C 5E 54 16 52 58 50 67 6E 66 7D 4A 6A 6F 64 6F 62 6C 51 6A 66 67 60 69 4D 79 75 6B 7A 48 6F 73 77 79 7F 71 37 5B 65 0F 19 09 1D 07 00 02 57 42 20 01 0F 05 02 08 45 15 09 1C 1C 0C 0C 52 5D 21 16 1E 15 1F 19 13 55 39 24 3D 3B 2D 2A 6C 70 62 17 32 20 22 2E 2A 22 7A 14 28 3C 2C 3E 28 34 3D 3D 6A 71 15 36 3A 36 CF C7 88 C6 DC CB C9 DF D1 8D 80 EE D4 C3 C1 D7 C9 9B DB D6 CB D1 C8 9D 8F 93 90 E2 D3 D9 D0 DC E4 EC A8 FA E1 FA FE EE E7 A3 BD A1 D2 F5 E5 E1 F3 F5 FF B9 D1 EF F9 EF F3 E7 F9 FE F8 AD B4 D6 8B 85 8B 8C 82 CF 83 9F 86 86 92 92 C8 C7 B7 9C 97 99 97 95 DE C2 DC A9 80 92 94 98 98 90 D4 BA BA AE BA A8 BA A6 A3 A3 F8 E3 83 A0 A8 A4 A1 A9 FA B4 AA BD BB AD AF F3 F2 92 B3 B2 B9 A2 BA A1 0A 16 08 12 0E 6E 4F 4E 4D 56 4E 55 06 1A 04 1E 1A 68 51 5D 5B 1F 01 1D 66 41 51 55 5F 59 53 15 45 7B 6D 7B 6F 7B 65 62 6C 39 20 42 67 69 67 60 76 3B 77 6B 7A 7A 6E 6E 3C 33 43 78 72 72 34 28 4A 50 48 3D 07 02 09 4D 0B 0D 40 07 09 15 07 00 5A 46 58 2D 0C 1E 18 14 1C 14 50 3E 06 12 06 14 3E 22 27 27 74 6F 0F 2C 2C 20 25 2D 66 28 36 21 3F 29 2B 77 7E 0B 35 30 37 73 39 3F 76 31 3B 27 C9 CE 88 94 8E 94 8C E2 D0 C7 C5 D3 86 D3 DD D5 DF 9B 85 99 85 9F F3 CF D6 D6 C2 91 C2 CE C4 D0 AA E9 ED E1 EF F9 E5 E2 F0 A3 BD A1 D2 F5 E5 E1 F3 F5 FF B9 D1 EF F9 EF F3 E7 F9 FE F8 AD B4 D6 8B 85 8B 8C 82 CF 83 9F 86 86 92 92 C8 C7 AB 97 9E 9E 8A D9 8A 86 8C 98 D2 91 95 99 97 81 9D 9A B8 EB F5 E9 8F A3 A0 A2 B5 E3 83 A0 A8 A4 A1 A9 9B B7 B4 96 AE BA B2 92 A0 B7 B5 A3 A5 98 BA 86 53 46 4A 46 42 6E 40 41 4D 54 00 62 47 49 47 40 56 7A 54 55 71 4F 59 53 7D 41 54 54 44 44 7B 5B 4B 68 6B 66 7B 61 78 4C 6E 6F 6F 76 26 44 65 6B 79 7E 74 58 72 73 53 6D 77 7D 5F 63 72 72 66 66 25 05 3B 10 03 0D 03 01 23 0D 04 20 05 04 0B 10 14 0F 2C 0B 1F 1B 15 13 15 53 3F 01 13 05 15 01 23 24 26 73 6E 0C 20 22 31 26 60 31 29 34 2D 31 33 34 36 2A 70 7F 0F 38 3C 37 39 3F 31 77 27 3A DF D9 CB CC 8E 92 8C F9 D0 C2 C4 C8 C8 C0 84 EA CA DE CA D8 CA D6 D3 D3 88 93 F3 DD D9 C4 D1 95 FA E4 FB E0 FA E6 E3 E3 F1 AD A0 D2 FF EA E6 EA F6 BB A5 B9 CA ED FD F9 FB FD F7 B1 D9 E7 F1 E7 8B 9F 81 86 80 D5 CC AE 8E 8C 93 84 C6 97 8B 96 93 8F 91 96 90 8C D2 DD B3 90 93 9E 83 99 80 D5 F7 EB 9C BB AF AB A5 A3 A5 E3 8F B1 A3 B5 A5 B1 B3 B4 B6 E3 FE 9C B0 B2 A1 B6 F0 A1 B9 A4 BD A1 43 44 46 5A 00 0F 7F 44 46 46 00 1C 06 73 56 44 5E 52 56 5E 1E 70 4C 58 40 52 44 58 59 59 0E 15 49 67 67 7A 6B 2F 7C 62 71 6A 74 68 70 62 24 75 75 68 71 6D 77 70 72 6E 3C 33 43 74 78 73 7D 7B 0D 4B 1B 06 1B 1D 0F 08 42 5E 40 35 14 06 00 0C 14 1C 58 36 0E 1A 0E 1C 06 1A 1F 1F 4C 57 37 19 25 38 2D 69 3E 20 3F 24 36 2A 36 24 66 37 2B 36 33 2F 31 36 30 2C 72 7D 01 2A 3D 33 39 3B 74 68 8A FF DA C8 CA C6 C2 CA 82 EC D0 C4 D4 C6 D0 CC D5 D5 82 99 FD D3 D3 CE D7 93 DE D4 D1 D6 C0 DC FC EE A8 F9 E1 FC E5 F9 EB EC EE F2 A8 A7 D7 E0 F4 FF F1 F7 F9 BF EF F2 E7 E1 F3 F4 B6 AA B4 C1 98 8A 8C 80 80 88 CC A2 92 86 92 80 92 8E 8B 8B C0 DB BB 95 91 8C 99 DD 9C 96 97 90 82 9E 82 90 EA BB A7 BA A7 BB A5 A2 AC B0 EE E1 95 BE A9 A7 B5 B7 F8 E4 FE 8B AE BC B6 BA BE B6 F6 98 A4 B0 58 4A 5C 40 41 41 16 0D 70 46 56 44 54 54 41 05 4A 54 4B 50 4A 56 53 53 41 1D 10 62 53 59 50 5C 64 6C 28 7A 61 7A 7E 6E 67 23 3D 21 52 75 65 61 73 75 7F 39 51 6F 79 6F 73 67 79 7E 78 2D 34 47 0F 1D 0D 1B 1D 0A 4C 1D 0D 10 09 15 0F 08 0A 16 54 5B 2B 00 13 1D 13 11 52 4E 50 25 04 16 10 1C 24 2C 68 06 3E 2A 3E 2C 36 2A 2F 2F 7C 67 16 20 2C 3E 2A 2A 3B 7F 2C 32 21 3A 24 38 39 39 27 7B 8A EA CB CA C1 DA C2 D9 82 9E 80 F5 D4 C6 C0 CC D4 DC 98 F6 CE DA CE DC C6 DA DF DF 8C 97 F2 D9 EB FF FC EC E0 A1 AC DE E7 ED E4 E8 E8 E0 A4 F6 F5 EE EA FA FB BF A1 BD C6 E1 F1 F5 FF F9 F3 B5 A5 9B 8D 9B 8F 9B 85 82 8C D9 C0 A7 8A 86 90 91 9F 95 D6 D9 AD 86 91 9F 9D 9F D0 CC D6 B1 98 94 BE BF AD A7 F4 EF A3 BF A6 A6 B2 B2 E6 B0 A1 B7 BF FB B6 B6 AA FF BF BC BC B0 B5 BD BA B2 B0 F5 4B 4D 5C 4C 5C 0F 19 0D 51 46 43 4E 48 43 57 09 1A 5D 57 4B 5D 5A 1C 4D 5D 40 59 45 5F 58 5A 15 69 67 67 7A 67 61 6B 23 56 71 61 65 6F 69 63 25 55 6B 7D 6B 7F 6B 75 72 7C 29 30 53 64 72 75 7E 0F 1D 0D 07 40 4F 3C 02 11 0A 14 08 09 09 44 58 5A 40 58 36 18 19 0F 18 06 53 4D 51 4D 57 35 11 2E 22 3C 20 21 21 2D 21 62 33 21 33 27 2A 21 31 3F 29 2B 79 3D 30 29 33 26 73 6D 71 26 38 27 3C DE C2 C7 C7 ED CE C2 8A D6 83 C6 C8 C8 C3 84 F6 F6 9B D7 CB DA DA CE F2 DC D6 90 C1 D9 C4 DD C1 E3 E4 E6 A9 E0 EA F8 F9 EB ED E7 A1 F2 FE F4 E0 BA E9 FD E8 EB F6 EE F8 F6 C0 E4 FE E6 B7 FB E7 8E 8E 9A C9 9A 96 9C 88 C2 91 85 90 93 8E 96 80 9E B4 88 9C 90 9A 98 DD 82 9C 83 98 82 9E 9B 9B EA B9 AD B8 BB A6 BE A8 A6 97 A9 AC A3 A8 B1 B1 88 BE BE AC AD BA 9F BC BC F4 A4 F1 B0 BE BA B1 0A 4A 46 50 0E 5C 58 42 52 0B 53 08 06 46 4A 41 1A 4F 59 52 5B 17 4F 14 12 5C 42 55 53 45 47 61 78 6A 6C 60 60 68 2C 42 72 66 72 60 72 6E 6B 6B 20 3B 59 7D 74 6A 6F 69 32 40 5C 3E 42 47 3A 35 3A 04 1B 00 1A 06 03 03 42 5E 40 28 08 11 05 09 13 1F 58 0A 0A 10 0C 5D 1E 1C 03 02 56 16 10 1F 3F 38 3C 24 2B 21 38 6D 30 26 33 34 2A 33 0D 2B 2C 3A 34 30 3A 7F 28 3C 39 36 70 21 24 38 32 3C DE 8B C9 CD C4 DA DF D9 CF C6 CE D5 86 D5 C1 D6 CF D7 CC F8 D2 D3 D3 CA 92 FF D9 DF DD 97 FB F6 C5 DF FA E8 EA E6 E2 EA A2 CC F0 E4 F4 E6 F0 EC F5 F5 A2 B9 DF FB F6 E8 E1 E7 B0 E2 E2 F8 E4 B5 86 84 9B 9A C0 CF BC 82 91 8A 94 88 89 89 C4 D8 DA C0 D8 AA 8A 90 8C 8E C8 D3 CB D1 BF 99 9D 81 A3 AA A4 E9 BD BB A3 BD E2 AF AF B2 B5 FD E4 91 A8 BA BC B0 B0 B8 FC 92 A2 B6 A2 B0 A2 BE BB BB 10 0B 69 4D 44 5A 5F 59 02 57 41 4A 43 07 54 57 55 5D 51 4D 10 1F 6C 52 41 5A 44 58 59 59 14 08 2A 30 28 5D 6F 64 69 7E 38 23 3B 21 4F 69 6D 71 73 7A 74 39 6A 7E 77 78 32 63 62 7E 70 7E 60 2F 4A 22 06 0A 01 1D 1E 08 01 17 40 15 07 15 03 00 0E 5B 0C 18 15 1A 5C 0D 00 1A 13 14 31 05 1B 00 3A 1F 3A 28 2A 26 22 2A 0D 33 25 33 27 33 2D 2A 34 7B 23 79 0A 26 2C 38 72 6E 70 7D 76 11 3D 39 DE CE DA DA 8E 92 8C DD C3 D1 C1 CC C3 D3 C1 D7 C9 EF CA D8 DA D6 D2 DA 92 DC C0 D4 C4 D6 C0 DC E5 E5 FB A9 E7 FC AC E1 ED E0 EB E4 E2 D3 F6 E4 FE F2 F6 FE BE F0 EC F8 E0 F2 E4 F8 F9 F9 E7 B5 83 98 C8 85 81 8C 87 88 86 C3 86 8E 94 C7 85 86 99 94 8D 97 8A AA 92 96 9C 9C 87 9F D6 83 86 94 AE A2 A6 AE EE A0 BC A8 B0 A2 B4 A8 A9 A9 B4 A4 A8 BA B5 BC AA BA AE AE 9E BA A3 A5 86 B6 A6 B0 44 5F 08 46 5C 4B 49 5F 02 4C 52 01 56 48 57 4C 4E 52 57 57 1E 56 4F 1D 5C 46 5C 5D 78 58 14 5A 78 6F 6D 7B 2E 7B 75 7D 67 70 20 67 69 75 24 66 76 74 6B 70 70 78 3C 72 60 77 75 63 65 44 6D 78 08 04 04 49 0F 01 08 4D 03 00 03 0E 13 09 10 45 1B 09 1D 59 10 0A 10 11 3D 01 14 14 04 57 1C 14 39 6B 26 26 3A 6F 29 35 2B 30 34 11 29 34 2D 31 33 34 36 79 36 3E 2F 7D 3C 3C 24 71 33 2F 3D 26 DE C6 DB CA C1 DD C0 C4 C0 F7 D2 C0 C2 CE CA C2 EA D7 D9 CD D8 D0 CE D0 9C F1 C5 C2 DF D9 D1 C6 F9 C7 E9 F0 EB FD CE E4 EC E7 E9 EF E1 D5 E1 E1 F3 E9 FD FA EA B1 E4 F0 FE DD F1 FC F3 C5 F1 F1 83 99 8D 8A 9A BF 8D 99 8A A5 81 88 8A C7 90 8A DA 8B 8A 96 9D 9A 8F 8E D2 B1 99 9F 92 9E 9A 92 98 AE AC A0 BC AA AF B9 EC BB AD AD E6 A1 AD A9 BF F1 F6 BD B2 B3 8F A4 A1 A7 B5 BC 95 A2 A7 A1 45 46 66 48 43 4A 60 42 41 48 45 45 68 73 66 68 51 1B 1B 15 0E 11 1F 1E 11 10 13 12 15 14 17 16 29 27 38 27 3E 2C 2C 44 6C 6D 65 73 26 62 7C 66 7F 6B 6C 70 71 71 26 3D 7B 67 75 7C 65 5E 7A 76 05 19 1A 0C 0D 1B 4C 0F 10 02 03 0A 03 13 17 45 0A 1A 0A 18 13 1A 08 18 00 00 5E 51 22 18 00 14 26 6B 2B 28 22 2C 39 21 23 37 25 25 66 36 31 24 34 2F 31 2D 27 7F 74 74 72 37 3F 34 25 77 3A 3A DE 8B C5 C8 DA CC C4 8D CD D1 C4 C4 D4 87 D5 D0 DB D5 CC D0 CA C6 9C 95 9B 9D F9 DF D5 D8 C6 C7 EF E8 FC A9 EC FD ED EE E9 E6 F4 F2 A6 F7 E5 F7 FB F6 FD ED FB ED EF B3 B2 D1 E2 F0 F5 FC F1 E1 CA 9A 9D 88 80 9B 85 99 9B C3 83 80 88 C7 8A 8A 8E DB 9A 9C DE CF D2 8D 93 87 98 BD 93 81 91 99 B9 9F 8D A7 BB A2 EC A0 B7 B0 B4 E1 A4 A2 E4 A4 B4 FB BD B7 AB B2 B9 AF B3 A7 B5 B5 F6 A3 AD A5 4F 7F 5A 48 4A 46 42 4A 71 5A 4D 43 49 4B 43 09 76 54 5F 5E 5B 4D 7F 52 5C 55 59 56 7A 58 53 52 6F 79 46 68 63 6A 2C 30 22 2F 20 4E 73 73 74 70 6E 5D 77 75 7A 7A 6E 4D 73 67 78 31 2B 37 38 35 39 08 07 19 0B 4F 51 4D 2E 0C 07 06 03 15 17 29 15 1C 1F 1C 0C 3E 0C 0D 1E 1A 13 10 02 1E 1B 1B 64 65 14 67 60 13 00 22 25 30 13 24 34 2E 28 2A 3D 37 37 3E 39 3E 3E 31 37 00 24 30 24 23 74 31 CF C7 CD DD C7 C1 CB 8D CD CF C4 81 CA C8 C3 85 DC D2 D4 DC CD 91 92 93 F6 D6 DC D4 C2 DE DA D2 AA ED E1 E7 E7 FC E4 E8 E6 AD CC EE E1 E0 E1 F7 A0 BB DC FC F2 FA E8 F8 B2 FF FF F6 B6 F1 FD F9 8F 98 C6 A6 A3 8A 9F 9E 83 84 85 DB C6 A2 9C 86 9F 8B 8C 90 91 91 C6 DD D1 9B 99 95 92 92 9A D6 89 A4 BA AC 82 A0 AF AC B0 AA BA A4 B4 AB AB A6 BB B7 BD F7 B3 B0 B9 B3 FF 86 83 9D B9 B4 B5 B9 43 51 4D 5B 00 66 42 44 56 66 6E 62 47 53 45 49 55 5C 17 17 4A 4B 74 75 08 5E 5D 59 5E 0D 59 58 2A 7F 7C 41 46 35 61 60 38 70 73 69 6E 3D 69 68 20 68 6B 39 6A 6B 48 74 7F 76 45 65 7F 7B 67 2F 4A 02 06 00 1A 06 0D 01 0B 19 01 15 0F 08 0A 4B 54 55 2C 10 13 1A 29 09 1B 1F 03 4B 56 1E 1A 1C 3E 22 29 25 27 35 29 29 62 30 35 22 25 22 37 36 3C 2E 34 35 27 18 38 2E 21 20 23 6B 30 31 32 21 CE 85 E5 87 D7 D6 C8 C9 8C EE ED 8F DF DE C0 C1 94 F6 F5 97 C7 C6 C5 C4 D6 94 9F 96 FB 90 9B 92 F3 F2 EC ED A9 A0 AB C0 CF A4 AF A6 FF FE E0 E1 BD B4 BF D4 D3 B8 B3 BA EB EA E9 E8 DB B9 F0 BB 93 92 A5 A4 C0 8B 88 C3 9B 9A AD AC C8 83 80 CB 83 82 81 80 B3 D8 D3 DA 96 D4 DF D6 8F 8E B9 B8 ED E4 EF AD AA E8 E3 EA BB BA 8D 8C E1 E8 E3 A1 BE FC F7 FE A7 A6 A5 A4 91 B2 BE F6 A2 F7 A7 B0 5E 0B 5B 59 4B 4C 45 4B 4B 40 00 55 4F 4A 41 7F 55 55 5D 70 50 59 53 1D 42 52 42 50 5B 52 40 50 78 2B 7F 60 7A 67 2C 41 6D 60 61 6D 26 73 7D 75 7F 4F 70 7C 3E 4B 75 70 77 49 7F 7F 73 5E 7A 73 05 4B 01 1A 4E 01 19 01 0E 2F 0F 02 07 0B 31 31 39 5B 50 2C 2A 3C 55 51 52 53 00 03 1F 14 11 55 26 2E 3E 2C 22 3C 1A 02 0E 16 0D 04 07 09 05 09 03 08 11 0A 01 0F 1D 1E 19 12 17 14 1B 02 18 01 E3 F4 E9 FA FD EA F8 F2 F2 E2 E3 EA E7 E0 E1 E6 E8 E2 E8 ED F1 E0 EC FC F1 F8 F1 F6 F3 EE DB C0 F8 AB E4 E0 ED EA E2 FE E7 A3 E4 EE E3 F4 EA A2 EE BB F9 F5 F2 F0 EB BD C4 FC FC E4 FB F2 B4 D4 84 8A 84 90 9D 86 9F B4 8D 96 92 C1 8A 8E 87 80 94 88 9D D9 9F 93 90 92 85 80 D0 9E 98 9B 8D D5 FB EB BF AC AB A4 EC A2 A4 E3 96 AE AA B2 A9 A0 FA 9A B6 B8 B2 A6 AF B4 A1 9A BE A7 B7 BB BD B1 0A 59 4D 5A 5E 40 42 5E 47 03 46 53 49 4A 04 68 55 5F 5D 03 1E 6A 52 56 5C 5C 47 5F 65 4E 59 58 6F 7F 7A 60 6D 2F 4D 6E 76 6A 76 64 55 7E 69 68 7F 6F 6A 70 7D 3F 4C 7C 61 7A 66 74 55 7B 7D 70 04 1F 3B 0C 1C 19 09 1F 20 11 0F 00 02 04 05 16 0E 76 72 35 11 1C 1D 11 52 07 19 1C 13 4D 54 78 40 07 27 2A 2F 23 6C 0E 2E 2C 23 2A 66 08 22 23 29 3E 2C 63 7E 7F 31 2E 5F 59 20 3E 39 3B 7A 3B DE DB 86 C6 DC C8 D8 C4 CF C6 8E D6 CF C9 C0 CA CD C8 96 DA D1 D2 C8 D4 DF D6 9E D6 D9 D8 D3 D9 EF A5 EB E6 E3 FB E5 E0 E7 AD EE E8 F5 F3 AA E2 F5 ED CC F0 F3 FA BC EA F3 E0 B0 E2 EF F9 F7 FD 98 84 86 80 94 8A 88 C3 C2 A0 95 93 94 82 8A 91 DA 94 9E 9F 8D 9A 88 DD DA 9E 83 D8 CC D7 A7 80 B9 BB AD AA BA AA A8 ED AB AD A3 AE B4 B5 A1 A6 AE FB B7 BF B8 AC B9 A9 F2 B5 A2 BE BB F7 A7 B0 58 5D 4D 5B 14 0F 7F 48 4E 46 43 55 43 43 04 4A 58 51 5D 5A 4A 1F 5F 5C 5C 14 44 11 54 52 14 46 6F 79 61 68 62 66 76 68 66 55 61 73 6F 66 66 69 7F 3B 6F 70 6A 77 3C 6E 62 76 73 78 70 7E 71 71 4A 05 09 04 0B 4F 02 02 16 43 05 19 0F 14 10 16 1D 17 17 1B 1F 13 2A 1C 00 1A 11 13 1A 12 07 03 2B 39 21 28 2C 23 29 23 23 2E 25 37 27 2B 31 20 33 28 16 2C 32 33 1B 31 3D 31 31 3D 00 36 26 3C CB C9 C4 CC DD 81 C8 CC D6 F7 D2 D4 C3 F3 CB CA 9A D9 D1 DE 9E D0 DE D7 D7 D0 C4 F3 C3 D1 D2 D0 F8 EE EC D9 FC E0 EF E8 F1 F0 EF F3 D1 EE F0 ED CA E9 F1 F6 EC F6 E8 E4 BC C3 E2 FE F5 F2 E7 E6 A7 8A 86 90 BA 8E 9F 86 91 D9 C0 A0 88 C7 81 97 88 94 8A D9 91 9C 9F 88 80 96 94 CB D6 B5 81 93 AC AE BA AC AA 9F BE A2 A1 A6 B3 B2 A9 B5 93 AC AE B3 88 AB B7 B0 AE B4 A6 AA FE 81 A3 A4 BC EF 0A 6A 46 09 4B 5D 5E 42 50 03 4F 42 45 52 56 40 5E 01 18 70 50 49 5D 51 5B 57 10 41 44 5E 5B 47 63 7F 71 79 62 7A 6B 20 6B 6D 73 2F 28 5B 2A 2B 46 35 36 45 56 76 6F 69 7D 61 69 47 79 7B 61 78 0F 2A 06 08 02 16 1F 04 11 36 13 04 14 33 16 04 1E 1E 0B 3A 1F 1C 14 18 21 16 04 05 1F 19 13 06 19 28 3A 20 3E 3B 3F 1E 21 31 29 31 32 34 00 24 2E 3A 11 37 3A 36 3F 3C 26 3C 22 22 05 23 26 34 DE CE CF C0 CB DC FC C1 C3 C0 C5 EE D4 C3 C1 D7 E9 CF CA D8 CA DA DB D4 D7 C0 E6 D4 D8 D3 DB C7 F9 E9 E1 E7 DA EA E1 FD CF E6 E4 E8 E7 CA E1 F6 E9 FE F6 FE FB ED EF D4 FC E7 F5 E3 E0 F6 F8 AF CA 86 89 91 AA 8A 8B 9F 87 86 AF 87 B6 86 96 84 96 97 9D 95 97 8C 91 BE 9D 9D 9E 94 95 83 9D 9A A4 EB AE A0 A0 A6 BF A5 A7 A7 83 AE A8 A9 A1 A6 AE B2 B7 B7 FE B3 B3 AE A6 9C A2 B5 B3 A5 F4 B6 58 4E 49 5D 4B 4B 03 4E 43 4D 43 44 4A 42 40 0A 48 5E 48 55 5F 5C 59 59 7D 41 54 54 44 17 52 5C 66 67 6D 6D 41 7D 68 68 70 23 72 64 6C 62 67 71 7F 7F 48 76 6D 76 68 74 7D 7D 30 72 7A 78 67 70 0E 2F 0D 0F 0F 1A 00 19 42 02 0C 04 14 13 31 15 1E 1A 0C 1C 5E 3E 0A 1C 1B 1F 11 13 1A 12 17 1A 24 25 2D 2A 3A 26 23 23 04 2A 2E 28 35 2F 21 21 74 2C 39 2F 3D 30 32 33 37 30 24 38 39 39 18 3A D9 DF 86 DE CF D9 E3 DF C6 C6 D2 E2 D4 C2 C5 D1 DF DF 96 CE DF C9 D3 CF D6 D6 C2 F7 DF DB D8 D0 EE A5 FF E8 F8 E0 FE E9 E7 F1 D2 E4 EC E2 E7 F1 FF FF B6 EE FF E9 CC F2 E1 FA E4 F8 F9 F9 D7 F9 85 98 8D 8D C0 98 8D 9B A6 86 86 80 93 8B 90 A4 96 9E 8A 8D D0 88 9D 8B A7 83 94 90 82 92 DA 82 AB BD 93 E6 E5 F2 91 B4 E2 A7 9C A5 9A E7 AC 99 B2 B3 84 B1 82 FF B1 81 BF BE BD 8D EC A4 A7 A6 76 58 4C 09 46 0F 41 0D 51 6F 49 42 43 49 47 40 71 5E 41 6A 4A 5E 4E 49 76 52 44 54 62 5E 57 5E 79 4E 66 6D 4A 6E 78 68 56 6A 63 6A 75 4E 6A 73 7B 77 71 7D 3E 6B 73 76 77 7D 30 65 6F 67 71 2F 4A 29 29 3A 27 2C 33 3D 23 20 2B 20 21 22 29 2C 28 29 37 2B 21 2B 2E 3C 36 3A 3E 36 27 22 35 3B 1E 04 1F 0C 1C 10 00 04 16 06 03 13 1F 17 10 0A 05 12 16 1D 17 1E 03 0D 13 10 1B 10 11 12 04 07 EF E6 E1 FC E3 F0 FC E1 F7 F0 FF F1 E7 E4 EF E4 FD FE E8 F6 E9 FA EE E9 E0 F2 F4 F4 E5 E8 E4 F4 C9 C0 C9 CE CB DF DE C8 CF CA D5 CC D9 D7 C5 C6 D1 DA DF DC D1 CF C8 D4 DD DD C3 CE C6 D6 D7 DE AB AC AD BD BE A0 AF A5 A3 B1 B4 BE B6 A6 A7 AE BB BC BD AD AC BE B8 B4 BC B4 AF A2 BF B0 BA B4 86 94 98 88 8D 84 8D 8A 87 87 8F 8C 95 92 96 83 9B 98 9D 86 8E 9E 9F 96 93 94 95 9E 84 93 91 87 6C 67 67 7E 71 7F 6D 6E 69 62 67 64 72 75 71 60 7E 7A 6C 78 61 69 79 71 7D 70 79 65 6F 74 61 66 5E 44 45 4C 5C 5F 5E 42 52 5C 4C 48 45 42 4A 56 5F 4A 4D 58 50 4B 53 4A 57 41 4F 50 52 41 55 5B 29 2E 2C 36 2B 3E 39 24 36 3A 31 34 27 29 30 2A 2D 3E 2A 26 3F 3B 2A 3C 3C 30 35 35 29 3E 3A 31 03 08 0D 1A 1F 1A 0D 03 16 0C 17 04 14 18 05 01 0C 1A 16 1A 1B 1B 03 1E 1D 1E 1D 1E 12 1E 00 0C FB FE E9 E7 FA E0 FB E8 F0 FC E1 E5 F0 E6 EA E6 FF FF E7 FC EF EA F5 E9 EB EC F3 FE FB FA FB F1 C3 DF C1 CC DD CC C9 C9 D0 CC CD C0 D4 CC C1 D1 DE DA CC D8 C1 CF DD DE D9 D2 D7 D4 D4 F6 E7 FC 89 A8 9A 90 9E 9B 83 CD B2 82 83 8A 87 80 81 A8 8F 97 8C 90 D3 9E 8F 8E 97 87 D0 A1 97 94 9F 94 AD AE 89 AD B8 AE A2 AE A7 A7 E0 87 A3 A6 B0 B0 A8 BE AB 89 AC BA B1 B4 A7 BE F0 81 BA A2 A7 94 46 47 08 40 40 0F 43 43 47 75 4F 4D 53 4A 41 05 7B 55 59 55 47 4C 55 4E 62 5C 47 54 44 17 60 47 6B 6F 6D 7A 4A 40 41 2D 71 76 72 67 67 64 61 4A 68 7F 7D 6B 3E 59 70 72 65 47 40 5E 36 54 7C 74 18 1F 27 19 1A 06 03 03 42 17 12 00 02 0E 0A 02 39 0E 0B 0D 11 12 19 0F 22 01 1F 01 3B 1E 06 07 25 39 68 1D 3C 2E 28 24 2C 24 14 33 27 23 2D 2B 3D 7B 0B 20 2D 2B 39 30 21 02 25 30 38 23 3B 22 CF D9 88 E5 C7 DB C9 FC D7 C2 CE D5 C9 D0 C1 D7 9A FA DC CF DF D1 DF D8 D6 93 9D 91 F3 C6 C1 DC FE F2 DC FB FB EA AC C9 E3 F7 E1 A1 D0 E2 E8 EA F9 F2 EC E0 CF EA FD F3 E6 FC E7 F4 E4 B7 D5 F1 9C 8A 86 8A 8B 8B CC C0 C2 AA 8E 85 8F 84 81 96 DA D3 B1 97 9A 9A 84 DD B4 D5 BF D8 A7 82 95 9B BE A4 BF AC BC EF 8D A9 B4 A2 AE A2 A3 A3 E4 ED 99 B4 B5 B4 B1 BB B5 A9 AB FA 81 A4 B7 B9 A0 BA 5D 4E 5A 09 6F 4B 5A 4C 4C 40 45 45 06 0A 04 60 4B 4E 51 4D 47 1F 1A 1D 71 5C 5D 5C 59 53 5D 41 73 48 6D 6D 7C 60 2C 40 63 71 6B 64 72 27 60 64 6E 7A 5B 78 70 7C 79 71 32 64 71 78 62 37 75 76 09 0E 1B 1A 4E 1B 03 06 07 0D 05 0F 02 14 01 16 09 12 17 17 58 21 5A 1E 1F 17 5F 12 56 04 00 14 38 3F 68 31 2A 28 61 22 32 26 2E 2E 36 22 2A 02 3F 2F 1E 2B 3B 3A 0C 32 20 27 19 3F 04 36 3A 32 CF 87 88 E6 DB DB 8C C2 C4 83 D0 CE D4 D3 D7 D6 CF D9 DD D4 DF D6 D0 D8 DC C7 D9 C5 CF 86 D1 DB FE E2 FC F0 BC A1 AC CE ED ED F6 E4 F4 F3 E1 F7 E9 BB A5 B9 DD F0 F2 F3 F7 F0 E4 F8 F9 F9 DD F1 AD 99 87 9C 9E C2 AE 84 8C 82 8E 82 83 A5 8D 8B 9B 95 9B 9C DE AC 8C 92 86 B1 99 9F 97 99 97 90 EA 9E 9B 8B A7 A1 AD A3 A1 A6 E0 92 B6 A8 B0 E5 8F 88 9A B0 B0 BE B2 BE B7 F3 96 A4 A2 A2 A6 B0 59 69 41 47 4F 41 4F 48 02 76 73 65 72 0A 69 05 7C 4E 4C 4C 4C 5A 4F 15 1F 1A 18 1C 4A 13 1D 15 76 2B 28 75 2E 4C 63 78 6C 77 20 3C 26 27 78 25 4E 74 6C 78 72 3F 70 78 64 76 7C 62 36 2A 34 43 0F 19 1B 00 01 01 3F 08 10 0A 01 0D 0F 1D 01 17 40 5B 1E 18 17 13 5C 09 1D 53 02 14 05 03 1B 07 2F 6B 21 3D 2B 22 62 3E 27 37 34 28 28 20 37 31 33 38 33 2A 1F 0A 18 72 11 12 14 10 03 13 7B 16 E2 ED E9 FC EA 80 E6 FD FB E2 F5 E5 89 ED F4 FC 9A 93 EF FC FB F4 F9 F3 F6 9A F1 E4 F2 98 FC FE CE CA DD CD A1 C1 D6 C9 C3 D6 C4 AE D5 C0 C0 C4 CF DF B7 CC CD DB DD C8 D6 BC C5 C2 D2 B7 BC C2 AF AE A3 AC A0 AB C5 AE A3 A7 CF A2 AE A1 A7 A4 BE D4 B0 B2 BA BC BD B9 DD B9 A0 A8 B5 B6 B0 DA 99 8C 8C 8A 86 89 E3 85 89 87 83 89 80 E8 8E 95 83 98 90 9F F1 85 9D 8F 97 86 82 FE 97 82 90 90 7F 79 07 6A 6F 6B 69 78 70 0C 63 69 60 62 71 77 15 78 62 72 7B 6A 6E 12 76 78 7B 74 63 65 1B 72 48 5B 4D 5C 5C 20 44 46 46 46 55 53 29 4F 51 43 5F 4E 4A 36 54 4F 45 58 47 41 3F 5C 4E 59 51 40 38 44 26 26 25 2A 39 3F 4D 2D 3A 25 23 32 36 4A 2A 37 36 3C 2B 2D 53 2F 3D 3D 35 24 24 58 26 20 08 0E 1D 1B 61 1C 09 06 07 16 12 6E 15 00 00 00 0F 09 77 0D 0C 06 19 08 00 7C 05 02 12 12 01 07 85 FE FB ED 8E 87 FB E8 E7 E8 E5 EF E2 8E E1 F0 E8 94 E2 F8 EC F8 FE ED 9D F2 E5 F5 F1 F5 E4 9A C9 CA CC CE CC DF A3 CE CA C5 C7 C3 D6 A8 C7 DF D1 DC DA C9 B1 DB D7 D6 D5 D1 C0 BE DE DC D0 D2 A8 BB C7 A1 BB A9 AB AF B2 CC AA B1 BF A0 A6 B5 D5 B6 A0 B7 B9 BD AC D2 BC BC BB B6 B4 A7 DB BB 90 8F 8F 8B 9E E0 9C 81 8C 84 82 91 E9 94 81 8E 9D 99 88 F6 8D 98 98 9A 90 83 FF 85 84 8E 93 97 7A 04 7D 7A 6A 68 6E 7D 0D 76 73 65 06 0F 73 60 7F 70 7D 77 7A 16 7B 7F 62 1C 6A 70 64 7F 7F 71 25 41 58 50 40 40 47 22 51 46 4B 4F 5C 43 2B 46 5B 5F 56 43 5A 30 5F 55 54 5D 4A 55 39 5F 5F 51 24 31 2C 46 24 3F 35 23 38 27 4F 32 21 23 2A 3F 3E 54 2D 2A 3A 2C 3B 39 5D 30 38 37 25 30 30 5A 02 00 0C 1A 09 0B 63 07 12 1A 14 13 1F 68 0E 15 03 0E 0B 1D 71 1C 1D 19 07 00 14 7E 15 1F 12 00 F9 EF 87 EA E6 E9 8C 85 F5 E6 E5 EA E3 E9 E0 8C EF E8 FC 96 FD F1 F4 E8 E1 F7 9F F2 EC FC E1 E6 CE A4 CC C2 C5 DA DF C9 AD CB CB C5 D3 D4 C0 AA D3 D5 CA CC CD DB B3 D5 C7 D5 C5 C2 D2 B8 DD D9 B9 BE BB AD C1 A5 BC B4 B7 B0 A4 CE AC B7 BD C5 D2 AC BD BC B5 BA B2 B9 DB A6 A3 B5 D9 BA AC BB 9F 98 8C E6 80 80 87 98 91 87 EF 91 8A 89 91 96 9E F4 8A 96 90 8A 8F 99 FD 81 85 93 83 84 90 FA 79 6A 7A 7C 7D 6B 03 7E 67 68 75 72 62 08 77 62 7E 6E 6B 7D 11 6B 74 7F 67 60 74 1E 62 65 6D 60 59 4F 27 53 4F 5D 56 4C 50 2C 4A 51 5F 40 48 41 35 58 56 51 4D 53 4A 32 51 5D 58 56 59 5B 50 3A 2B 3E 2C 2E 21 23 28 42 21 22 24 26 29 2B 20 4A 39 33 3E 3E 31 33 38 52 37 26 22 36 39 3B 30 5A 0D 09 18 0E 01 03 08 62 0A 08 04 06 09 0B 00 6A 10 0B 01 1E 11 13 18 72 1C 09 14 16 19 1B 10 7A F9 EC EC EE E1 E3 E8 82 F1 EA EC F7 E3 F5 F7 EC F6 ED FD EB 91 FE E9 F9 E1 FA FC E7 F3 E5 9B F6 CB CF DB C0 C2 D9 C9 DF AD C0 C8 C7 D5 CE C8 D3 DF C9 B7 DC CB CD CF D4 DE C5 D5 C3 B9 D0 D6 C5 B9 A2 A4 BF AB BD C3 A5 A9 A7 B3 A8 AA B1 A1 B7 D5 B1 A8 A0 AD B6 B0 AB B7 A1 DF BF AC B3 A7 BC 86 9D 8D 9B E1 9C 8B 89 9A 82 87 EE 87 92 80 9D 9B 9C F7 8C 8D 9B 84 9C 87 FC 91 84 92 8F 95 80 05 6E 7D 7B 76 6E 79 02 77 70 64 79 76 63 0B 70 69 7F 60 69 6A 10 69 6E 76 72 65 62 04 07 04 74 5F 58 5C 5B 4F 43 45 4C 22 31 30 31 45 4F 4D 4B 5B 3B 59 2C 2E 5C 53 4D 42 56 42 54 45 47 27 20 2F 3E 3A 26 3E 2A 4C 58 52 26 35 32 32 3F 51 55 3C 29 39 4D 4E 39 2E 3C 3C 30 35 51 42 47 33 30 18 78 78 0E 0B 1D 01 0C 0C 1A 60 72 76 00 01 17 17 1A 16 00 7E 6C 6C 7D 7A 1E 19 1F 1F 7E 13 10 F8 E6 E9 E7 F7 8F 9F 9D 82 8B F7 E4 E3 EC E1 EB FE 92 F0 F2 F9 8C 8F F5 FD FD F7 91 FD F8 FA F2 AA B8 BB C1 C1 C1 CB AD C9 CC CE C6 A6 B2 B4 CC D4 DF D1 D8 BE AA AC D4 C6 D2 A4 A1 DC C7 DA A7 D8 DE A2 A8 BE AE A2 CD D0 D1 D5 AB A7 B7 A5 AB DA C9 CA CC DE D7 AB B8 B7 B8 B5 BF B2 DE BA B4 99 FA F8 F9 80 8A 88 FF F7 8D 85 95 8E 82 96 89 9B 95 9C 8A FE ED E9 8E 9B 9D 97 90 86 98 86 90 0A 18 18 7A 7E 6E 65 63 02 10 15 72 76 7F 11 15 0A 68 6D 70 0C 0F 6F 6A 77 00 00 62 61 7E 67 66 2A 39 38 5D 4F 46 5B 4C 4C 23 49 4F 42 42 5C 50 51 2A 28 29 4B 54 3C 2C 22 23 45 5A 36 26 24 4C 4A 2C 21 25 3A 3A 3F 5E 52 36 33 41 28 26 37 45 4B 4B 48 2C 2D 5F 2E 28 21 20 50 43 46 47 44 20 19 6B 1B 19 16 6F 79 7D 72 16 13 61 15 17 1C 65 6F 6B 68 79 76 12 15 13 1B 7A 05 02 76 03 11 16 E2 8B 99 99 9E FA FF 8D F6 E6 E3 E9 86 96 94 95 9A 93 F5 F0 F0 F6 95 E8 E1 93 E7 F0 FA FB 94 E6 DE AB BB B9 D9 CE C0 C1 A2 D0 D4 D3 C3 C2 D0 A5 A9 AB CF D8 D2 D3 BC CE C6 C1 D5 D4 C2 B7 A7 A5 CA C3 A5 A0 A0 A6 C5 BE AD BA A6 A3 B4 A2 AA B1 DA B8 AA AC BA BA DC B2 BB BF B3 BE A4 B9 B3 BA 86 8F 8F 86 82 8B EC E5 91 93 8F 95 EF 80 8B 89 9E FB F0 8A 8E 90 88 FD 9F 9A 9E 98 FF 90 9B 99 6E 0B 00 7A 7E 60 78 04 02 0B 77 64 63 6C 61 6B 7E 12 6B 70 72 69 79 6F 61 7A 7C 67 73 65 14 1D 59 5B 47 5D 27 5C 45 41 54 46 52 21 2E 54 54 4A 4E 3B 55 50 50 56 35 53 55 52 43 5F 57 43 41 47 2B 27 48 2E 2F 3C 3C 2C 2E 2F 21 25 2F 32 29 35 36 3A 2C 30 30 2A 31 2E 3D 2A 32 34 37 39 27 26 1F 0C 09 1B 1B 04 6C 0F 10 06 0E 15 66 6F 17 15 15 0F 71 0C 0D 7F 1F 0F 07 17 15 71 7E 04 04 1A FE 82 FD FA 8E EC FE F8 E6 E6 80 89 F5 F7 EB F1 93 9B 90 EE FB FA F7 F8 FC F7 99 E4 E5 97 FA F4 DE DE DA C8 C2 AF CB CC D1 A3 A8 D2 D6 C8 D0 AC CF C8 D7 D0 D2 CA D7 D2 DB DF C7 D4 C5 C3 B4 C1 AF B3 A9 BA CE A0 A5 A1 B5 AB A5 A0 B2 A4 AC AB CF CB C9 C9 AB AC B2 B2 A6 B6 C5 A4 A5 B9 BB A1 8F 89 9D 87 8A 9B 8E 82 8C 87 8A 91 88 85 8B 8B 9E 8E 93 9B 91 91 98 88 81 F3 E1 E1 8F F7 80 F8 64 64 7C 6C 7B 7C 0C 1F 7B 03 74 0C 68 68 70 60 6F 68 18 0C 67 1F 68 10 7C 7C 64 74 63 64 14 61 27 49 47 47 4A 5A 5F 49 4D 4F 4C 40 54 5F 46 51 35 4E 4B 5D 46 5A 48 32 47 40 54 49 54 59 3B 40 39 2F 30 25 2D 40 39 3E 26 3B 32 31 49 32 37 21 3B 0E 0B 0D 0C 1E 10 14 13 1D 50 35 19 1B 18 14 38 6B 3E 3A 60 6F 0F 2C 2C 22 24 28 27 29 64 01 35 37 34 38 2C 1E 29 2E 26 21 31 3D 3F 36 3A 75 EE C4 C4 C5 CF DD 8C DB D1 8D 80 F2 D1 CE D7 D6 9A FD CA D8 D0 DC FD C8 C1 C7 C2 D0 DA DE D5 DB AA CF E7 E5 E2 EE FE AD F4 F0 AE A1 CC E6 F4 E4 F4 FE EB FC BE C6 F9 F3 D3 E6 E3 E5 E4 F6 F8 FC 8B 85 C8 AD 81 83 80 8C 90 C3 96 92 C8 C7 AE 84 8A 9A 96 9C 8D 9A DC A4 97 9D D0 D9 A1 92 91 9E AF A5 AC E0 8F BA BF B9 B0 A2 AC A8 A7 A9 E4 81 B5 B7 B4 B8 AC FF AA AE FC F3 98 BE B8 B0 F4 9E 45 45 4F 09 6A 40 40 41 43 51 61 54 55 53 56 44 56 52 59 57 1E 7B 53 51 5E 52 42 11 40 44 1A 15 44 6E 7F 29 54 6A 6D 61 63 6D 64 21 42 68 68 69 7B 69 59 6C 6D 6B 6E 7C 7E 7A 71 7F 36 53 7B 79 06 0A 1A 49 18 1C 42 4D 31 0A 0E 06 07 17 0B 17 1F 5B 3C 16 12 13 1D 0F 33 06 03 05 04 16 18 1C 2B 25 68 0D 21 23 20 2C 30 63 36 32 68 67 11 16 7A 1F 37 35 32 3E 2E 1C 27 20 24 23 37 3B 3D 34 C4 8B EC C6 C2 C3 CD DF 82 D5 D3 8F 86 F2 F7 85 FE D4 D4 D5 DF CD 9C 95 E5 D6 D5 DA D3 D9 D0 9C C9 EA E6 E8 EA E6 ED E3 A2 C7 EF ED EA E6 F6 A5 EC E8 B6 B9 CD E8 F5 EE E1 B3 D6 E3 F7 F9 F7 D6 8B 85 89 8D 87 8E 82 CD A6 8C 8C 8D 87 95 C4 93 89 D5 D8 B1 91 91 9B DD B9 9C 9E 96 D6 B3 9B 99 A6 AA BA 8A AF A1 AD A9 AB A2 AE E1 82 A8 A8 A9 BB A9 F8 AF AD F1 FC 97 B3 A3 B1 BF B3 A4 B1 F5 73 4E 46 6A 4F 41 4D 49 4B 42 4E 01 62 48 48 49 5B 49 18 4F 4D 11 1C 6E 5B 5D 57 50 46 58 46 50 2A 4F 67 65 62 6E 7E 5E 75 6A 73 72 26 41 76 64 74 78 38 6F 6D 31 3C 55 7D 7D 77 31 5D 78 7A 72 4A 2F 07 05 02 0E 1E 3E 15 0A 13 12 46 21 16 04 14 18 58 0F 0D 51 5C 37 13 03 11 1F 13 04 11 55 13 2E 26 1A 39 26 3F 3E 62 05 32 20 28 24 64 33 29 75 78 0A 31 2A 28 35 72 12 36 23 3F 34 35 3B 8A F9 C9 C7 CA EA D9 DF CD 83 D6 D2 88 87 E5 D0 C9 CF CA D8 D2 D6 DD D3 92 F7 DF DD DA D6 C6 F0 FF F9 E7 A9 F8 FC A2 AD C1 E2 EE E0 E2 EE E5 EB BA DF F7 F5 F2 FE EE D8 E7 E1 FF B1 E0 E4 BA B5 B9 9C 81 9A 9D CF AA 9F 83 8D 83 A4 93 95 8B C5 8C 88 D6 D9 BD 85 99 9E 9A D3 BB 9E 84 82 9A 94 8F BE BA A6 EE B9 BF E3 E2 87 A1 AF AF B4 AC E5 91 A9 B7 B7 BB 9A A9 AF BD F3 A6 A2 F8 F7 96 A7 43 5F 41 5A 46 0F 7C 42 57 4D 44 64 53 55 4B 05 4C 48 16 19 76 50 52 5A 12 78 5F 5F 51 17 70 5A 66 67 69 7B 4B 7A 7E 62 22 75 73 2F 26 4F 71 6B 7D 7A 6A 70 7F 71 3C 5B 7D 61 79 7F 62 52 61 67 05 4B 1E 1A 40 4F 26 0C 12 02 0E 04 15 02 44 3C 1F 15 3D 0C 0C 10 5C 0B 01 5D 50 3C 13 0F 1D 16 2B 25 68 19 2B 3C 23 08 37 31 2F 61 30 34 6A 65 14 34 2A 2E 3B 38 35 3C 3C 73 1B 23 39 39 31 10 DF D9 C7 89 D8 DC 82 8D EC C6 D7 81 FC C2 C5 C9 DB D5 DC 99 FA D0 D0 D1 D3 C1 F5 C4 C4 D8 94 C3 F9 A5 A8 D9 E1 E3 E5 FE EA A3 DA ED E9 F3 FD C0 EF E9 F7 B9 E8 EC B2 BD C0 FC FD F0 F8 FE F5 FB CA A7 8D 9C AB 9A 9E 82 C2 95 93 CF C6 B5 91 96 89 92 99 97 DE AD 89 9F 9E 96 B5 84 84 98 D4 83 B9 E5 E8 9A B9 AA A8 A4 B1 AB E0 8A B4 A8 AA A4 9F AE AA B6 FE A9 AF F3 F2 80 B9 BF B1 B6 A4 BA 58 4E 08 6D 41 43 40 4C 50 66 55 53 49 07 52 56 14 1B 6C 4C 4C 54 55 4E 5A 13 7C 58 44 56 71 40 78 64 28 7F 7D 21 2C 58 51 23 44 6E 6A 6B 65 77 5F 6E 6A 76 3E 69 6F 33 32 46 43 31 52 78 78 79 0B 19 48 41 39 0A 09 06 07 0D 04 48 23 12 16 0A 5A 0D 0B 57 5E 2C 13 08 06 1B 50 30 10 05 1D 16 2B 25 68 1B 2F 21 28 0F 30 2A 34 28 35 2F 64 15 35 2E 36 3D 7E 29 2F 73 72 12 25 22 22 25 35 39 C3 CA C6 89 EA C0 C0 C1 C3 D1 E2 D3 CF D3 CD D6 D2 9B E8 D6 CB D1 D8 9D C4 C0 9E 91 F5 D6 DA D4 EE E2 E9 E7 AE CB E3 E1 EE E2 F2 C3 F4 EE F0 EC E9 F3 B8 C9 F1 EA F2 F9 B2 E5 E3 BF B6 C4 E3 FC 99 98 C8 AF 9C 8E 82 8E A0 91 89 95 8F 94 8C C5 AA 94 8D 97 9A DF 8A 8E DC D3 B3 8B 93 94 9C D5 81 A4 BA BC A0 AE 8E BF AB B7 A9 B2 AE E7 94 AA AF B5 BC F9 A8 AC F2 FD 96 B2 BE B8 A5 BF F4 9E 58 44 46 4C 6C 5D 45 59 4B 50 48 01 76 48 51 4B 5E 1B 4E 4A 10 1F 74 52 5C 54 10 7A 59 59 53 15 4E 64 64 65 6F 7D 4E 7F 6B 77 69 72 6E 27 54 6A 6F 75 7C 39 68 6C 32 3D 5A 66 7E 76 77 65 7D 74 04 4B 2E 06 1C 06 02 19 20 11 09 15 0F 14 0C 45 2A 14 0D 17 1A 5F 0A 0E 5C 53 3A 10 06 16 1A 10 39 2E 68 10 2B 21 0E 3F 2B 37 29 32 2E 67 14 2A 2F 35 3C 79 28 2C 72 7D 1F 36 28 38 35 36 3A 75 FA CE DB C6 EC DD C5 D9 CB D0 C8 81 F6 C8 D1 CB DE 9B CE CA 90 9F F2 D2 C0 C4 D5 D6 DF D6 DA 95 C1 F9 E7 E7 EB CD FE E4 F6 EA F3 E9 A6 D7 EB F0 F4 FF B8 EF ED B1 BC D3 F7 E4 B0 CB F3 F6 F8 F4 84 8F C8 AD 81 83 80 8C 90 A1 92 88 92 8E 97 8D DA AB 97 8C 90 9B DC 8B 81 DD D0 A1 99 9B 9D 86 A2 EB 92 A5 A1 BB B5 8F B0 AA B4 A8 B5 AF E4 95 B5 AE B6 BD FE A9 AF F3 F2 80 A7 B4 B2 BE A7 BD 0A 60 5A 46 40 4E 6E 5F 4B 57 49 52 4E 07 74 4A 4F 55 5C 19 48 4C 12 1D 61 5A 5E 56 57 47 5B 47 6F 2B 4C 66 62 63 6D 7F 40 71 69 75 6F 74 6C 25 4A 74 6D 77 7A 3F 6A 6E 3C 33 44 64 64 7C 7D 66 02 4B 24 00 1C 0E 2E 1F 0B 17 09 12 0E 47 34 0A 0F 15 1C 59 08 0C 52 5D 27 20 50 35 19 1B 18 14 38 09 3A 20 3A 26 3F 25 62 13 2F 34 28 23 64 33 29 75 78 0C 0D 7F 18 32 3E 3F 31 23 76 7F 03 30 CF C0 CD C7 CA 86 EE DF CB D7 C9 D2 CE 87 F4 CA CF D5 DC 99 C8 CC 92 9D E1 DC C5 C5 DE 97 F5 D3 F8 E2 EB E8 E0 AF DE EC EC E7 C8 EE E8 E0 A4 CE F5 F5 FF B9 DA F0 F0 F1 F3 E1 B0 E7 E5 B9 B4 DF 8B 9B 89 87 8B 9C 89 CD BB 86 8E AF 89 95 93 80 9D 92 99 97 DE B4 8E 92 9C 96 D0 87 85 D9 D4 A6 BD AE AC A0 BD A7 EC 86 B0 AC AE A0 88 A2 B3 E5 80 BE B9 B5 BF B1 B8 FD 96 BC BC BD B7 A5 F4 A3 59 05 08 6A 4F 41 4D 49 4B 42 4E 01 62 48 48 49 5B 49 76 5C 49 1F 66 58 53 5F 51 5F 52 17 70 5A 66 67 69 7B 2E 79 7F 23 22 50 77 68 75 74 24 43 68 7A 76 7A 50 7A 6B 3D 48 76 71 7D 77 79 70 35 2E 04 04 05 0F 1D 4C 1B 11 4D 40 29 09 09 03 45 31 14 16 1E 5E 3B 13 11 1E 12 02 3F 13 00 54 2F 2F 2A 24 28 20 2B 6C 09 2D 2F 2C 20 34 67 32 36 74 7B 12 38 2E 3E 32 38 21 36 70 08 33 39 1A 30 DD 8B F2 CC CF C3 CD C3 C6 83 E4 CE CA CB C5 D7 9A CD CB 97 9E EC D5 D3 D5 D2 C0 DE C4 D2 94 F1 E5 E7 E4 E8 FC C1 E9 FA A2 D9 E5 E0 EA E6 EA E1 BA DF F7 F5 F2 FE EE BD E4 E0 BE B1 C3 C4 B4 D1 85 87 84 88 9C BC 85 83 85 82 90 8E 94 82 C4 A1 95 97 94 98 8C DF 8A 8E DC D3 A3 86 9F 84 87 D5 8C B9 A9 A7 AD 9C A5 A3 A5 A2 B0 AE B4 A2 E4 81 B5 B7 B4 B8 AC FF AA AE FC F3 98 BE B8 B0 F4 9E 45 45 4F 09 6A 40 40 41 43 51 73 48 48 40 45 55 55 49 5D 19 7A 50 50 51 53 41 10 47 45 19 14 7F 6B 7B 69 67 6B 7C 69 2D 5B 66 6E 55 73 75 6F 6C 69 73 38 55 77 6D 7D 3D 64 60 3E 31 5C 76 64 74 04 0E 1B 0C 4E 36 09 03 37 30 40 25 09 0B 08 04 08 5B 0E 0A 50 5F 3F 1C 1C 12 14 18 17 19 54 31 25 27 24 28 3C 1A 1F 6D 06 2C 2C 2D 27 35 64 33 29 75 78 0A 29 36 2F 2E 72 15 22 30 38 34 01 06 8A EF C7 C5 C2 CE DE 8D D4 D0 8E 81 F5 D0 CD D6 C9 9B FE CB DF D1 DF 9D 9A E4 D5 D4 DD D2 DA D1 A3 DE DB A9 CA E0 E0 E1 E3 F1 A0 F7 F5 A9 A4 C6 F2 F2 F6 FC ED FA BC C4 E7 F2 FE C4 C5 B7 D0 FA 86 87 89 9B CE 99 9F C3 C2 A0 9A 84 85 8F C4 AE 95 89 8D 97 9F AA AF DD B6 9C 9C 9D 97 85 D4 83 B9 E5 E8 8D AF A1 A5 BE AA E3 8B B3 A9 A9 A1 90 89 FB 9C B6 B2 B3 BD AF F2 A5 A3 FF F6 9F BB BB 4D 0B 63 46 40 48 0C 69 4D 4F 4C 40 54 72 77 05 7E 54 54 55 5F 4D 1C 4B 41 1D 10 78 58 53 5D 54 64 2B 5A 7C 7E 6A 69 58 51 23 44 6E 6A 6B 65 77 3A 6D 6B 37 3E 57 69 73 75 72 62 78 77 79 34 53 05 19 01 07 1A 3A 3F 4D 26 0C 0C 0D 07 15 44 13 09 55 58 30 0D 0D 1D 18 1E 1A 50 3F 13 00 54 26 22 2E 39 2C 22 1A 1F 6D 06 2C 2C 2D 27 35 64 33 29 75 78 13 3F 2F 3D 33 37 20 35 71 0F 32 3A 00 F9 8B EC C6 C2 C3 CD DF 82 D5 D3 8F 86 ED C5 D5 DB D5 DD CA DB 9F E5 D8 DC 93 98 E6 D3 D2 DF D0 E4 EF A1 DC DD AF C8 E2 EE EF E1 F3 A6 F1 F7 AB BA D6 FD E1 F7 FC FD F3 B2 C3 F5 E2 F9 C2 C7 B5 AE 84 84 85 8F 9D CC 9B 91 CD C0 AF 89 95 93 80 9D 92 99 97 DE B4 8E 92 9C 96 A5 A2 D6 B3 9B 99 A6 AA BA E9 B8 BC E2 ED 92 AC AC A8 B5 AF E4 9F B6 B4 AC A0 8B AC FC 99 BD BF BC B0 A4 F7 A2 A6 04 0B 7A 46 43 4E 42 44 43 4D 00 6D 43 52 71 76 1A 7F 57 55 52 5E 4E 1D 44 40 1E 11 64 42 47 46 63 6A 66 29 5C 7A 6E 61 67 56 53 21 42 68 68 69 7B 69 38 6F 6D 31 3C 4E 73 66 74 78 36 56 66 74 08 02 09 07 4E 3D 05 14 03 0F 35 32 46 23 0B 09 16 1A 0A 59 08 0C 52 5D 21 04 15 15 1F 04 1C 55 01 39 27 27 2F 1A 1F 6D 06 2C 2C 2D 27 35 64 33 29 75 78 0A 37 31 3B 3C 22 3C 22 34 76 13 3B 39 C6 CA DA FC FD 8F E8 C2 CE CF C1 D3 86 D1 D7 8B 9A EF D0 D8 D7 9F FE DC DA C7 E5 E2 96 F3 DB D9 E6 EA FA A9 F8 FC A2 AD D6 F6 F2 EA EF F4 EC A5 D6 F2 EA F8 CB CC BC D9 FD FF FC F0 E4 B7 E2 E6 C4 CB BB 86 9B 9B 84 CD A3 85 92 88 85 86 8A C5 A8 9A 96 9D AD 90 89 89 9A D3 B1 97 84 9E 97 94 A4 EB 9A A8 A0 AB EC BB B1 ED E0 8B A7 B7 A5 AB BF A8 BD F9 87 BA B2 9A BD BF B4 F1 A0 A4 FA F5 69 43 41 47 4B 5C 49 0D 7B 56 41 4F 75 4E 48 53 5F 49 18 4F 4D 11 1C 7E 5A 5A 5E 54 45 52 14 6C 7F 6A 66 4E 61 63 68 2D 74 70 2E 21 47 72 77 71 68 7A 74 70 7F 71 3C 59 7D 7F 7C 70 64 50 7B 79 0E 4B 1E 1A 40 4F 2F 0C 0C 02 04 08 07 09 44 21 15 17 14 18 0C 38 13 11 16 53 06 02 58 57 27 02 23 38 3B 69 08 3D 2D 23 21 04 2F 2D 22 67 32 36 74 7B 1D 2C 2C 30 1B 32 3E 37 70 27 25 79 74 17 D8 C2 DC C0 DD C7 8C FD CD D6 CE C5 E1 C8 C8 C1 9A CD CB 97 9E F7 D3 D3 D5 93 FB DE D8 D0 94 F1 E5 E7 E4 E8 FC C8 E3 E1 E6 A3 F6 F2 A8 A7 CE E4 EA FA F6 FC ED FA BC C4 F7 FD D7 FE FA F3 B4 E3 99 C5 C8 A7 8B 98 CC B7 87 82 8C 80 88 83 C4 A1 95 97 94 98 8C B8 93 91 96 D3 86 82 D8 D7 A7 9C A4 AC A9 B9 A1 BD A9 ED 86 AC AC AD A7 B5 83 AA B6 BF F8 AF AD F1 FC 8E BB BF A6 B4 A4 84 BD B9 5C 4E 5A 09 58 5C 02 0D 63 56 53 55 54 46 48 4C 5B 55 18 7D 51 53 50 5C 40 60 59 5D 40 52 46 15 7C 78 26 29 4D 6E 62 6C 66 6A 61 6F 26 43 6B 69 76 7A 6A 4A 77 73 6A 78 60 33 66 62 38 37 52 67 0B 05 0B 3A 07 03 1A 08 10 43 16 12 48 47 21 10 08 14 2B 10 12 09 19 0F 52 05 03 5F 56 27 1B 00 24 2F 1B 20 22 39 29 3F 62 35 33 6F 66 0F 2B 2B 3D 7B 13 36 30 38 7C 19 3D 3F 3C 30 24 04 3D 39 DC CE DA 89 D8 DC 82 8D E8 C2 D0 C0 C8 C2 D7 C0 9A E2 DD D7 ED D6 D0 CB D7 C1 90 C7 C5 99 94 FB EF FC A8 D3 EB EE E0 EC EC E7 A0 C5 E9 EB E8 E4 E8 C8 F1 F5 E8 FA EE BD E4 E0 BE B1 C5 FE FA F2 8B 9B 87 9B 8B CF A8 82 8E 8F 81 93 B5 97 8B 91 DA A8 91 95 88 9A 8E AE 82 9C 84 D1 B1 98 98 91 99 BB A7 BD EE 9F AD A1 AE A2 A4 A8 B3 AA 97 B5 B5 AF F8 89 B2 BE A8 B4 BC A6 BD 82 F0 87 FB 94 79 73 08 40 40 4B 49 55 02 4C 46 01 67 52 57 51 48 5A 54 50 5F 51 1C 51 5B 40 44 54 52 17 47 5D 6B 79 6D 7A 4F 5C 54 2D 51 53 49 21 34 37 34 25 5F 6A 6D 70 6A 66 3C 54 7C 77 75 69 36 54 52 51 4A 28 07 07 1A 1D 0D 0E 16 20 08 08 08 06 44 24 4F 4B 58 10 10 1B 19 05 52 1C 16 51 35 1F 1D 1B 2F 38 2D 69 22 26 3F 39 27 27 60 32 2E 26 36 20 29 18 37 29 2E 3A 2E 7D 1B 3D 34 34 2E 1E 16 10 F2 8B 9B 9C 8E C6 C2 C9 C7 DB 80 CE C0 87 F7 D5 DB D5 D1 CA D6 9F D0 D4 C1 C7 D5 D5 96 C4 DC D4 F8 EE FB DA DA C0 D4 D5 B7 B3 C5 A1 C3 F6 F1 EC EE E2 B8 D0 F0 FB F9 E5 B2 D0 D6 D5 B6 D4 FB FB 9E 99 89 8A 9A AA 99 9F 8D C3 B3 95 89 9F 9C C5 CF CB D8 90 90 9B 99 85 D2 9C 96 D1 B3 82 86 9A BA AE A9 A7 EE A3 A5 BE B6 A6 A4 E1 B5 AF A5 B7 BF A8 9B 98 9D FF E8 ED F2 BA BE B5 B3 AF F4 BA 4C 0B 6E 5B 4B 41 4F 45 02 4F 49 52 52 42 40 05 49 53 59 4B 5B 4C 7F 7C 71 13 04 01 16 72 45 40 63 7F 71 29 47 61 68 68 7A 23 43 47 42 27 47 6A 74 6F 6A 78 7D 6B 58 5C 4A 33 79 7F 72 72 6C 35 05 0D 48 2E 0B 1D 01 0C 0C 43 0C 08 15 13 01 01 5A 08 10 18 0C 1A 0F 39 33 2B 50 42 46 57 31 04 3F 22 3C 30 6E 06 22 29 27 3B 60 02 00 03 64 06 35 35 2C 2B 3F 3C 28 19 13 0B 70 62 66 77 11 24 DF C2 DC D0 8E E6 C2 C9 C7 DB 80 EC CF C9 CD 85 F9 FD FC 99 FD D0 D2 C9 C0 D2 D3 C5 F2 F6 EC 95 B9 BB A8 CC FF FA E5 F9 FB A3 C9 EF E2 E2 FC A5 D9 DD DC B9 DD F0 F2 E9 E0 F2 F3 E5 B6 BF C3 F0 8F 80 8D 87 8A C6 A4 8C 8C 84 C0 B2 83 89 83 C5 93 95 9C 9C 86 DF 93 9B D2 BB 9F 9F 91 D7 BF 9A A4 AC E8 A5 A7 BC B8 A8 A6 E3 B3 A9 A7 B5 A1 B6 92 BA B6 BE FE 8C B9 B3 B5 F3 B9 BF B2 B2 AC F5 45 4D 08 61 41 41 4B 0D 69 4C 4E 46 06 4B 4D 56 4E 5E 5C 19 4D 57 5D 4F 57 40 10 72 70 73 7C 54 64 6C 28 5A 6B 61 6B 2D 47 72 75 68 72 7E 24 4C 74 7F 7D 61 3E 5C 5A 59 32 50 7F 7F 62 65 75 76 1E 22 06 0D 07 0E 4C 58 52 43 09 0F 02 02 1C 45 15 1D 58 30 10 1B 15 1C 1C 53 1C 18 05 03 11 11 6A 38 20 28 3C 2A 3F 0B 16 10 05 61 0B 0E 06 65 33 35 3C 3C 26 7F 33 3B 72 1A 24 30 3A 3E 35 3B 8A C7 C1 DA DA CA C8 8D D1 CB C1 D3 C3 D4 EA CC D1 D0 DD D0 9E 8D 8E 88 92 DA DE D5 D3 CF 94 DA EC AB C2 E8 FE EE E2 E8 F1 E6 A0 ED EF F4 F0 E0 FE BB EB F1 FF ED F9 EE DC FA FB FA F3 FE B4 A7 D8 DE C8 AC 9F 9A 85 99 9B C3 A9 8F 82 82 9C C5 B9 BD BC D9 BD 90 92 89 80 92 93 85 B8 9E 9F 9E AF A2 E8 FB FC FA EC 88 B3 B6 A9 B5 BF E7 8D AB BE BE A0 F9 9D 99 98 FD 91 BC BE A5 A4 B6 B7 A1 0A 03 7F 4C 4B 44 49 43 46 0A 74 64 65 6F 04 14 0A 0B 18 50 50 5B 59 45 12 5C 56 11 63 64 14 59 63 78 7C 6C 6A 2F 7F 65 63 71 65 72 48 62 60 60 68 77 79 77 7A 3F 2E 28 32 50 71 62 7E 37 5D 7B 0E 0E 10 28 2B 37 4C 04 0C 07 05 19 46 08 02 45 32 14 14 15 1F 11 18 5A 01 53 1C 18 05 03 11 11 6A 38 20 28 3C 2A 3F 6D 01 05 04 08 28 23 21 3D 7A 34 3E 79 2A 30 2C 7D 01 14 08 71 25 3F 35 27 CF D8 88 EA E8 EB E5 EF E7 FB 80 92 93 87 E1 D4 CF D2 CC C0 9E F6 D2 D9 D7 CB 90 F2 F0 F3 94 F6 E5 E5 FC FB EF EC F8 DE A4 D3 A0 B4 B6 B7 A4 EC F4 FF FD E1 BE F0 FA BD C7 C0 B0 FD FF E4 E0 F0 8E CB 9B 81 8F 9D 89 9E B1 94 89 92 95 C7 A9 84 88 90 9D 8D DE B6 92 99 97 8B D0 9E 90 D7 A7 82 A3 B8 BB E9 A2 A6 BF B9 A7 A7 E0 B2 AE A6 B6 A0 A9 94 95 81 FE 8C A8 B2 B1 B8 B8 BE BA BA F4 E6 1A 0B 61 47 4A 4A 54 7E 6F 6A 00 67 53 53 51 57 5F 48 18 7A 78 7B 68 5C 5B 44 51 5F 16 5E 5A 51 6F 73 28 66 68 2F 58 6C 6B 74 61 6F 63 74 61 25 76 72 6B 6D 7B 7B 3C 6E 7A 72 62 74 65 51 40 46 2F 4B 59 59 5E 4F 05 03 06 06 18 41 09 01 44 30 31 5B 14 10 0D 0B 19 19 52 00 18 10 04 12 07 33 1E 18 0D 69 7F 7F 7C 6D 07 32 35 28 32 3E 64 0C 34 3F 3D 21 7E 1C 1A 19 72 10 3F 3F 22 25 35 36 DE E7 C7 C7 C9 8F EB C4 CE D7 80 E7 D3 D3 D1 D7 DF C8 98 FA F8 FB F5 D3 D6 D6 C8 91 D9 D1 94 C1 E5 FB A8 BA BE AF FF E5 E3 F1 E5 F2 A6 E8 EA A5 CD FA F4 F5 BE CC E8 EF F7 F6 E4 DF D7 C4 D0 D4 BB CB D9 D9 DE CF 85 83 86 86 98 C1 89 81 C4 B0 A9 DB 94 90 8D 8B 99 99 D2 80 98 90 84 92 87 D5 89 8D 8C 9B BB BC BF A8 AE AF E0 F3 F6 F7 F4 E5 93 B5 BC BC A6 FF 91 B4 BC BA F0 97 A3 A3 A1 A7 4F 58 08 6A 68 6B 7F 0B 72 03 15 11 16 07 61 54 4F 52 4C 40 1E 76 52 59 57 4B 10 72 70 73 14 76 65 65 7C 7B 6F 6C 78 5E 24 53 20 34 36 37 24 40 6B 6E 71 6D 67 3F 55 73 76 76 68 31 5B 7E 7A 7C 4A 28 2E 2D 4E 2C 03 03 16 11 01 02 12 29 05 16 1E 1A 09 59 4F 4F 4C 5D 37 02 05 18 02 0E 54 3C 24 2F 2D 31 6E 0C 0A 09 62 00 2F 2F 32 35 25 26 2E 15 39 2A 3A 3E 2D 7D 63 63 60 71 13 26 21 3C DE D2 88 E0 C0 CB C9 D5 82 EE C9 CF CF 87 E7 E3 FE 9B FB D6 D0 CB CE DC D1 C7 F9 DF D2 D2 CC 95 E5 ED A8 FD E6 EA AC F9 ED F3 A0 F2 EE E6 F6 E0 E9 BB F7 F7 BE C8 FD F1 FE B3 C3 E5 E4 F2 F1 E1 CA A8 AE AD AA 80 9B CD A8 8C 8E 84 95 C7 D7 D5 DA BE 89 8C 97 8B 85 DD BB 9D 94 94 8E D7 B7 B3 8E EB 8B A6 A0 BB BE AC A1 B7 84 AE B1 E7 8E AA B4 BE AB F9 ED EF FC 98 A3 A6 B9 A5 AF F7 9D BB 4E 4E 50 09 63 46 42 44 02 60 66 65 06 64 4B 4B 4E 49 59 5A 4A 6C 53 44 50 56 51 5F 75 45 41 51 6F 2B 47 60 62 2F 24 4F 70 66 6E 75 2F 44 6B 77 74 3B 7E 6C 6A 6A 6E 78 61 33 53 57 52 50 7B 79 0E 4B 3B 19 01 1B 2B 02 0E 07 40 32 16 08 10 45 3C 23 58 3A 11 11 08 0F 13 10 04 36 19 1B 10 55 19 3B 27 3D 6E 02 25 23 2B 63 06 19 66 04 2B 2B 2E 29 39 3A 2A 18 33 31 36 73 03 21 39 23 74 13 F2 8B EB C6 C0 DB DE CC C1 D7 80 89 F1 C2 C1 CE DF D5 DC 90 ED D6 D0 CB D7 C1 90 E2 C6 D8 C0 E6 E3 E7 FE EC FC AF DF FD ED F7 A0 C7 DE A7 C7 EA F4 EF EA F8 FD EB CF F4 FE E5 F5 E3 B6 C4 E4 FA 9E CB A5 80 80 86 CC AB BA C3 A3 8E 88 93 96 84 99 8F AB 89 91 8B DC B3 93 87 85 83 97 9B D4 B2 AB B8 86 A8 BA BA BE AC AE E3 87 A0 B5 E7 A2 B0 AE AE AA BC AD FF 9F 9B 96 83 B1 BD BA B6 B0 BC 5F 46 08 5F 5D 01 0C 78 71 03 64 4E 4A 4B 45 57 6A 57 59 4D 57 51 49 50 12 45 43 1F 16 62 67 15 4E 64 64 65 6F 7D 5F 62 7B 61 65 60 68 74 24 63 6F 6F 6D 6B 7B 6C 3C 5E 54 57 43 64 71 76 66 35 0C 1E 1C 1C 1C 0A 1F 4D 21 25 24 34 2D 47 26 17 1F 15 0C 59 2D 0F 13 09 52 35 28 51 35 18 1A 01 38 2A 2B 3D 1B 1C 6C 0E 30 36 24 24 66 14 34 2A 2E 7B 1E 01 7E 1C 33 33 26 21 31 32 22 02 07 75 E9 D9 DD CD CB 8F FF DD CD D7 80 E7 FE 87 E7 CA D4 CF CA D8 DD CB 9C 95 E5 D6 D5 DA D3 D9 D0 9C DF D8 A8 C7 EF FB F9 FF E3 EF A0 C6 E7 F4 A4 D6 EA F4 EC B9 D8 C7 BC DE FD FD E4 E3 F7 F4 E0 C6 9A 84 9C C9 BB BC CC AE 90 96 84 84 C6 A8 8D 89 A9 8B 97 8D DE AA B7 DD B1 81 85 95 93 D7 BB 9C A6 88 BA BC AA AA EC 82 AB AF E0 E9 91 93 8D EC 8D B3 BD B8 AA FF BA A8 A6 A6 A2 B4 A5 F7 97 93 6E 68 40 40 40 4E 0C 6C 17 13 00 68 48 43 41 5D 6F 68 18 08 0E 1F 65 58 53 41 43 11 62 45 51 54 79 7E 7A 70 2E 41 63 79 67 56 53 21 33 27 5D 60 7B 69 6B 39 4A 6D 79 7C 61 66 62 68 36 59 7B 61 0F 2E 1D 1B 01 4F 2E 18 0C 07 35 32 46 54 54 45 23 1E 19 0B 0D 5F 28 0F 17 12 03 04 04 0E 54 37 25 25 2C 3A 04 2E 3C 2C 2C 63 14 33 23 26 37 30 28 22 78 17 31 2B 39 08 19 73 04 23 33 36 27 20 D8 D2 88 E7 C1 DB C9 F9 C7 CD 8D D8 C3 C6 D6 85 EF 95 EB 97 9E EB CE D8 D3 C0 C5 C3 CF 97 FA DA FE EE A8 CA C8 CB D8 FA ED AE F9 E4 E7 F5 A4 D0 B4 C8 B6 B9 CA ED F9 FC E1 E6 E2 E8 B6 D9 FB E1 8F CB AB AF AA A9 85 9B 87 CE 99 84 87 95 C4 B0 D4 A8 D6 D9 AA 8D 99 9C 81 86 82 88 D6 B9 9B 81 AF EB 8B 8F 8A 9A E2 9E EC E3 94 B3 A3 A6 B7 B0 A8 A2 F8 9B B1 B1 B8 FD 91 95 94 84 85 F7 90 BA 46 47 49 5B 0E 66 42 49 47 5B 62 48 52 44 4B 4C 54 1B 4E 4A 1E 6A 6F 1D 76 5C 5C 5D 57 45 71 41 62 6E 7A 6C 7B 62 2C 7B 71 23 55 52 26 43 6B 69 76 7A 6A 5B 77 6B 72 72 66 76 30 67 65 37 41 46 4A 2F 07 05 02 0E 1E 21 07 15 09 00 14 47 12 16 5A 2E 2B 59 3A 10 10 11 13 01 22 18 06 07 18 10 6A 6B 3E 3A 6E 1A 1F 6D 06 2C 2C 2D 27 35 6A 65 1F 29 2A 36 2C 7F 2B 35 3B 3F 35 71 26 3E 3A 32 C3 C5 CF 89 C6 C0 DF D9 98 83 F6 C4 C8 C3 CB D7 F7 DA D6 D8 D9 DA CE 87 92 DA DE D8 C2 DE D5 D9 E3 F1 E9 FD E7 E0 E2 A3 AC AD D6 E4 E8 E3 EB F7 CC FE F6 FD F1 ED D1 FC FC F2 F7 F4 E4 AD B4 F3 8B 82 84 C9 9A 80 CC 81 8D 82 84 C1 B0 82 8A 81 95 89 D8 8D 87 8F 99 D3 D2 BA 9E 98 82 9E 95 99 A3 B1 A9 BD A7 A0 A2 ED B1 A8 A9 B1 B6 A2 A0 EB 8C BE B6 BD B1 AD 91 BC BC B2 B7 B4 A4 ED F4 F5 5C 4E 46 4D 41 5D 0C 44 56 46 4D 52 06 50 45 56 1A 5D 57 4C 50 5B 7B 58 46 65 55 5F 52 58 46 78 6F 7F 69 4D 6F 7B 6D 5B 67 6D 64 6E 74 4A 65 6B 7B 7C 7D 6B 24 3F 6A 78 7C 77 7F 63 36 7A 71 61 0B 0F 09 1D 0F 4F 05 1E 42 0D 0F 15 46 04 0B 17 08 1E 1B 0D 50 5F 28 04 02 16 50 4C 56 21 11 1B 2E 24 3A 04 2F 21 2D 2A 27 31 7A 61 30 22 2A 21 35 29 78 30 2D 7F 3D 31 20 36 31 35 2F 77 35 31 CE CE CC 89 DA C0 8C CE C3 C0 C8 C4 88 87 EA C4 D7 DE 98 84 9E 9F CA D8 DC D7 DF C3 96 C0 D5 C6 AA E2 E6 E0 FA E6 ED E1 EB F9 E5 E5 A6 F4 F1 E6 F9 FE EB EA F8 EA F0 F1 EB B3 BD B1 F0 F6 FD F9 CA 9F 87 C9 9C 8A 98 9F 8B 86 96 84 C6 8E 8A 83 95 DB 99 9B 91 8A 88 DD 84 96 9E 95 99 85 A2 90 A4 AF A7 BB 83 AE A2 AC A5 A6 B2 FB E6 AE AA AC AE B2 B9 B5 B7 A5 B9 B9 F2 A0 A5 B2 B5 B2 A7 A6 4C 5E 44 45 57 63 45 40 4B 57 70 44 54 4E 4B 41 1A 06 18 15 1E 69 5D 51 47 56 10 0C 16 1B 14 7C 64 7F 6D 7B 78 6E 60 2D 3F 23 2C 21 54 62 75 70 7F 68 6C 4D 67 6F 79 6E 32 2E 30 59 7F 64 60 7A 18 12 48 1B 0B 1E 19 08 11 17 40 3A 0F 03 59 38 40 5B 2A 1C 0A 0D 15 18 04 1A 1E 16 56 13 15 01 2B 6B 2E 3B 21 22 6C 2E 23 20 28 24 68 69 6A 18 60 7B 0A 3C 2A 2D 35 38 24 3A 3E 36 76 33 35 21 CB 8B CE DB C1 C2 8C CE C3 C0 C8 C4 86 C1 CD CB D3 C8 D0 DC DA 91 9C E6 FB C7 D5 DC C5 97 D7 DA FF E5 FC B3 AE D2 D1 B7 A2 CF EF E0 E2 EE EA E2 BA FF F9 ED FF BF FA EF FD FE B0 E2 F3 E5 E2 F0 98 C5 C6 C7 B3 D5 CC A1 8D 82 84 88 88 80 C4 81 9B 8F 99 D9 98 8D 93 90 D2 80 95 83 80 92 86 D5 AC A2 A6 A0 BD A7 A9 A9 EC E3 9B 88 B2 A2 A9 B6 FA B8 B7 AC B0 AB E6 FD 87 BD A3 A4 A6 A7 BB A7 5E 4E 4C 09 4F 48 4B 5F 47 44 41 55 4F 48 4A 1F 1A 1B 59 5E 59 4D 59 5A 53 47 59 5E 58 17 5A 5A 7E 2B 7B 7C 7E 7F 63 7F 76 66 64 45 35 46 30 30 2C 58 2A 2E 29 5C 28 5E 23 22 23 26 21 25 26 50 5C 5D 2A 5A 5C 5B 29 2E 57 21 57 59 22 21 26 27 3B 4D 4A 4C 4E 4F 48 49 30 46 40 40 37 40 4C 44 0B 08 0D 08 7C 0E 79 7E 72 77 01 07 71 77 02 7D 69 6C 6A 6F 6E 1D 6B 6A 67 12 68 1C 37 3E 3A 11 CF CD C9 DC C2 DB FF C8 D1 D0 C9 CE C8 D4 E7 CA D4 CF D9 D0 D0 DA CE F0 D7 C0 C3 D0 D1 D2 F5 C6 F9 EE FC C0 EA C8 FE E2 F7 F3 C9 EF E0 E8 D7 EA E8 EF D1 F7 FA FA E4 D3 F3 FE F5 DA F3 EE C0 FA 85 87 BC 80 9E A4 89 94 A6 82 94 80 B2 9E 94 80 BC 94 8A 94 9F 8B 95 93 95 A7 89 81 93 B4 81 86 BE A4 A5 88 BD BC A9 B9 8B 87 96 A8 B5 AE A6 A9 BF 92 AB 95 B7 B1 B7 94 B6 F3 ED F1 FA F7 93 A7 45 5E 58 09 13 0F 00 0D 74 4A 53 48 44 4B 41 05 07 1B 14 19 76 56 58 59 57 5D 10 0C 16 60 55 5C 7E 62 66 6E 2E 69 63 7F 22 70 74 60 74 73 24 71 73 76 7D 5A 71 73 70 78 71 67 30 78 62 72 79 66 4A 1F 07 49 0C 1A 0A 0B 07 11 40 32 07 11 01 01 5A 5B 11 0D 1B 12 0F 53 0A 20 09 1C 14 18 18 36 25 2E 2E 2F 27 2C 25 28 2C 37 14 33 27 23 21 17 3B 2F 31 36 0F 2A 3D 33 26 3A 24 28 04 3E 27 3E F8 C2 DB C2 8E DF C9 DF C1 C6 CE D5 EF C9 C7 CA D7 D2 D6 DE 9E DE CE DA C7 DE D5 DF C2 97 DC D4 F9 AB FF FB E1 E1 EB AD F6 FA F0 E4 A8 A7 C1 FD EA FE FB ED FB FB BC BA B5 B3 E4 E8 E6 F2 DC FA 86 82 8C 88 97 A6 82 8B 8D A7 81 95 83 B4 81 96 89 92 97 97 B1 8F 99 93 A6 9A 9D 94 A2 8E 84 90 83 B8 98 BB A7 A2 AD BF BB 80 AC AE B5 A2 90 AC B7 BE 8B BC AD AC B5 B2 BC A0 94 B0 AF A4 90 B4 53 64 4E 7E 4B 4A 47 6E 47 51 54 40 4F 49 60 44 4E 5E 4B 7B 4B 4C 55 53 57 40 43 7E 54 5D 51 56 7E 42 66 6F 61 4E 6F 6E 6D 76 6E 75 52 7E 74 60 3A 75 77 6D 3E 6C 69 6D 62 7C 62 65 73 73 50 70 19 08 1A 00 1E 1B 05 02 0C 59 40 41 5D 24 05 0B 1A 0F 58 1F 17 11 18 5D 1E 1A 03 05 56 00 1D 01 22 6B 3B 39 2B 2C 25 2B 2B 26 24 61 28 26 29 20 7A 66 78 3F 2A 2F 72 2C 27 32 3E 25 39 20 31 27 84 C2 C6 CB CF CC C7 D8 D2 D0 CD C0 C8 C6 C3 C0 C8 FE D5 FF C8 D1 D4 FC F5 80 D3 C8 D9 CD D5 8C DB B3 DE FE C5 E2 E5 FE E1 F0 F9 EC E4 E8 E8 F6 C5 F7 F1 EA EA EC E8 E4 E2 F6 C3 DD C2 C7 E4 E7 83 88 8D 98 9B 8E 82 99 8B 97 99 91 94 8E 87 80 B7 9E 99 8A 8B 8D 99 90 97 9D 84 B0 94 84 9B 99 BF BF AD 86 A8 A9 BF A8 B6 AA B3 95 B4 A6 AD A9 B3 B5 BF A8 AB BE B2 A9 BB A7 A9 81 B3 A5 B7 B0 44 5F 49 4E 4B 7F 5E 44 41 46 70 53 4F 44 41 68 5F 5A 4B 4C 4C 5A 51 58 5C 47 79 42 62 45 55 5C 66 62 66 6E 5F 7A 6D 63 76 6A 74 78 56 62 76 66 7F 75 6C 78 79 7A 20 3D 2E 2E 30 47 77 65 7D 74 08 07 0D 3D 07 0C 07 21 07 05 14 23 09 15 00 00 08 29 11 1E 16 0B 3E 12 00 17 15 03 3F 19 17 19 3F 2F 2D 05 2B 29 38 0F 2D 31 24 24 34 13 2D 26 31 08 31 23 3B 0B 35 3E 39 10 3F 22 22 07 26 30 C9 C2 DB C0 C1 C1 ED C1 D0 C6 C1 C5 DF 87 C7 CA D4 D5 DD DA CA D6 D2 DA 92 DD DF C6 F2 DE C7 D6 E5 E5 E6 EC ED FB E5 E3 E5 A3 EE EE F1 A7 E7 EA F4 F5 FD FA EA F6 F2 FA BC BD BE B1 F5 F8 FA FB 8F 88 9C 80 80 88 CC 8B 83 8A 8C 84 82 C9 C4 B7 9F 9A 8B 96 90 C5 DC B1 9D 92 94 98 98 90 D4 86 AF B8 BB A0 A1 A1 BF E3 EC ED 83 FB 9A 80 AD B1 B6 BA BA F4 8C AA B2 B3 B7 A1 8C B3 A3 BE B8 B1 59 77 1A 4A 76 1A 6E 63 6E 73 7C 11 7A 44 48 4C 5F 55 4C 65 4A 5A 4E 50 5B 5D 51 5D 6A 53 51 43 6F 67 67 79 63 6A 62 79 5E 41 75 72 6F 69 61 76 69 57 79 60 7B 6D 40 49 60 72 74 78 78 70 44 79 0B 1F 0E 06 1C 02 42 2F 17 10 09 0F 03 14 17 29 1B 02 1D 0B 22 3C 13 13 1C 16 13 05 1F 18 1A 06 16 08 27 27 20 2A 2F 39 2B 2C 2E 6F 25 34 08 2A 3B 3F 31 37 39 7F 39 25 31 3B 31 3F 31 32 27 7B 84 85 E4 C6 CF CB C5 C3 C5 83 D3 D8 CB C5 CB C9 9A DC CA D6 CB CF CF 93 9C 9D FC DE D7 D3 DD DB ED AB E7 FB EA EA FE AD F6 FA F0 E4 F5 A9 AA AB D6 F4 F9 FD F7 F1 FB BD F3 E0 E3 F4 E2 E4 BA BB C4 A7 87 88 8A 86 82 8A C2 82 83 82 89 92 8A 91 89 D5 D6 D7 B2 90 9D 99 9B 9D 97 D1 99 87 80 9C A5 A5 E8 BA AB BD A5 A8 B1 ED EE EF 8A A8 A5 A1 B3 B5 BF F9 AD A6 B1 BF BD BF A3 FF F8 F9 98 BA 4B 4F 41 47 49 0F 5E 58 4E 46 53 0F 08 09 68 4A 5B 5F 51 57 59 1F 4C 52 41 5A 44 58 59 59 47 1B 24 25 44 66 6F 6B 65 63 65 23 63 6D 69 74 61 61 3A 6B 77 6A 77 6B 75 72 7C 60 3E 3F 38 5B 7B 74 0E 02 06 0E 4E 1D 09 1D 0D 11 14 12 48 49 4A 29 15 1A 1C 10 10 18 5C 12 00 17 15 03 05 59 5A 5B 06 24 29 2D 27 21 2B 6D 23 20 23 2E 33 29 30 65 35 2B 3D 2B 3F 2B 35 32 3C 20 7E 7F 78 1B 3B 34 CE C2 C6 CE 8E DB DE CC C6 CA CE C6 86 D4 CD C2 D4 DA D4 CA 90 91 92 ED C0 DC D3 D4 C5 C4 DD DB ED AB E5 EC FD FC ED EA E7 F0 AE AF A8 EF ED F6 EE F4 EA E0 B0 FB FE EB FD FF E5 FC F3 BA F5 FB 8B 87 91 9A 87 9C C2 89 80 96 93 84 94 CA 90 97 9B 9F 9D 8A D0 9B 9E B2 82 96 82 90 82 9E 9B 9B EA BC A9 BA EE AC AD A3 A1 A6 AC AD A3 A3 E4 A6 B5 B5 B6 BC BD AB B9 B9 F2 A0 A5 B2 B5 B2 A7 A6 4C 5E 44 45 57 4C 43 43 4C 46 43 55 43 43 67 4A 54 55 5D 5A 4A 56 53 53 12 44 51 42 16 53 5D 46 69 64 66 67 6B 6C 78 68 66 23 64 74 63 27 70 6A 3A 6F 70 7C 3E 73 7D 7E 79 33 7F 77 36 7B 7D 76 0F 05 1B 0C 37 00 19 4D 0A 02 16 04 46 05 01 00 14 5B 1B 16 10 11 19 1E 06 16 14 51 05 02 17 16 2F 38 3B 2F 3B 23 20 34 0D 37 28 24 34 67 32 20 34 3F 37 2B 2D 7F 2B 38 20 36 70 35 3F 24 37 3A C4 C5 CD CA DA CA C8 8D C6 D6 C5 81 D2 C8 84 D1 D2 DE 98 D5 DF DC D7 9D DD D5 90 DD DF D4 D1 DB F9 EE CB E6 E0 E1 E9 EE F6 EA EF EF C1 F5 EB F0 EA F4 D9 EC EA F7 BC F2 E2 E7 F9 FE F8 E4 B4 E2 8B 98 C8 87 81 9B CC 9E 87 97 A6 80 8F 8B C4 91 95 DB 9F 9C 90 9A 8E 9C 86 96 D0 83 97 99 90 9A A7 EB B8 A6 BC BB A4 B9 B6 B3 FA EE E9 AB AB A6 BB B7 B0 B6 AD AB E6 BE 86 A1 B1 B5 B3 A5 B7 B9 43 4E 46 5D 71 46 48 4E 4E 4A 45 4F 52 78 57 40 59 49 5D 4D 4C 5A 5A 4F 57 40 58 6E 42 58 5F 50 64 6C 7A 68 60 7B 53 79 7B 73 65 40 65 64 61 76 69 4F 77 72 7B 71 4E 78 74 61 75 62 7E 43 7B 7E 0F 05 2D 11 1E 06 1E 08 11 2A 0E 22 09 09 0A 00 19 0F 11 16 10 45 5C 2E 17 07 50 23 13 11 06 10 39 23 1C 26 25 2A 22 1F 27 30 35 2D 32 67 34 37 35 2B 3D 2B 2A 36 39 2E 31 3C 34 34 35 38 30 30 8A CF C7 CC DD 8F C2 C2 D6 83 C5 D9 CF D4 D0 D7 DF DF D1 CB DB DC C8 E2 C7 C1 D9 D0 C3 C3 DC DA F8 E2 F2 E8 FA E6 E3 E3 DD E0 EF E5 E3 E3 ED F6 F9 F4 F6 F7 FB FC E8 F4 FC F4 B0 F5 FF E4 F7 FA 84 85 8D 8A 9A 86 82 8A CC CD CE C1 82 8E 97 86 95 95 96 9C 9D 8B 99 99 D2 90 9F 9F 98 92 97 81 A3 A4 A6 E9 A2 A0 BF B9 E2 82 B5 B5 A9 E7 B6 A0 B9 B8 B7 B7 BB BC A8 B4 BD BD F0 B8 A5 F7 B0 BC 59 4A 4A 45 4B 4B 6F 42 4C 4D 45 42 52 4E 4B 4B 1A 52 4B 19 50 50 48 1D 51 5C 5E 5F 53 54 40 50 6E 48 67 67 60 6A 6F 79 6B 6C 6E 21 6F 74 24 50 74 70 76 76 69 71 3C 72 60 77 75 63 36 63 6D 65 0F 24 1A 0D 0B 1D 4C 1D 03 11 01 0C 03 13 01 17 09 5B 11 0A 5E 1A 11 0D 06 0A 23 08 1B 15 1B 19 39 6B 2E 3B 21 22 6C 29 2B 25 26 24 34 22 2A 31 7A 38 37 37 30 3A 3F 29 3B 3C 3E 22 17 3B 38 3A DD 8B E6 CC D9 8F E3 EE ED F3 CC C0 C5 C2 84 EA F9 F4 98 D7 D1 CB 9C DC DE DF DF C6 D3 D3 F3 D0 FE C5 E7 E7 C8 E6 F4 E8 E6 D0 F9 EC E4 E8 E8 A5 E8 FE E9 EC FB EC E8 BD E6 FA FD F4 B6 F8 E1 E1 CA 98 91 84 8C 80 80 CD 8B 87 C0 DC C6 AB 8B 84 9E 92 96 9E DE DF 9A 8F 9D 9E CA D1 D6 83 9B CF EA EB AE A0 A0 A6 BF A5 A7 A7 E0 A7 A7 AE A8 B6 AF B8 BB BC AD AC F0 FD 90 B2 A2 A2 EC F7 F8 F5 6E 5E 5A 48 5A 46 43 43 18 03 6E 13 06 54 41 46 4F 4B 5C 58 4A 5A 7D 5E 46 5A 5F 5F 16 54 5B 40 66 6F 28 67 61 7B 2C 6F 67 23 6E 74 6A 6B 67 64 76 77 7A 78 7D 74 72 72 32 72 73 65 7F 61 71 35 05 19 0C 0C 1C 1C 4C 0C 01 17 09 17 03 47 0B 17 1E 1E 0A 51 0D 56 5C 55 1C 1C 50 01 19 04 1D 01 23 24 26 3A 6E 3F 23 3E 2B 37 29 2E 28 6F 37 6C 7A 73 78 2E 37 2B 34 7D 72 32 3E 35 76 1A 31 26 D9 CA CF CC E1 DF C9 C3 ED D1 C4 C4 D4 87 CC C4 CC DE 98 D7 D1 9F FD DE D1 DC C5 DF C2 FE D0 99 AA DB E7 FA E7 FB E5 E2 EC CA E4 A1 BB A7 C9 E0 E9 E8 F9 FE FB D0 EC F8 FC DC E2 F5 F3 E5 B4 FD 8B 9D 8D C9 80 80 CC BE 9B 8E 82 8E 8A AE 80 C9 DA AB 97 8A 97 8B 95 92 9C BA 94 D1 CB D7 B9 90 B9 B8 A9 AE AB 80 BC A8 AC 93 AF B2 AF B3 AD AA B4 FB B0 B8 A8 BA FC B3 BD F3 91 B2 B5 B8 A1 BB 5E 62 4C 05 0E 7F 43 5E 4B 57 49 4E 48 6E 40 05 07 1B 75 5C 4D 4C 5D 5A 57 7C 40 54 58 67 5B 46 63 7F 61 66 60 2F 64 6C 74 66 20 6F 69 27 57 7C 77 79 77 75 57 7B 30 3D 42 7C 63 78 62 7E 7B 7B 23 0F 48 54 4E 22 09 1E 11 02 07 04 25 0B 0B 16 1F 1F 28 16 0D 16 08 14 1D 1D 50 19 17 01 11 55 24 24 68 08 2D 2C 23 38 2C 37 09 25 6A 67 14 2A 29 32 2C 30 31 31 15 39 72 6E 70 1C 33 24 27 34 CD CE EB C5 C1 DC C9 C9 F2 CC D3 C8 D2 CE CB CB 9A D3 D9 CF DB 9F D2 D2 92 E0 C9 DC D4 D8 D8 FC EE A7 A8 D9 E1 FC E5 F9 EB EC EE C8 E2 A7 B9 A5 D7 FE EB EA FF F8 F9 DE E0 EA E0 E5 F9 D6 E7 E6 8F 9F AA 88 82 8E 82 8E 87 90 C0 89 87 91 81 C5 94 94 D8 B8 9D 9C 93 88 9C 87 B9 95 BB 92 87 86 AB AC AD 8A BC B6 BC B9 AD 82 B3 B2 A3 B3 86 A4 B6 BA B6 BA BB AC FC B5 B3 A5 B5 F1 B8 B8 F4 94 59 58 4D 5D 67 4B 6F 5F 5B 53 54 4E 67 44 47 4A 4F 55 4C 19 57 4C 1C 4F 57 42 45 58 44 52 50 15 6C 64 7A 29 43 6A 7F 7E 63 64 65 42 74 7E 74 71 75 5A 6B 6A 7B 6B 5E 7C 7E 72 7E 72 73 64 3A 35 2B 08 0B 06 1B 01 18 4D 0B 07 40 5C 46 24 05 0B 1A 0F 58 1F 17 11 18 5D 13 10 13 1E 03 19 00 55 3D 22 3C 21 6E 26 28 6D 7F 63 03 2E 28 29 21 26 2E 32 37 37 7E 31 3D 30 37 05 35 3F 32 38 26 1B CB C6 CD E0 DD E9 CD DB CD D6 D2 C8 D2 C2 E7 CA D4 D5 DD DA CA D6 D3 D3 E1 C7 D1 C5 D3 F4 C6 D0 EB FF E1 E6 E0 DB F5 FD E7 CD E1 EC E3 BD A4 A5 CC FE F6 FD F1 ED A6 BD B2 D5 F1 E7 F9 E5 FD E1 8F D1 C8 AA 81 81 82 88 81 97 89 8E 88 94 DE C5 93 95 91 8D 97 9E 90 94 88 92 84 98 99 99 DA DB E4 88 A7 A7 A0 AA AF B9 AB AC AE B2 FC E7 AD AB B3 AF B1 B8 B2 B6 A6 B8 B6 F3 A3 A4 B5 B4 B1 A6 59 4D 5D 45 42 56 5A 48 4C 47 4F 53 68 46 49 40 79 5A 56 1E 4A 1F 5A 54 5C 57 10 55 53 51 55 40 66 7F 28 6A 61 61 62 68 61 77 69 6E 68 27 6D 6B 7C 74 38 7F 71 6D 3C 6B 77 7D 74 7E 64 37 29 35 4A 0A 06 0D 4E 08 1E 02 17 13 40 5C 46 24 16 00 1B 0F 1D 59 1D 0A 0F 09 1D 1E 50 12 19 19 1A 10 29 3F 21 26 20 3C 6C 24 31 63 24 24 28 2E 21 21 7A 3D 37 2B 7E 29 39 33 36 3C 22 71 6B 77 37 3A C4 C5 CD CA DA C6 C3 C3 EB CD C6 CE E7 C3 C0 85 CE DE DB D1 D0 D6 DF DC DE 93 F3 DE D8 D9 D1 D6 FE E2 E7 E7 C7 E1 EA E2 A2 EA F3 A1 E2 E2 EA EC FF FF F6 FC E9 D1 FD F0 F7 D0 FF E3 F3 AD B4 FC 84 82 9C 80 8F 83 85 97 83 97 89 8E 88 C9 CA CB B6 94 9F 9E 9B 8D C6 DD 9B 9D 99 85 9F 96 98 9C B0 AE AC E9 BD BA AF AE A7 B0 B3 A7 B3 AB A8 BC 99 B4 AA BC E4 FF B5 B3 BB A7 B9 B0 BA BE AE B0 4E 0B 5B 5C 4D 4C 49 5E 51 45 55 4D 4A 5E 45 46 59 54 4D 57 4A 76 52 5B 5D 70 65 62 62 78 79 6A 59 52 45 4B 41 43 53 4E 4D 4D 4E 44 45 53 4D 4A 54 53 51 4A 4A 50 4E 54 51 52 5C 4E 45 4E 59 57 25 27 37 2A 21 21 22 28 21 37 29 2E 28 38 2D 21 23 14 0D 59 16 1E 0A 18 52 1E 1F 03 13 57 00 1D 2B 25 68 26 20 2A 6C 2C 21 37 29 37 23 67 27 2A 34 35 3D 3A 2A 36 33 33 7E 73 29 3E 23 77 27 3D C5 DE C4 CD 8E DC DC C8 C1 CA C6 D8 86 C4 CB CB D4 DE DB CD D7 D0 D2 F4 D6 93 C0 D0 C4 D6 D9 D0 FE EE FA A9 FA E0 AC EA E7 F7 A0 F2 FF EA E6 EA F6 E8 E1 F4 FC F0 F0 D4 FC F5 FF E3 F3 E6 E1 F0 99 9F B8 88 9C 8E 81 88 96 86 92 92 BF 88 91 C5 97 8E 8B 8D DE 8C 8C 98 91 9A 96 88 D6 A5 9B 9A BE EB A7 BB EE BA A2 A9 A7 B1 AC A8 A3 B5 9D AA AF FB B0 B8 A8 BA FC B0 BD A1 B5 F1 A2 BF B5 BB 0A 44 46 4C 0E 4E 4F 59 4B 55 45 01 45 48 4A 4B 5F 58 4C 50 51 51 10 1D 4B 5C 45 11 45 5F 5B 40 66 6F 28 7A 7E 6A 6F 64 64 7A 20 62 69 69 6A 60 79 6F 71 76 70 56 78 3D 62 72 62 70 7B 72 60 70 18 4B 1C 06 4E 08 09 19 42 05 15 15 13 15 01 45 19 14 16 0D 0C 1E 1F 09 01 26 1E 15 13 05 18 1C 2F 39 01 2D 1D 2A 3E 24 27 0A 24 0E 34 23 21 37 7A 2E 28 3D 3F 2B 39 12 20 37 35 23 76 25 31 38 C5 DD CD C6 DC CB C9 DF F6 DA D0 C4 EF C3 FD CA CF 9B D0 D8 C8 DA 9C D0 DD C1 D5 91 C2 DF D5 DB AA E4 E6 EC AE EE EF F9 EB F5 E5 A1 E5 E8 EA EB FF F8 EC F0 F1 F1 B0 BD EB FC E5 B1 E5 FF FB E0 86 8F C8 9A 9E 8A 8F 84 84 9A C0 82 89 89 8A 80 99 8F 91 96 90 B6 98 DD 82 92 82 90 9B 92 80 90 B8 EB BC A6 EE A8 A9 B9 E2 8C B2 A5 A3 B5 90 BC AA BE 96 B6 FE B2 BD A9 B1 BB B9 BF B1 F7 B7 BA 44 45 4D 4A 5A 46 43 43 76 51 41 45 43 09 04 6A 48 5F 5D 4B 1E 56 52 5B 5D 09 10 52 57 59 13 41 2A 6D 61 67 6A 2F 63 7F 66 66 72 4E 74 63 61 77 3A 73 71 6A 6A 70 6E 64 41 67 7F 61 45 63 7B 65 26 02 05 00 1A 3B 1E 43 11 17 0F 11 2B 06 16 0E 1F 0F 0A 1C 0F 0A 19 0E 06 01 15 00 03 12 07 01 39 0A 24 25 21 38 6C 2A 30 2C 35 31 66 28 36 21 3F 29 2B 36 2C 3B 39 2F 21 2A 3D 33 39 3B 27 19 C3 D8 DC E7 CF C2 C9 DE DB CE C2 CE CA D4 CA C0 CD E8 C1 D4 DC D0 D0 CE FE DA C3 C5 F8 D6 D9 D0 C8 F9 E9 E7 EA E6 E2 EA C7 EE F5 ED E7 F3 EB F7 D7 FA EA F2 FB EB BC CF F7 E3 FC F0 EF C3 E6 F4 8E 82 86 8E CE BC 85 80 97 8F 81 95 89 95 B6 80 8B 8E 9D 8A 8A DF 8E 98 98 96 93 85 93 93 D4 91 BF AE E8 BD A1 EF B8 BF A3 A7 A9 AF A1 E7 B4 B7 B5 AF BD BA AA B6 B3 B3 F2 A0 A9 A2 A2 B2 B9 FB 0A 68 40 4C 4D 44 0C 54 4D 56 52 01 55 42 50 51 53 55 5F 4A 1E 17 7B 58 5C 56 42 50 5A 17 47 50 7E 7F 61 67 69 7C 2C 20 3C 23 54 73 67 63 6D 6B 7D 3B 68 6B 71 6B 79 7E 66 7A 7F 7F 3F 54 2E 49 2D 02 1C 05 0F 0D 41 3F 17 0D 0E 04 14 3B 06 10 13 17 1C 0A 22 4D 1F 25 47 31 3E 3D 26 2B 44 29 29 27 21 2C 20 3B 10 39 27 31 2D 28 28 26 28 19 3E 3E 2E 3C 32 30 2C 30 37 3D 24 0D 14 22 27 3C C4 CE DB DA E2 CE D5 C8 D0 FF F4 D3 C7 C3 CD CB DD EB D4 D8 CA D9 D3 CF DF 9D F2 C4 C5 DE DA D0 F9 F8 C4 E8 F7 EA FE D1 C1 EC F2 E4 A8 E4 F7 CA E8 FF FD EB BE ED F9 EC E7 F6 E3 E5 B6 E5 F1 FF 8F 88 9C 8C 8A CF 88 98 87 C3 94 8E C6 C0 A7 8A 94 9D 91 8B 93 DF 88 8F 93 97 99 9F 91 D7 9B 9B EA B9 AD A8 A2 EF AF A2 AC AD A5 A2 B2 AE AB AB FA AC B1 AD B6 FF AE A8 BC BD B9 BF B1 F7 A7 BC 47 5E 44 48 5A 40 5E 0A 02 50 45 55 52 4E 4A 42 14 1B 7B 51 5B 5C 57 1D 4B 5C 45 43 16 44 51 41 7E 62 66 6E 7D 2F 24 4A 67 6D 65 73 67 6B 24 76 7F 6F 6C 70 70 78 6F 3D 3F 2D 30 52 79 79 72 7C 18 06 09 1D 07 00 02 1E 42 45 40 36 07 15 0A 0C 14 1C 0B 50 17 0C 3D 1E 06 1A 06 14 12 16 00 10 25 3B 2D 27 01 29 2A 3E 27 37 23 2D 29 34 21 0A 3C 3D 2B 3C 2A 3B 3D 24 21 3C 20 34 38 03 3D 38 CF C8 C4 C6 DD CA F8 C4 CF C6 C9 C5 C5 C8 CA CB DF D8 CC D0 D1 D1 F5 D9 D7 CB D3 D9 D7 D9 D3 D0 C3 EF FB F0 E3 ED E3 E1 CB E7 E3 EE E8 F3 E5 EC F4 FE EA D0 FA EB F5 F0 F7 C9 FF FF F3 E3 FD F8 8F B1 87 87 8B A6 82 8B 8D 90 85 92 95 8E 8B 8B 89 93 97 95 97 9B 9D 84 81 80 95 82 85 9E 9B 9B 89 A4 A6 BD AF A6 A2 A8 B0 B0 A1 B2 B5 AE A3 AB B7 BE B6 AD AD 9C BD B3 B2 A7 F0 B7 BF B9 B0 F5 4B 4C 4F 5B 4B 48 4D 59 4B 4C 4E 01 51 4E 50 4D 1A 48 48 5C 5D 56 5A 54 57 57 10 5F 57 5A 51 15 59 7F 69 7B 7A 2F 7C 7F 6D 60 65 72 75 6E 6A 62 34 35 36 39 45 4C 68 78 62 33 3E 3F 38 37 4F 48 50 4B 3B 1D 0B 1F 4C 43 42 22 07 06 14 02 03 04 0E 12 17 17 5E 17 15 0E 06 1C 02 08 58 59 5A 55 39 24 3D 3B 2D 2A 6C 25 2B 30 34 2E 34 3E 64 26 35 2E 36 2D 7E 71 7C 1C 35 34 22 34 31 36 20 3C C5 C5 88 C1 C7 DC D8 C2 D0 DA 80 C7 CF C9 CD D6 D2 DE DC 97 9E E4 F5 C9 D7 DE C3 91 D5 D8 C1 DB FE B1 A8 A9 FE FD E3 EE E7 F0 F3 E4 E2 A9 D0 EC F9 F0 C8 EB F1 FC F9 EE E1 FA FE F6 B6 F1 FD FB 83 98 80 8C 8A C1 CC B6 B6 8C 94 80 8A C7 94 97 95 98 9D 8A 8D 96 92 9A D2 87 99 9C 93 CD D4 D5 B9 E5 E8 9D A1 BB AD A1 E2 B3 B2 AE A5 A2 B7 B6 BF BF F8 B0 AA BA B1 AE E8 F3 FE F1 84 B2 A7 A0 46 5F 08 48 49 48 5E 48 45 42 54 44 42 07 4D 51 5F 56 4B 03 1E 7C 5D 53 15 47 10 57 5F 59 50 15 63 65 6C 60 6D 6E 78 62 70 23 77 68 72 6F 24 62 73 6D 7D 77 3E 71 7D 70 77 50 71 7F 76 63 34 73 03 05 0C 49 0F 08 0B 1F 07 04 01 15 09 15 44 03 15 09 58 0A 1B 13 19 1E 06 16 14 51 06 16 06 14 27 2E 3C 2C 3C 3C 27 28 3B 15 21 2D 33 22 64 28 2F 28 2C 79 3C 3A 7C 3A 20 36 31 25 33 25 74 21 C2 CA C6 89 9E DF C9 DF CB CC C4 EC D3 CB D0 CC CA D7 D1 DC CC EA D2 D6 DC DC C7 DF 96 D5 D5 C6 EF AB F8 EC FC E6 E3 E9 C1 B9 DC C6 EF F3 E8 E4 F8 B6 CA EC F0 F1 F9 EF CE F1 E5 F8 FA F3 E7 C9 D8 88 B0 DC AC A1 A0 BD BE D3 BC 82 8A 8E 81 8B 8E A7 8C 9C 8C 92 95 93 93 9F AC 95 93 81 91 99 A5 BB A5 AC A0 BB 90 8F B7 B0 A9 AF A3 B4 B7 89 BB A2 BD AB 82 8B AE BC B6 BA BE B6 86 BB B5 A1 4C 44 5A 44 00 6D 59 5E 4B 4D 45 52 55 6B 45 5C 5F 49 64 71 57 4C 48 52 40 4A 6C 61 53 45 5D 5A 6E 25 6B 7A 63 47 48 5A 5B 41 61 72 63 57 61 77 73 74 7C 49 7B 6D 75 72 76 5E 65 7D 62 7E 64 79 13 0E 1A 20 00 1F 19 19 42 13 01 13 07 0A 01 11 1F 09 0B 3A 44 23 3B 14 06 1F 11 13 5B 25 01 1B 24 2E 3A 15 2C 3A 25 21 26 30 1C 73 25 1F 71 07 14 17 08 05 6E 03 3F 31 3B 36 3E 25 0A 23 31 27 C7 C2 C6 C8 C2 F3 C8 C8 D4 C6 CC CE D6 CA C1 CB CE E7 FA CC CD D6 D2 D8 C1 C0 FC D0 CF D2 C6 E9 DE F9 E9 ED E7 E1 EB DD EE E2 F4 E7 E9 F5 E9 AB D8 EE EB F0 F0 FA EF EE DE F2 E9 F4 E4 CB D9 FA 8E 9E 84 8C 9D B3 A9 95 87 80 95 95 8F 88 8A A0 94 8F 91 8D 87 D1 9F 8E BB 9D 80 84 82 A7 95 87 AB A6 AD BD AB BD BF ED EF E3 B0 A0 B4 A6 A9 A0 AE BE AA F9 FC FD FC BC BE A1 B5 B0 B2 AE F4 B0 52 42 5B 5D 5D 7C 4F 5F 4B 53 54 6A 43 5E 6D 4B 59 54 4A 4B 5B 5C 48 1D 5E 56 5E 56 42 5F 14 5A 6C 2B 5E 68 7C 66 6D 63 76 70 2E 21 4F 73 24 68 6F 68 6C 39 7C 7A 3C 78 64 76 7E 31 3E 7C 71 6C 4A 46 48 1F 0F 03 19 08 42 13 01 08 14 14 4D 28 1F 16 1A 1C 0C 5F 08 04 02 16 50 1C 03 04 00 55 28 2E 68 00 0D 20 21 3D 23 31 21 23 2A 22 0B 27 30 3E 3B 2D 2D 7F 28 24 22 36 70 3E 30 77 02 34 D8 C2 C9 C7 DA DC 82 8D EB D7 80 CC D3 D4 D0 85 D8 DE 98 F0 FD D0 D1 CD D3 C1 D1 D3 DA D2 E2 D4 F8 E2 E9 E7 FA FC AC E4 F6 E6 ED A1 E2 E8 E1 F6 BA F5 F7 ED BE EB F4 F8 B2 E0 F1 FC F3 B7 E0 EC 9A 8E C8 9D 86 8E 98 CD 83 97 94 93 8F 85 91 91 9F 9F D8 9A 92 9E 8F 8E D2 9E 95 9C 94 92 86 DB EA 82 BC E9 A3 BA BF B9 E2 A1 A5 E1 88 A8 B0 E5 A9 AE A8 A9 B1 AD A8 B8 B6 F3 B9 BF A6 A2 A0 F5 5A 4A 5A 48 43 4A 58 48 50 03 54 58 56 42 04 0D 53 55 5C 50 5D 5E 48 52 40 7A 5E 55 5F 54 55 41 65 79 28 60 7D 2F 6D 61 70 66 61 65 7F 27 65 61 7E 7E 7C 55 77 71 79 5B 7D 61 7D 70 62 63 71 71 3C 0A 04 1C 0B 20 1E 09 07 11 13 29 0F 14 10 0A 08 02 2A 1C 0F 0A 19 0E 06 23 11 03 17 1A 11 01 2F 39 3B 2F 3C 20 21 39 2D 17 32 20 22 22 37 0D 33 28 2C 36 2C 26 0E 38 23 26 35 22 22 07 35 27 CB C6 CD DD CB DD DF CB CD D1 C3 C4 F4 C2 C8 CA DB DF F7 F8 CB CB D4 EF D7 C0 C5 DD C2 F2 DA D6 F8 F2 F8 FD EB EB DE E8 E4 F1 E5 F2 EE D3 EB EE FF F5 CD EA FB CC FD EB F7 F7 C4 FE FD F2 FA E6 A6 82 86 82 BA 8A 94 99 B2 82 93 92 91 88 96 81 B2 94 94 9D 9B 8D AC 9C 81 80 87 9E 84 93 A7 94 BC AE 98 A8 BD BC BB A2 B0 A7 B4 B3 A7 A3 A5 A7 B6 BE 8B A0 B3 BD B3 B1 A3 A6 BF A5 B3 A4 87 AC 47 49 47 45 5A 46 4F 46 6A 4A 53 55 49 55 5D 76 43 56 5A 56 52 52 55 53 47 47 55 79 5F 44 40 5A 78 72 5B 70 63 6D 63 61 66 62 79 49 6F 74 70 6A 68 62 4B 60 73 7D 73 71 64 7C 7C 64 7B 72 55 7B 0B 07 11 1A 07 1C 3F 14 0F 01 0F 0D 15 1E 09 07 15 17 35 18 0E 0C 05 10 10 1C 1C 3C 17 07 3D 11 1E 39 29 2D 2F 2D 20 28 11 3A 2D 23 29 2B 17 3C 37 39 37 35 7E 32 3D 2D 72 35 3F 23 76 77 35 39 D8 CE C9 CD D7 8F C9 D5 CB D0 D4 D2 F2 D5 C5 C1 DB D9 D4 DC 9E DE D2 D9 92 C2 C5 DE C2 D2 C7 95 F9 F2 E5 EB E1 E3 AC EC F0 E6 A0 F5 EE E2 A4 F6 FB F6 FD B7 BE D2 FD ED E2 FA FE F6 B6 FE E7 B5 8C 84 9A 8B 87 8B 88 88 8C C3 94 8E C6 8E 90 96 9F 97 9E AD 8C 9E 98 9C 90 9F 95 D1 97 99 90 D5 BE A2 AB A2 BD EF A4 A4 B1 B7 AF B3 BF E7 B7 BC B7 B9 B7 B5 FE BE AE B8 F2 A7 B8 B4 F6 A4 B5 B8 4F 05 08 64 4F 5F 5C 44 4C 44 00 48 55 07 42 4A 48 59 51 5D 5A 5A 52 1D 46 5C 10 58 42 44 51 59 6C 5F 7A 68 6A 6E 6E 61 67 23 61 6F 62 27 69 6C 74 6E 6C 7C 6D 3F 74 74 61 67 7F 63 6F 37 67 6C 07 09 07 05 4E 0E 1E 08 42 17 08 04 46 14 05 08 1F 55 58 34 1F 0F 0C 14 1C 14 50 18 05 57 12 1A 38 29 21 2D 2A 2A 22 6D 36 2C 60 28 32 34 21 29 3C 0F 2A 38 3A 3E 3E 31 37 73 31 3F 32 77 30 34 D3 D8 88 C1 C7 DC D8 C2 D0 DA 80 D2 DF CA C6 CA D6 9B D9 CB DB 9F C8 D5 D7 93 C3 D0 DB D2 9A 95 C7 EA F8 F9 E7 E1 EB AD EB F0 A0 E7 E9 F5 E6 EC FE FF FD F7 BE EB F3 BD FB E7 E3 F4 FA F1 C0 E7 8B 8F 89 8B 82 8A CC 8C 8C 87 C0 97 89 8B 91 88 9F DB 99 97 9F 93 85 8E 9B 80 D0 82 8F 9A 96 9A A6 EB A9 BB AB EF B8 A5 A7 E3 B3 A0 AB A2 EA E5 97 BA A8 A9 B7 B1 BB FD BB A0 F0 B7 B9 A5 B6 BC 4E 4F 4D 47 0E 5B 43 0D 4B 57 53 44 4A 41 04 08 04 1B 61 56 4B 1F 54 5C 44 56 10 5F 59 43 14 45 65 78 7B 60 6C 66 60 64 76 7A 20 75 69 27 67 77 7F 7A 6C 7C 3E 6C 65 70 70 7C 7C 62 36 7A 75 65 1A 02 06 0E 4E 0D 09 0E 03 16 13 04 46 0E 10 45 1D 14 0C 59 0A 10 5C 1E 1B 01 13 1D 13 57 07 0C 27 29 27 25 3D 6F 21 2C 32 33 29 2F 21 67 6C 16 23 36 3A 36 32 1E 3F 3E 3D 26 3E 25 06 36 3D 27 F9 D2 C5 CB C1 C3 8C 90 82 8F 80 E0 C5 C4 CB D0 D4 CF 98 84 9E EE C9 DC DC C7 DF C6 D3 C5 76 1C AA DA FD E8 E0 FB E3 FA E7 F1 A0 CD CA C4 A8 A5 A8 AB A9 A1 B0 BF DD F1 FE B3 E2 F8 F1 FF E0 E6 CA 99 8D 9A 8B 9D 9A 88 86 8B 94 95 96 94 DE CA D5 8A 8D 98 90 8B 93 8A 97 81 DE 92 99 9A DB 85 B8 A2 BE A8 AD B6 A4 B9 B6 B3 B3 FB E9 E8 B3 B2 AD F5 A9 AC BF B1 A8 B2 A5 B6 A2 FF B5 B8 B9 FA 5E 4E 5A 44 5D 02 43 4B 0F 56 53 44 4E 53 50 55 49 01 17 16 4F 4A 5D 53 46 5C 47 54 44 19 57 5A 67 24 60 7D 7A 7F 7F 37 2D 2C 76 33 28 7D 6B 75 73 76 36 7A 71 72 33 6A 7B 77 77 74 62 38 78 7C 1C 0E 0B 01 0F 1B 42 05 16 0E 0C 5E 07 17 0D 3A 19 1A 14 15 0D 42 59 48 30 56 45 35 50 1F 1B 06 3E 25 29 24 2B 72 3D 38 23 2D 34 2E 31 22 36 6B 39 34 35 7F 35 3A 25 60 67 04 1E 35 1B 27 63 67 9D E8 DF E8 CC F7 EA E2 ED F9 D4 DB EA C8 EF D5 E2 CF 81 F2 E6 C9 F4 FB 94 DF D1 DF D1 8A D1 DB AC E3 FC FD FE FC B6 A2 AD F6 F0 E5 E7 F3 E1 F6 B4 EA ED F8 F0 EB F3 EA F7 E1 BE F2 F9 FA BB C4 9F 8A 86 9D 81 98 89 9F 8A 97 94 91 95 DD CB CA 8B 8E 99 97 8A 90 8B 98 80 DD 93 9E 9B D8 84 87 A3 A8 A1 A7 A9 A7 B8 B9 B2 B0 FA EE E9 A6 A7 A6 B5 AE B6 AD AD F1 AD A8 B3 BD A4 BE A1 B2 A6 FB 49 44 45 7E 4B 0F 44 4C 54 46 00 52 43 53 04 50 4A 1B 4C 51 5B 1F 58 58 54 52 45 5D 42 17 40 47 6B 6F 61 67 69 2F 69 63 74 6A 72 6E 68 6A 61 6B 6E 3B 7E 76 6C 3F 65 72 67 33 67 78 62 7F 34 57 03 05 09 07 0D 0A 4C 24 0C 05 0F 41 0B 08 00 00 54 47 1A 0B 40 43 1E 0F 4C 2A 1F 04 56 1A 15 0C 6A 28 27 27 20 2A 2F 39 62 37 2F 61 34 22 25 29 7A 39 2A 36 35 3A 2E 7D 25 3B 35 3F 76 2E 3B 20 8A CA DA CC 8E DD C9 CC C6 DA 80 D5 C9 87 D7 D1 DB C9 CC 99 CA CD DD D9 DB DD D7 9F F5 D8 C1 D9 EE AB E6 E6 FA AF E0 E2 E3 E7 A0 F3 E3 F6 F1 EC E8 FE FC B9 FF EC EF F8 FF F1 FC E8 B6 F6 E1 E1 85 86 89 9D 87 8C 8D 81 8E 9A C0 AF 87 8A 81 DF DA DB AA 9C 8F 8A 99 8E 86 9A 9E 96 B7 84 87 90 A7 A9 A4 B0 F4 EF 8E A4 AC A7 A9 AF A1 E7 B6 A0 BE B2 AA BC BD AB FC AA B3 A0 F0 B0 A6 A7 B8 BC 4F 4F 08 5D 41 0F 62 4C 4F 46 1A 01 06 75 41 41 53 49 5D 5A 4A 6F 5D 49 5A 09 10 7F 57 5A 51 15 69 6A 66 29 60 60 78 2D 60 66 20 64 6B 77 70 7C 4E 73 7D 39 77 6B 79 70 32 64 79 65 7E 37 67 74 07 0E 48 07 0F 02 09 4D 03 0F 12 04 07 03 1D 45 1F 03 11 0A 0A 0C 29 56 3C 12 1D 14 56 14 1B 00 26 2F 68 2A 21 21 38 2C 2B 2D 33 7B 66 0A 25 2C 36 1D 2A 36 33 1E 38 39 20 36 23 22 76 3E 27 75 C4 DE C4 C5 8E C0 DE 8D C7 CE D0 D5 DF D3 C1 DD CE 94 C8 D5 DF D6 D2 81 F0 E1 8E BB 8A F5 E6 8B AA CE E5 EB EB EB E8 E8 E6 A3 E9 EC E7 E0 E1 A5 A6 F2 F5 FE BE EC EE FE AF F0 F9 F5 AC F4 FB F8 9A 8A 86 90 82 80 8B 82 DC DF A2 B3 D8 93 81 9D 8E D4 90 8D 93 93 9F 92 9F 83 91 9F 8F 9B 9B 92 A5 98 AD BD BA A6 A2 AA B1 8E A1 AF A7 A0 A1 B7 F4 96 B9 B0 B2 8C B9 AF A4 B6 A2 FF 9B B6 BD B9 7F 58 4D 7A 7D 63 6F 42 4C 4D 45 42 52 4E 4B 4B 6F 48 5D 19 6D 6C 70 1D 51 5C 5E 5F 53 54 40 5C 65 65 5B 6C 7A 7B 65 63 65 70 4D 60 68 66 63 60 68 35 55 78 77 73 4F 78 60 65 75 63 38 5A 75 7C 06 27 07 0E 07 01 2D 18 16 0B 05 0F 12 0E 07 04 0E 12 17 17 5E 13 13 1A 1B 1D 23 14 02 03 1D 1B 2D 38 05 28 20 2E 2B 28 30 6D 0D 20 2F 2B 17 20 28 2D 3D 2B 70 12 3D 34 3E 03 31 22 25 20 3B 27 CE EA DD DD C6 CA C2 D9 CB C0 C1 D5 CF C8 CA 85 CA DA CB CA C9 D0 CE D9 E1 D6 C4 C5 DF D9 D3 C6 C7 EA E6 E8 E9 EA FE A3 CF E2 E9 ED D5 E2 F6 F3 FF E9 B6 D4 FF F6 F0 CE DF C7 C0 C2 F3 E5 E2 F0 98 BF 81 84 8B 80 99 99 B1 AE B4 B1 C6 94 81 97 8C 9E 8A D9 8A 96 91 98 9D 86 84 DD D6 9A 87 A6 AF BF BC A0 A0 A8 BF 80 A3 AD A1 A6 A3 B5 EA 88 BB B2 B4 8A BB AD AA B8 A0 FD 9D B0 BF BB 87 98 7E 7B 7B 4C 5C 59 49 5F 71 6E 74 71 06 54 41 57 4C 5E 4A 6A 5B 4B 48 54 5C 54 43 7C 57 59 55 52 6F 79 26 44 6F 66 60 5E 67 71 76 64 74 29 49 64 73 77 4B 54 4A 4F 4C 72 60 67 43 5C 42 47 34 65 05 19 1C 39 0F 06 1E 2E 0D 0F 0F 13 25 08 08 0A 08 4A 3B 16 12 10 0E 4F 21 0A 1D 13 19 1B 07 55 26 22 3B 3D 6E 21 2D 20 27 63 23 20 28 67 2A 2A 2E 7B 3A 3C 7E 3A 31 2D 26 2A 03 30 3B 32 74 26 D3 C6 CA C6 C2 DC 8C C1 CB D0 D4 81 C8 C6 C9 C0 9A DA D4 CB DB DE D8 C4 92 D6 C8 D8 C5 C3 9A 95 C5 F9 EC EC FC AF C5 E9 B8 A3 A0 D3 E3 F6 F1 E0 E9 EF D1 FD A4 BF C8 EF F3 F7 F9 FF F1 B7 FB E5 8F 99 89 9D 87 80 82 CD 90 86 93 94 8A 93 C0 B3 95 97 8D 94 9B DF 9D 93 93 9F 89 82 9F 84 D4 96 AB A7 AB BC A2 AE B8 A4 AD AD E0 A7 B4 A8 A9 E5 AE B2 BB B2 AD FF B4 B4 A1 A7 BF A3 AF F7 BD A6 0A 45 47 5D 0E 4E 40 41 4D 54 45 45 06 41 4B 57 1A 1B 59 5B 51 4D 48 58 56 1D 10 62 4F 5A 56 5A 66 2B 35 29 61 7F 78 64 6D 6D 55 6F 62 62 76 69 73 7E 6A 50 6A 7A 71 5C 71 67 79 7E 78 56 73 72 18 0E 1B 1A 01 1D 2A 01 03 04 23 00 0A 04 11 09 1B 0F 17 0B 44 5F 3D 11 17 01 04 34 18 16 16 19 2F 2F 01 3A 0D 20 20 22 30 2A 2E 26 07 2B 21 37 2E 1D 31 35 2A 3A 2E 1C 3E 36 22 25 18 32 31 31 E9 C4 C6 CF C7 DD C1 F9 D0 C2 C4 C8 C8 C0 E1 DD CA D2 CA DC FB C7 CC D4 C0 CA E4 D8 DB D2 D0 D1 C7 C6 F1 F0 F7 F6 AC C5 CA B9 ED EC BC F4 F7 AB FC FD FE FF F8 F9 CE F8 E2 F6 F1 E5 D7 FB F1 E7 9E AA 8B 9D 87 80 82 9E B0 86 90 84 87 93 A9 84 82 B8 97 8C 90 8B AE 98 82 96 91 85 A6 92 86 9C A5 AF 85 A0 A0 BA B8 A8 B1 90 A5 A0 B4 A4 AC 84 B6 BE AA AD 97 9B 9F B2 BC B7 B9 A5 BF B8 BA 92 58 44 5D 59 5D 6E 4F 59 4B 4C 4E 52 65 48 4A 41 53 4F 51 56 50 4C 69 53 56 56 56 58 58 52 50 66 73 66 6A 66 62 20 4E 78 71 6A 6E 64 75 74 4B 67 70 7E 7B 6D 57 71 7A 72 53 70 73 7E 63 79 60 3A 28 1E 1B 00 00 0A 1F 1E 2D 01 0A 04 05 13 2D 0B 1C 14 31 0A 2D 1A 10 18 11 07 15 15 35 18 19 18 23 38 3B 20 21 21 0D 3F 20 2A 34 33 27 20 21 16 23 36 3A 36 32 0B 35 30 37 15 22 30 3B 32 17 3A C4 CD C1 CE C7 DB C9 C0 F6 CA C3 CA 86 8A 84 F1 D3 D8 D3 99 93 9F 8D C9 DB D0 DB C2 E2 DE D7 DE AA E9 E9 FB FD CC E0 F8 F1 F7 E5 F3 C5 F2 F7 F1 F5 F6 DB F6 F2 F0 EE D1 F7 E5 F5 FD DF E4 D7 FD 8F 88 83 8C 8A BB 89 95 96 A0 8F 8D 89 95 A6 84 99 90 9F 8B 91 8A 92 9A B1 9C 9C 9E 84 B4 9B 99 A5 B9 9B BD B7 A3 A9 9A AB B7 A8 82 A9 AB AB B7 89 AF A1 B5 BB 88 B5 B9 A6 BB 93 BE BA A2 B9 BB 69 44 46 4D 47 5B 45 42 4C 6A 54 44 4B 64 4B 4B 5E 52 4C 50 51 51 68 44 42 56 73 5E 58 53 5D 41 63 64 66 5F 6F 63 79 68 41 6C 6C 74 6B 69 35 4A 7C 7D 6B 7C 6A 5C 73 71 67 7E 7E 23 59 71 72 66 0F 1F 2B 06 02 1A 01 03 50 31 01 0F 01 02 37 00 16 1E 1B 0D 11 0D 2E 1C 1C 14 15 25 0F 07 11 30 24 2F 07 2F 28 3C 29 39 04 31 2F 2C 12 28 02 2C 38 34 36 38 3D 3C 35 11 37 25 35 3D 1A 32 22 30 C6 FE DB CC ED DA DF D9 CD CE E9 D2 E3 C9 C5 C7 D6 DE DC FA DF CF C8 D4 DD DD F6 DE D8 C3 F7 DA E6 E4 FA CA EF FF F8 E4 ED ED C6 EE E8 F3 C2 E4 F7 F2 F4 E0 D0 FE F1 F8 D1 F2 E0 E5 FF F8 FA D3 85 85 9C BA 87 95 89 BD 8D 8A 8E 95 AA 8E 8A 80 B5 8B 8C 90 91 91 8F AA 9B 87 98 B2 9E 92 97 9E 88 A4 B0 9E A7 BB A4 83 B7 AE A5 B3 AF A4 93 AC AE B3 9B B6 B2 B0 AE 9B BD BD A4 9C B7 AF BD B8 5F 46 7F 40 4A 5B 44 61 4B 4D 45 72 52 5E 48 40 68 48 4B 70 4A 5A 51 4E 60 40 43 62 53 43 40 5C 64 6C 7B 4B 7B 7C 65 63 67 70 73 21 48 62 73 76 3A 49 7D 6C 6A 7A 6E 6E 7A 67 64 61 2C 38 3B 73 0F 0E 0C 1A 40 1D 09 18 16 06 12 12 48 04 0B 08 55 09 1D 0C 0A 1A 0E 0E 5D 11 05 02 1F 19 11 06 39 25 2D 3E 3D 0D 0E 0E 62 16 0B 29 32 33 34 7F 75 74 3E 3C 3B 3B 2F 73 30 31 33 38 78 34 3B 7B DF C0 87 C7 CB D8 DF 82 D6 C6 C3 C9 C8 C8 C8 CA DD C2 97 CB CD CC 92 C5 DF DF 8F D4 D2 DE C0 DC E5 E5 B5 FC E5 C2 ED FF E9 E6 F4 F1 F3 EB F7 E0 F2 EF EC E9 A4 B0 B3 FB F7 F6 F4 E2 B8 FA F5 E7 81 8E 9C 9E 8F 9B 8F 85 CC 80 8F 8C C9 8A 85 97 91 9E 8C 8E 9F 8B 9F 95 DD 9E 91 83 9D 92 80 85 BF A7 BB AC E1 9D BF BE 8B B7 A5 AC 8F B4 85 A6 AE B2 AE BC 8B AD B0 B8 BC B2 B2 BD B3 B3 97 EF 76 6C 41 5D 42 4E 4E 00 70 56 4E 4F 43 55 78 47 4F 52 54 5D 4D 63 0E 5E 6A 06 72 7F 7A 67 68 05 56 68 64 60 6B 61 78 51 76 66 72 6C 6F 69 65 69 46 7F 7D 6F 7B 73 73 6D 7F 76 7E 65 4A 55 61 66 03 05 0D 1A 1D 23 0D 14 07 11 3C 35 14 06 00 0C 14 1C 28 15 1F 0B 1A 12 00 1E 5E 33 03 04 1D 1B 2F 38 3B 05 2F 36 29 3F 1E 16 34 28 2A 34 18 11 28 3A 3C 30 30 38 0C 2F 3D 27 35 32 22 3E 3B 3B F6 FF DA C8 CA C6 C2 CA F2 D1 CF D5 C3 C4 D0 CA C8 95 DB CA CE DA CE D4 DD D7 DC D8 DB DE C0 FA F8 EF ED FB FD AF E0 E4 EF EA F4 D2 E3 F3 F0 EC F4 FC EB D4 FF F1 FD FA F7 E1 BE C5 E4 F6 F0 FC 84 8C B8 9B 81 9B 89 8E 96 8A 8F 8F C8 A8 96 81 9F 89 8B B5 97 92 95 89 93 87 99 9E 98 D9 A4 90 B8 A2 A7 AD 9D AA B8 B9 AB AD A7 B2 8B A6 AA A4 BD BE AA F7 8A AD BD B9 BB BD B7 81 A4 B8 A0 B0 49 5F 41 46 40 01 63 5F 46 46 52 52 6A 4E 49 4C 4E 5A 4C 50 51 51 12 71 5B 5E 59 45 75 42 46 47 6F 65 7C 59 6F 7B 64 5E 6D 76 6E 65 4F 73 61 68 69 6F 77 6B 7F 78 79 59 73 67 71 42 62 78 66 74 0D 0E 48 00 1D 4F 08 04 11 13 0F 12 03 03 2B 31 2A 33 17 15 1A 1A 0E 32 26 23 26 10 1A 02 11 36 25 25 2C 20 3A 26 23 23 06 22 34 20 09 37 21 37 3B 35 3C 68 11 2F 39 2F 33 3D 34 63 15 38 3A 31 C3 DF C1 C6 C0 E6 D8 C8 CF D0 EF D1 C3 D5 C5 CB DE F8 CD CA CA D0 D1 EE C6 C1 D9 DF D1 F8 C4 D0 F8 EA E6 ED CD FA FF F9 ED EE D3 F8 EB E5 EB E9 D5 EB FD EB FF F1 F8 DE E7 E0 E4 FE FB D3 F5 E1 8F A4 98 8C 9C 8E 82 89 A1 96 93 95 89 8A A5 86 99 94 8D 97 8A B0 8C 98 80 92 9E 95 B5 82 87 81 A5 A6 9B AC A2 AA AF B9 AD B1 8F B1 A3 B5 A5 AB BE 94 BA B3 BB BC A8 8D A0 BC A0 B4 A4 A3 AD 9A 5A 4E 5A 48 40 4B 63 4F 48 46 43 55 76 55 4B 55 5F 49 4C 40 6D 5A 50 58 51 47 5F 43 65 43 55 47 7E 2B 7A 6C 7D 7B 63 7F 67 23 72 64 60 75 61 76 72 3B 6C 76 75 7A 72 5B 73 7A 7C 74 72 37 60 7A 4A 19 0D 1A 1A 00 1E 08 42 13 12 04 10 0E 0B 10 09 5B 0B 1C 0D 0C 15 12 1C 5D 4C 33 24 49 24 19 2F 2A 3B 2C 6E 23 23 2A 2B 2D 60 20 21 26 2D 2B 74 1D 39 30 32 7F 28 32 72 37 35 32 24 2E 24 21 8A E4 E9 FC FA E7 8C DF C7 D0 D4 CE D4 C2 84 D1 D5 D0 DD D7 FB D1 D8 9D C0 D6 C3 C5 D9 C5 D1 95 F8 EE EE FB EB FC E4 AD F6 EC EB E4 E8 C6 F1 F1 F2 F4 EA F0 EA E6 BC C8 C0 DF B0 F9 F7 E4 B4 FB 85 9F C8 8F 81 9A 82 89 A4 82 89 8D C6 93 8B C5 99 94 96 97 9B 9C 88 DD 86 9C D0 9E B7 82 80 9D EA F1 E8 8F AF A6 A0 ED B6 AC E0 A6 A3 B3 E4 B0 A9 BE AA F9 B7 B1 BA B2 F2 E9 F0 9D BF B4 B1 BB 49 4E 08 5A 4B 5D 5A 44 41 46 00 74 74 6B 04 4D 5B 48 18 57 51 4B 1C 5B 5D 46 5E 55 70 56 5D 59 6F 6F 28 7D 61 2F 6F 62 6C 6D 65 62 72 3D 24 37 2B 2D 29 2B 2B 2C 24 2D 22 23 20 25 22 24 39 40 04 00 06 06 19 01 41 5D 52 57 52 58 4B 5F 54 50 48 49 55 4A 4A 47 4E 44 5F 32 31 41 4E 41 46 47 7A 79 7D 7A 7D 78 7C 7D 72 73 70 75 75 6A 11 2B 31 35 37 2E 30 72 6C 6D 66 61 69 7C 6E 67 61 67 98 86 9B 9D 96 9D 95 80 E3 E2 90 99 90 E3 C1 C3 DB CE D4 CD 9E CC C8 CF DB DD D7 9C 9C 9A 84 85 B9 B8 B9 A4 BF BF BC BD B2 AE B0 B1 B6 B7 B5 A8 DB DA A9 A0 AC D9 FD F4 FE B3 E4 FE B6 F4 FB FB 84 8E 8B 9D CE 9B 83 CD 8D A2 95 95 8E C7 CC 97 9F 88 8C 96 8C 9A DC 89 9D 98 95 9F DF CD D4 BC AE AE A6 BD A7 BB B5 ED B1 A6 B2 B7 A3 B5 E4 AC A9 FB AD B7 BF A9 BD B4 BE B2 B2 BD B3 F7 BA BA 5D 6D 49 40 42 4A 48 0D 56 4C 00 53 43 54 50 4A 48 5E 18 4A 5B 4C 4F 54 5D 5D 0A 11 5E 43 40 45 79 31 27 26 69 6E 78 68 75 62 79 2F 67 64 67 6A 6F 75 6C 6A 30 6E 69 7C 7C 67 7F 66 73 65 3A 76 05 06 47 08 1E 06 43 1B 53 4C 07 00 12 02 13 04 03 54 11 1D 1B 11 08 14 06 0A 2F 14 18 13 04 1A 23 25 3C 1D 3C 36 6C 39 2D 63 27 24 32 67 2D 21 3F 35 2C 30 2A 26 7C 38 3C 37 20 3E 3F 39 20 75 CC D9 C7 C4 8E C3 C3 CE C3 CF C8 CE D5 D3 C5 D5 D3 94 CE 88 91 D8 DD C9 D7 C4 D1 C8 99 D0 D1 C1 D5 EE E6 ED FE E0 E5 E3 F6 F0 D4 F3 FF A7 F0 EA BA FC FD ED BE FA F2 F9 E2 FC F9 FF E2 E4 B4 F3 98 84 85 C9 82 80 8F 8C 8E 8B 8F 92 92 8B 8D 86 9F 95 9B 9C 9F 8F 95 D2 84 C2 DF 83 83 9B 91 86 9E B9 B1 E9 BA A0 EC AA A7 B7 E0 AD AF A4 A1 AB B9 BE AB F9 B8 AD B3 B0 F2 BF BF B2 B7 BB BC BA 59 5F 40 4C 4F 43 58 45 6B 47 45 4F 52 4E 50 5C 1A 53 5D 58 52 4B 54 07 12 7F 59 52 53 59 57 50 47 6A 66 68 69 6A 7E 2D 77 70 65 73 26 54 6D 62 74 7E 7C 56 6B 6B 3C 7F 6B 33 63 74 64 61 71 67 26 02 0B 0C 00 0C 09 4D 0F 02 0E 00 01 02 16 45 1D 1E 0C 59 0C 0A 10 18 01 53 15 03 04 18 06 4F 6A 07 21 2A 2B 21 2F 28 62 0E 21 2F 27 20 21 37 60 7B 34 30 2D 2B 39 33 37 21 70 21 39 25 20 75 C5 DB CD C7 C7 CB DC DF CD C5 C9 CD C3 C8 C2 C3 D6 D2 D6 DC E1 DE DF DE D7 C0 C3 FD DF D4 D1 DB E9 EE DB EC FC F9 E5 EE E7 D2 F5 E0 E8 F3 EB F2 FF E9 CC FC EC F2 F5 F3 F3 FF A6 F3 F2 F2 A5 A7 89 DA C5 DE 88 D8 8E C0 D6 D3 82 D7 CB 85 81 87 9B D6 CE 9A CE CC 9F 9E C2 91 C9 C0 97 C3 A0 87 B3 EB BC A6 EE A8 A9 B9 E2 AF A9 A2 A3 A9 A7 A0 A9 FB BE AB B1 B2 FC AE B7 A1 A6 B4 A4 F7 A3 BC 5E 43 08 5A 4B 43 4A 0D 51 4A 47 4F 43 43 04 46 5F 49 4C 72 5B 4C 48 4F 57 5F 10 5D 5F 44 40 50 64 62 66 6E 2E 7A 7E 61 38 23 3C 69 37 39 5D 6A 6F 3B 7B 78 70 3F 72 72 65 33 62 74 62 62 66 7B 4A 1F 07 49 1A 07 09 4D 03 13 10 0D 0F 04 05 11 13 14 16 57 42 50 14 4C 4C 34 35 25 39 27 20 3C 05 05 1B 19 01 1C 18 2C 32 33 2C 28 25 26 30 2C 35 35 77 21 73 28 2B 2A 7F 35 3F 23 3B 7A 21 27 C6 CE C6 CA C1 CB C9 C9 CE CC C3 C0 CA CF CB D6 CE F9 CA D6 C9 CC D9 CF 92 C1 D5 C2 C3 DB C0 95 B0 AB CD E4 FE FB F5 AD F0 E6 F3 F1 E9 E9 F7 E0 B4 B5 B8 DC F0 EB F5 E9 EB B3 AD B1 DB F2 F9 F7 8F 99 C8 CE C9 CF 81 84 91 90 89 8F 81 A4 DE B9 BD 92 8C 95 9F 9D D1 AF 87 9D 9E 94 84 AB 96 80 A3 A7 AC BA 92 FD AF 95 F7 81 8E 8D 96 9B F4 99 B9 B7 B1 BC B0 AB 80 A9 B7 A1 BD B8 B8 B6 B8 89 4E 4E 5E 4C 42 40 5C 40 47 4D 54 7D 64 52 57 4C 54 5E 4B 4A 72 5E 45 58 40 6F 64 43 57 53 5D 5B 6D 5B 64 68 7A 69 63 7F 6F 2D 42 74 75 6E 6A 60 69 68 54 78 67 7A 6E 41 56 72 64 70 54 7E 7A 71 03 05 0F 35 2D 00 02 1B 07 11 14 04 14 14 38 36 0E 09 11 17 19 2B 13 31 1D 10 11 1D 1F 0D 11 11 19 3F 3A 20 20 28 0F 22 2C 35 25 33 32 22 36 6B 39 28 3B 36 30 29 39 2F 26 17 35 3D 33 30 35 21 CF FF CD C5 CB C8 DE CC CF E6 CD C0 CF CB E9 C0 C9 C8 DD D7 D9 DA CE CE FF D2 DE D0 D1 D2 C6 8F AA E2 E6 E0 FA E6 ED E1 EB F9 E1 F5 EF E8 EA AB B4 B5 D5 FC ED EC F9 F3 F5 F6 E2 D2 F7 F9 B3 E1 CA 88 9A 8C 8F 9B 89 CD AB AE 85 92 95 82 8A 82 9F 89 D8 9F 8C 90 91 DD 86 8A 80 94 D6 BA 91 86 B9 AE A6 AE AB BD EC BA AB B7 A8 E1 A8 A6 A9 A0 FA FB B9 B5 AC BA BD B9 AB F3 B5 A9 BF A4 A0 A6 04 66 4D 5A 5D 4A 42 4A 47 51 53 6C 47 49 45 42 5F 49 02 19 1E 52 59 4E 41 56 5E 56 53 45 47 15 7D 6E 7A 6C 2E 63 63 6C 66 66 64 2F 4B 62 77 76 7F 75 7F 7C 6C 6C 51 7C 7C 72 77 74 64 2D 34 7C 04 02 1C 00 0F 03 05 17 03 17 09 0E 08 47 02 0C 14 12 0B 11 1B 1B 52 3C 01 00 15 05 05 32 0C 16 22 2A 26 2E 2B 3C 0D 2E 21 2C 35 2F 32 34 17 3C 37 39 37 35 2D 10 2C 29 3B 3C 3E 02 33 25 3D 30 D9 EF C9 D0 EC CE DE DE E1 D1 D9 D1 D2 C8 E5 C6 D9 D4 CD D7 CA CC FD CE C1 D6 C4 F3 D7 DB D5 DB E9 EE FB C6 FE EA E2 C2 F0 E7 E5 F3 F5 CA E1 F6 E9 FA FF FC ED CF F3 EE FB E7 F9 FE F8 DA F1 E6 99 8A 8F 8C 9D A0 9C 88 8C A7 85 8D 8F 91 81 97 9F 9F B9 8A 8D 9A 88 B0 97 80 83 90 91 92 87 A6 AF B8 BB A0 A1 A1 BF 8E AD AD B4 A0 AF A9 A1 B7 A9 88 B6 B8 AE AC B4 B2 A6 97 B1 A5 B7 FB F4 9C 6E 11 08 05 0E 61 4D 40 47 19 00 0D 06 65 45 49 5B 55 5B 5C 04 1F 71 58 41 40 51 56 53 76 57 56 65 7E 66 7D 4F 7C 7F 68 76 4A 64 43 67 6B 65 6B 79 7E 56 7C 6A 6B 75 73 75 47 69 61 73 56 77 76 05 1E 06 1D 2F 0B 08 04 16 0A 0F 0F 07 0B 2D 0B 1C 14 3C 1C 0D 1C 0E 14 02 07 19 1E 18 3A 1D 1B 23 26 3D 24 0D 27 2D 23 25 26 09 12 09 06 27 26 35 2E 36 2D 17 3B 08 32 26 32 3C 13 37 3B 35 3B C9 CE E9 DF CF C6 C0 CC C0 CF C5 E3 C7 CB C5 CB D9 DE EA DC CD DA CE CB D7 D7 F2 D0 DA D6 DA D6 EF DF E7 FD EF E3 C5 E3 D7 D0 C4 D5 E9 F3 E5 E9 D3 F5 DA CD DD DB F9 FF E6 D6 E1 E4 FF E3 ED D0 9B 9E 81 9D 97 A6 82 AF B6 A0 CC C1 A8 86 89 80 DA B6 9D 8A 8D 9E 9B 98 B7 8B 93 99 97 99 93 90 8F B3 AB A1 AF A1 AB A8 8B A7 85 B9 A5 AF A5 AB BD BE 96 B8 B3 BA 8F B8 A1 A0 B9 BE B8 A4 97 BA 44 5F 49 40 40 4A 5E 64 46 6E 45 52 55 46 43 40 75 4B 5D 57 7A 5A 50 54 44 56 42 54 52 76 47 46 6F 7F 5B 70 63 6D 63 61 4B 67 53 75 67 73 71 76 59 69 7D 78 6A 76 73 73 46 7A 7D 74 3A 37 47 6C 07 09 07 05 54 4F 40 4D 32 11 09 02 03 5D 44 49 5A 28 11 1D 1B 45 5C 51 52 27 09 01 13 4D 54 38 2F 38 3B 28 29 2A 03 3D 27 2D 0F 33 22 22 36 0A 28 3F 3D 2B 17 3B 1B 2F 3D 26 20 18 32 07 3B 26 C3 DF C1 C6 C0 E6 C8 F9 CD D7 C1 CD F7 D2 C5 CB CE D2 CC C0 F8 D6 D0 D1 D7 D7 E1 C4 D7 D9 C0 DC FE F2 DB E0 EA EA CF E2 EF EE E5 EF F2 CB E5 F6 EE CE E8 FD FF EB F9 C9 FB FE F5 DE E4 F3 F1 E7 BE 92 98 8C A7 8B B8 84 8F 86 A9 8F A0 88 96 86 9F BE 80 89 97 8D 9D 89 9B 9C 9E A5 9F 9A 91 A1 B8 A2 AF AE AB BD 9C BF AB A0 A5 95 B4 A6 AD A9 95 BD BE AA BB AB 93 AF BB B4 B9 BF B7 BB 87 A1 4B 5F 5D 5A 6F 4B 48 44 56 4A 4F 4F 47 4B 6D 4B 5C 54 71 4D 5B 52 4F 11 12 7C 40 54 58 17 44 47 63 68 6D 33 2E 42 69 7E 71 62 67 64 49 77 61 6B 4A 74 6B 70 6A 76 73 73 5D 63 75 7F 46 65 7D 76 0F 24 18 0C 00 20 1E 09 07 11 29 05 2A 0E 15 10 13 1F 19 0D 17 10 12 2D 00 1A 13 14 25 0E 19 17 25 27 72 69 6E 0A 34 3D 06 22 34 24 7C 67 64 0B 3B 36 3D 63 7E 12 39 2E 21 32 37 34 19 27 20 3C C5 C5 FB CC DC C6 C9 E8 DA D3 C9 D3 C7 D3 CD CA D4 FF D9 CD DB EC D9 CF DB D6 E4 C8 C6 D2 98 95 DC EA E4 FC EB B5 AC C5 ED EF E9 E5 E7 FE F7 D6 FF E8 EB F0 F1 F1 EF CE F7 E7 E3 DC F3 E4 E7 F4 8D 8E BB 8C 9D 9C 85 82 8C 90 A3 8E 88 93 85 8C 94 9E 8A B5 91 8B AF 89 97 83 BD 98 98 BB 9B 81 87 AA B0 85 A1 BB 99 A3 A6 A6 B2 AD AF A2 B6 8B BB B6 BD 98 A8 BE B5 B1 B3 B1 BC B4 90 A2 A0 A0 58 4E 5B 68 58 4E 45 41 43 41 4C 44 69 57 50 4C 55 55 4B 76 4E 4B 55 52 5C 60 55 43 5F 52 7D 51 45 7B 7C 60 61 61 58 74 72 66 53 75 74 6E 6F 60 4A 69 71 7A 7B 53 7D 6E 66 47 62 70 72 7E 7A 72 2E 0A 1C 0C 38 0E 1E 04 03 01 0C 04 32 0E 07 0E 36 12 0B 0D 2A 0D 1D 19 17 49 50 5D 56 26 00 0C 70 6B 64 69 01 3D 28 28 30 63 29 25 7C 67 17 2C 3D 35 39 35 64 7F 11 34 3C 07 22 30 32 32 02 3A C6 DE C5 CC E3 C6 C2 8D D6 D1 C1 C5 C3 87 D2 CA D6 CE D5 DC FD 85 E0 FA DB C7 DC D0 D4 9A E6 C0 E4 E5 ED FB D2 ED F9 E4 EE E7 F3 DD B4 E4 DC B0 D8 D5 D4 C9 C2 AF C0 FE FE FA F5 FF E2 CB E0 F0 98 86 81 87 8F 83 B0 89 87 95 85 8D 89 97 89 80 94 8F A4 BB 8B 8C 95 93 97 80 83 BD 97 8E 91 87 96 9F BA A8 AA A6 A2 AA 92 AF A1 B5 A0 A8 B6 A8 F4 99 AD AA B7 B1 B9 AE A1 9F B1 A8 B3 A5 88 9D 43 58 5C 46 5C 56 70 6C 45 44 52 44 41 46 50 4C 55 55 4B 65 76 56 4F 49 5D 41 49 70 51 50 46 50 6D 6A 7C 60 61 61 5C 62 75 66 72 55 74 66 60 60 69 4B 79 6B 7F 72 79 69 77 61 63 3F 75 64 59 74 12 3F 1A 08 0A 0A 3A 02 0E 16 0D 04 2B 06 1C 45 0E 09 19 1D 1B 5F 0A 12 1E 06 1D 14 22 18 00 14 26 1D 27 25 3B 22 29 19 2D 37 21 2D 66 31 2B 29 2F 36 3D 0D 37 32 39 14 3C 27 35 23 20 36 38 01 C3 C6 CD 89 C7 C1 D8 C8 D0 D5 C1 CD 8A 87 D7 C0 D9 F9 D9 CA D7 CC EA D2 DE C6 DD D4 FF D9 C0 D0 F8 FD E9 E5 CC EE FF E4 F1 A3 F6 EE EA F2 E9 E0 BA F2 F6 ED FB ED EA FC FE BF B0 E2 F3 F4 D0 F0 86 9F 89 AF 87 83 98 88 90 A5 89 8D 92 82 96 C5 98 82 D8 BD 9B 93 88 9C DE D3 D5 B3 97 84 9D 86 98 AA BC A0 A1 89 A5 A1 B6 A6 B2 87 AF AB B0 A0 A8 FB BA A0 FE 9D BD AE BB A0 F0 A3 B7 A3 BD BA 06 0B 0D 64 4F 57 76 42 4C 46 68 44 4F 40 4C 51 77 5A 40 19 44 50 52 58 12 5B 55 58 51 5F 40 19 2A 7F 61 6A 65 7C 41 64 6C 59 6F 6F 63 4F 61 6C 7D 73 6C 54 77 71 3C 67 7D 7D 75 31 7E 72 7D 72 02 1F 44 49 1A 06 0F 06 11 20 15 12 12 08 09 31 13 18 13 2A 17 05 19 3E 07 00 04 1E 1B 57 00 1C 29 20 68 3A 27 35 29 0F 23 31 10 33 2F 24 21 11 23 2B 3D 0A 2A 3B 1F 3C 3E 30 25 3D 37 23 3D 3A C4 FF D1 D9 CB 8F D0 8D F6 CC D4 C0 CA 87 C6 C4 D6 DA D6 DA DB 85 9C E9 DD C7 D1 DD F4 D6 D8 D4 E4 E8 ED A9 FE EA FE EE E7 ED F4 BE AF B8 D7 E0 F6 FE FB ED FB FB BC E9 FB FE F5 B1 FF F9 B4 F3 85 99 8B 8C CE 81 83 99 C2 82 8C 8D 89 90 81 81 DA 9D 97 8B DE DF 93 8F 96 96 82 D1 82 8E 84 90 83 A5 AB A6 BC BD A9 AE B6 E3 93 8D E9 93 94 E5 AA A9 B1 BA BB FF B1 B8 B3 A0 A5 A3 B3 BA B1 BB 5E 11 08 0E 09 0F 41 48 43 50 55 53 43 4A 41 4B 4E 1B 59 55 52 50 4B 58 56 1F 10 53 43 43 14 12 2D 2B 65 6C 6F 7C 79 7F 67 6E 65 6F 72 27 77 60 76 7E 7B 6D 7B 7B 32 3D 42 7F 75 70 65 72 38 35 09 04 1A 1B 0B 0C 18 4D 31 2F 4F 35 36 47 14 04 08 1A 15 1C 0A 1A 0E 0E 31 1C 1E 1F 13 14 00 1C 25 25 07 3B 2A 2A 3E 6D 0B 07 0F 33 22 22 36 65 2E 22 28 3C 0A 16 1A 0E 26 3C 20 71 3A 38 27 26 8A F0 FC DB 80 8F FF E1 82 CC C6 C7 D5 C2 D0 85 E1 E8 CC D6 CE 9F D0 D2 C1 C0 E4 C3 98 97 E7 F9 AA E4 EE EF FD EA F8 D9 E3 E8 E5 A1 F6 F5 EB E3 F3 EF B8 C2 CA FE F7 F8 B2 E3 E2 FE F0 FE E0 D1 8B 9F 8D C6 BA 86 81 88 B1 8C 95 93 85 82 B0 8C 97 9E D8 90 90 DF 9A 92 80 90 95 B2 CC AB B3 9C BE A7 A9 AB E3 9D B9 A3 AC A6 B2 9D A4 B2 AD A9 BE A8 84 EB BD 87 E9 9F 9C 9F 80 8D E6 8B B7 B9 43 4E 46 5D 72 5B 49 5F 4F 4A 4E 40 4A 7B 40 40 4C 5E 54 56 4E 52 59 53 46 6F 72 44 45 5E 5A 50 79 78 44 68 77 6A 7E 51 56 71 61 65 6F 69 63 55 76 7A 6C 7F 71 6D 71 33 50 66 63 78 78 72 67 66 26 0A 11 0C 1C 33 2E 18 11 0A 0E 04 15 14 2B 07 10 1E 1B 0D 0D 23 33 0F 16 16 02 25 0F 07 11 06 16 04 3A 2D 2B 3D 18 34 32 26 6E 22 35 02 3C 35 33 29 39 2D 37 30 32 1F 27 2A 03 34 3A 3B 38 3A DE D8 FA C0 DD C4 80 8D 86 F1 C9 D2 CD 8B 84 80 9F 9B E9 CD C7 85 9C 9D E6 C1 9E C2 C2 D8 C4 8F AA AB DB C5 4C 2F E3 EB E4 F0 E5 F5 BC A7 46 25 EA E9 F1 FA FB A5 BC BD FD F5 F6 E2 F3 E3 AE B5 CA BF B8 C9 9E 9D 85 8E 87 D9 C0 C9 C6 81 8B 97 DA DB D0 B6 BD B0 D5 DD DA BF 9F 92 97 9B DD 9D A3 B8 BC A6 BC B6 9E A8 B3 B6 A5 B2 B2 97 A5 B7 BB B6 BD AD BB AD AF 9B E2 E3 E0 E1 E6 E7 84 E5 6A 0B 5C 46 0E 0F 7F 59 52 19 00 68 55 64 56 5C 4A 4F 57 17 46 52 50 6E 4B 5E 52 5E 5A 63 4D 45 6F 4D 7D 7D 7B 7D 69 7E 41 6C 6E 75 74 66 67 71 4E 62 68 7C 4C 70 73 69 41 6A 7D 73 79 7B 34 62 0B 18 48 07 01 1B 4C 0B 0D 16 0E 05 46 01 0B 17 5A 16 1D 0A 0D 1E 1B 18 52 5E 4E 51 56 04 0D 18 28 24 24 00 2A 6F 71 6D 65 22 33 32 2F 20 2A 28 3F 35 2C 2A 3B 2C 2F 34 3D 3D 38 3E 3A 3E 30 34 D3 D8 CD DA DD C6 C3 C3 E1 CC CE D5 C7 CE CA C0 C8 FF DD D5 CA DE 9C DF D3 C1 C3 F5 D3 DB C0 D4 AA FD E9 E5 FB EA AC E1 ED F7 F3 C0 E1 E0 F6 E0 FD FA EC FC FA BF D8 D2 DF D0 F1 FD F5 E2 F8 F4 9E 82 87 87 CE 8D 8D 9E 8B 90 B0 93 8F 84 81 C5 96 9E 8E 9C 92 8C DC 91 9B 9E 99 85 B8 98 80 D5 B9 BE B8 B9 A1 BD B8 A8 A6 E3 AC A4 B0 A2 A8 B6 9E 94 95 F9 BC A6 FC A9 BB BE B5 95 99 9A F4 B7 53 0B 5C 40 4D 44 5F 0D 41 4C 55 4F 52 73 4D 46 51 48 18 5A 51 4A 52 49 7A 56 59 5A 5F 59 14 74 79 63 61 45 6F 7C 78 40 63 71 6B 43 6F 63 45 76 71 56 71 7D 6E 70 75 73 66 50 2A 4D 51 7E 60 79 0B 09 45 3B 1B 01 02 08 10 3F 02 14 0F 0B 00 16 26 49 1B 21 4B 3D 32 31 22 2F 40 2D 15 1B 1D 10 24 3F 14 3D 2B 3D 21 24 2C 22 2C 1D 22 22 32 20 36 34 28 34 3B 31 28 01 10 26 23 38 38 32 27 26 E6 CA D1 CC DC F3 F8 DF C3 C7 C9 CF C1 F7 C8 C4 CE DD D7 CB D3 91 FE C8 C1 DA DE D4 C5 C4 F8 D4 F3 EE FA D5 C6 E6 FF F9 ED F1 F9 DD C7 E0 E3 F7 FF FC F9 ED F7 F0 F2 EE CE DB F9 E2 E2 F8 E6 EC AB 8C 8F 9B 8B 88 8D 99 8B 8C 8E A9 83 8E 8F 80 94 BA 8B 91 97 D1 9F 8E 81 9C 85 83 95 92 B6 80 A3 A7 AC E9 A8 BD A3 A0 8A AA B3 B5 A9 B5 BD E5 AE A2 A8 BC 92 BA AA B8 BE E1 80 A3 BF B4 B1 F5 49 43 49 47 49 4A 5F 0D 41 4C 55 4F 52 07 46 44 48 48 6A 58 50 58 59 1D 50 52 42 42 62 5E 57 5E 79 59 6D 7F 6B 7D 7F 6C 6E 4F 65 6F 61 73 6C 57 7F 6D 7D 6B 6D 7E 70 3D 5E 76 7E 76 62 7F 57 74 06 08 1D 05 0F 1B 05 02 0C 43 34 18 16 02 27 5F 26 3C 11 0D 12 1E 1E 50 20 06 1E 1F 13 05 28 17 3F 22 24 2D 3D 13 7E 2E 1A 76 02 0F 0A 17 18 75 06 38 34 30 3B 31 28 01 26 36 22 3C 3F 39 35 39 F6 CF CD DF CB C3 C3 DD CF C6 CE D5 FA E5 D1 D6 D3 D5 DD CA CD F3 DD C4 D7 C1 EC E5 C4 D6 D0 DC E4 EC D8 E5 EF FB EA E2 F0 EE AE C3 F3 F4 ED EB FF E8 EB D5 FF E6 F9 EF CE DB F9 E2 E2 F8 E6 EC B6 AA 8F 8E 9C 8A 8B 8C 96 8A 8F 8F 95 BB AC 8C 89 8F 97 8B 87 BE 9B 9A 80 96 97 90 82 9E 9B 9B 98 AE BE AC BC BC AD A1 EC A0 B3 83 AF A3 E4 84 A9 B0 9A B0 BA 9E AF B6 93 B4 B7 A3 B3 B0 B5 A1 4F 4F 08 5D 47 4C 47 5E 02 0B 6C 40 55 53 0D 71 53 56 5D 7D 5B 53 5D 44 66 5A 5D 54 1A 17 59 46 49 31 54 4E 67 7B 60 6C 60 2E 52 74 68 69 61 77 46 79 6D 70 72 7B 6F 41 20 70 48 24 54 59 58 45 36 5B 34 0A 02 06 09 03 16 3F 14 04 14 0A 0D 0B 1B 17 24 1D 1B 09 19 11 1D 03 1D 14 18 03 28 37 3F 38 21 27 2B 3C 3F 01 23 3A 25 33 1A 13 36 24 3E 32 36 3E 0E 33 3D 29 34 3C 22 3C 78 15 21 26 C3 C5 CD DA DD E3 CD D4 C7 D1 FC E9 CF D4 D0 CA C8 C2 E4 F8 D9 D8 CE D8 D5 D2 C4 D8 D9 D9 C7 E9 C2 E2 FB FD E1 FD F5 CC E5 E4 F2 E4 E1 E6 F0 EC F5 F5 CC F0 FD F4 D0 FC E1 E7 D1 F6 F1 E5 F1 F2 8B 9F 8D 8D C0 8C 9F B9 8B 8E 85 B5 8F 8A 81 C5 89 8F 99 8D 97 8C 88 94 91 80 A6 9E 9A 82 99 90 EA BB BA A6 A8 A6 A0 A8 94 AC AC B4 AB A2 E4 B3 BB B7 AD BC 88 88 9D 8D 9B BD A6 B0 BA BE B0 F5 7E 43 41 5A 0E 67 45 5E 56 4C 52 48 45 46 48 61 5B 4F 59 7A 4B 4C 48 52 5F 13 59 42 16 56 40 41 6B 68 60 6C 6A 2F 78 62 22 6A 6E 65 6F 64 65 71 75 69 38 3B 3C 31 3C 4B 73 7F 65 74 65 37 77 7A 1F 05 1C 49 19 06 00 01 42 01 05 41 15 1E 0A 06 12 09 17 17 17 05 19 19 52 04 19 05 1E 57 1D 1B 2E 22 2B 28 3A 20 3E 2D 31 63 23 2E 33 29 30 6B 7A 18 39 35 32 7F 0F 38 26 05 31 3D 23 32 74 3C C4 D8 DC CC CF CB 80 8D CD D1 80 C2 D4 C2 C5 D1 DF 9B D6 DC C9 9F 9C CA DB C7 D8 DE C3 C3 94 D4 FE FF E9 EA E6 E6 E2 EA A2 F7 EF A1 EF E9 E0 EC F9 FA EC F6 EC D6 F2 FE FD E1 E2 F4 F5 E3 B4 FA 8C 8D 9B 8C 9A CF B8 84 81 88 93 C1 DB C7 C4 BE A7 DB B7 D9 D3 DF DC B5 D2 DE D0 D1 BA D7 D9 D5 EA 88 E8 E4 EE 8B A3 BA AC 96 B0 E1 BA E7 88 A4 A9 AF F8 E4 FE FF A0 FD 84 BC BC A4 BB B2 F4 E8 0A 6F 49 50 6C 4E 5E 6C 51 48 73 48 5C 42 66 4C 5E 68 51 43 5B 73 5D 4E 46 60 59 4B 53 78 44 50 64 43 61 6E 66 43 63 7A 52 71 65 77 6F 68 71 76 59 77 77 6A 7B 4B 6E 7C 76 76 63 40 63 78 60 70 2B 18 1B 0C 1A 39 03 01 17 0E 05 20 15 0C 44 27 13 1F 58 55 5E 2C 15 07 17 49 50 5D 56 3E 10 4F 6A 67 68 0A 22 20 3F 28 26 79 60 6D 66 05 2D 21 60 7B 74 79 1F 2C 37 67 72 7F 70 13 3F 33 07 3C D0 CE 92 89 82 8F ED DE C9 F0 C9 DB C3 9D 84 E1 DB CF D9 99 CD DA CE D4 D7 C0 90 92 CD 87 C9 F6 B0 D7 CF E0 FA E3 ED EF AF D1 F5 EF E8 E2 F6 D9 F8 EE F1 F5 FA EC C0 AF F1 CB A5 D3 D8 DB C4 C9 DA B7 8B 85 87 8A 82 99 BE 97 85 93 8B 8E 8A 84 96 A7 9C 9C 88 9A 90 92 82 9E 95 9F 82 AB B6 80 B9 A2 A6 AC BD BC 80 AC BB A6 B2 9D 92 B5 A5 A1 B3 B5 BF 89 B2 BE A8 BB BD A1 BD FF 94 A2 A7 BC 44 4E 5B 5A 62 4E 55 48 50 7F 6D 4E 42 52 48 40 49 67 71 57 5A 56 5F 5C 46 5C 42 42 6A 7E 5A 51 63 68 69 7D 61 7D 22 6E 71 4F 69 6F 63 58 23 7E 2A 66 3F 39 7A 7E 68 7C 32 60 75 63 7F 72 67 35 1A 19 07 19 0B 1D 18 04 07 10 2C 04 10 02 08 45 1E 1A 0C 18 5E 0C 19 0F 1B 16 03 51 55 0C 44 08 06 2E 3E 2C 22 10 03 23 62 37 29 22 2D 08 2A 65 38 3A 2A 79 3D 33 33 2E 37 06 20 35 37 23 31 01 D3 DB CD C5 C7 C1 C9 FE C7 D1 C9 C4 D5 CB CD CB DF F7 DD CF DB D3 F5 D3 D6 DA D3 D0 C2 D8 C6 95 EB E7 FA EC EF EB F5 AD E3 E7 E4 E4 E2 EB ED EB FF D2 F6 FD FB E7 F4 F4 E1 E7 FF E3 FF F4 F5 F9 AE 8A 9C 88 D4 CF A3 83 AB 8D 89 95 DC C7 AB 8B AF 8B 9C 98 8A 9A C6 DD BD 9D B3 9D 93 96 86 CF EA 84 A6 9D BC B6 8B A8 B6 8E A9 AF 8B A6 BC A6 AF A8 AC B6 B3 97 B5 AE A6 BC A2 B8 B5 B6 B8 91 4B 5F 49 6A 5B 5C 58 42 4F 03 48 48 55 53 4B 57 53 58 59 55 1E 5B 5D 49 53 13 51 5D 44 52 55 51 73 2B 69 6D 6A 6A 68 59 6B 6E 65 21 75 6F 6D 63 6E 48 70 76 69 3F 70 74 7C 76 30 7C 77 65 7F 70 18 27 01 07 0B 3C 09 1F 0B 06 13 28 02 08 02 03 09 1E 0C 10 10 0C 08 1C 1C 10 15 3F 17 1A 11 3C 24 38 3C 28 20 2C 29 6D 2C 22 2D 24 05 7D 18 02 33 2F 34 38 3C 72 0E 28 3C 3D 35 23 0A 35 21 3C C6 CF DB F5 9C CC F4 98 E0 ED EC F1 FA 97 F8 C6 D6 D2 DD D7 CA E3 C8 D8 C0 DE D9 DF D7 DB E8 D1 EF FD ED E5 E1 FF E1 E8 EC F7 DC C3 F3 F4 ED EB FF E8 EB D5 FF E6 F9 EF CE C7 E2 F0 F2 FE FA F2 BA 87 89 9D 88 80 9E 80 CC A1 95 92 8F 89 81 96 89 B7 99 80 9B 8D A0 B0 9D 97 85 9D 93 84 A8 A6 BE B9 A9 BD AB A8 A5 A8 B1 9F 93 B5 B4 A6 B0 A0 BD A2 F6 BA AD 98 B9 B3 B7 A1 B1 BD 95 B6 BA F2 5E 0B 4B 41 4F 41 4B 48 02 50 54 53 47 53 41 42 43 1B 4B 5C 4A 4B 55 53 55 40 10 46 5E 5E 58 50 2A 78 7C 7B 6F 7B 69 6A 7B 23 73 75 67 73 61 25 73 68 38 6E 71 6D 77 74 7C 74 7C 7E 71 64 47 61 18 0A 1C 0C 09 16 5D 43 52 22 0E 41 03 1F 07 00 0A 0F 11 16 10 5F 14 1C 01 53 1F 12 15 02 06 07 2F 2F 68 3E 26 26 20 28 62 30 34 33 27 33 21 22 23 7B 3B 2B 3B 3E 28 34 3C 34 7E 71 13 2F 37 30 DA DF C1 C6 C0 95 8C 97 82 EC CE E8 C8 CE D0 CC DB D7 D1 C3 DB F2 D9 C9 C0 DA D3 C2 E5 C3 C6 D4 FE EE EF F0 AE F8 ED FE A2 E0 F2 E4 E7 F3 E1 E1 B4 B5 B6 A3 BE D0 F2 DE E0 F6 F1 E5 F3 F3 C7 E1 98 8A 9C 8C 89 96 CC 9E 96 82 92 95 83 83 CA CB D4 BA 96 D9 9B 87 9F 98 82 87 99 9E 98 D7 9C 94 B9 EB A7 AA AD BA BE BF A7 A7 E0 B6 AE AE A8 A0 FA A8 AC AB BF AB B9 BA AB F3 A2 A4 B8 B9 BD BB 4D 05 08 6C 56 4C 49 5D 56 4A 4F 4F 1C 07 1E 05 68 4E 56 6A 4A 4D 5D 49 57 54 49 11 41 56 47 15 79 7F 67 79 7E 6A 68 23 2C 2D 41 6F 26 62 7C 66 7F 6B 6C 70 71 71 3C 75 73 60 30 7E 75 74 61 67 18 0E 0C 49 19 07 05 01 07 43 13 15 14 06 10 00 1D 02 58 0A 0A 10 0C 0D 1B 1D 17 5F 56 32 0C 16 2F 3B 3C 20 21 21 76 6D 78 63 13 35 29 37 05 2B 7A 3E 20 3A 3B 2F 28 34 3D 3D 70 39 37 24 74 3A C9 C8 DD DB DC CA C8 8D D5 CB C9 CD C3 87 D7 D1 C8 DA CC DC D9 C6 9C D9 D3 C7 D1 91 D2 D2 D8 D0 FE E2 E6 EE A0 AF C9 F5 E1 E6 F0 F5 EF E8 EA BF BA A1 B8 CB FB F2 F3 EB F7 C0 E4 E3 F7 E3 F1 F2 93 CB 9F 88 9D CF 9E 88 8F 8C 96 84 82 C9 CA CB BB 95 D8 9C 86 9C 99 8D 86 9A 9F 9F D6 9F 95 86 EA A4 AB AA BB BD BE A8 A6 E3 B7 A9 AF AB A1 E5 A9 AF AA B8 AA BA BB A4 F2 A1 B5 BC B9 A1 BD BB 4D 05 08 6C 56 4C 49 5D 56 4A 4F 4F 1C 07 1E 05 7D 5E 4C 74 5B 4B 4E 54 51 40 62 44 58 17 70 54 7E 6E 27 5D 67 62 69 5A 6D 71 6B 68 68 60 24 71 73 76 7D 4A 6A 7E 68 78 32 5C 62 75 73 65 2E 35 4A 04 1A 0D 0B 1D 4C 0E 03 0D 03 04 0A 47 16 00 0B 0E 1D 0A 0A 3C 1D 13 11 16 1C 51 19 05 10 10 38 6B 0B 26 20 21 29 2E 36 2A 2F 2F 7C 67 05 26 39 34 2D 37 2A 65 7C 0C 27 32 3E 25 3F 23 2D 6F 8A E4 DA CD CB DD 8C E4 E6 99 80 F2 CF C3 C1 9F 9A F4 CA DD DB CD 9C C9 CB C3 D5 8B 96 E3 C6 DC ED EC ED FB AE FF FE E4 E1 E6 BA A1 D2 F5 E5 EC F6 F2 F6 FE BE F0 FA FB E1 F6 E4 AB B6 C4 E0 FA 9A CB 84 86 9D 9C D6 CD B6 82 8B 84 C6 97 96 8A 9C 92 8C C3 DE BB 9D 89 97 DC A4 98 9B 92 CE D5 99 A4 BD BB AD AA F6 ED 90 A6 B1 B4 A3 B4 B0 8C BE E1 F8 F9 9D B3 B3 AE B7 F3 A1 A5 AF ED F4 85 45 58 41 5D 47 40 42 0D 41 4F 4F 52 43 07 56 40 4B 4E 5D 4A 4A 6F 53 4E 5B 47 59 5E 58 17 7D 71 30 2B 44 60 60 64 2C 42 41 4C 20 73 63 76 71 60 69 6F 54 70 70 74 3C 52 51 5C 3E 31 44 72 65 60 0F 18 1C 20 0A 55 4C 22 10 07 05 13 34 02 15 10 1F 08 0C 29 1F 0D 1D 10 17 07 15 03 05 26 01 14 24 3F 21 3D 37 0B 29 2B 2B 2D 29 35 2F 28 2A 16 3F 2F 2C 30 30 38 12 3C 3F 36 03 3D 3F 27 24 34 CD CE FB DD C1 DF E0 C2 D1 D0 E9 D5 C3 CA D7 F1 DB D0 DD E9 CC D0 DA D4 C6 FA C4 D4 DB C4 F5 D1 EE E2 FC E0 E1 E1 ED E1 D2 E2 F2 E0 EB E2 F0 E0 E8 E8 D7 EB FA FA EE EE B2 F4 E2 FE E3 E7 B4 E5 86 8A 8B 80 80 88 CC 9F 87 92 95 84 95 93 AB 97 9E 9E 8A 8A DE 98 8E 92 87 83 DE D1 A4 92 85 80 AF B8 BC 80 AA F5 EC 99 A7 BB B4 92 A3 B3 B0 AC B4 BC 91 AD BB B2 9D BE B1 BC A5 BF A2 84 B1 A1 5E 42 46 4E 67 5B 49 40 60 4C 4F 4D 43 46 4A 76 5F 4F 4C 50 50 58 75 49 57 5E 79 5F 42 52 53 50 78 58 6D 7D 7A 66 62 6A 4B 77 65 6C 44 68 6B 69 7F 7A 76 4A 69 76 68 7E 7A 76 62 42 73 63 60 7C 04 0C 21 1D 0B 02 38 04 0F 06 3A 0E 08 02 29 04 14 1A 1F 1C 0C 2C 19 09 06 1A 1E 16 3F 03 11 18 1E 22 25 2C 08 3D 2D 20 27 00 2F 2F 20 2E 23 16 3F 2F 2C 30 30 38 15 29 37 3E 14 30 22 32 00 3C C7 CE FB CC DA DB C5 C3 C5 EA D4 C4 CB F7 C5 D6 C9 CC D7 CB DA EC D9 C9 C6 DA DE D6 FF C3 D1 D8 D9 EE E4 EC ED FB E3 FF D1 E6 F4 F5 EF E9 E3 CC EE FE F5 CD F7 F2 F9 C7 FD FD F5 C2 F3 E3 E0 FC 84 8C A1 9D 8B 82 B8 88 9A 97 A1 93 83 86 B7 80 8E 8F 91 97 99 B6 88 98 9F A0 89 9C 94 98 98 A6 AF BF BC A0 A0 A8 85 B9 A7 AE 90 A4 B4 AE AB A1 89 BE AC AD B7 B1 BB 94 A6 B6 BD 82 A2 A5 BD BB 4D 78 4D 5D 5A 46 42 4A 6B 57 45 4C 67 44 50 4C 55 55 6B 5C 4A 4B 55 53 55 5A 44 54 5B 67 5B 5C 64 7F 7B 5A 6B 7B 78 64 6C 64 49 75 63 6A 40 6A 6F 79 74 7C 4D 7A 68 69 7B 7D 77 58 62 72 79 46 06 02 0C 0C 1C 3C 09 19 16 0A 0E 06 2F 13 01 08 29 1E 14 1C 1D 0B 13 0F 3E 1C 13 10 1A 1E 0E 10 2E 18 2D 3D 3A 26 22 2A 0B 37 25 2C 00 2E 28 20 09 3E 2C 2D 37 31 3B 14 26 36 3D 17 39 39 20 06 CF DF DC C0 C0 C8 E5 D9 C7 CE EC CE C8 C0 F7 C0 CE CF D1 D7 D9 F6 C8 D8 DF F4 C2 DE C3 C7 E7 D0 FE FF E1 E7 E9 C6 F8 E8 EF C0 EF ED E9 F5 D7 E0 EE EF F1 F7 F9 D6 E8 F8 FF C0 FF E4 F8 F3 C7 F0 9E 9F 81 87 89 A6 98 88 8F A2 8C 84 94 93 B7 80 8E 8F 91 97 99 B6 88 98 9F BC B1 84 82 9F A7 90 BE BF A1 A7 A9 86 B8 A8 AF 91 A1 A5 AF A8 88 AA B9 BA B4 B0 A4 BA B8 8E B7 A7 A4 B8 B8 B0 9D A1 4F 46 6C 46 5B 4D 40 48 75 4A 54 49 6A 4E 4A 4E 69 5E 4C 4D 57 51 5B 74 46 56 5D 63 45 44 67 50 7E 7F 61 67 69 46 78 68 6F 42 6C 68 61 69 69 60 74 6F 4B 7C 6A 6B 75 73 75 5A 64 74 7B 47 75 7C 18 28 07 05 01 1D 3F 08 16 17 09 0F 01 2E 10 00 17 38 17 17 1A 16 08 14 1D 1D 23 14 02 03 1D 1B 2D 02 3C 2C 23 03 25 23 27 0C 30 35 2F 28 2A 36 09 3E 2C 2D 37 31 3B 14 26 36 3D 13 3F 30 00 30 D2 DF E9 DB CB CE FF C8 D6 D7 C9 CF C1 EE D0 C0 D7 FD D1 DB D1 D1 DD DE D1 DA FC D4 C0 D2 D8 FA FA FF E1 E6 E0 FC DF E8 F6 F7 E9 EF E1 CE F0 E0 F7 D6 F1 F7 F1 EB FD E8 E0 FC D6 F8 F4 F8 FA F4 89 88 81 A5 8B 99 89 81 AD 93 94 88 89 89 97 B6 9F 8F 8C 90 90 98 B5 89 97 9E A2 90 98 90 91 A6 AF A7 AD AA BA A0 BE 9E A7 B7 B4 A8 A8 A0 8D B1 BF B6 9A B6 B1 B3 B9 BC BC 9F BF B2 B7 BB BD AF 4F 4F 7B 4C 5A 5B 45 43 45 6A 54 44 4B 64 48 50 49 4F 5D 4B 7D 50 50 52 40 5A 5E 56 7A 52 42 50 66 58 6D 7D 7A 66 62 6A 4B 77 65 6C 49 75 60 60 68 49 7D 68 6B 7A 6F 69 42 72 62 70 7B 72 60 70 18 18 3B 0C 1A 1B 05 03 05 2A 14 04 0B 2E 07 0A 14 1E 1C 38 1D 0B 15 12 1C 53 26 10 1A 02 11 4F 6A 22 3B 1D 2B 22 3C 22 30 22 32 38 04 26 36 16 32 34 2F 1C 26 2B 39 33 21 3A 3F 3F 05 3F 3B 22 EF D3 DC CC C0 DC C5 C2 CC EF C9 CF C3 F4 CC CA CD F9 D9 CA DB F3 D9 CB D7 DF F5 C9 C2 D2 DA C6 E3 E4 E6 C5 EB F9 E9 E1 C7 FB F4 E4 E8 F4 ED EA F4 D9 F9 FA F5 DC F3 F1 FD E1 D5 E9 E2 F2 FA E6 83 84 86 AB 81 9D 88 88 90 A0 8F 8D 89 95 A1 9D 8E 9E 96 8A 97 90 92 B1 93 91 95 9D B4 96 87 90 86 AE BE AC A2 9B A9 B5 B6 8F AF A2 A7 AB 97 B1 B5 A9 B9 BE BB AC 89 AE B7 A1 84 A3 B7 B3 B1 A6 69 4A 46 0E 5A 0F 4A 44 4C 47 00 40 48 5E 04 56 4E 54 4A 58 59 5A 7F 5C 5C 14 44 11 55 45 51 54 7E 6E 28 7A 7A 60 7E 6C 65 66 20 6E 60 27 70 7C 6A 7E 22 39 51 6D 78 78 60 60 58 78 65 63 7B 67 13 28 1D 1A 1A 00 01 4D 11 17 12 08 08 00 27 0A 14 1F 11 0D 17 10 12 32 02 16 02 10 18 13 37 00 39 3F 27 24 6E 2B 2D 39 27 15 21 2D 33 22 10 3C 2A 3E 1B 2C 2D 2B 33 30 72 20 29 3C 34 38 38 16 DF D8 DC C6 C3 8F CD CE C1 CC D5 CF D2 E4 D1 D6 CE D4 D5 99 CD DA D0 D8 D1 C7 DF C3 E5 D2 D8 D0 E9 FF ED ED C7 FB E9 E0 CD F1 E4 E4 F4 A7 F4 E9 FB F8 F1 F7 F9 BF EF E9 E0 F2 E4 F4 F1 EE B4 E2 98 84 86 8E CE 8C 99 9F 90 86 8E 95 C6 94 90 84 8E 9E AB 8D 8C 9E 88 98 95 8A D0 97 9F 99 9D 86 A2 AE AC F2 E7 EF EC AC B6 E3 A6 AE B4 E7 8D 8B 89 8F 8A 8C 93 9A 92 89 81 8C 83 94 9A 92 97 81 63 64 66 76 67 6B 78 44 4F 46 4F 54 52 07 4B 43 1A 4C 59 50 4A 56 52 5A 12 52 53 52 53 44 47 15 7E 64 63 6C 60 43 63 6E 63 6F 53 75 69 75 65 62 7F 68 44 4F 71 73 69 70 77 52 7E 70 7A 6E 67 7C 19 3B 1A 06 0A 1A 0F 19 2B 27 31 14 09 13 0D 0B 1D 38 0D 0B 0C 1A 12 1E 0B 3A 34 20 03 18 00 10 0E 2E 24 28 37 1E 39 22 36 2A 2E 26 12 3E 34 20 16 34 2C 0A 37 25 39 13 3D 27 39 3E 38 36 38 03 CB C7 DD CC FD DB C9 DD EA CA D3 D5 C9 D5 DD F1 C3 CB DD EF D1 D3 C9 D0 D7 E7 C9 C1 D3 F3 D1 D9 FE EA CB E8 E2 EC F9 E1 E3 F7 E9 EE E8 D3 FD F5 FF D6 F1 F7 C8 F0 F0 E8 FF F6 D1 FF F7 FB ED E6 83 98 BC 80 8D 84 BF 84 98 86 A1 8D 8A 88 93 A6 9B 97 9B 8C 92 9E 88 98 A0 96 91 9D 82 9E 99 90 9E A2 AB A2 BD 8E A0 A1 AD B4 83 A0 AA A4 B1 A9 BB AF BD 8B BB BE B0 A9 BB BE B5 85 A4 B6 B0 B0 59 6A 44 45 41 58 6F 4C 4E 40 55 4D 47 53 41 77 5F 5A 54 4D 57 52 59 6B 5D 5F 45 5C 53 76 58 59 65 7C 4B 68 62 6C 79 61 63 77 65 53 63 66 68 71 73 76 7D 5A 76 7E 72 7A 77 52 7C 7D 79 60 55 77 08 19 0D 1F 07 0E 18 08 32 11 09 02 03 25 1D 31 13 18 13 2A 17 05 19 30 13 07 05 03 1F 03 0D 31 2B 3F 2D 0F 3B 3B 39 3F 27 00 2F 2F 32 35 25 26 2E 0F 21 29 3B 16 32 2E 26 21 25 3C 33 39 20 14 CE CF C1 DD C7 C0 C2 CC CE EA CE C7 C9 E8 C2 C3 97 FE C0 DA D6 DE D2 DA D7 E5 D5 DF D2 D8 C6 95 E2 EA FB A9 E0 E0 F8 AD F1 F6 F0 F1 E9 F5 F0 DC F5 EE EA B9 F2 F6 FF F8 FC E0 F5 B1 F2 F8 F1 E6 CA 85 87 9D CE 8E 80 81 8D 94 C0 95 8E 8E 97 C5 99 94 96 97 9B 9C 88 94 9D 9D A5 82 93 85 B0 90 A7 A4 9A AC AF A3 80 A2 A1 A2 AC 92 B2 A8 B6 A4 BD BE AB 85 96 B6 AF A9 BD A1 A9 81 B9 A4 9D B1 10 0B 04 09 69 5D 43 58 52 6A 44 1B 06 0B 04 66 55 56 55 5C 50 4B 06 1D 62 41 10 0C 16 63 46 1B 7A 79 28 34 2E 5B 7E 23 6D 65 66 72 63 73 24 38 3A 58 6D 6A 6A 70 71 5E 41 47 5C 5C 42 54 2E 49 2D 02 1C 05 0F 0D 41 3F 17 0D 0E 04 14 3B 06 10 13 17 1C 0A 22 4D 1F 25 47 31 3E 3D 26 2B 44 29 29 27 21 2C 20 3B 10 39 27 31 2D 28 28 26 28 19 3E 3E 2E 3C 32 30 2C 30 37 3D 24 0D 14 22 27 3C C4 CE DB DA E2 CE D5 C8 D0 FF F4 D3 C7 C3 CD CB DD EB D4 D8 CA D9 D3 CF DF 9D F2 C4 C5 DE DA D0 F9 F8 C4 E8 F7 EA FE D1 C0 F6 F3 E8 E8 E2 F7 F6 D5 F9 F2 FC FD EB EF C1 DD E1 F4 F4 E4 C3 ED E5 8F 98 B4 A5 87 82 85 99 AD 91 84 84 94 B3 9D 95 9F D5 9B 8A DE DF B1 92 96 9A 96 88 D6 98 86 91 AF B9 E8 EA 9D BB A3 BD E2 AF AF B2 B5 E7 B4 B7 B3 B8 BD F9 AD B7 B3 A8 BE B7 F0 B3 B3 F7 B8 B0 59 58 08 5D 46 4E 42 0D 4E 4A 4D 48 52 07 54 57 53 58 5D 6D 5F 54 59 1D 42 41 5F 57 5F 43 14 45 78 62 6B 6C 2E 7C 64 62 77 6F 64 21 64 62 24 68 75 69 7D 39 6A 77 7D 73 32 7F 79 7C 7F 63 34 65 18 02 0B 0C 3D 1B 03 1D 42 0F 0F 12 15 47 14 17 13 18 1D 59 0D 17 13 08 1E 17 50 13 13 57 19 1A 38 2E 68 3D 26 2E 22 6D 2E 2A 2D 28 32 67 34 37 33 38 3D 0D 3F 34 39 7D 22 21 3F 37 3F 23 74 25 D8 C2 CB CC 8E DC C4 C2 D7 CF C4 81 C4 C2 84 C9 DF C8 CB 99 CA D7 DD D3 92 DF D9 DC DF C3 94 C5 F8 E2 EB EC C3 C4 D8 DE F6 EC F0 A1 EA E8 F7 F6 BA EB EA F0 FD FA BC EE FA FC E5 FD F2 B7 F6 F0 CA 87 8D 9A 9D CF 98 85 83 8D C0 8C 87 95 8F 80 8E DB 99 8A 95 DF 8C 8F 9B 90 95 B2 CC AB B3 9C BE A7 A9 AB E3 9D B9 A3 AC A6 B2 9D A4 B2 AD A9 BE A8 84 EB BD 87 E9 9F 9C 9F 80 8D E6 8B B7 B9 43 4E 46 5D 72 5B 49 5F 4F 4A 4E 40 4A 7B 40 40 4C 5E 54 56 4E 52 59 53 46 6F 72 44 45 5E 5A 50 79 78 44 68 77 6A 7E 51 56 71 61 65 6F 69 63 55 76 7A 6C 7F 71 6D 71 33 50 66 63 78 78 72 67 66 26 0A 11 0C 1C 33 2E 18 11 0A 0E 04 15 14 2B 07 10 1E 1B 0D 0D 23 33 0F 16 16 02 25 0F 07 11 06 16 06 29 3B 25 2A 38 02 30 27 25 33 12 3E 34 20 74 38 2B 0D 3F 34 39 7D 22 21 3F 37 3F 23 74 25 D8 C2 CB CC 8E DC C4 C2 D7 CF C4 81 C4 C2 84 C8 D5 C9 DD 99 CA D7 DD D3 92 DE D1 C3 DD D2 C0 95 EB F8 E3 A9 FE FD E5 EE E7 D0 F4 EE F6 A7 E8 EA E9 E8 B8 E9 EC F6 FF F8 B2 E0 F8 FE E3 FB F0 B5 88 8E C8 84 81 9D 89 CD 96 8B 81 8F C6 8A 85 97 91 9E 8C D9 9C 96 98 DD 82 81 99 92 93 A3 95 9E AF EB B8 BB A1 A9 A5 B9 E2 B3 B2 A8 A5 A2 E4 B6 B2 B4 AD B5 BA FF BE B8 F2 BF B5 A2 A5 F7 A0 BD 4B 45 08 44 4F 5D 47 48 56 03 42 48 42 07 54 57 53 58 5D 6A 6A 6F 68 4F 5B 54 57 54 44 17 44 47 63 68 6D 4A 34 53 4B 64 76 6F 61 63 2B 55 71 6B 74 7E 6A 45 7C 6A 75 71 76 60 4C 23 75 4F 21 57 24 27 38 35 5E 33 0F 01 0B 06 0E 15 3A 13 01 17 17 12 16 18 12 23 18 18 04 16 1C 1E 06 1A 11 1B 3E 17 0A 3C 3D 26 22 28 31 30 0C 20 3F 22 36 19 0E 29 39 3D 37 31 3B 0D 3E 32 24 37 39 25 39 7B E8 DE DB C0 C0 CA DF DE EE C2 D9 C4 D4 FB E6 D0 C9 D2 D6 DC CD CC F3 DF D8 D6 D3 C5 C5 EB FB C7 EE EE FA DD F7 FF E9 FE DE D0 F4 EE F6 C8 F6 E1 FF E9 CC E0 EE FA B2 FE E1 C0 E4 FE E6 B7 F8 FA 99 98 C8 99 9C 86 8F 88 C2 90 88 8E 93 8B 80 C5 98 9E D8 95 9B 8C 8F DD 86 9B 91 9F D6 83 86 9C AD AC AD BB EE BF BE A4 A1 A6 94 A0 AD A2 E4 B5 A8 B4 BE B0 AA FF AC AF BB B0 B5 F1 A5 BF BB A0 46 4F 08 4B 4B 0F 41 42 50 46 00 55 4E 46 4A 05 4E 49 51 5E 59 5A 4E 1D 42 41 59 52 53 64 40 5A 7A 2B 64 66 7D 7C 2C 7D 70 6A 63 64 26 74 6C 6A 6F 77 7C 39 7C 7A 3C 70 7D 61 75 31 62 7F 75 7B 4A 1F 1A 00 09 08 09 1F 42 13 12 08 05 02 30 04 11 1E 58 09 0C 10 1A 14 06 53 00 03 1F 14 11 55 39 23 27 3C 22 2B 6C 2F 27 63 2C 24 35 34 64 31 32 3A 36 79 2A 2D 35 3A 35 36 22 71 26 25 3D 36 CF FF DA C8 C7 C3 C5 C3 C5 83 F3 D5 C9 D7 F0 D7 97 E8 EC CB DF D6 D0 D4 DC D4 90 DE D0 D1 C7 D0 FE C8 B2 D5 C9 E6 F8 E1 E3 E1 AD D3 F3 E9 EA E0 E8 C7 FA EC F7 F3 F8 EE CE A1 F3 C9 A3 D5 DA D9 BA B7 D8 B5 8D 83 85 88 8C 97 BC 95 83 95 89 8C 94 9A 94 A5 9A 9A 8A 98 9E 9C 80 9C 93 99 80 A9 88 BE BB A0 A0 AA BF BE 8E A2 B9 A4 B4 9B 90 B7 BB BF B1 B7 B9 8F B0 BC A6 B5 BF A3 BB F9 96 A0 59 42 46 4C 5D 5C 60 4C 5B 46 52 7D 64 52 57 4C 54 5E 4B 4A 71 5D 56 58 51 47 43 6D 79 45 50 50 78 5F 71 79 6B 7C 50 59 70 62 69 6D 6F 69 63 56 6E 74 68 56 6C 7B 79 6F 46 6A 60 74 38 74 67 3C 43 45 48 20 0A 4F 51 4D 29 02 07 08 2D 00 48 45 36 12 16 1C 5E 3D 0E 18 13 18 3C 18 18 12 54 17 38 2E 29 22 6E 23 25 23 27 30 6C 61 16 28 2D 2B 2E 28 78 7F 7E 19 35 3A 27 21 35 22 15 6D 08 12 C3 DF C4 C8 CC 82 FE D8 CC CD C5 D3 FA C5 D1 CC D6 DF CB E5 8C DC E4 88 F0 FD FC E1 EA 87 E8 D6 E6 E2 ED E7 FA D3 F8 E8 F0 EE E9 EF E7 EB D8 E1 FF ED FD F5 F1 EF F1 F8 FC E7 CC D3 E3 E4 FD FB 8F 98 9B A5 8F 96 89 9F BE B7 92 80 82 8E 8A 82 AA 97 99 8D 98 90 8E 90 DC B1 85 82 9F 99 91 86 B9 87 A9 B0 AB BD 90 85 AB B0 B4 AE B4 BE 98 84 BD BC AA BC B9 BE A8 B4 BD BD A3 8D 9E BE A7 A1 45 59 51 68 49 48 5E 48 45 42 54 48 49 49 74 4A 53 55 4C 4A 7F 51 58 7B 5B 54 45 43 53 44 1A 56 79 49 67 71 5D 66 76 68 40 6C 78 21 75 6E 7E 60 4A 3D 5E 39 33 3F 36 55 5E 50 42 74 78 7C 7B 5D 03 0C 00 46 22 00 1B 2C 06 15 4E 41 25 0B 05 16 09 12 1B 38 1A 09 52 5D 3A 1A 17 19 59 3B 1B 02 08 39 21 2A 25 6F 3F 24 38 26 01 26 21 35 21 22 3B 2F 31 36 30 7F 2F 29 2B 3F 35 14 2E 23 31 3B D9 C2 C7 C7 82 8F 89 E4 CC D5 C5 D3 D5 CE CB CB 96 9B 9D EA D6 D0 CB 9D C5 DA D3 DA C5 F5 C1 DC E6 EF A8 EA FB FD FE E8 EC F7 A0 E3 E7 F5 C5 C6 DB D3 D4 BF C9 DD F9 FA FB FD AA B1 B6 EB B4 D0 84 8F D2 C9 CE 80 9E 89 87 91 C0 8C 89 83 8D 83 83 DB 8A 9C 8F 8A 99 8E 86 D3 9F 83 92 92 86 D5 BA A7 A9 AA A7 A1 AB ED B0 A6 B1 B4 A3 B4 B0 87 BB A8 BD 94 BF A7 88 AF B3 B7 B9 BF B1 86 A1 B4 44 5F 41 5D 57 7E 59 42 56 4A 4E 46 6B 46 5C 71 48 5A 5C 50 50 58 6D 48 53 5D 44 58 42 4E 75 47 68 62 7C 7B 6F 68 69 5E 7B 6E 62 6E 6A 74 47 6D 7F 78 73 7C 7A 5E 70 71 7D 64 54 78 65 76 76 79 0F 28 07 05 01 1D 2A 02 10 0E 01 15 2D 0E 0A 01 0F 0F 1B 3F 17 1D 13 13 13 10 13 18 3A 12 02 10 26 38 0A 28 3D 2A 1C 28 30 2A 2F 25 66 24 2B 2B 2E 3A 31 37 2D 7F 35 33 72 16 28 32 3A 22 30 30 CE F8 DC D0 C2 CA DF E0 C3 DB C9 CC D3 CA E9 CC D4 D2 D5 CC D3 F6 D2 DE C0 D6 DD D4 D8 C3 F0 DC E7 EE E6 FA E7 E0 E2 CC EE EF EF F6 C2 EE F7 E4 F8 F7 FD DA F1 F3 F3 EF A3 D2 FC FD F9 E0 D0 FC 99 8A 8A 85 8B AC 83 81 8D 91 D2 B1 83 95 8D 8A 9E B6 8D 95 8A 96 8C 91 9B 96 82 D1 9F 84 D4 99 AF B8 BB E9 BA A7 AD A3 E2 8E B5 AD B2 AE B4 A9 B3 BE AA 94 B7 B1 B5 B0 A7 BE F0 B8 A5 F7 B9 BA 58 4E 08 5D 46 4E 42 0D 6F 56 4C 55 4F 57 48 4C 5F 49 75 58 46 56 51 48 5F 71 51 42 53 67 51 47 63 64 6C 29 6D 60 62 79 63 6A 6E 72 26 6E 6A 25 5F 63 7B 75 6B 7B 79 79 42 76 62 78 79 73 67 45 04 07 29 05 0B 1D 18 1E 21 0C 0E 15 07 0E 0A 00 08 2B 16 15 3F 13 19 0F 06 27 11 03 11 12 00 23 2B 27 3D 2C 18 2E 20 38 27 30 16 20 2A 32 21 0C 2E 3E 35 2A 08 3E 30 28 37 1A 24 34 3B 1E 20 30 C7 D8 FB DD CB DF DF EE CD D6 CE D5 E3 C9 C5 C7 D6 DE EB D6 CB D1 D8 CE E6 DA DD D4 FF D9 E0 C7 EB EF ED CA E1 E1 F8 EC EB ED E5 F3 D2 EE E9 E0 D3 F5 CC EB FF FB F9 C9 FB FE F5 D8 F8 C4 F1 F6 85 85 8C 9A BE A3 A8 84 90 86 83 95 8F 88 8A B1 93 96 9D A3 91 91 99 B4 9C 95 9F B8 92 B5 95 86 AF 9E BC AA 81 A9 AA BE A7 B7 84 A8 B5 B7 A8 A4 A3 95 B9 B4 BB 8C A8 BC BC B7 B1 A3 B2 93 BD A6 5A 47 49 50 60 4E 41 48 71 42 56 44 06 55 41 44 56 4F 51 54 5B 1F 48 4F 53 57 55 11 41 5E 40 5D 2A 78 7C 7B 6F 61 6B 68 22 77 69 6C 63 3D 24 51 68 7A 7C 7C 57 7B 3C 20 32 33 44 78 7B 72 34 28 4A 12 11 10 17 42 21 20 4F 07 04 41 2E 2F 5E 08 17 41 0B 0A 50 19 1A 1B 52 1F 11 02 02 23 06 14 2E 2E 0C 28 3A 2A 6C 70 62 10 21 37 23 67 36 20 3B 37 2C 30 33 3A 7C 29 20 32 34 34 76 20 3D 21 C2 8B DB DD DC CE C2 CA C7 83 D4 C8 CB C2 9E 85 DF C3 D1 CA CA DA D8 E9 C0 D2 D4 D4 C5 F4 DB C0 E4 FF A8 A9 FA FD ED E9 E7 F0 D4 EE D5 E6 F2 E0 BA CF F0 FC EC FA BC F4 E1 B3 FE FE B6 F8 FA F0 CA 88 80 80 82 8B CC 9B 87 8D 84 8E 94 AA 91 89 8E 92 D8 8F 9B 91 98 92 80 DD D0 B2 9E 9E 98 91 EA BD AD A7 AA A0 BE ED B5 AA B4 A9 E6 AC A1 BC FA E6 F8 F9 AC BA A8 A8 A0 BD F0 B5 BF A4 B7 BA 44 45 4D 4A 5A 4A 48 0D 52 4A 4E 46 06 55 41 56 4F 57 4C 6D 4C 5E 58 54 5C 54 10 47 53 59 50 5A 78 2B 69 65 7C 6A 6D 69 7B 23 72 64 61 6E 77 71 7F 69 7D 7D 30 3F 53 73 7E 6A 30 7E 78 72 34 61 18 0A 0C 00 00 08 4C 1B 07 0D 04 0E 14 47 07 04 14 5B 1A 1C 5E 0D 19 1A 1B 00 04 14 04 12 10 5B 3E 39 29 2D 27 21 2B 1B 27 2D 24 2E 34 31 21 2B 3E 34 2A 1A 32 30 2F 38 36 73 20 3E 25 3E 20 3C C5 C5 88 CA CF C1 8B D9 82 C1 C5 81 C5 CB CB D6 DF DF 98 D8 D9 DE D5 D3 FD D5 D6 91 9B 97 F1 CD E9 E3 E9 E7 E9 EA DC EC F6 EB D4 EE C2 E6 F0 E4 D8 FA EB FC CE ED F3 F9 E7 F0 E4 D0 E5 E4 F1 E1 BB 9E 87 9D 87 81 8B AC 91 90 85 95 AB 82 97 96 9B 9C 9D AA 87 92 9E 92 9E 9D 95 86 B8 96 99 90 EA A2 BB E9 A0 BA A0 A1 E2 AC B2 E1 A3 AA B4 B1 A3 B5 BD AE 97 AB B9 B0 A1 88 F0 FA F6 98 BA B9 53 0B 65 48 5C 44 49 59 02 4C 52 45 43 55 04 51 43 4B 5D 19 57 4C 1C 5C 5E 5F 5F 46 53 53 44 47 63 68 6D 44 61 6B 65 6B 6B 60 61 75 69 75 50 7C 6A 7E 7E 76 6C 7C 79 48 61 76 44 78 75 7C 67 53 05 19 20 00 1D 1B 03 1F 1B 24 12 0E 13 17 37 00 0E 0F 11 17 19 0C 2F 04 1C 07 18 14 02 1E 17 3C 3E 2E 25 05 27 22 25 39 0B 25 14 2E 33 24 2C 20 3E 17 31 34 37 2B 7C 34 34 73 24 3E 23 34 3C 30 CE E7 E5 FD FA EC 96 F1 E5 CA D4 CD C7 C5 89 F7 CF D5 D6 DC CC E3 DE C8 DB DF D4 C2 EA 85 D7 ED BF C9 C6 C5 DE D3 BC D1 E1 EF E9 E4 E8 F3 D8 F1 FF E9 F5 F0 F0 FE F0 C1 F6 F6 E6 F4 FA F8 E4 F8 8F 85 9C B5 AC 9A 9F 84 8C 86 93 92 AA 86 9D 80 88 A7 AC 8B 9F 9B 95 93 95 A3 9C 90 82 91 9B 87 A7 E5 8A BC BD A6 A2 A8 B1 B0 8C A0 BF A2 B6 99 98 AE AB B0 B0 BA AF AE 9D B1 BA B4 B5 A3 A7 89 65 59 4C 4C 5C 7B 55 5D 47 50 7C 6D 4F 4A 4D 51 73 5D 6C 56 4B 5C 54 58 56 7C 42 55 53 45 60 4C 7A 6E 26 6A 7D 78 65 79 6A 23 74 73 6F 60 63 60 68 3B 68 6B 77 7C 79 3D 73 67 30 5C 77 65 7F 70 1E 22 0E 3D 01 1A 0F 05 07 07 2D 00 14 0C 01 11 5A 12 1E 59 0A 10 09 1E 1A 16 14 3C 3D 23 20 26 3E 24 38 69 22 26 21 24 36 10 14 0D 05 7D 18 02 33 2F 34 38 3C 72 0E 28 3C 3D 35 23 0A 35 21 3C C6 CF DB F5 9C CC F4 98 E0 ED EC F1 FA 97 F8 C6 D6 D2 DD D7 CA E3 C8 D8 C0 DE D9 DF D7 DB E8 D1 EF FD ED E5 E1 FF E1 E8 EC F7 DC C3 F3 F4 ED EB FF E8 EB D5 FF E6 F9 EF CE C7 E2 F0 F2 FE FA F2 BA 87 89 9D 88 80 9E 80 CC A1 95 92 8F 89 81 96 89 B7 99 80 9B 8D A0 BF 87 80 99 9F 93 84 87 BA A8 A1 AD AA BA BC 90 82 B0 A7 A5 B3 92 BE B4 A0 A9 87 8B AD B1 AF 90 B4 BF BA A4 9E A4 B3 B1 A7 7E 52 58 4C 00 4C 5F 5E 52 4C 54 72 5F 4A 46 4A 56 72 5C) */; - - internal static byte[] 4 = new byte[39059] - { - 249, 223, 201, 219, 218, 202, 222, 131, 199, 219, - 197, 154, 134, 135, 153, 133, 239, 213, 203, 204, - 206, 207, 211, 207, 198, 214, 212, 145, 196, 194, - 216, 208, 170, 253, 233, 229, 251, 234, 172, 249, - 251, 243, 229, 192, 234, 235, 235, 242, 186, 239, - 234, 248, 250, 246, 242, 250, 211, 255, 252, 254, - 225, 183, 199, 217, 171, 135, 132, 134, 153, 207, - 184, 189, 163, 143, 140, 142, 145, 199, 183, 169, - 218, 175, 138, 152, 151, 147, 149, 147, 149, 178, - 156, 157, 153, 128, 212, 152, 165, 175, 161, 175, - 183, 239, 163, 191, 166, 166, 178, 128, 170, 171, - 171, 178, 250, 182, 183, 189, 183, 185, 165, 253, - 179, 190, 191, 164, 184, 163, 149, 185, 70, 68, - 95, 9, 67, 64, 72, 68, 68, 90, 0, 81, - 84, 78, 71, 64, 123, 87, 84, 86, 73, 31, - 81, 82, 86, 90, 86, 72, 22, 67, 93, 83, - 70, 78, 94, 76, 66, 61, 83, 68, 81, 92, - 65, 70, 65, 85, 65, 66, 91, 79, 93, 93, - 95, 115, 112, 114, 101, 51, 96, 112, 100, 99, - 125, 116, 6, 75, 11, 5, 1, 28, 9, 77, - 18, 12, 19, 8, 18, 14, 11, 11, 59, 23, - 20, 22, 9, 95, 25, 5, 2, 28, 2, 5, - 55, 59, 56, 58, 29, 20, 30, 6, 2, 26, - 1, 8, 29, 2, 14, 0, 10, 30, 23, 12, - 9, 4, 30, 11, 17, 18, 3, 9, 27, 16, - 27, 14, 30, 30, 7, 1, 229, 249, 241, 232, - 226, 227, 229, 227, 237, 237, 229, 254, 246, 230, - 231, 238, 251, 252, 253, 247, 145, 254, 206, 200, - 222, 214, 254, 208, 219, 210, 213, 214, 233, 228, - 253, 231, 250, 252, 245, 224, 224, 236, 236, 192, - 229, 228, 235, 240, 244, 239, 184, 248, 240, 251, - 188, 238, 235, 254, 242, 254, 250, 183, 249, 224, - 153, 159, 200, 139, 139, 207, 138, 159, 141, 142, - 192, 146, 135, 138, 129, 197, 153, 148, 150, 151, - 155, 156, 136, 148, 157, 157, 159, 131, 146, 146, - 134, 161, 179, 187, 173, 136, 173, 172, 163, 184, - 172, 183, 224, 160, 168, 163, 228, 170, 168, 191, - 189, 171, 254, 171, 165, 173, 183, 243, 189, 164, - 165, 163, 244, 183, 79, 11, 78, 91, 65, 66, - 12, 94, 67, 78, 69, 1, 69, 72, 74, 75, - 95, 88, 76, 80, 81, 81, 108, 79, 91, 80, - 85, 11, 22, 23, 103, 92, 112, 110, 50, 41, - 52, 47, 36, 36, 34, 57, 58, 33, 78, 110, - 119, 113, 117, 105, 97, 88, 121, 120, 110, 120, - 117, 114, 100, 120, 121, 121, 89, 116, 4, 10, - 15, 12, 28, 85, 76, 4, 12, 10, 20, 8, - 7, 11, 13, 31, 27, 15, 17, 22, 16, 81, - 82, 83, 58, 26, 3, 5, 25, 5, 13, 37, - 56, 36, 43, 44, 61, 60, 35, 63, 49, 11, - 41, 50, 50, 40, 54, 60, 10, 41, 55, 58, - 59, 44, 47, 50, 32, 20, 53, 37, 31, 57, - 50, 58, 138, 134, 136, 207, 207, 198, 192, 141, - 214, 204, 128, 211, 195, 211, 214, 204, 223, 205, - 221, 153, 215, 209, 218, 210, 146, 210, 210, 222, - 195, 195, 148, 212, 237, 236, 250, 236, 233, 238, - 248, 228, 237, 237, 160, 172, 166, 225, 229, 236, - 246, 187, 236, 246, 190, 252, 238, 248, 243, 231, - 245, 177, 247, 240, 243, 231, 143, 140, 137, 157, - 135, 128, 130, 205, 141, 129, 138, 132, 133, 147, - 196, 200, 218, 154, 216, 159, 155, 136, 220, 137, - 139, 131, 149, 130, 214, 128, 157, 129, 162, 235, - 188, 161, 171, 239, 191, 172, 175, 166, 224, 175, - 167, 170, 161, 141, 179, 168, 172, 182, 172, 166, - 157, 186, 181, 161, 181, 182, 183, 163, 189, 186, - 68, 102, 73, 71, 79, 72, 73, 95, 24, 3, - 73, 79, 79, 83, 77, 68, 86, 82, 66, 92, - 90, 31, 79, 72, 81, 80, 85, 66, 69, 81, - 65, 89, 102, 114, 120, 104, 124, 110, 97, 104, - 118, 102, 114, 64, 97, 96, 118, 96, 125, 122, - 108, 112, 113, 113, 95, 124, 124, 115, 100, 49, - 112, 126, 122, 113, 74, 10, 15, 14, 28, 10, - 11, 12, 22, 12, 18, 65, 17, 14, 16, 13, - 90, 8, 8, 28, 29, 22, 26, 20, 23, 23, - 80, 31, 23, 26, 17, 85, 26, 121, 13, 49, - 62, 32, 34, 40, 44, 55, 41, 32, 42, 103, - 9, 42, 44, 50, 54, 62, 126, 30, 42, 56, - 32, 50, 55, 52, 27, 56, 34, 60, 196, 204, - 136, 200, 216, 202, 222, 204, 197, 198, 211, 241, - 195, 213, 205, 202, 222, 155, 215, 223, 158, 250, - 196, 205, 221, 221, 213, 223, 194, 222, 213, 217, - 170, 198, 231, 255, 231, 225, 235, 173, 195, 245, - 229, 243, 231, 224, 225, 214, 245, 238, 234, 250, - 251, 236, 188, 237, 224, 250, 243, 244, 229, 183, - 242, 250, 152, 203, 165, 168, 173, 142, 128, 142, - 151, 143, 129, 149, 143, 136, 138, 197, 142, 130, - 136, 156, 178, 150, 146, 152, 147, 129, 156, 136, - 214, 160, 145, 156, 173, 163, 188, 172, 170, 239, - 129, 162, 180, 170, 174, 166, 230, 134, 178, 160, - 168, 186, 191, 188, 142, 186, 174, 180, 189, 183, - 240, 190, 176, 247, 152, 130, 103, 106, 123, 70, - 91, 93, 79, 72, 81, 3, 80, 83, 79, 68, - 65, 86, 26, 93, 87, 75, 30, 115, 107, 112, - 115, 96, 89, 92, 70, 91, 81, 21, 71, 100, - 126, 96, 96, 104, 44, 76, 116, 102, 114, 96, - 97, 98, 84, 96, 104, 114, 119, 125, 62, 112, - 122, 61, 65, 122, 125, 97, 122, 114, 52, 88, - 5, 29, 1, 7, 9, 79, 45, 27, 7, 17, - 1, 6, 3, 52, 9, 10, 21, 15, 16, 28, - 26, 95, 49, 18, 4, 26, 30, 22, 86, 54, - 2, 16, 56, 42, 47, 44, 30, 42, 62, 36, - 45, 39, 96, 46, 32, 103, 23, 40, 53, 52, - 44, 49, 59, 59, 124, 16, 61, 37, 57, 63, - 49, 119, 21, 35, 207, 217, 201, 206, 203, 255, - 197, 219, 205, 215, 128, 241, 201, 206, 202, 209, - 154, 246, 215, 207, 215, 209, 219, 157, 243, 197, - 213, 195, 215, 208, 209, 229, 239, 249, 225, 230, - 234, 175, 227, 235, 162, 211, 208, 204, 199, 180, - 201, 196, 201, 242, 255, 247, 255, 243, 207, 245, - 253, 225, 228, 177, 219, 248, 226, 252, 132, 140, - 200, 168, 152, 138, 158, 140, 133, 134, 192, 177, - 131, 149, 141, 138, 158, 182, 145, 157, 154, 147, - 153, 221, 191, 156, 134, 152, 152, 144, 212, 180, - 188, 174, 186, 168, 169, 170, 236, 157, 167, 177, - 169, 174, 162, 139, 171, 171, 189, 251, 149, 182, - 168, 182, 178, 186, 242, 146, 166, 180, 164, 182, - 179, 176, 10, 123, 77, 91, 71, 64, 72, 108, - 79, 76, 85, 79, 82, 7, 75, 67, 26, 89, - 89, 75, 77, 31, 76, 92, 65, 64, 85, 85, - 22, 85, 81, 83, 101, 121, 109, 41, 97, 127, - 105, 99, 107, 109, 103, 33, 118, 104, 119, 108, - 110, 114, 119, 119, 92, 112, 112, 113, 123, 125, - 119, 116, 100, 55, 86, 116, 4, 15, 27, 42, - 6, 14, 2, 3, 7, 15, 19, 49, 3, 21, - 13, 10, 30, 91, 23, 31, 94, 50, 61, 93, - 20, 28, 2, 81, 19, 25, 2, 16, 38, 36, - 56, 44, 61, 25, 45, 33, 55, 38, 96, 46, - 32, 103, 39, 42, 52, 61, 49, 61, 59, 49, - 63, 56, 114, 58, 62, 37, 51, 37, 34, 52, - 198, 255, 209, 217, 203, 143, 195, 203, 130, 206, - 207, 215, 207, 201, 195, 133, 219, 205, 221, 203, - 223, 216, 217, 254, 221, 222, 221, 222, 210, 222, - 192, 204, 170, 200, 224, 232, 224, 225, 233, 225, - 162, 202, 238, 229, 227, 255, 203, 246, 249, 242, - 244, 245, 255, 235, 243, 239, 225, 195, 245, 227, - 255, 248, 240, 193, 147, 155, 141, 201, 129, 137, - 204, 160, 141, 149, 137, 143, 129, 199, 165, 147, - 159, 137, 153, 158, 155, 178, 147, 153, 155, 149, - 153, 148, 146, 215, 185, 154, 188, 162, 166, 174, - 238, 142, 186, 168, 176, 162, 167, 164, 150, 162, - 182, 172, 181, 191, 248, 182, 184, 255, 145, 178, - 182, 186, 182, 184, 179, 179, 244, 152, 69, 93, - 65, 71, 73, 15, 109, 91, 71, 81, 65, 70, - 67, 117, 65, 66, 72, 94, 75, 74, 87, 80, - 82, 29, 126, 90, 94, 84, 102, 82, 70, 92, - 101, 111, 40, 102, 104, 47, 64, 100, 108, 102, - 97, 115, 38, 85, 97, 98, 104, 126, 107, 106, - 119, 112, 114, 78, 125, 102, 98, 114, 115, 100, - 52, 101, 24, 2, 11, 12, 29, 79, 10, 2, - 16, 67, 20, 9, 3, 71, 22, 0, 29, 9, - 29, 10, 13, 22, 19, 19, 82, 31, 25, 31, - 19, 39, 6, 28, 41, 46, 104, 10, 38, 46, - 34, 35, 39, 47, 16, 36, 52, 46, 43, 33, - 122, 52, 62, 121, 46, 45, 53, 62, 55, 115, - 51, 57, 55, 57, 58, 48, 198, 234, 221, 221, - 193, 221, 201, 202, 208, 198, 211, 210, 207, 209, - 193, 133, 252, 210, 214, 208, 202, 218, 156, 244, - 223, 195, 197, 221, 197, 210, 148, 231, 239, 248, - 248, 230, 224, 252, 233, 173, 207, 236, 246, 232, - 232, 224, 164, 196, 236, 254, 234, 248, 249, 250, - 212, 244, 246, 247, 245, 255, 193, 254, 250, 241, - 133, 156, 200, 185, 139, 157, 133, 130, 134, 176, - 143, 148, 148, 132, 129, 150, 218, 139, 138, 144, - 157, 154, 143, 221, 148, 156, 130, 209, 130, 159, - 145, 213, 139, 173, 161, 187, 163, 174, 236, 161, - 171, 173, 165, 150, 175, 169, 160, 170, 173, 178, - 182, 190, 254, 185, 169, 179, 177, 167, 185, 190, - 184, 155, 177, 180, 89, 95, 5, 90, 95, 90, - 77, 95, 71, 80, 0, 76, 67, 83, 76, 74, - 94, 105, 93, 85, 95, 75, 85, 75, 87, 19, - 99, 69, 68, 82, 90, 82, 126, 99, 40, 64, - 96, 107, 105, 117, 80, 80, 73, 33, 118, 98, - 118, 108, 117, 127, 75, 118, 107, 109, 127, 120, - 97, 51, 96, 99, 127, 116, 113, 102, 74, 13, - 7, 27, 78, 27, 4, 8, 66, 49, 51, 40, - 70, 11, 13, 11, 31, 54, 23, 29, 27, 95, - 26, 18, 0, 83, 4, 25, 19, 87, 38, 38, - 3, 107, 36, 32, 32, 42, 31, 32, 45, 44, - 52, 41, 47, 41, 35, 101, 42, 62, 42, 48, - 49, 59, 17, 62, 21, 58, 62, 61, 51, 46, - 116, 17, 211, 197, 201, 196, 199, 204, 232, 212, - 204, 194, 205, 200, 197, 135, 208, 215, 219, 216, - 211, 208, 208, 216, 156, 219, 211, 208, 196, 222, - 196, 228, 219, 192, 248, 232, 237, 169, 254, 253, - 229, 238, 231, 206, 239, 247, 239, 233, 227, 165, - 219, 237, 253, 235, 255, 248, 249, 189, 215, 253, - 230, 244, 250, 248, 228, 240, 191, 155, 138, 136, - 128, 139, 204, 137, 135, 149, 137, 128, 146, 142, - 139, 139, 218, 146, 150, 217, 219, 187, 147, 138, - 156, 145, 145, 159, 146, 215, 144, 144, 188, 162, - 169, 189, 167, 160, 162, 237, 171, 173, 224, 228, - 150, 166, 182, 164, 184, 180, 180, 176, 189, 255, - 143, 156, 128, 135, 162, 180, 184, 179, 135, 161, - 79, 91, 8, 70, 72, 15, 92, 76, 80, 66, - 66, 78, 74, 78, 71, 5, 105, 122, 106, 25, - 77, 70, 79, 73, 87, 94, 125, 80, 78, 94, - 89, 64, 103, 43, 126, 104, 98, 122, 105, 45, - 100, 108, 114, 33, 114, 111, 97, 37, 123, 120, - 123, 124, 114, 122, 110, 124, 102, 122, 127, 127, - 54, 113, 117, 118, 30, 4, 26, 40, 25, 10, - 31, 2, 15, 6, 64, 46, 21, 4, 13, 9, - 22, 26, 12, 22, 12, 60, 20, 28, 28, 23, - 21, 81, 59, 24, 25, 16, 36, 63, 61, 36, - 110, 0, 63, 46, 43, 47, 44, 32, 50, 40, - 54, 19, 53, 55, 57, 45, 55, 51, 53, 41, - 43, 9, 57, 54, 12, 54, 51, 5, 207, 217, - 203, 204, 192, 219, 140, 233, 199, 213, 201, 192, - 210, 206, 203, 203, 251, 201, 215, 214, 208, 254, - 238, 242, 253, 253, 144, 225, 211, 197, 221, 218, - 238, 216, 252, 232, 224, 235, 237, 255, 230, 163, - 196, 228, 240, 238, 229, 241, 243, 244, 246, 212, - 241, 233, 245, 243, 245, 179, 209, 231, 243, 229, - 245, 242, 143, 203, 171, 134, 128, 153, 137, 159, - 133, 134, 142, 130, 131, 200, 160, 140, 140, 158, - 138, 158, 155, 145, 159, 152, 162, 150, 130, 152, - 153, 147, 212, 154, 172, 235, 174, 168, 189, 187, - 236, 136, 143, 130, 144, 164, 180, 174, 171, 161, - 250, 180, 190, 249, 173, 179, 179, 170, 242, 150, - 157, 144, 134, 178, 166, 188, 69, 79, 8, 70, - 72, 15, 95, 68, 69, 77, 65, 77, 6, 98, - 105, 100, 113, 90, 81, 75, 87, 31, 110, 88, - 94, 82, 68, 88, 64, 82, 20, 124, 100, 111, - 109, 113, 76, 96, 96, 97, 107, 109, 103, 100, - 116, 39, 70, 100, 116, 127, 107, 57, 88, 115, - 125, 105, 86, 118, 102, 120, 119, 99, 125, 122, - 4, 57, 9, 29, 11, 79, 3, 11, 66, 32, - 8, 0, 8, 0, 1, 53, 31, 9, 17, 22, - 26, 95, 19, 27, 82, 30, 31, 28, 19, 25, - 0, 0, 39, 6, 39, 36, 43, 33, 56, 56, - 47, 19, 37, 51, 47, 40, 32, 101, 60, 52, - 42, 121, 19, 48, 49, 56, 60, 39, 37, 60, - 5, 56, 33, 39, 201, 206, 219, 137, 222, 221, - 197, 206, 199, 208, 128, 199, 201, 213, 132, 232, - 213, 214, 221, 215, 202, 202, 209, 152, 224, 147, - 252, 208, 196, 197, 205, 149, 221, 226, 228, 229, - 231, 238, 225, 254, 210, 241, 233, 226, 227, 167, - 203, 246, 249, 242, 244, 245, 255, 235, 243, 239, - 194, 246, 226, 248, 249, 243, 180, 250, 140, 203, - 165, 168, 223, 191, 137, 159, 139, 140, 132, 193, - 137, 129, 196, 168, 187, 201, 181, 150, 136, 150, - 146, 154, 210, 178, 134, 148, 132, 150, 147, 144, - 234, 164, 174, 233, 129, 188, 175, 164, 174, 175, - 161, 181, 169, 181, 139, 171, 250, 153, 185, 181, - 191, 177, 191, 184, 242, 133, 191, 189, 163, 186, - 177, 131, 69, 71, 93, 68, 75, 127, 67, 94, - 75, 87, 73, 87, 67, 7, 114, 74, 86, 78, - 85, 92, 30, 118, 82, 89, 87, 75, 125, 94, - 88, 82, 77, 21, 76, 103, 103, 126, 46, 70, - 98, 105, 103, 123, 77, 71, 79, 39, 84, 96, - 104, 114, 119, 125, 95, 124, 127, 120, 126, 118, - 98, 112, 98, 126, 123, 123, 74, 36, 27, 10, - 7, 3, 0, 12, 22, 12, 18, 32, 16, 2, - 22, 4, 29, 30, 88, 45, 12, 10, 25, 93, - 32, 18, 30, 22, 19, 39, 17, 7, 35, 36, - 44, 105, 33, 41, 108, 0, 45, 53, 41, 47, - 33, 103, 5, 51, 63, 41, 57, 62, 59, 20, - 61, 40, 52, 62, 49, 63, 118, 22, 48, 52, - 218, 223, 193, 223, 203, 143, 225, 194, 212, 202, - 206, 198, 134, 230, 210, 192, 200, 218, 223, 220, - 157, 249, 221, 206, 198, 144, 227, 221, 217, 192, - 229, 198, 254, 226, 235, 226, 221, 248, 229, 227, - 229, 163, 201, 239, 226, 226, 252, 193, 243, 237, - 241, 253, 251, 237, 200, 239, 231, 246, 176, 194, - 226, 229, 241, 251, 141, 159, 128, 201, 167, 129, - 136, 136, 154, 165, 137, 147, 149, 147, 196, 168, - 187, 219, 136, 156, 140, 150, 147, 153, 161, 150, - 147, 158, 152, 147, 212, 184, 139, 235, 184, 172, - 188, 166, 163, 169, 131, 181, 165, 179, 167, 160, - 161, 229, 158, 178, 170, 188, 189, 171, 181, 178, - 188, 178, 188, 241, 159, 185, 176, 176, 82, 96, - 77, 69, 90, 65, 73, 95, 2, 96, 72, 64, - 72, 73, 65, 73, 106, 94, 74, 80, 81, 91, - 28, 82, 84, 19, 125, 112, 22, 81, 91, 71, - 42, 64, 109, 101, 122, 97, 105, 127, 37, 112, - 32, 66, 110, 102, 106, 107, 127, 119, 91, 118, - 123, 121, 122, 116, 113, 122, 117, 127, 98, 55, - 123, 115, 74, 8, 0, 8, 0, 1, 9, 1, - 69, 16, 64, 22, 15, 3, 16, 13, 42, 30, - 10, 26, 27, 17, 8, 28, 21, 22, 80, 33, - 4, 30, 23, 16, 106, 4, 59, 42, 39, 35, - 32, 44, 54, 44, 50, 7, 39, 52, 48, 101, - 31, 22, 25, 121, 14, 58, 46, 52, 61, 55, - 3, 61, 57, 32, 116, 16, 231, 234, 136, 249, - 203, 221, 197, 194, 198, 240, 201, 198, 200, 198, - 200, 133, 255, 246, 249, 153, 238, 218, 206, 212, - 221, 215, 227, 197, 217, 212, 220, 212, 249, 255, - 225, 234, 174, 220, 224, 226, 245, 208, 237, 238, - 233, 243, 236, 236, 244, 252, 220, 246, 235, 253, - 240, 248, 178, 224, 253, 254, 249, 227, 252, 252, - 132, 140, 188, 144, 158, 138, 204, 130, 132, 195, - 147, 140, 137, 136, 144, 141, 147, 149, 159, 217, - 173, 139, 147, 158, 154, 146, 131, 133, 159, 148, - 167, 129, 165, 168, 160, 168, 189, 187, 165, 174, - 226, 187, 224, 147, 163, 171, 165, 177, 179, 173, - 189, 249, 141, 171, 174, 184, 188, 180, 164, 185, - 246, 158, 186, 177, 79, 83, 122, 122, 103, 15, - 124, 72, 80, 74, 79, 69, 3, 108, 4, 117, - 95, 73, 81, 86, 90, 26, 120, 29, 98, 86, - 66, 88, 89, 83, 125, 86, 98, 98, 101, 102, - 101, 122, 88, 104, 108, 104, 97, 111, 38, 84, - 97, 107, 81, 114, 114, 108, 112, 63, 79, 120, - 124, 64, 117, 127, 125, 120, 97, 53, 57, 27, - 9, 7, 78, 45, 40, 4, 16, 6, 3, 21, - 15, 8, 10, 4, 22, 91, 53, 22, 8, 26, - 17, 24, 28, 7, 80, 56, 24, 19, 17, 13, - 11, 39, 36, 32, 41, 46, 56, 34, 48, 23, - 57, 49, 35, 103, 43, 35, 122, 17, 57, 46, - 126, 18, 51, 43, 59, 61, 55, 113, 23, 33, - 49, 39, 203, 204, 205, 250, 193, 218, 222, 206, - 199, 131, 208, 211, 207, 196, 193, 133, 220, 212, - 202, 153, 244, 222, 203, 157, 255, 220, 198, 216, - 216, 208, 148, 244, 252, 238, 250, 232, 233, 234, - 220, 232, 240, 234, 239, 229, 166, 232, 226, 165, - 208, 250, 239, 185, 211, 240, 234, 244, 252, 244, - 176, 208, 224, 242, 230, 244, 141, 142, 187, 129, - 135, 137, 152, 205, 141, 133, 192, 171, 135, 144, - 196, 168, 149, 141, 145, 151, 153, 223, 189, 139, - 151, 129, 145, 150, 147, 163, 141, 133, 175, 235, - 167, 175, 238, 155, 169, 168, 182, 171, 224, 140, - 169, 177, 173, 171, 189, 251, 153, 175, 187, 173, - 189, 186, 183, 128, 191, 164, 164, 180, 177, 245, - 90, 89, 65, 74, 75, 15, 74, 66, 80, 3, - 116, 68, 67, 83, 76, 5, 119, 84, 78, 80, - 80, 88, 28, 124, 68, 86, 66, 80, 81, 82, - 100, 80, 120, 98, 103, 109, 46, 96, 106, 45, - 86, 102, 101, 117, 110, 39, 73, 106, 108, 114, - 118, 126, 62, 94, 106, 120, 96, 114, 119, 116, - 69, 127, 125, 115, 30, 75, 7, 15, 78, 59, - 9, 8, 22, 11, 64, 44, 9, 17, 13, 11, - 29, 91, 57, 15, 27, 13, 29, 26, 23, 39, - 9, 1, 19, 87, 27, 19, 106, 7, 33, 57, - 61, 111, 1, 34, 52, 42, 46, 38, 102, 6, - 50, 32, 40, 58, 63, 60, 13, 48, 41, 47, - 49, 54, 112, 33, 36, 62, 55, 48, 138, 205, - 199, 219, 142, 227, 197, 221, 209, 131, 237, 206, - 208, 206, 202, 194, 154, 250, 206, 220, 204, 222, - 219, 216, 226, 214, 194, 216, 217, 211, 148, 218, - 236, 171, 196, 224, 254, 252, 172, 192, 237, 245, - 233, 239, 225, 167, 197, 243, 255, 233, 249, 254, - 251, 204, 244, 244, 244, 231, 176, 254, 240, 183, - 216, 252, 154, 152, 200, 164, 129, 153, 133, 131, - 133, 195, 161, 151, 131, 149, 133, 130, 159, 179, - 145, 138, 138, 144, 142, 148, 145, 146, 156, 209, - 160, 152, 152, 148, 190, 162, 164, 160, 186, 182, - 159, 153, 134, 147, 165, 179, 175, 168, 160, 147, - 181, 183, 185, 173, 183, 179, 181, 169, 171, 131, - 181, 163, 191, 184, 176, 134, 69, 94, 90, 74, - 75, 92, 12, 93, 80, 74, 67, 68, 85, 7, - 66, 74, 72, 27, 112, 111, 127, 83, 80, 29, - 90, 90, 67, 69, 89, 69, 77, 125, 99, 120, - 124, 102, 124, 118, 44, 125, 103, 113, 105, 110, - 98, 67, 109, 118, 106, 119, 121, 96, 62, 114, - 115, 121, 119, 51, 61, 49, 54, 107, 52, 86, - 5, 7, 7, 27, 78, 82, 76, 36, 12, 7, - 9, 2, 7, 19, 11, 23, 55, 26, 22, 24, - 25, 26, 14, 71, 82, 26, 30, 24, 2, 30, - 21, 25, 35, 49, 41, 61, 39, 32, 34, 99, - 108, 109, 9, 47, 34, 46, 39, 36, 46, 52, - 42, 20, 63, 49, 61, 58, 55, 33, 106, 113, - 63, 57, 61, 33, 195, 202, 196, 192, 212, 202, - 200, 141, 209, 214, 195, 194, 195, 212, 215, 195, - 207, 215, 212, 192, 215, 209, 216, 212, 209, 210, - 196, 222, 196, 249, 213, 216, 239, 219, 228, 232, - 237, 234, 195, 255, 230, 230, 242, 210, 242, 245, - 229, 241, 255, 252, 225, 212, 255, 241, 253, 250, - 247, 225, 170, 177, 255, 249, 253, 225, 131, 138, - 132, 128, 148, 142, 152, 132, 141, 141, 206, 207, - 200, 183, 136, 132, 153, 158, 183, 139, 154, 154, - 142, 174, 134, 129, 145, 133, 147, 144, 141, 184, - 171, 165, 169, 174, 171, 189, 246, 237, 171, 173, - 169, 181, 175, 166, 168, 172, 160, 190, 188, 249, - 173, 170, 191, 190, 183, 160, 163, 183, 163, 187, - 184, 172, 108, 74, 65, 69, 75, 75, 12, 89, - 77, 3, 73, 79, 79, 83, 77, 68, 86, 82, - 66, 92, 30, 76, 95, 79, 91, 67, 68, 17, - 17, 16, 72, 105, 36, 111, 100, 101, 104, 125, - 99, 96, 82, 98, 116, 105, 114, 104, 84, 100, - 110, 115, 126, 112, 114, 122, 79, 105, 96, 114, - 100, 116, 113, 110, 89, 116, 4, 10, 15, 12, - 28, 85, 76, 4, 12, 10, 20, 8, 7, 11, - 13, 31, 27, 15, 17, 22, 16, 81, 82, 83, - 33, 7, 2, 16, 2, 18, 19, 12, 7, 42, - 38, 40, 41, 42, 62, 119, 98, 42, 46, 40, - 50, 46, 37, 41, 51, 33, 61, 61, 126, 44, - 41, 62, 49, 54, 35, 34, 48, 34, 56, 57, - 211, 216, 220, 219, 207, 219, 201, 202, 219, 237, - 193, 204, 195, 212, 208, 215, 219, 207, 221, 222, - 199, 214, 210, 219, 221, 157, 200, 220, 218, 252, - 209, 204, 170, 249, 237, 248, 251, 234, 255, 249, - 172, 163, 210, 228, 247, 242, 225, 246, 238, 210, - 252, 185, 163, 191, 167, 189, 193, 246, 254, 245, - 255, 249, 243, 181, 153, 132, 157, 155, 141, 138, - 204, 208, 194, 183, 136, 132, 148, 130, 196, 140, - 137, 219, 150, 150, 222, 143, 157, 143, 151, 157, - 132, 209, 152, 150, 153, 144, 174, 174, 184, 172, - 160, 171, 169, 163, 182, 138, 180, 164, 171, 183, - 165, 183, 191, 181, 172, 144, 170, 186, 177, 174, - 242, 178, 162, 182, 163, 186, 177, 187, 94, 11, - 69, 92, 93, 91, 12, 78, 77, 77, 84, 64, - 79, 73, 87, 5, 91, 79, 24, 85, 91, 94, - 79, 73, 18, 92, 94, 84, 22, 82, 88, 80, - 103, 110, 102, 125, 74, 106, 111, 100, 111, 98, - 108, 81, 106, 102, 103, 96, 105, 77, 121, 117, - 107, 122, 72, 111, 115, 119, 121, 127, 113, 55, - 91, 101, 15, 25, 9, 29, 7, 0, 2, 87, - 66, 32, 1, 15, 5, 2, 8, 69, 21, 9, - 28, 28, 12, 12, 82, 93, 33, 22, 30, 21, - 31, 25, 19, 85, 57, 36, 61, 59, 45, 42, - 108, 112, 98, 23, 50, 32, 34, 46, 42, 34, - 122, 20, 40, 60, 44, 62, 40, 52, 61, 61, - 106, 113, 21, 54, 58, 54, 207, 199, 136, 198, - 220, 203, 201, 223, 209, 141, 128, 238, 212, 195, - 193, 215, 201, 155, 219, 214, 203, 209, 200, 157, - 143, 147, 144, 226, 211, 217, 208, 220, 228, 236, - 168, 250, 225, 250, 254, 238, 231, 163, 189, 161, - 210, 245, 229, 225, 243, 245, 255, 185, 209, 239, - 249, 239, 243, 231, 249, 254, 248, 173, 180, 214, - 139, 133, 139, 140, 130, 207, 131, 159, 134, 134, - 146, 146, 200, 199, 183, 156, 151, 153, 151, 149, - 222, 194, 220, 169, 128, 146, 148, 152, 152, 144, - 212, 186, 186, 174, 186, 168, 186, 166, 163, 163, - 248, 227, 131, 160, 168, 164, 161, 169, 250, 180, - 170, 189, 187, 173, 175, 243, 242, 146, 179, 178, - 185, 162, 186, 161, 10, 22, 8, 18, 14, 110, - 79, 78, 77, 86, 78, 85, 6, 26, 4, 30, - 26, 104, 81, 93, 91, 31, 1, 29, 102, 65, - 81, 85, 95, 89, 83, 21, 69, 123, 109, 123, - 111, 123, 101, 98, 108, 57, 32, 66, 103, 105, - 103, 96, 118, 59, 119, 107, 122, 122, 110, 110, - 60, 51, 67, 120, 114, 114, 52, 40, 74, 80, - 72, 61, 7, 2, 9, 77, 11, 13, 64, 7, - 9, 21, 7, 0, 90, 70, 88, 45, 12, 30, - 24, 20, 28, 20, 80, 62, 6, 18, 6, 20, - 62, 34, 39, 39, 116, 111, 15, 44, 44, 32, - 37, 45, 102, 40, 54, 33, 63, 41, 43, 119, - 126, 11, 53, 48, 55, 115, 57, 63, 118, 49, - 59, 39, 201, 206, 136, 148, 142, 148, 140, 226, - 208, 199, 197, 211, 134, 211, 221, 213, 223, 155, - 133, 153, 133, 159, 243, 207, 214, 214, 194, 145, - 194, 206, 196, 208, 170, 233, 237, 225, 239, 249, - 229, 226, 240, 163, 189, 161, 210, 245, 229, 225, - 243, 245, 255, 185, 209, 239, 249, 239, 243, 231, - 249, 254, 248, 173, 180, 214, 139, 133, 139, 140, - 130, 207, 131, 159, 134, 134, 146, 146, 200, 199, - 171, 151, 158, 158, 138, 217, 138, 134, 140, 152, - 210, 145, 149, 153, 151, 129, 157, 154, 184, 235, - 245, 233, 143, 163, 160, 162, 181, 227, 131, 160, - 168, 164, 161, 169, 155, 183, 180, 150, 174, 186, - 178, 146, 160, 183, 181, 163, 165, 152, 186, 134, - 83, 70, 74, 70, 66, 110, 64, 65, 77, 84, - 0, 98, 71, 73, 71, 64, 86, 122, 84, 85, - 113, 79, 89, 83, 125, 65, 84, 84, 68, 68, - 123, 91, 75, 104, 107, 102, 123, 97, 120, 76, - 110, 111, 111, 118, 38, 68, 101, 107, 121, 126, - 116, 88, 114, 115, 83, 109, 119, 125, 95, 99, - 114, 114, 102, 102, 37, 5, 59, 16, 3, 13, - 3, 1, 35, 13, 4, 32, 5, 4, 11, 16, - 20, 15, 44, 11, 31, 27, 21, 19, 21, 83, - 63, 1, 19, 5, 21, 1, 35, 36, 38, 115, - 110, 12, 32, 34, 49, 38, 96, 49, 41, 52, - 45, 49, 51, 52, 54, 42, 112, 127, 15, 56, - 60, 55, 57, 63, 49, 119, 39, 58, 223, 217, - 203, 204, 142, 146, 140, 249, 208, 194, 196, 200, - 200, 192, 132, 234, 202, 222, 202, 216, 202, 214, - 211, 211, 136, 147, 243, 221, 217, 196, 209, 149, - 250, 228, 251, 224, 250, 230, 227, 227, 241, 173, - 160, 210, 255, 234, 230, 234, 246, 187, 165, 185, - 202, 237, 253, 249, 251, 253, 247, 177, 217, 231, - 241, 231, 139, 159, 129, 134, 128, 213, 204, 174, - 142, 140, 147, 132, 198, 151, 139, 150, 147, 143, - 145, 150, 144, 140, 210, 221, 179, 144, 147, 158, - 131, 153, 128, 213, 247, 235, 156, 187, 175, 171, - 165, 163, 165, 227, 143, 177, 163, 181, 165, 177, - 179, 180, 182, 227, 254, 156, 176, 178, 161, 182, - 240, 161, 185, 164, 189, 161, 67, 68, 70, 90, - 0, 15, 127, 68, 70, 70, 0, 28, 6, 115, - 86, 68, 94, 82, 86, 94, 30, 112, 76, 88, - 64, 82, 68, 88, 89, 89, 14, 21, 73, 103, - 103, 122, 107, 47, 124, 98, 113, 106, 116, 104, - 112, 98, 36, 117, 117, 104, 113, 109, 119, 112, - 114, 110, 60, 51, 67, 116, 120, 115, 125, 123, - 13, 75, 27, 6, 27, 29, 15, 8, 66, 94, - 64, 53, 20, 6, 0, 12, 20, 28, 88, 54, - 14, 26, 14, 28, 6, 26, 31, 31, 76, 87, - 55, 25, 37, 56, 45, 105, 62, 32, 63, 36, - 54, 42, 54, 36, 102, 55, 43, 54, 51, 47, - 49, 54, 48, 44, 114, 125, 1, 42, 61, 51, - 57, 59, 116, 104, 138, 255, 218, 200, 202, 198, - 194, 202, 130, 236, 208, 196, 212, 198, 208, 204, - 213, 213, 130, 153, 253, 211, 211, 206, 215, 147, - 222, 212, 209, 214, 192, 220, 252, 238, 168, 249, - 225, 252, 229, 249, 235, 236, 238, 242, 168, 167, - 215, 224, 244, 255, 241, 247, 249, 191, 239, 242, - 231, 225, 243, 244, 182, 170, 180, 193, 152, 138, - 140, 128, 128, 136, 204, 162, 146, 134, 146, 128, - 146, 142, 139, 139, 192, 219, 187, 149, 145, 140, - 153, 221, 156, 150, 151, 144, 130, 158, 130, 144, - 234, 187, 167, 186, 167, 187, 165, 162, 172, 176, - 238, 225, 149, 190, 169, 167, 181, 183, 248, 228, - 254, 139, 174, 188, 182, 186, 190, 182, 246, 152, - 164, 176, 88, 74, 92, 64, 65, 65, 22, 13, - 112, 70, 86, 68, 84, 84, 65, 5, 74, 84, - 75, 80, 74, 86, 83, 83, 65, 29, 16, 98, - 83, 89, 80, 92, 100, 108, 40, 122, 97, 122, - 126, 110, 103, 35, 61, 33, 82, 117, 101, 97, - 115, 117, 127, 57, 81, 111, 121, 111, 115, 103, - 121, 126, 120, 45, 52, 71, 15, 29, 13, 27, - 29, 10, 76, 29, 13, 16, 9, 21, 15, 8, - 10, 22, 84, 91, 43, 0, 19, 29, 19, 17, - 82, 78, 80, 37, 4, 22, 16, 28, 36, 44, - 104, 6, 62, 42, 62, 44, 54, 42, 47, 47, - 124, 103, 22, 32, 44, 62, 42, 42, 59, 127, - 44, 50, 33, 58, 36, 56, 57, 57, 39, 123, - 138, 234, 203, 202, 193, 218, 194, 217, 130, 158, - 128, 245, 212, 198, 192, 204, 212, 220, 152, 246, - 206, 218, 206, 220, 198, 218, 223, 223, 140, 151, - 242, 217, 235, 255, 252, 236, 224, 161, 172, 222, - 231, 237, 228, 232, 232, 224, 164, 246, 245, 238, - 234, 250, 251, 191, 161, 189, 198, 225, 241, 245, - 255, 249, 243, 181, 165, 155, 141, 155, 143, 155, - 133, 130, 140, 217, 192, 167, 138, 134, 144, 145, - 159, 149, 214, 217, 173, 134, 145, 159, 157, 159, - 208, 204, 214, 177, 152, 148, 190, 191, 173, 167, - 244, 239, 163, 191, 166, 166, 178, 178, 230, 176, - 161, 183, 191, 251, 182, 182, 170, 255, 191, 188, - 188, 176, 181, 189, 186, 178, 176, 245, 75, 77, - 92, 76, 92, 15, 25, 13, 81, 70, 67, 78, - 72, 67, 87, 9, 26, 93, 87, 75, 93, 90, - 28, 77, 93, 64, 89, 69, 95, 88, 90, 21, - 105, 103, 103, 122, 103, 97, 107, 35, 86, 113, - 97, 101, 111, 105, 99, 37, 85, 107, 125, 107, - 127, 107, 117, 114, 124, 41, 48, 83, 100, 114, - 117, 126, 15, 29, 13, 7, 64, 79, 60, 2, - 17, 10, 20, 8, 9, 9, 68, 88, 90, 64, - 88, 54, 24, 25, 15, 24, 6, 83, 77, 81, - 77, 87, 53, 17, 46, 34, 60, 32, 33, 33, - 45, 33, 98, 51, 33, 51, 39, 42, 33, 49, - 63, 41, 43, 121, 61, 48, 41, 51, 38, 115, - 109, 113, 38, 56, 39, 60, 222, 194, 199, 199, - 237, 206, 194, 138, 214, 131, 198, 200, 200, 195, - 132, 246, 246, 155, 215, 203, 218, 218, 206, 242, - 220, 214, 144, 193, 217, 196, 221, 193, 227, 228, - 230, 169, 224, 234, 248, 249, 235, 237, 231, 161, - 242, 254, 244, 224, 186, 233, 253, 232, 235, 246, - 238, 248, 246, 192, 228, 254, 230, 183, 251, 231, - 142, 142, 154, 201, 154, 150, 156, 136, 194, 145, - 133, 144, 147, 142, 150, 128, 158, 180, 136, 156, - 144, 154, 152, 221, 130, 156, 131, 152, 130, 158, - 155, 155, 234, 185, 173, 184, 187, 166, 190, 168, - 166, 151, 169, 172, 163, 168, 177, 177, 136, 190, - 190, 172, 173, 186, 159, 188, 188, 244, 164, 241, - 176, 190, 186, 177, 10, 74, 70, 80, 14, 92, - 88, 66, 82, 11, 83, 8, 6, 70, 74, 65, - 26, 79, 89, 82, 91, 23, 79, 20, 18, 92, - 66, 85, 83, 69, 71, 97, 120, 106, 108, 96, - 96, 104, 44, 66, 114, 102, 114, 96, 114, 110, - 107, 107, 32, 59, 89, 125, 116, 106, 111, 105, - 50, 64, 92, 62, 66, 71, 58, 53, 58, 4, - 27, 0, 26, 6, 3, 3, 66, 94, 64, 40, - 8, 17, 5, 9, 19, 31, 88, 10, 10, 16, - 12, 93, 30, 28, 3, 2, 86, 22, 16, 31, - 63, 56, 60, 36, 43, 33, 56, 109, 48, 38, - 51, 52, 42, 51, 13, 43, 44, 58, 52, 48, - 58, 127, 40, 60, 57, 54, 112, 33, 36, 56, - 50, 60, 222, 139, 201, 205, 196, 218, 223, 217, - 207, 198, 206, 213, 134, 213, 193, 214, 207, 215, - 204, 248, 210, 211, 211, 202, 146, 255, 217, 223, - 221, 151, 251, 246, 197, 223, 250, 232, 234, 230, - 226, 234, 162, 204, 240, 228, 244, 230, 240, 236, - 245, 245, 162, 185, 223, 251, 246, 232, 225, 231, - 176, 226, 226, 248, 228, 181, 134, 132, 155, 154, - 192, 207, 188, 130, 145, 138, 148, 136, 137, 137, - 196, 216, 218, 192, 216, 170, 138, 144, 140, 142, - 200, 211, 203, 209, 191, 153, 157, 129, 163, 170, - 164, 233, 189, 187, 163, 189, 226, 175, 175, 178, - 181, 253, 228, 145, 168, 186, 188, 176, 176, 184, - 252, 146, 162, 182, 162, 176, 162, 190, 187, 187, - 16, 11, 105, 77, 68, 90, 95, 89, 2, 87, - 65, 74, 67, 7, 84, 87, 85, 93, 81, 77, - 16, 31, 108, 82, 65, 90, 68, 88, 89, 89, - 20, 8, 42, 48, 40, 93, 111, 100, 105, 126, - 56, 35, 59, 33, 79, 105, 109, 113, 115, 122, - 116, 57, 106, 126, 119, 120, 50, 99, 98, 126, - 112, 126, 96, 47, 74, 34, 6, 10, 1, 29, - 30, 8, 1, 23, 64, 21, 7, 21, 3, 0, - 14, 91, 12, 24, 21, 26, 92, 13, 0, 26, - 19, 20, 49, 5, 27, 0, 58, 31, 58, 40, - 42, 38, 34, 42, 13, 51, 37, 51, 39, 51, - 45, 42, 52, 123, 35, 121, 10, 38, 44, 56, - 114, 110, 112, 125, 118, 17, 61, 57, 222, 206, - 218, 218, 142, 146, 140, 221, 195, 209, 193, 204, - 195, 211, 193, 215, 201, 239, 202, 216, 218, 214, - 210, 218, 146, 220, 192, 212, 196, 214, 192, 220, - 229, 229, 251, 169, 231, 252, 172, 225, 237, 224, - 235, 228, 226, 211, 246, 228, 254, 242, 246, 254, - 190, 240, 236, 248, 224, 242, 228, 248, 249, 249, - 231, 181, 131, 152, 200, 133, 129, 140, 135, 136, - 134, 195, 134, 142, 148, 199, 133, 134, 153, 148, - 141, 151, 138, 170, 146, 150, 156, 156, 135, 159, - 214, 131, 134, 148, 174, 162, 166, 174, 238, 160, - 188, 168, 176, 162, 180, 168, 169, 169, 180, 164, - 168, 186, 181, 188, 170, 186, 174, 174, 158, 186, - 163, 165, 134, 182, 166, 176, 68, 95, 8, 70, - 92, 75, 73, 95, 2, 76, 82, 1, 86, 72, - 87, 76, 78, 82, 87, 87, 30, 86, 79, 29, - 92, 70, 92, 93, 120, 88, 20, 90, 120, 111, - 109, 123, 46, 123, 117, 125, 103, 112, 32, 103, - 105, 117, 36, 102, 118, 116, 107, 112, 112, 120, - 60, 114, 96, 119, 117, 99, 101, 68, 109, 120, - 8, 4, 4, 73, 15, 1, 8, 77, 3, 0, - 3, 14, 19, 9, 16, 69, 27, 9, 29, 89, - 16, 10, 16, 17, 61, 1, 20, 20, 4, 87, - 28, 20, 57, 107, 38, 38, 58, 111, 41, 53, - 43, 48, 52, 17, 41, 52, 45, 49, 51, 52, - 54, 121, 54, 62, 47, 125, 60, 60, 36, 113, - 51, 47, 61, 38, 222, 198, 219, 202, 193, 221, - 192, 196, 192, 247, 210, 192, 194, 206, 202, 194, - 234, 215, 217, 205, 216, 208, 206, 208, 156, 241, - 197, 194, 223, 217, 209, 198, 249, 199, 233, 240, - 235, 253, 206, 228, 236, 231, 233, 239, 225, 213, - 225, 225, 243, 233, 253, 250, 234, 177, 228, 240, - 254, 221, 241, 252, 243, 197, 241, 241, 131, 153, - 141, 138, 154, 191, 141, 153, 138, 165, 129, 136, - 138, 199, 144, 138, 218, 139, 138, 150, 157, 154, - 143, 142, 210, 177, 153, 159, 146, 158, 154, 146, - 152, 174, 172, 160, 188, 170, 175, 185, 236, 187, - 173, 173, 230, 161, 173, 169, 191, 241, 246, 189, - 178, 179, 143, 164, 161, 167, 181, 188, 149, 162, - 167, 161, 69, 70, 102, 72, 67, 74, 96, 66, - 65, 72, 69, 69, 104, 115, 102, 104, 81, 27, - 27, 21, 14, 17, 31, 30, 17, 16, 19, 18, - 21, 20, 23, 22, 41, 39, 56, 39, 62, 44, - 44, 68, 108, 109, 101, 115, 38, 98, 124, 102, - 127, 107, 108, 112, 113, 113, 38, 61, 123, 103, - 117, 124, 101, 94, 122, 118, 5, 25, 26, 12, - 13, 27, 76, 15, 16, 2, 3, 10, 3, 19, - 23, 69, 10, 26, 10, 24, 19, 26, 8, 24, - 0, 0, 94, 81, 34, 24, 0, 20, 38, 107, - 43, 40, 34, 44, 57, 33, 35, 55, 37, 37, - 102, 54, 49, 36, 52, 47, 49, 45, 39, 127, - 116, 116, 114, 55, 63, 52, 37, 119, 58, 58, - 222, 139, 197, 200, 218, 204, 196, 141, 205, 209, - 196, 196, 212, 135, 213, 208, 219, 213, 204, 208, - 202, 198, 156, 149, 155, 157, 249, 223, 213, 216, - 198, 199, 239, 232, 252, 169, 236, 253, 237, 238, - 233, 230, 244, 242, 166, 247, 229, 247, 251, 246, - 253, 237, 251, 237, 239, 179, 178, 209, 226, 240, - 245, 252, 241, 225, 202, 154, 157, 136, 128, 155, - 133, 153, 155, 195, 131, 128, 136, 199, 138, 138, - 142, 219, 154, 156, 222, 207, 210, 141, 147, 135, - 152, 189, 147, 129, 145, 153, 185, 159, 141, 167, - 187, 162, 236, 160, 183, 176, 180, 225, 164, 162, - 228, 164, 180, 251, 189, 183, 171, 178, 185, 175, - 179, 167, 181, 181, 246, 163, 173, 165, 79, 127, - 90, 72, 74, 70, 66, 74, 113, 90, 77, 67, - 73, 75, 67, 9, 118, 84, 95, 94, 91, 77, - 127, 82, 92, 85, 89, 86, 122, 88, 83, 82, - 111, 121, 70, 104, 99, 106, 44, 48, 34, 47, - 32, 78, 115, 115, 116, 112, 110, 93, 119, 117, - 122, 122, 110, 77, 115, 103, 120, 49, 43, 55, - 56, 53, 57, 8, 7, 25, 11, 79, 81, 77, - 46, 12, 7, 6, 3, 21, 23, 41, 21, 28, - 31, 28, 12, 62, 12, 13, 30, 26, 19, 16, - 2, 30, 27, 27, 100, 101, 20, 103, 96, 19, - 0, 34, 37, 48, 19, 36, 52, 46, 40, 42, - 61, 55, 55, 62, 57, 62, 62, 49, 55, 0, - 36, 48, 36, 35, 116, 49, 207, 199, 205, 221, - 199, 193, 203, 141, 205, 207, 196, 129, 202, 200, - 195, 133, 220, 210, 212, 220, 205, 145, 146, 147, - 246, 214, 220, 212, 194, 222, 218, 210, 170, 237, - 225, 231, 231, 252, 228, 232, 230, 173, 204, 238, - 225, 224, 225, 247, 160, 187, 220, 252, 242, 250, - 232, 248, 178, 255, 255, 246, 182, 241, 253, 249, - 143, 152, 198, 166, 163, 138, 159, 158, 131, 132, - 133, 219, 198, 162, 156, 134, 159, 139, 140, 144, - 145, 145, 198, 221, 209, 155, 153, 149, 146, 146, - 154, 214, 137, 164, 186, 172, 130, 160, 175, 172, - 176, 170, 186, 164, 180, 171, 171, 166, 187, 183, - 189, 247, 179, 176, 185, 179, 255, 134, 131, 157, - 185, 180, 181, 185, 67, 81, 77, 91, 0, 102, - 66, 68, 86, 102, 110, 98, 71, 83, 69, 73, - 85, 92, 23, 23, 74, 75, 116, 117, 8, 94, - 93, 89, 94, 13, 89, 88, 42, 127, 124, 65, - 70, 53, 97, 96, 56, 112, 115, 105, 110, 61, - 105, 104, 32, 104, 107, 57, 106, 107, 72, 116, - 127, 118, 69, 101, 127, 123, 103, 47, 74, 2, - 6, 0, 26, 6, 13, 1, 11, 25, 1, 21, - 15, 8, 10, 75, 84, 85, 44, 16, 19, 26, - 41, 9, 27, 31, 3, 75, 86, 30, 26, 28, - 62, 34, 41, 37, 39, 53, 41, 41, 98, 48, - 53, 34, 37, 34, 55, 54, 60, 46, 52, 53, - 39, 24, 56, 46, 33, 32, 35, 107, 48, 49, - 50, 33, 206, 133, 229, 135, 215, 214, 200, 201, - 140, 238, 237, 143, 223, 222, 192, 193, 148, 246, - 245, 151, 199, 198, 197, 196, 214, 148, 159, 150, - 251, 144, 155, 146, 243, 242, 236, 237, 169, 160, - 171, 192, 207, 164, 175, 166, 255, 254, 224, 225, - 189, 180, 191, 212, 211, 184, 179, 186, 235, 234, - 233, 232, 219, 185, 240, 187, 147, 146, 165, 164, - 192, 139, 136, 195, 155, 154, 173, 172, 200, 131, - 128, 203, 131, 130, 129, 128, 179, 216, 211, 218, - 150, 212, 223, 214, 143, 142, 185, 184, 237, 228, - 239, 173, 170, 232, 227, 234, 187, 186, 141, 140, - 225, 232, 227, 161, 190, 252, 247, 254, 167, 166, - 165, 164, 145, 178, 190, 246, 162, 247, 167, 176, - 94, 11, 91, 89, 75, 76, 69, 75, 75, 64, - 0, 85, 79, 74, 65, 127, 85, 85, 93, 112, - 80, 89, 83, 29, 66, 82, 66, 80, 91, 82, - 64, 80, 120, 43, 127, 96, 122, 103, 44, 65, - 109, 96, 97, 109, 38, 115, 125, 117, 127, 79, - 112, 124, 62, 75, 117, 112, 119, 73, 127, 127, - 115, 94, 122, 115, 5, 75, 1, 26, 78, 1, - 25, 1, 14, 47, 15, 2, 7, 11, 49, 49, - 57, 91, 80, 44, 42, 60, 85, 81, 82, 83, - 0, 3, 31, 20, 17, 85, 38, 46, 62, 44, - 34, 60, 26, 2, 14, 22, 13, 4, 7, 9, - 5, 9, 3, 8, 17, 10, 1, 15, 29, 30, - 25, 18, 23, 20, 27, 2, 24, 1, 227, 244, - 233, 250, 253, 234, 248, 242, 242, 226, 227, 234, - 231, 224, 225, 230, 232, 226, 232, 237, 241, 224, - 236, 252, 241, 248, 241, 246, 243, 238, 219, 192, - 248, 171, 228, 224, 237, 234, 226, 254, 231, 163, - 228, 238, 227, 244, 234, 162, 238, 187, 249, 245, - 242, 240, 235, 189, 196, 252, 252, 228, 251, 242, - 180, 212, 132, 138, 132, 144, 157, 134, 159, 180, - 141, 150, 146, 193, 138, 142, 135, 128, 148, 136, - 157, 217, 159, 147, 144, 146, 133, 128, 208, 158, - 152, 155, 141, 213, 251, 235, 191, 172, 171, 164, - 236, 162, 164, 227, 150, 174, 170, 178, 169, 160, - 250, 154, 182, 184, 178, 166, 175, 180, 161, 154, - 190, 167, 183, 187, 189, 177, 10, 89, 77, 90, - 94, 64, 66, 94, 71, 3, 70, 83, 73, 74, - 4, 104, 85, 95, 93, 3, 30, 106, 82, 86, - 92, 92, 71, 95, 101, 78, 89, 88, 111, 127, - 122, 96, 109, 47, 77, 110, 118, 106, 118, 100, - 85, 126, 105, 104, 127, 111, 106, 112, 125, 63, - 76, 124, 97, 122, 102, 116, 85, 123, 125, 112, - 4, 31, 59, 12, 28, 25, 9, 31, 32, 17, - 15, 0, 2, 4, 5, 22, 14, 118, 114, 53, - 17, 28, 29, 17, 82, 7, 25, 28, 19, 77, - 84, 120, 64, 7, 39, 42, 47, 35, 108, 14, - 46, 44, 35, 42, 102, 8, 34, 35, 41, 62, - 44, 99, 126, 127, 49, 46, 95, 89, 32, 62, - 57, 59, 122, 59, 222, 219, 134, 198, 220, 200, - 216, 196, 207, 198, 142, 214, 207, 201, 192, 202, - 205, 200, 150, 218, 209, 210, 200, 212, 223, 214, - 158, 214, 217, 216, 211, 217, 239, 165, 235, 230, - 227, 251, 229, 224, 231, 173, 238, 232, 245, 243, - 170, 226, 245, 237, 204, 240, 243, 250, 188, 234, - 243, 224, 176, 226, 239, 249, 247, 253, 152, 132, - 134, 128, 148, 138, 136, 195, 194, 160, 149, 147, - 148, 130, 138, 145, 218, 148, 158, 159, 141, 154, - 136, 221, 218, 158, 131, 216, 204, 215, 167, 128, - 185, 187, 173, 170, 186, 170, 168, 237, 171, 173, - 163, 174, 180, 181, 161, 166, 174, 251, 183, 191, - 184, 172, 185, 169, 242, 181, 162, 190, 187, 247, - 167, 176, 88, 93, 77, 91, 20, 15, 127, 72, - 78, 70, 67, 85, 67, 67, 4, 74, 88, 81, - 93, 90, 74, 31, 95, 92, 92, 20, 68, 17, - 84, 82, 20, 70, 111, 121, 97, 104, 98, 102, - 118, 104, 102, 85, 97, 115, 111, 102, 102, 105, - 127, 59, 111, 112, 106, 119, 60, 110, 98, 118, - 115, 120, 112, 126, 113, 113, 74, 5, 9, 4, - 11, 79, 2, 2, 22, 67, 5, 25, 15, 20, - 16, 22, 29, 23, 23, 27, 31, 19, 42, 28, - 0, 26, 17, 19, 26, 18, 7, 3, 43, 57, - 33, 40, 44, 35, 41, 35, 35, 46, 37, 55, - 39, 43, 49, 32, 51, 40, 22, 44, 50, 51, - 27, 49, 61, 49, 49, 61, 0, 54, 38, 60, - 203, 201, 196, 204, 221, 129, 200, 204, 214, 247, - 210, 212, 195, 243, 203, 202, 154, 217, 209, 222, - 158, 208, 222, 215, 215, 208, 196, 243, 195, 209, - 210, 208, 248, 238, 236, 217, 252, 224, 239, 232, - 241, 240, 239, 243, 209, 238, 240, 237, 202, 233, - 241, 246, 236, 246, 232, 228, 188, 195, 226, 254, - 245, 242, 231, 230, 167, 138, 134, 144, 186, 142, - 159, 134, 145, 217, 192, 160, 136, 199, 129, 151, - 136, 148, 138, 217, 145, 156, 159, 136, 128, 150, - 148, 203, 214, 181, 129, 147, 172, 174, 186, 172, - 170, 159, 190, 162, 161, 166, 179, 178, 169, 181, - 147, 172, 174, 179, 136, 171, 183, 176, 174, 180, - 166, 170, 254, 129, 163, 164, 188, 239, 10, 106, - 70, 9, 75, 93, 94, 66, 80, 3, 79, 66, - 69, 82, 86, 64, 94, 1, 24, 112, 80, 73, - 93, 81, 91, 87, 16, 65, 68, 94, 91, 71, - 99, 127, 113, 121, 98, 122, 107, 32, 107, 109, - 115, 47, 40, 91, 42, 43, 70, 53, 54, 69, - 86, 118, 111, 105, 125, 97, 105, 71, 121, 123, - 97, 120, 15, 42, 6, 8, 2, 22, 31, 4, - 17, 54, 19, 4, 20, 51, 22, 4, 30, 30, - 11, 58, 31, 28, 20, 24, 33, 22, 4, 5, - 31, 25, 19, 6, 25, 40, 58, 32, 62, 59, - 63, 30, 33, 49, 41, 49, 50, 52, 0, 36, - 46, 58, 17, 55, 58, 54, 63, 60, 38, 60, - 34, 34, 5, 35, 38, 52, 222, 206, 207, 192, - 203, 220, 252, 193, 195, 192, 197, 238, 212, 195, - 193, 215, 233, 207, 202, 216, 202, 218, 219, 212, - 215, 192, 230, 212, 216, 211, 219, 199, 249, 233, - 225, 231, 218, 234, 225, 253, 207, 230, 228, 232, - 231, 202, 225, 246, 233, 254, 246, 254, 251, 237, - 239, 212, 252, 231, 245, 227, 224, 246, 248, 175, - 202, 134, 137, 145, 170, 138, 139, 159, 135, 134, - 175, 135, 182, 134, 150, 132, 150, 151, 157, 149, - 151, 140, 145, 190, 157, 157, 158, 148, 149, 131, - 157, 154, 164, 235, 174, 160, 160, 166, 191, 165, - 167, 167, 131, 174, 168, 169, 161, 166, 174, 178, - 183, 183, 254, 179, 179, 174, 166, 156, 162, 181, - 179, 165, 244, 182, 88, 78, 73, 93, 75, 75, - 3, 78, 67, 77, 67, 68, 74, 66, 64, 10, - 72, 94, 72, 85, 95, 92, 89, 89, 125, 65, - 84, 84, 68, 23, 82, 92, 102, 103, 109, 109, - 65, 125, 104, 104, 112, 35, 114, 100, 108, 98, - 103, 113, 127, 127, 72, 118, 109, 118, 104, 116, - 125, 125, 48, 114, 122, 120, 103, 112, 14, 47, - 13, 15, 15, 26, 0, 25, 66, 2, 12, 4, - 20, 19, 49, 21, 30, 26, 12, 28, 94, 62, - 10, 28, 27, 31, 17, 19, 26, 18, 23, 26, - 36, 37, 45, 42, 58, 38, 35, 35, 4, 42, - 46, 40, 53, 47, 33, 33, 116, 44, 57, 47, - 61, 48, 50, 51, 55, 48, 36, 56, 57, 57, - 24, 58, 217, 223, 134, 222, 207, 217, 227, 223, - 198, 198, 210, 226, 212, 194, 197, 209, 223, 223, - 150, 206, 223, 201, 211, 207, 214, 214, 194, 247, - 223, 219, 216, 208, 238, 165, 255, 232, 248, 224, - 254, 233, 231, 241, 210, 228, 236, 226, 231, 241, - 255, 255, 182, 238, 255, 233, 204, 242, 225, 250, - 228, 248, 249, 249, 215, 249, 133, 152, 141, 141, - 192, 152, 141, 155, 166, 134, 134, 128, 147, 139, - 144, 164, 150, 158, 138, 141, 208, 136, 157, 139, - 167, 131, 148, 144, 130, 146, 218, 130, 171, 189, - 147, 230, 229, 242, 145, 180, 226, 167, 156, 165, - 154, 231, 172, 153, 178, 179, 132, 177, 130, 255, - 177, 129, 191, 190, 189, 141, 236, 164, 167, 166, - 118, 88, 76, 9, 70, 15, 65, 13, 81, 111, - 73, 66, 67, 73, 71, 64, 113, 94, 65, 106, - 74, 94, 78, 73, 118, 82, 68, 84, 98, 94, - 87, 94, 121, 78, 102, 109, 74, 110, 120, 104, - 86, 106, 99, 106, 117, 78, 106, 115, 123, 119, - 113, 125, 62, 107, 115, 118, 119, 125, 48, 101, - 111, 103, 113, 47, 74, 41, 41, 58, 39, 44, - 51, 61, 35, 32, 43, 32, 33, 34, 41, 44, - 40, 41, 55, 43, 33, 43, 46, 60, 54, 58, - 62, 54, 39, 34, 53, 59, 30, 4, 31, 12, - 28, 16, 0, 4, 22, 6, 3, 19, 31, 23, - 16, 10, 5, 18, 22, 29, 23, 30, 3, 13, - 19, 16, 27, 16, 17, 18, 4, 7, 239, 230, - 225, 252, 227, 240, 252, 225, 247, 240, 255, 241, - 231, 228, 239, 228, 253, 254, 232, 246, 233, 250, - 238, 233, 224, 242, 244, 244, 229, 232, 228, 244, - 201, 192, 201, 206, 203, 223, 222, 200, 207, 202, - 213, 204, 217, 215, 197, 198, 209, 218, 223, 220, - 209, 207, 200, 212, 221, 221, 195, 206, 198, 214, - 215, 222, 171, 172, 173, 189, 190, 160, 175, 165, - 163, 177, 180, 190, 182, 166, 167, 174, 187, 188, - 189, 173, 172, 190, 184, 180, 188, 180, 175, 162, - 191, 176, 186, 180, 134, 148, 152, 136, 141, 132, - 141, 138, 135, 135, 143, 140, 149, 146, 150, 131, - 155, 152, 157, 134, 142, 158, 159, 150, 147, 148, - 149, 158, 132, 147, 145, 135, 108, 103, 103, 126, - 113, 127, 109, 110, 105, 98, 103, 100, 114, 117, - 113, 96, 126, 122, 108, 120, 97, 105, 121, 113, - 125, 112, 121, 101, 111, 116, 97, 102, 94, 68, - 69, 76, 92, 95, 94, 66, 82, 92, 76, 72, - 69, 66, 74, 86, 95, 74, 77, 88, 80, 75, - 83, 74, 87, 65, 79, 80, 82, 65, 85, 91, - 41, 46, 44, 54, 43, 62, 57, 36, 54, 58, - 49, 52, 39, 41, 48, 42, 45, 62, 42, 38, - 63, 59, 42, 60, 60, 48, 53, 53, 41, 62, - 58, 49, 3, 8, 13, 26, 31, 26, 13, 3, - 22, 12, 23, 4, 20, 24, 5, 1, 12, 26, - 22, 26, 27, 27, 3, 30, 29, 30, 29, 30, - 18, 30, 0, 12, 251, 254, 233, 231, 250, 224, - 251, 232, 240, 252, 225, 229, 240, 230, 234, 230, - 255, 255, 231, 252, 239, 234, 245, 233, 235, 236, - 243, 254, 251, 250, 251, 241, 195, 223, 193, 204, - 221, 204, 201, 201, 208, 204, 205, 192, 212, 204, - 193, 209, 222, 218, 204, 216, 193, 207, 221, 222, - 217, 210, 215, 212, 212, 246, 231, 252, 137, 168, - 154, 144, 158, 155, 131, 205, 178, 130, 131, 138, - 135, 128, 129, 168, 143, 151, 140, 144, 211, 158, - 143, 142, 151, 135, 208, 161, 151, 148, 159, 148, - 173, 174, 137, 173, 184, 174, 162, 174, 167, 167, - 224, 135, 163, 166, 176, 176, 168, 190, 171, 137, - 172, 186, 177, 180, 167, 190, 240, 129, 186, 162, - 167, 148, 70, 71, 8, 64, 64, 15, 67, 67, - 71, 117, 79, 77, 83, 74, 65, 5, 123, 85, - 89, 85, 71, 76, 85, 78, 98, 92, 71, 84, - 68, 23, 96, 71, 107, 111, 109, 122, 74, 64, - 65, 45, 113, 118, 114, 103, 103, 100, 97, 74, - 104, 127, 125, 107, 62, 89, 112, 114, 101, 71, - 64, 94, 54, 84, 124, 116, 24, 31, 39, 25, - 26, 6, 3, 3, 66, 23, 18, 0, 2, 14, - 10, 2, 57, 14, 11, 13, 17, 18, 25, 15, - 34, 1, 31, 1, 59, 30, 6, 7, 37, 57, - 104, 29, 60, 46, 40, 36, 44, 36, 20, 51, - 39, 35, 45, 43, 61, 123, 11, 32, 45, 43, - 57, 48, 33, 2, 37, 48, 56, 35, 59, 34, - 207, 217, 136, 229, 199, 219, 201, 252, 215, 194, - 206, 213, 201, 208, 193, 215, 154, 250, 220, 207, - 223, 209, 223, 216, 214, 147, 157, 145, 243, 198, - 193, 220, 254, 242, 220, 251, 251, 234, 172, 201, - 227, 247, 225, 161, 208, 226, 232, 234, 249, 242, - 236, 224, 207, 234, 253, 243, 230, 252, 231, 244, - 228, 183, 213, 241, 156, 138, 134, 138, 139, 139, - 204, 192, 194, 170, 142, 133, 143, 132, 129, 150, - 218, 211, 177, 151, 154, 154, 132, 221, 180, 213, - 191, 216, 167, 130, 149, 155, 190, 164, 191, 172, - 188, 239, 141, 169, 180, 162, 174, 162, 163, 163, - 228, 237, 153, 180, 181, 180, 177, 187, 181, 169, - 171, 250, 129, 164, 183, 185, 160, 186, 93, 78, - 90, 9, 111, 75, 90, 76, 76, 64, 69, 69, - 6, 10, 4, 96, 75, 78, 81, 77, 71, 31, - 26, 29, 113, 92, 93, 92, 89, 83, 93, 65, - 115, 72, 109, 109, 124, 96, 44, 64, 99, 113, - 107, 100, 114, 39, 96, 100, 110, 122, 91, 120, - 112, 124, 121, 113, 50, 100, 113, 120, 98, 55, - 117, 118, 9, 14, 27, 26, 78, 27, 3, 6, - 7, 13, 5, 15, 2, 20, 1, 22, 9, 18, - 23, 23, 88, 33, 90, 30, 31, 23, 95, 18, - 86, 4, 0, 20, 56, 63, 104, 49, 42, 40, - 97, 34, 50, 38, 46, 46, 54, 34, 42, 2, - 63, 47, 30, 43, 59, 58, 12, 50, 32, 39, - 25, 63, 4, 54, 58, 50, 207, 135, 136, 230, - 219, 219, 140, 194, 196, 131, 208, 206, 212, 211, - 215, 214, 207, 217, 221, 212, 223, 214, 208, 216, - 220, 199, 217, 197, 207, 134, 209, 219, 254, 226, - 252, 240, 188, 161, 172, 206, 237, 237, 246, 228, - 244, 243, 225, 247, 233, 187, 165, 185, 221, 240, - 242, 243, 247, 240, 228, 248, 249, 249, 221, 241, - 173, 153, 135, 156, 158, 194, 174, 132, 140, 130, - 142, 130, 131, 165, 141, 139, 155, 149, 155, 156, - 222, 172, 140, 146, 134, 177, 153, 159, 151, 153, - 151, 144, 234, 158, 155, 139, 167, 161, 173, 163, - 161, 166, 224, 146, 182, 168, 176, 229, 143, 136, - 154, 176, 176, 190, 178, 190, 183, 243, 150, 164, - 162, 162, 166, 176, 89, 105, 65, 71, 79, 65, - 79, 72, 2, 118, 115, 101, 114, 10, 105, 5, - 124, 78, 76, 76, 76, 90, 79, 21, 31, 26, - 24, 28, 74, 19, 29, 21, 118, 43, 40, 117, - 46, 76, 99, 120, 108, 119, 32, 60, 38, 39, - 120, 37, 78, 116, 108, 120, 114, 63, 112, 120, - 100, 118, 124, 98, 54, 42, 52, 67, 15, 25, - 27, 0, 1, 1, 63, 8, 16, 10, 1, 13, - 15, 29, 1, 23, 64, 91, 30, 24, 23, 19, - 92, 9, 29, 83, 2, 20, 5, 3, 27, 7, - 47, 107, 33, 61, 43, 34, 98, 62, 39, 55, - 52, 40, 40, 32, 55, 49, 51, 56, 51, 42, - 31, 10, 24, 114, 17, 18, 20, 16, 3, 19, - 123, 22, 226, 237, 233, 252, 234, 128, 230, 253, - 251, 226, 245, 229, 137, 237, 244, 252, 154, 147, - 239, 252, 251, 244, 249, 243, 246, 154, 241, 228, - 242, 152, 252, 254, 206, 202, 221, 205, 161, 193, - 214, 201, 195, 214, 196, 174, 213, 192, 192, 196, - 207, 223, 183, 204, 205, 219, 221, 200, 214, 188, - 197, 194, 210, 183, 188, 194, 175, 174, 163, 172, - 160, 171, 197, 174, 163, 167, 207, 162, 174, 161, - 167, 164, 190, 212, 176, 178, 186, 188, 189, 185, - 221, 185, 160, 168, 181, 182, 176, 218, 153, 140, - 140, 138, 134, 137, 227, 133, 137, 135, 131, 137, - 128, 232, 142, 149, 131, 152, 144, 159, 241, 133, - 157, 143, 151, 134, 130, 254, 151, 130, 144, 144, - 127, 121, 7, 106, 111, 107, 105, 120, 112, 12, - 99, 105, 96, 98, 113, 119, 21, 120, 98, 114, - 123, 106, 110, 18, 118, 120, 123, 116, 99, 101, - 27, 114, 72, 91, 77, 92, 92, 32, 68, 70, - 70, 70, 85, 83, 41, 79, 81, 67, 95, 78, - 74, 54, 84, 79, 69, 88, 71, 65, 63, 92, - 78, 89, 81, 64, 56, 68, 38, 38, 37, 42, - 57, 63, 77, 45, 58, 37, 35, 50, 54, 74, - 42, 55, 54, 60, 43, 45, 83, 47, 61, 61, - 53, 36, 36, 88, 38, 32, 8, 14, 29, 27, - 97, 28, 9, 6, 7, 22, 18, 110, 21, 0, - 0, 0, 15, 9, 119, 13, 12, 6, 25, 8, - 0, 124, 5, 2, 18, 18, 1, 7, 133, 254, - 251, 237, 142, 135, 251, 232, 231, 232, 229, 239, - 226, 142, 225, 240, 232, 148, 226, 248, 236, 248, - 254, 237, 157, 242, 229, 245, 241, 245, 228, 154, - 201, 202, 204, 206, 204, 223, 163, 206, 202, 197, - 199, 195, 214, 168, 199, 223, 209, 220, 218, 201, - 177, 219, 215, 214, 213, 209, 192, 190, 222, 220, - 208, 210, 168, 187, 199, 161, 187, 169, 171, 175, - 178, 204, 170, 177, 191, 160, 166, 181, 213, 182, - 160, 183, 185, 189, 172, 210, 188, 188, 187, 182, - 180, 167, 219, 187, 144, 143, 143, 139, 158, 224, - 156, 129, 140, 132, 130, 145, 233, 148, 129, 142, - 157, 153, 136, 246, 141, 152, 152, 154, 144, 131, - 255, 133, 132, 142, 147, 151, 122, 4, 125, 122, - 106, 104, 110, 125, 13, 118, 115, 101, 6, 15, - 115, 96, 127, 112, 125, 119, 122, 22, 123, 127, - 98, 28, 106, 112, 100, 127, 127, 113, 37, 65, - 88, 80, 64, 64, 71, 34, 81, 70, 75, 79, - 92, 67, 43, 70, 91, 95, 86, 67, 90, 48, - 95, 85, 84, 93, 74, 85, 57, 95, 95, 81, - 36, 49, 44, 70, 36, 63, 53, 35, 56, 39, - 79, 50, 33, 35, 42, 63, 62, 84, 45, 42, - 58, 44, 59, 57, 93, 48, 56, 55, 37, 48, - 48, 90, 2, 0, 12, 26, 9, 11, 99, 7, - 18, 26, 20, 19, 31, 104, 14, 21, 3, 14, - 11, 29, 113, 28, 29, 25, 7, 0, 20, 126, - 21, 31, 18, 0, 249, 239, 135, 234, 230, 233, - 140, 133, 245, 230, 229, 234, 227, 233, 224, 140, - 239, 232, 252, 150, 253, 241, 244, 232, 225, 247, - 159, 242, 236, 252, 225, 230, 206, 164, 204, 194, - 197, 218, 223, 201, 173, 203, 203, 197, 211, 212, - 192, 170, 211, 213, 202, 204, 205, 219, 179, 213, - 199, 213, 197, 194, 210, 184, 221, 217, 185, 190, - 187, 173, 193, 165, 188, 180, 183, 176, 164, 206, - 172, 183, 189, 197, 210, 172, 189, 188, 181, 186, - 178, 185, 219, 166, 163, 181, 217, 186, 172, 187, - 159, 152, 140, 230, 128, 128, 135, 152, 145, 135, - 239, 145, 138, 137, 145, 150, 158, 244, 138, 150, - 144, 138, 143, 153, 253, 129, 133, 147, 131, 132, - 144, 250, 121, 106, 122, 124, 125, 107, 3, 126, - 103, 104, 117, 114, 98, 8, 119, 98, 126, 110, - 107, 125, 17, 107, 116, 127, 103, 96, 116, 30, - 98, 101, 109, 96, 89, 79, 39, 83, 79, 93, - 86, 76, 80, 44, 74, 81, 95, 64, 72, 65, - 53, 88, 86, 81, 77, 83, 74, 50, 81, 93, - 88, 86, 89, 91, 80, 58, 43, 62, 44, 46, - 33, 35, 40, 66, 33, 34, 36, 38, 41, 43, - 32, 74, 57, 51, 62, 62, 49, 51, 56, 82, - 55, 38, 34, 54, 57, 59, 48, 90, 13, 9, - 24, 14, 1, 3, 8, 98, 10, 8, 4, 6, - 9, 11, 0, 106, 16, 11, 1, 30, 17, 19, - 24, 114, 28, 9, 20, 22, 25, 27, 16, 122, - 249, 236, 236, 238, 225, 227, 232, 130, 241, 234, - 236, 247, 227, 245, 247, 236, 246, 237, 253, 235, - 145, 254, 233, 249, 225, 250, 252, 231, 243, 229, - 155, 246, 203, 207, 219, 192, 194, 217, 201, 223, - 173, 192, 200, 199, 213, 206, 200, 211, 223, 201, - 183, 220, 203, 205, 207, 212, 222, 197, 213, 195, - 185, 208, 214, 197, 185, 162, 164, 191, 171, 189, - 195, 165, 169, 167, 179, 168, 170, 177, 161, 183, - 213, 177, 168, 160, 173, 182, 176, 171, 183, 161, - 223, 191, 172, 179, 167, 188, 134, 157, 141, 155, - 225, 156, 139, 137, 154, 130, 135, 238, 135, 146, - 128, 157, 155, 156, 247, 140, 141, 155, 132, 156, - 135, 252, 145, 132, 146, 143, 149, 128, 5, 110, - 125, 123, 118, 110, 121, 2, 119, 112, 100, 121, - 118, 99, 11, 112, 105, 127, 96, 105, 106, 16, - 105, 110, 118, 114, 101, 98, 4, 7, 4, 116, - 95, 88, 92, 91, 79, 67, 69, 76, 34, 49, - 48, 49, 69, 79, 77, 75, 91, 59, 89, 44, - 46, 92, 83, 77, 66, 86, 66, 84, 69, 71, - 39, 32, 47, 62, 58, 38, 62, 42, 76, 88, - 82, 38, 53, 50, 50, 63, 81, 85, 60, 41, - 57, 77, 78, 57, 46, 60, 60, 48, 53, 81, - 66, 71, 51, 48, 24, 120, 120, 14, 11, 29, - 1, 12, 12, 26, 96, 114, 118, 0, 1, 23, - 23, 26, 22, 0, 126, 108, 108, 125, 122, 30, - 25, 31, 31, 126, 19, 16, 248, 230, 233, 231, - 247, 143, 159, 157, 130, 139, 247, 228, 227, 236, - 225, 235, 254, 146, 240, 242, 249, 140, 143, 245, - 253, 253, 247, 145, 253, 248, 250, 242, 170, 184, - 187, 193, 193, 193, 203, 173, 201, 204, 206, 198, - 166, 178, 180, 204, 212, 223, 209, 216, 190, 170, - 172, 212, 198, 210, 164, 161, 220, 199, 218, 167, - 216, 222, 162, 168, 190, 174, 162, 205, 208, 209, - 213, 171, 167, 183, 165, 171, 218, 201, 202, 204, - 222, 215, 171, 184, 183, 184, 181, 191, 178, 222, - 186, 180, 153, 250, 248, 249, 128, 138, 136, 255, - 247, 141, 133, 149, 142, 130, 150, 137, 155, 149, - 156, 138, 254, 237, 233, 142, 155, 157, 151, 144, - 134, 152, 134, 144, 10, 24, 24, 122, 126, 110, - 101, 99, 2, 16, 21, 114, 118, 127, 17, 21, - 10, 104, 109, 112, 12, 15, 111, 106, 119, 0, - 0, 98, 97, 126, 103, 102, 42, 57, 56, 93, - 79, 70, 91, 76, 76, 35, 73, 79, 66, 66, - 92, 80, 81, 42, 40, 41, 75, 84, 60, 44, - 34, 35, 69, 90, 54, 38, 36, 76, 74, 44, - 33, 37, 58, 58, 63, 94, 82, 54, 51, 65, - 40, 38, 55, 69, 75, 75, 72, 44, 45, 95, - 46, 40, 33, 32, 80, 67, 70, 71, 68, 32, - 25, 107, 27, 25, 22, 111, 121, 125, 114, 22, - 19, 97, 21, 23, 28, 101, 111, 107, 104, 121, - 118, 18, 21, 19, 27, 122, 5, 2, 118, 3, - 17, 22, 226, 139, 153, 153, 158, 250, 255, 141, - 246, 230, 227, 233, 134, 150, 148, 149, 154, 147, - 245, 240, 240, 246, 149, 232, 225, 147, 231, 240, - 250, 251, 148, 230, 222, 171, 187, 185, 217, 206, - 192, 193, 162, 208, 212, 211, 195, 194, 208, 165, - 169, 171, 207, 216, 210, 211, 188, 206, 198, 193, - 213, 212, 194, 183, 167, 165, 202, 195, 165, 160, - 160, 166, 197, 190, 173, 186, 166, 163, 180, 162, - 170, 177, 218, 184, 170, 172, 186, 186, 220, 178, - 187, 191, 179, 190, 164, 185, 179, 186, 134, 143, - 143, 134, 130, 139, 236, 229, 145, 147, 143, 149, - 239, 128, 139, 137, 158, 251, 240, 138, 142, 144, - 136, 253, 159, 154, 158, 152, 255, 144, 155, 153, - 110, 11, 0, 122, 126, 96, 120, 4, 2, 11, - 119, 100, 99, 108, 97, 107, 126, 18, 107, 112, - 114, 105, 121, 111, 97, 122, 124, 103, 115, 101, - 20, 29, 89, 91, 71, 93, 39, 92, 69, 65, - 84, 70, 82, 33, 46, 84, 84, 74, 78, 59, - 85, 80, 80, 86, 53, 83, 85, 82, 67, 95, - 87, 67, 65, 71, 43, 39, 72, 46, 47, 60, - 60, 44, 46, 47, 33, 37, 47, 50, 41, 53, - 54, 58, 44, 48, 48, 42, 49, 46, 61, 42, - 50, 52, 55, 57, 39, 38, 31, 12, 9, 27, - 27, 4, 108, 15, 16, 6, 14, 21, 102, 111, - 23, 21, 21, 15, 113, 12, 13, 127, 31, 15, - 7, 23, 21, 113, 126, 4, 4, 26, 254, 130, - 253, 250, 142, 236, 254, 248, 230, 230, 128, 137, - 245, 247, 235, 241, 147, 155, 144, 238, 251, 250, - 247, 248, 252, 247, 153, 228, 229, 151, 250, 244, - 222, 222, 218, 200, 194, 175, 203, 204, 209, 163, - 168, 210, 214, 200, 208, 172, 207, 200, 215, 208, - 210, 202, 215, 210, 219, 223, 199, 212, 197, 195, - 180, 193, 175, 179, 169, 186, 206, 160, 165, 161, - 181, 171, 165, 160, 178, 164, 172, 171, 207, 203, - 201, 201, 171, 172, 178, 178, 166, 182, 197, 164, - 165, 185, 187, 161, 143, 137, 157, 135, 138, 155, - 142, 130, 140, 135, 138, 145, 136, 133, 139, 139, - 158, 142, 147, 155, 145, 145, 152, 136, 129, 243, - 225, 225, 143, 247, 128, 248, 100, 100, 124, 108, - 123, 124, 12, 31, 123, 3, 116, 12, 104, 104, - 112, 96, 111, 104, 24, 12, 103, 31, 104, 16, - 124, 124, 100, 116, 99, 100, 20, 97, 39, 73, - 71, 71, 74, 90, 95, 73, 77, 79, 76, 64, - 84, 95, 70, 81, 53, 78, 75, 93, 70, 90, - 72, 50, 71, 64, 84, 73, 84, 89, 59, 64, - 57, 47, 48, 37, 45, 64, 57, 62, 38, 59, - 50, 49, 73, 50, 55, 33, 59, 14, 11, 13, - 12, 30, 16, 20, 19, 29, 80, 53, 25, 27, - 24, 20, 56, 107, 62, 58, 96, 111, 15, 44, - 44, 34, 36, 40, 39, 41, 100, 1, 53, 55, - 52, 56, 44, 30, 41, 46, 38, 33, 49, 61, - 63, 54, 58, 117, 238, 196, 196, 197, 207, 221, - 140, 219, 209, 141, 128, 242, 209, 206, 215, 214, - 154, 253, 202, 216, 208, 220, 253, 200, 193, 199, - 194, 208, 218, 222, 213, 219, 170, 207, 231, 229, - 226, 238, 254, 173, 244, 240, 174, 161, 204, 230, - 244, 228, 244, 254, 235, 252, 190, 198, 249, 243, - 211, 230, 227, 229, 228, 246, 248, 252, 139, 133, - 200, 173, 129, 131, 128, 140, 144, 195, 150, 146, - 200, 199, 174, 132, 138, 154, 150, 156, 141, 154, - 220, 164, 151, 157, 208, 217, 161, 146, 145, 158, - 175, 165, 172, 224, 143, 186, 191, 185, 176, 162, - 172, 168, 167, 169, 228, 129, 181, 183, 180, 184, - 172, 255, 170, 174, 252, 243, 152, 190, 184, 176, - 244, 158, 69, 69, 79, 9, 106, 64, 64, 65, - 67, 81, 97, 84, 85, 83, 86, 68, 86, 82, - 89, 87, 30, 123, 83, 81, 94, 82, 66, 17, - 64, 68, 26, 21, 68, 110, 127, 41, 84, 106, - 109, 97, 99, 109, 100, 33, 66, 104, 104, 105, - 123, 105, 89, 108, 109, 107, 110, 124, 126, 122, - 113, 127, 54, 83, 123, 121, 6, 10, 26, 73, - 24, 28, 66, 77, 49, 10, 14, 6, 7, 23, - 11, 23, 31, 91, 60, 22, 18, 19, 29, 15, - 51, 6, 3, 5, 4, 22, 24, 28, 43, 37, - 104, 13, 33, 35, 32, 44, 48, 99, 54, 50, - 104, 103, 17, 22, 122, 31, 55, 53, 50, 62, - 46, 28, 39, 32, 36, 35, 55, 59, 61, 52, - 196, 139, 236, 198, 194, 195, 205, 223, 130, 213, - 211, 143, 134, 242, 247, 133, 254, 212, 212, 213, - 223, 205, 156, 149, 229, 214, 213, 218, 211, 217, - 208, 156, 201, 234, 230, 232, 234, 230, 237, 227, - 162, 199, 239, 237, 234, 230, 246, 165, 236, 232, - 182, 185, 205, 232, 245, 238, 225, 179, 214, 227, - 247, 249, 247, 214, 139, 133, 137, 141, 135, 142, - 130, 205, 166, 140, 140, 141, 135, 149, 196, 147, - 137, 213, 216, 177, 145, 145, 155, 221, 185, 156, - 158, 150, 214, 179, 155, 153, 166, 170, 186, 138, - 175, 161, 173, 169, 171, 162, 174, 225, 130, 168, - 168, 169, 187, 169, 248, 175, 173, 241, 252, 151, - 179, 163, 177, 191, 179, 164, 177, 245, 115, 78, - 70, 106, 79, 65, 77, 73, 75, 66, 78, 1, - 98, 72, 72, 73, 91, 73, 24, 79, 77, 17, - 28, 110, 91, 93, 87, 80, 70, 88, 70, 80, - 42, 79, 103, 101, 98, 110, 126, 94, 117, 106, - 115, 114, 38, 65, 118, 100, 116, 120, 56, 111, - 109, 49, 60, 85, 125, 125, 119, 49, 93, 120, - 122, 114, 74, 47, 7, 5, 2, 14, 30, 62, - 21, 10, 19, 18, 70, 33, 22, 4, 20, 24, - 88, 15, 13, 81, 92, 55, 19, 3, 17, 31, - 19, 4, 17, 85, 19, 46, 38, 26, 57, 38, - 63, 62, 98, 5, 50, 32, 40, 36, 100, 51, - 41, 117, 120, 10, 49, 42, 40, 53, 114, 18, - 54, 35, 63, 52, 53, 59, 138, 249, 201, 199, - 202, 234, 217, 223, 205, 131, 214, 210, 136, 135, - 229, 208, 201, 207, 202, 216, 210, 214, 221, 211, - 146, 247, 223, 221, 218, 214, 198, 240, 255, 249, - 231, 169, 248, 252, 162, 173, 193, 226, 238, 224, - 226, 238, 229, 235, 186, 223, 247, 245, 242, 254, - 238, 216, 231, 225, 255, 177, 224, 228, 186, 181, - 185, 156, 129, 154, 157, 207, 170, 159, 131, 141, - 131, 164, 147, 149, 139, 197, 140, 136, 214, 217, - 189, 133, 153, 158, 154, 211, 187, 158, 132, 130, - 154, 148, 143, 190, 186, 166, 238, 185, 191, 227, - 226, 135, 161, 175, 175, 180, 172, 229, 145, 169, - 183, 183, 187, 154, 169, 175, 189, 243, 166, 162, - 248, 247, 150, 167, 67, 95, 65, 90, 70, 15, - 124, 66, 87, 77, 68, 100, 83, 85, 75, 5, - 76, 72, 22, 25, 118, 80, 82, 90, 18, 120, - 95, 95, 81, 23, 112, 90, 102, 103, 105, 123, - 75, 122, 126, 98, 34, 117, 115, 47, 38, 79, - 113, 107, 125, 122, 106, 112, 127, 113, 60, 91, - 125, 97, 121, 127, 98, 82, 97, 103, 5, 75, - 30, 26, 64, 79, 38, 12, 18, 2, 14, 4, - 21, 2, 68, 60, 31, 21, 61, 12, 12, 16, - 92, 11, 1, 93, 80, 60, 19, 15, 29, 22, - 43, 37, 104, 25, 43, 60, 35, 8, 55, 49, - 47, 97, 48, 52, 106, 101, 20, 52, 42, 46, - 59, 56, 53, 60, 60, 115, 27, 35, 57, 57, - 49, 16, 223, 217, 199, 137, 216, 220, 130, 141, - 236, 198, 215, 129, 252, 194, 197, 201, 219, 213, - 220, 153, 250, 208, 208, 209, 211, 193, 245, 196, - 196, 216, 148, 195, 249, 165, 168, 217, 225, 227, - 229, 254, 234, 163, 218, 237, 233, 243, 253, 192, - 239, 233, 247, 185, 232, 236, 178, 189, 192, 252, - 253, 240, 248, 254, 245, 251, 202, 167, 141, 156, - 171, 154, 158, 130, 194, 149, 147, 207, 198, 181, - 145, 150, 137, 146, 153, 151, 222, 173, 137, 159, - 158, 150, 181, 132, 132, 152, 212, 131, 185, 229, - 232, 154, 185, 170, 168, 164, 177, 171, 224, 138, - 180, 168, 170, 164, 159, 174, 170, 182, 254, 169, - 175, 243, 242, 128, 185, 191, 177, 182, 164, 186, - 88, 78, 8, 109, 65, 67, 64, 76, 80, 102, - 85, 83, 73, 7, 82, 86, 20, 27, 108, 76, - 76, 84, 85, 78, 90, 19, 124, 88, 68, 86, - 113, 64, 120, 100, 40, 127, 125, 33, 44, 88, - 81, 35, 68, 110, 106, 107, 101, 119, 95, 110, - 106, 118, 62, 105, 111, 51, 50, 70, 67, 49, - 82, 120, 120, 121, 11, 25, 72, 65, 57, 10, - 9, 6, 7, 13, 4, 72, 35, 18, 22, 10, - 90, 13, 11, 87, 94, 44, 19, 8, 6, 27, - 80, 48, 16, 5, 29, 22, 43, 37, 104, 27, - 47, 33, 40, 15, 48, 42, 52, 40, 53, 47, - 100, 21, 53, 46, 54, 61, 126, 41, 47, 115, - 114, 18, 37, 34, 34, 37, 53, 57, 195, 202, - 198, 137, 234, 192, 192, 193, 195, 209, 226, 211, - 207, 211, 205, 214, 210, 155, 232, 214, 203, 209, - 216, 157, 196, 192, 158, 145, 245, 214, 218, 212, - 238, 226, 233, 231, 174, 203, 227, 225, 238, 226, - 242, 195, 244, 238, 240, 236, 233, 243, 184, 201, - 241, 234, 242, 249, 178, 229, 227, 191, 182, 196, - 227, 252, 153, 152, 200, 175, 156, 142, 130, 142, - 160, 145, 137, 149, 143, 148, 140, 197, 170, 148, - 141, 151, 154, 223, 138, 142, 220, 211, 179, 139, - 147, 148, 156, 213, 129, 164, 186, 188, 160, 174, - 142, 191, 171, 183, 169, 178, 174, 231, 148, 170, - 175, 181, 188, 249, 168, 172, 242, 253, 150, 178, - 190, 184, 165, 191, 244, 158, 88, 68, 70, 76, - 108, 93, 69, 89, 75, 80, 72, 1, 118, 72, - 81, 75, 94, 27, 78, 74, 16, 31, 116, 82, - 92, 84, 16, 122, 89, 89, 83, 21, 78, 100, - 100, 101, 111, 125, 78, 127, 107, 119, 105, 114, - 110, 39, 84, 106, 111, 117, 124, 57, 104, 108, - 50, 61, 90, 102, 126, 118, 119, 101, 125, 116, - 4, 75, 46, 6, 28, 6, 2, 25, 32, 17, - 9, 21, 15, 20, 12, 69, 42, 20, 13, 23, - 26, 95, 10, 14, 92, 83, 58, 16, 6, 22, - 26, 16, 57, 46, 104, 16, 43, 33, 14, 63, - 43, 55, 41, 50, 46, 103, 20, 42, 47, 53, - 60, 121, 40, 44, 114, 125, 31, 54, 40, 56, - 53, 54, 58, 117, 250, 206, 219, 198, 236, 221, - 197, 217, 203, 208, 200, 129, 246, 200, 209, 203, - 222, 155, 206, 202, 144, 159, 242, 210, 192, 196, - 213, 214, 223, 214, 218, 149, 193, 249, 231, 231, - 235, 205, 254, 228, 246, 234, 243, 233, 166, 215, - 235, 240, 244, 255, 184, 239, 237, 177, 188, 211, - 247, 228, 176, 203, 243, 246, 248, 244, 132, 143, - 200, 173, 129, 131, 128, 140, 144, 161, 146, 136, - 146, 142, 151, 141, 218, 171, 151, 140, 144, 155, - 220, 139, 129, 221, 208, 161, 153, 155, 157, 134, - 162, 235, 146, 165, 161, 187, 181, 143, 176, 170, - 180, 168, 181, 175, 228, 149, 181, 174, 182, 189, - 254, 169, 175, 243, 242, 128, 167, 180, 178, 190, - 167, 189, 10, 96, 90, 70, 64, 78, 110, 95, - 75, 87, 73, 82, 78, 7, 116, 74, 79, 85, - 92, 25, 72, 76, 18, 29, 97, 90, 94, 86, - 87, 71, 91, 71, 111, 43, 76, 102, 98, 99, - 109, 127, 64, 113, 105, 117, 111, 116, 108, 37, - 74, 116, 109, 119, 122, 63, 106, 110, 60, 51, - 68, 100, 100, 124, 125, 102, 2, 75, 36, 0, - 28, 14, 46, 31, 11, 23, 9, 18, 14, 71, - 52, 10, 15, 21, 28, 89, 8, 12, 82, 93, - 39, 32, 80, 53, 25, 27, 24, 20, 56, 9, - 58, 32, 58, 38, 63, 37, 98, 19, 47, 52, - 40, 35, 100, 51, 41, 117, 120, 12, 13, 127, - 24, 50, 62, 63, 49, 35, 118, 127, 3, 48, - 207, 192, 205, 199, 202, 134, 238, 223, 203, 215, - 201, 210, 206, 135, 244, 202, 207, 213, 220, 153, - 200, 204, 146, 157, 225, 220, 197, 197, 222, 151, - 245, 211, 248, 226, 235, 232, 224, 175, 222, 236, - 236, 231, 200, 238, 232, 224, 164, 206, 245, 245, - 255, 185, 218, 240, 240, 241, 243, 225, 176, 231, - 229, 185, 180, 223, 139, 155, 137, 135, 139, 156, - 137, 205, 187, 134, 142, 175, 137, 149, 147, 128, - 157, 146, 153, 151, 222, 180, 142, 146, 156, 150, - 208, 135, 133, 217, 212, 166, 189, 174, 172, 160, - 189, 167, 236, 134, 176, 172, 174, 160, 136, 162, - 179, 229, 128, 190, 185, 181, 191, 177, 184, 253, - 150, 188, 188, 189, 183, 165, 244, 163, 89, 5, - 8, 106, 79, 65, 77, 73, 75, 66, 78, 1, - 98, 72, 72, 73, 91, 73, 118, 92, 73, 31, - 102, 88, 83, 95, 81, 95, 82, 23, 112, 90, - 102, 103, 105, 123, 46, 121, 127, 35, 34, 80, - 119, 104, 117, 116, 36, 67, 104, 122, 118, 122, - 80, 122, 107, 61, 72, 118, 113, 125, 119, 121, - 112, 53, 46, 4, 4, 5, 15, 29, 76, 27, - 17, 77, 64, 41, 9, 9, 3, 69, 49, 20, - 22, 30, 94, 59, 19, 17, 30, 18, 2, 63, - 19, 0, 84, 47, 47, 42, 36, 40, 32, 43, - 108, 9, 45, 47, 44, 32, 52, 103, 50, 54, - 116, 123, 18, 56, 46, 62, 50, 56, 33, 54, - 112, 8, 51, 57, 26, 48, 221, 139, 242, 204, - 207, 195, 205, 195, 198, 131, 228, 206, 202, 203, - 197, 215, 154, 205, 203, 151, 158, 236, 213, 211, - 213, 210, 192, 222, 196, 210, 148, 241, 229, 231, - 228, 232, 252, 193, 233, 250, 162, 217, 229, 224, - 234, 230, 234, 225, 186, 223, 247, 245, 242, 254, - 238, 189, 228, 224, 190, 177, 195, 196, 180, 209, - 133, 135, 132, 136, 156, 188, 133, 131, 133, 130, - 144, 142, 148, 130, 196, 161, 149, 151, 148, 152, - 140, 223, 138, 142, 220, 211, 163, 134, 159, 132, - 135, 213, 140, 185, 169, 167, 173, 156, 165, 163, - 165, 162, 176, 174, 180, 162, 228, 129, 181, 183, - 180, 184, 172, 255, 170, 174, 252, 243, 152, 190, - 184, 176, 244, 158, 69, 69, 79, 9, 106, 64, - 64, 65, 67, 81, 115, 72, 72, 64, 69, 85, - 85, 73, 93, 25, 122, 80, 80, 81, 83, 65, - 16, 71, 69, 25, 20, 127, 107, 123, 105, 103, - 107, 124, 105, 45, 91, 102, 110, 85, 115, 117, - 111, 108, 105, 115, 56, 85, 119, 109, 125, 61, - 100, 96, 62, 49, 92, 118, 100, 116, 4, 14, - 27, 12, 78, 54, 9, 3, 55, 48, 64, 37, - 9, 11, 8, 4, 8, 91, 14, 10, 80, 95, - 63, 28, 28, 18, 20, 24, 23, 25, 84, 49, - 37, 39, 36, 40, 60, 26, 31, 109, 6, 44, - 44, 45, 39, 53, 100, 51, 41, 117, 120, 10, - 41, 54, 47, 46, 114, 21, 34, 48, 56, 52, - 1, 6, 138, 239, 199, 197, 194, 206, 222, 141, - 212, 208, 142, 129, 245, 208, 205, 214, 201, 155, - 254, 203, 223, 209, 223, 157, 154, 228, 213, 212, - 221, 210, 218, 209, 163, 222, 219, 169, 202, 224, - 224, 225, 227, 241, 160, 247, 245, 169, 164, 198, - 242, 242, 246, 252, 237, 250, 188, 196, 231, 242, - 254, 196, 197, 183, 208, 250, 134, 135, 137, 155, - 206, 153, 159, 195, 194, 160, 154, 132, 133, 143, - 196, 174, 149, 137, 141, 151, 159, 170, 175, 221, - 182, 156, 156, 157, 151, 133, 212, 131, 185, 229, - 232, 141, 175, 161, 165, 190, 170, 227, 139, 179, - 169, 169, 161, 144, 137, 251, 156, 182, 178, 179, - 189, 175, 242, 165, 163, 255, 246, 159, 187, 187, - 77, 11, 99, 70, 64, 72, 12, 105, 77, 79, - 76, 64, 84, 114, 119, 5, 126, 84, 84, 85, - 95, 77, 28, 75, 65, 29, 16, 120, 88, 83, - 93, 84, 100, 43, 90, 124, 126, 106, 105, 88, - 81, 35, 68, 110, 106, 107, 101, 119, 58, 109, - 107, 55, 62, 87, 105, 115, 117, 114, 98, 120, - 119, 121, 52, 83, 5, 25, 1, 7, 26, 58, - 63, 77, 38, 12, 12, 13, 7, 21, 68, 19, - 9, 85, 88, 48, 13, 13, 29, 24, 30, 26, - 80, 63, 19, 0, 84, 38, 34, 46, 57, 44, - 34, 26, 31, 109, 6, 44, 44, 45, 39, 53, - 100, 51, 41, 117, 120, 19, 63, 47, 61, 51, - 55, 32, 53, 113, 15, 50, 58, 0, 249, 139, - 236, 198, 194, 195, 205, 223, 130, 213, 211, 143, - 134, 237, 197, 213, 219, 213, 221, 202, 219, 159, - 229, 216, 220, 147, 152, 230, 211, 210, 223, 208, - 228, 239, 161, 220, 221, 175, 200, 226, 238, 239, - 225, 243, 166, 241, 247, 171, 186, 214, 253, 225, - 247, 252, 253, 243, 178, 195, 245, 226, 249, 194, - 199, 181, 174, 132, 132, 133, 143, 157, 204, 155, - 145, 205, 192, 175, 137, 149, 147, 128, 157, 146, - 153, 151, 222, 180, 142, 146, 156, 150, 165, 162, - 214, 179, 155, 153, 166, 170, 186, 233, 184, 188, - 226, 237, 146, 172, 172, 168, 181, 175, 228, 159, - 182, 180, 172, 160, 139, 172, 252, 153, 189, 191, - 188, 176, 164, 247, 162, 166, 4, 11, 122, 70, - 67, 78, 66, 68, 67, 77, 0, 109, 67, 82, - 113, 118, 26, 127, 87, 85, 82, 94, 78, 29, - 68, 64, 30, 17, 100, 66, 71, 70, 99, 106, - 102, 41, 92, 122, 110, 97, 103, 86, 83, 33, - 66, 104, 104, 105, 123, 105, 56, 111, 109, 49, - 60, 78, 115, 102, 116, 120, 54, 86, 102, 116, - 8, 2, 9, 7, 78, 61, 5, 20, 3, 15, - 53, 50, 70, 35, 11, 9, 22, 26, 10, 89, - 8, 12, 82, 93, 33, 4, 21, 21, 31, 4, - 28, 85, 1, 57, 39, 39, 47, 26, 31, 109, - 6, 44, 44, 45, 39, 53, 100, 51, 41, 117, - 120, 10, 55, 49, 59, 60, 34, 60, 34, 52, - 118, 19, 59, 57, 198, 202, 218, 252, 253, 143, - 232, 194, 206, 207, 193, 211, 134, 209, 215, 139, - 154, 239, 208, 216, 215, 159, 254, 220, 218, 199, - 229, 226, 150, 243, 219, 217, 230, 234, 250, 169, - 248, 252, 162, 173, 214, 246, 242, 234, 239, 244, - 236, 165, 214, 242, 234, 248, 203, 204, 188, 217, - 253, 255, 252, 240, 228, 183, 226, 230, 196, 203, - 187, 134, 155, 155, 132, 205, 163, 133, 146, 136, - 133, 134, 138, 197, 168, 154, 150, 157, 173, 144, - 137, 137, 154, 211, 177, 151, 132, 158, 151, 148, - 164, 235, 154, 168, 160, 171, 236, 187, 177, 237, - 224, 139, 167, 183, 165, 171, 191, 168, 189, 249, - 135, 186, 178, 154, 189, 191, 180, 241, 160, 164, - 250, 245, 105, 67, 65, 71, 75, 92, 73, 13, - 123, 86, 65, 79, 117, 78, 72, 83, 95, 73, - 24, 79, 77, 17, 28, 126, 90, 90, 94, 84, - 69, 82, 20, 108, 127, 106, 102, 78, 97, 99, - 104, 45, 116, 112, 46, 33, 71, 114, 119, 113, - 104, 122, 116, 112, 127, 113, 60, 89, 125, 127, - 124, 112, 100, 80, 123, 121, 14, 75, 30, 26, - 64, 79, 47, 12, 12, 2, 4, 8, 7, 9, - 68, 33, 21, 23, 20, 24, 12, 56, 19, 17, - 22, 83, 6, 2, 88, 87, 39, 2, 35, 56, - 59, 105, 8, 61, 45, 35, 33, 4, 47, 45, - 34, 103, 50, 54, 116, 123, 29, 44, 44, 48, - 27, 50, 62, 55, 112, 39, 37, 121, 116, 23, - 216, 194, 220, 192, 221, 199, 140, 253, 205, 214, - 206, 197, 225, 200, 200, 193, 154, 205, 203, 151, - 158, 247, 211, 211, 213, 147, 251, 222, 216, 208, - 148, 241, 229, 231, 228, 232, 252, 200, 227, 225, - 230, 163, 246, 242, 168, 167, 206, 228, 234, 250, - 246, 252, 237, 250, 188, 196, 247, 253, 215, 254, - 250, 243, 180, 227, 153, 197, 200, 167, 139, 152, - 204, 183, 135, 130, 140, 128, 136, 131, 196, 161, - 149, 151, 148, 152, 140, 184, 147, 145, 150, 211, - 134, 130, 216, 215, 167, 156, 164, 172, 169, 185, - 161, 189, 169, 237, 134, 172, 172, 173, 167, 181, - 131, 170, 182, 191, 248, 175, 173, 241, 252, 142, - 187, 191, 166, 180, 164, 132, 189, 185, 92, 78, - 90, 9, 88, 92, 2, 13, 99, 86, 83, 85, - 84, 70, 72, 76, 91, 85, 24, 125, 81, 83, - 80, 92, 64, 96, 89, 93, 64, 82, 70, 21, - 124, 120, 38, 41, 77, 110, 98, 108, 102, 106, - 97, 111, 38, 67, 107, 105, 118, 122, 106, 74, - 119, 115, 106, 120, 96, 51, 102, 98, 56, 55, - 82, 103, 11, 5, 11, 58, 7, 3, 26, 8, - 16, 67, 22, 18, 72, 71, 33, 16, 8, 20, - 43, 16, 18, 9, 25, 15, 82, 5, 3, 95, - 86, 39, 27, 0, 36, 47, 27, 32, 34, 57, - 41, 63, 98, 53, 51, 111, 102, 15, 43, 43, - 61, 123, 19, 54, 48, 56, 124, 25, 61, 63, - 60, 48, 36, 4, 61, 57, 220, 206, 218, 137, - 216, 220, 130, 141, 232, 194, 208, 192, 200, 194, - 215, 192, 154, 226, 221, 215, 237, 214, 208, 203, - 215, 193, 144, 199, 197, 153, 148, 251, 239, 252, - 168, 211, 235, 238, 224, 236, 236, 231, 160, 197, - 233, 235, 232, 228, 232, 200, 241, 245, 232, 250, - 238, 189, 228, 224, 190, 177, 197, 254, 250, 242, - 139, 155, 135, 155, 139, 207, 168, 130, 142, 143, - 129, 147, 181, 151, 139, 145, 218, 168, 145, 149, - 136, 154, 142, 174, 130, 156, 132, 209, 177, 152, - 152, 145, 153, 187, 167, 189, 238, 159, 173, 161, - 174, 162, 164, 168, 179, 170, 151, 181, 181, 175, - 248, 137, 178, 190, 168, 180, 188, 166, 189, 130, - 240, 135, 251, 148, 121, 115, 8, 64, 64, 75, - 73, 85, 2, 76, 70, 1, 103, 82, 87, 81, - 72, 90, 84, 80, 95, 81, 28, 81, 91, 64, - 68, 84, 82, 23, 71, 93, 107, 121, 109, 122, - 79, 92, 84, 45, 81, 83, 73, 33, 52, 55, - 52, 37, 95, 106, 109, 112, 106, 102, 60, 84, - 124, 119, 117, 105, 54, 84, 82, 81, 74, 40, - 7, 7, 26, 29, 13, 14, 22, 32, 8, 8, - 8, 6, 68, 36, 79, 75, 88, 16, 16, 27, - 25, 5, 82, 28, 22, 81, 53, 31, 29, 27, - 47, 56, 45, 105, 34, 38, 63, 57, 39, 39, - 96, 50, 46, 38, 54, 32, 41, 24, 55, 41, - 46, 58, 46, 125, 27, 61, 52, 52, 46, 30, - 22, 16, 242, 139, 155, 156, 142, 198, 194, 201, - 199, 219, 128, 206, 192, 135, 247, 213, 219, 213, - 209, 202, 214, 159, 208, 212, 193, 199, 213, 213, - 150, 196, 220, 212, 248, 238, 251, 218, 218, 192, - 212, 213, 183, 179, 197, 161, 195, 246, 241, 236, - 238, 226, 184, 208, 240, 251, 249, 229, 178, 208, - 214, 213, 182, 212, 251, 251, 158, 153, 137, 138, - 154, 170, 153, 159, 141, 195, 179, 149, 137, 159, - 156, 197, 207, 203, 216, 144, 144, 155, 153, 133, - 210, 156, 150, 209, 179, 130, 134, 154, 186, 174, - 169, 167, 238, 163, 165, 190, 182, 166, 164, 225, - 181, 175, 165, 183, 191, 168, 155, 152, 157, 255, - 232, 237, 242, 186, 190, 181, 179, 175, 244, 186, - 76, 11, 110, 91, 75, 65, 79, 69, 2, 79, - 73, 82, 82, 66, 64, 5, 73, 83, 89, 75, - 91, 76, 127, 124, 113, 19, 4, 1, 22, 114, - 69, 64, 99, 127, 113, 41, 71, 97, 104, 104, - 122, 35, 67, 71, 66, 39, 71, 106, 116, 111, - 106, 120, 125, 107, 88, 92, 74, 51, 121, 127, - 114, 114, 108, 53, 5, 13, 72, 46, 11, 29, - 1, 12, 12, 67, 12, 8, 21, 19, 1, 1, - 90, 8, 16, 24, 12, 26, 15, 57, 51, 43, - 80, 66, 70, 87, 49, 4, 63, 34, 60, 48, - 110, 6, 34, 41, 39, 59, 96, 2, 0, 3, - 100, 6, 53, 53, 44, 43, 63, 60, 40, 25, - 19, 11, 112, 98, 102, 119, 17, 36, 223, 194, - 220, 208, 142, 230, 194, 201, 199, 219, 128, 236, - 207, 201, 205, 133, 249, 253, 252, 153, 253, 208, - 210, 201, 192, 210, 211, 197, 242, 246, 236, 149, - 185, 187, 168, 204, 255, 250, 229, 249, 251, 163, - 201, 239, 226, 226, 252, 165, 217, 221, 220, 185, - 221, 240, 242, 233, 224, 242, 243, 229, 182, 191, - 195, 240, 143, 128, 141, 135, 138, 198, 164, 140, - 140, 132, 192, 178, 131, 137, 131, 197, 147, 149, - 156, 156, 134, 223, 147, 155, 210, 187, 159, 159, - 145, 215, 191, 154, 164, 172, 232, 165, 167, 188, - 184, 168, 166, 227, 179, 169, 167, 181, 161, 182, - 146, 186, 182, 190, 254, 140, 185, 179, 181, 243, - 185, 191, 178, 178, 172, 245, 69, 77, 8, 97, - 65, 65, 75, 13, 105, 76, 78, 70, 6, 75, - 77, 86, 78, 94, 92, 25, 77, 87, 93, 79, - 87, 64, 16, 114, 112, 115, 124, 84, 100, 108, - 40, 90, 107, 97, 107, 45, 71, 114, 117, 104, - 114, 126, 36, 76, 116, 127, 125, 97, 62, 92, - 90, 89, 50, 80, 127, 127, 98, 101, 117, 118, - 30, 34, 6, 13, 7, 14, 76, 88, 82, 67, - 9, 15, 2, 2, 28, 69, 21, 29, 88, 48, - 16, 27, 21, 28, 28, 83, 28, 24, 5, 3, - 17, 17, 106, 56, 32, 40, 60, 42, 63, 11, - 22, 16, 5, 97, 11, 14, 6, 101, 51, 53, - 60, 60, 38, 127, 51, 59, 114, 26, 36, 48, - 58, 62, 53, 59, 138, 199, 193, 218, 218, 202, - 200, 141, 209, 203, 193, 211, 195, 212, 234, 204, - 209, 208, 221, 208, 158, 141, 142, 136, 146, 218, - 222, 213, 211, 207, 148, 218, 236, 171, 194, 232, - 254, 238, 226, 232, 241, 230, 160, 237, 239, 244, - 240, 224, 254, 187, 235, 241, 255, 237, 249, 238, - 220, 250, 251, 250, 243, 254, 180, 167, 216, 222, - 200, 172, 159, 154, 133, 153, 155, 195, 169, 143, - 130, 130, 156, 197, 185, 189, 188, 217, 189, 144, - 146, 137, 128, 146, 147, 133, 184, 158, 159, 158, - 175, 162, 232, 251, 252, 250, 236, 136, 179, 182, - 169, 181, 191, 231, 141, 171, 190, 190, 160, 249, - 157, 153, 152, 253, 145, 188, 190, 165, 164, 182, - 183, 161, 10, 3, 127, 76, 75, 68, 73, 67, - 70, 10, 116, 100, 101, 111, 4, 20, 10, 11, - 24, 80, 80, 91, 89, 69, 18, 92, 86, 17, - 99, 100, 20, 89, 99, 120, 124, 108, 106, 47, - 127, 101, 99, 113, 101, 114, 72, 98, 96, 96, - 104, 119, 121, 119, 122, 63, 46, 40, 50, 80, - 113, 98, 126, 55, 93, 123, 14, 14, 16, 40, - 43, 55, 76, 4, 12, 7, 5, 25, 70, 8, - 2, 69, 50, 20, 20, 21, 31, 17, 24, 90, - 1, 83, 28, 24, 5, 3, 17, 17, 106, 56, - 32, 40, 60, 42, 63, 109, 1, 5, 4, 8, - 40, 35, 33, 61, 122, 52, 62, 121, 42, 48, - 44, 125, 1, 20, 8, 113, 37, 63, 53, 39, - 207, 216, 136, 234, 232, 235, 229, 239, 231, 251, - 128, 146, 147, 135, 225, 212, 207, 210, 204, 192, - 158, 246, 210, 217, 215, 203, 144, 242, 240, 243, - 148, 246, 229, 229, 252, 251, 239, 236, 248, 222, - 164, 211, 160, 180, 182, 183, 164, 236, 244, 255, - 253, 225, 190, 240, 250, 189, 199, 192, 176, 253, - 255, 228, 224, 240, 142, 203, 155, 129, 143, 157, - 137, 158, 177, 148, 137, 146, 149, 199, 169, 132, - 136, 144, 157, 141, 222, 182, 146, 153, 151, 139, - 208, 158, 144, 215, 167, 130, 163, 184, 187, 233, - 162, 166, 191, 185, 167, 167, 224, 178, 174, 166, - 182, 160, 169, 148, 149, 129, 254, 140, 168, 178, - 177, 184, 184, 190, 186, 186, 244, 230, 26, 11, - 97, 71, 74, 74, 84, 126, 111, 106, 0, 103, - 83, 83, 81, 87, 95, 72, 24, 122, 120, 123, - 104, 92, 91, 68, 81, 95, 22, 94, 90, 81, - 111, 115, 40, 102, 104, 47, 88, 108, 107, 116, - 97, 111, 99, 116, 97, 37, 118, 114, 107, 109, - 123, 123, 60, 110, 122, 114, 98, 116, 101, 81, - 64, 70, 47, 75, 89, 89, 94, 79, 5, 3, - 6, 6, 24, 65, 9, 1, 68, 48, 49, 91, - 20, 16, 13, 11, 25, 25, 82, 0, 24, 16, - 4, 18, 7, 51, 30, 24, 13, 105, 127, 127, - 124, 109, 7, 50, 53, 40, 50, 62, 100, 12, - 52, 63, 61, 33, 126, 28, 26, 25, 114, 16, - 63, 63, 34, 37, 53, 54, 222, 231, 199, 199, - 201, 143, 235, 196, 206, 215, 128, 231, 211, 211, - 209, 215, 223, 200, 152, 250, 248, 251, 245, 211, - 214, 214, 200, 145, 217, 209, 148, 193, 229, 251, - 168, 186, 190, 175, 255, 229, 227, 241, 229, 242, - 166, 232, 234, 165, 205, 250, 244, 245, 190, 204, - 232, 239, 247, 246, 228, 223, 215, 196, 208, 212, - 187, 203, 217, 217, 222, 207, 133, 131, 134, 134, - 152, 193, 137, 129, 196, 176, 169, 219, 148, 144, - 141, 139, 153, 153, 210, 128, 152, 144, 132, 146, - 135, 213, 137, 141, 140, 155, 187, 188, 191, 168, - 174, 175, 224, 243, 246, 247, 244, 229, 147, 181, - 188, 188, 166, 255, 145, 180, 188, 186, 240, 151, - 163, 163, 161, 167, 79, 88, 8, 106, 104, 107, - 127, 11, 114, 3, 21, 17, 22, 7, 97, 84, - 79, 82, 76, 64, 30, 118, 82, 89, 87, 75, - 16, 114, 112, 115, 20, 118, 101, 101, 124, 123, - 111, 108, 120, 94, 36, 83, 32, 52, 54, 55, - 36, 64, 107, 110, 113, 109, 103, 63, 85, 115, - 118, 118, 104, 49, 91, 126, 122, 124, 74, 40, - 46, 45, 78, 44, 3, 3, 22, 17, 1, 2, - 18, 41, 5, 22, 30, 26, 9, 89, 79, 79, - 76, 93, 55, 2, 5, 24, 2, 14, 84, 60, - 36, 47, 45, 49, 110, 12, 10, 9, 98, 0, - 47, 47, 50, 53, 37, 38, 46, 21, 57, 42, - 58, 62, 45, 125, 99, 99, 96, 113, 19, 38, - 33, 60, 222, 210, 136, 224, 192, 203, 201, 213, - 130, 238, 201, 207, 207, 135, 231, 227, 254, 155, - 251, 214, 208, 203, 206, 220, 209, 199, 249, 223, - 210, 210, 204, 149, 229, 237, 168, 253, 230, 234, - 172, 249, 237, 243, 160, 242, 238, 230, 246, 224, - 233, 187, 247, 247, 190, 200, 253, 241, 254, 179, - 195, 229, 228, 242, 241, 225, 202, 168, 174, 173, - 170, 128, 155, 205, 168, 140, 142, 132, 149, 199, - 215, 213, 218, 190, 137, 140, 151, 139, 133, 221, - 187, 157, 148, 148, 142, 215, 183, 179, 142, 235, - 139, 166, 160, 187, 190, 172, 161, 183, 132, 174, - 177, 231, 142, 170, 180, 190, 171, 249, 237, 239, - 252, 152, 163, 166, 185, 165, 175, 247, 157, 187, - 78, 78, 80, 9, 99, 70, 66, 68, 2, 96, - 102, 101, 6, 100, 75, 75, 78, 73, 89, 90, - 74, 108, 83, 68, 80, 86, 81, 95, 117, 69, - 65, 81, 111, 43, 71, 96, 98, 47, 36, 79, - 112, 102, 110, 117, 47, 68, 107, 119, 116, 59, - 126, 108, 106, 106, 110, 120, 97, 51, 83, 87, - 82, 80, 123, 121, 14, 75, 59, 25, 1, 27, - 43, 2, 14, 7, 64, 50, 22, 8, 16, 69, - 60, 35, 88, 58, 17, 17, 8, 15, 19, 16, - 4, 54, 25, 27, 16, 85, 25, 59, 39, 61, - 110, 2, 37, 35, 43, 99, 6, 25, 102, 4, - 43, 43, 46, 41, 57, 58, 42, 24, 51, 49, - 54, 115, 3, 33, 57, 35, 116, 19, 242, 139, - 235, 198, 192, 219, 222, 204, 193, 215, 128, 137, - 241, 194, 193, 206, 223, 213, 220, 144, 237, 214, - 208, 203, 215, 193, 144, 226, 198, 216, 192, 230, - 227, 231, 254, 236, 252, 175, 223, 253, 237, 247, - 160, 199, 222, 167, 199, 234, 244, 239, 234, 248, - 253, 235, 207, 244, 254, 229, 245, 227, 182, 196, - 228, 250, 158, 203, 165, 128, 128, 134, 204, 171, - 186, 195, 163, 142, 136, 147, 150, 132, 153, 143, - 171, 137, 145, 139, 220, 179, 147, 135, 133, 131, - 151, 155, 212, 178, 171, 184, 134, 168, 186, 186, - 190, 172, 174, 227, 135, 160, 181, 231, 162, 176, - 174, 174, 170, 188, 173, 255, 159, 155, 150, 131, - 177, 189, 186, 182, 176, 188, 95, 70, 8, 95, - 93, 1, 12, 120, 113, 3, 100, 78, 74, 75, - 69, 87, 106, 87, 89, 77, 87, 81, 73, 80, - 18, 69, 67, 31, 22, 98, 103, 21, 78, 100, - 100, 101, 111, 125, 95, 98, 123, 97, 101, 96, - 104, 116, 36, 99, 111, 111, 109, 107, 123, 108, - 60, 94, 84, 87, 67, 100, 113, 118, 102, 53, - 12, 30, 28, 28, 28, 10, 31, 77, 33, 37, - 36, 52, 45, 71, 38, 23, 31, 21, 12, 89, - 45, 15, 19, 9, 82, 53, 40, 81, 53, 24, - 26, 1, 56, 42, 43, 61, 27, 28, 108, 14, - 48, 54, 36, 36, 102, 20, 52, 42, 46, 123, - 30, 1, 126, 28, 51, 51, 38, 33, 49, 50, - 34, 2, 7, 117, 233, 217, 221, 205, 203, 143, - 255, 221, 205, 215, 128, 231, 254, 135, 231, 202, - 212, 207, 202, 216, 221, 203, 156, 149, 229, 214, - 213, 218, 211, 217, 208, 156, 223, 216, 168, 199, - 239, 251, 249, 255, 227, 239, 160, 198, 231, 244, - 164, 214, 234, 244, 236, 185, 216, 199, 188, 222, - 253, 253, 228, 227, 247, 244, 224, 198, 154, 132, - 156, 201, 187, 188, 204, 174, 144, 150, 132, 132, - 198, 168, 141, 137, 169, 139, 151, 141, 222, 170, - 183, 221, 177, 129, 133, 149, 147, 215, 187, 156, - 166, 136, 186, 188, 170, 170, 236, 130, 171, 175, - 224, 233, 145, 147, 141, 236, 141, 179, 189, 184, - 170, 255, 186, 168, 166, 166, 162, 180, 165, 247, - 151, 147, 110, 104, 64, 64, 64, 78, 12, 108, - 23, 19, 0, 104, 72, 67, 65, 93, 111, 104, - 24, 8, 14, 31, 101, 88, 83, 65, 67, 17, - 98, 69, 81, 84, 121, 126, 122, 112, 46, 65, - 99, 121, 103, 86, 83, 33, 51, 39, 93, 96, - 123, 105, 107, 57, 74, 109, 121, 124, 97, 102, - 98, 104, 54, 89, 123, 97, 15, 46, 29, 27, - 1, 79, 46, 24, 12, 7, 53, 50, 70, 84, - 84, 69, 35, 30, 25, 11, 13, 95, 40, 15, - 23, 18, 3, 4, 4, 14, 84, 55, 37, 37, - 44, 58, 4, 46, 60, 44, 44, 99, 20, 51, - 35, 38, 55, 48, 40, 34, 120, 23, 49, 43, - 57, 8, 25, 115, 4, 35, 51, 54, 39, 32, - 216, 210, 136, 231, 193, 219, 201, 249, 199, 205, - 141, 216, 195, 198, 214, 133, 239, 149, 235, 151, - 158, 235, 206, 216, 211, 192, 197, 195, 207, 151, - 250, 218, 254, 238, 168, 202, 200, 203, 216, 250, - 237, 174, 249, 228, 231, 245, 164, 208, 180, 200, - 182, 185, 202, 237, 249, 252, 225, 230, 226, 232, - 182, 217, 251, 225, 143, 203, 171, 175, 170, 169, - 133, 155, 135, 206, 153, 132, 135, 149, 196, 176, - 212, 168, 214, 217, 170, 141, 153, 156, 129, 134, - 130, 136, 214, 185, 155, 129, 175, 235, 139, 143, - 138, 154, 226, 158, 236, 227, 148, 179, 163, 166, - 183, 176, 168, 162, 248, 155, 177, 177, 184, 253, - 145, 149, 148, 132, 133, 247, 144, 186, 70, 71, - 73, 91, 14, 102, 66, 73, 71, 91, 98, 72, - 82, 68, 75, 76, 84, 27, 78, 74, 30, 106, - 111, 29, 118, 92, 92, 93, 87, 69, 113, 65, - 98, 110, 122, 108, 123, 98, 44, 123, 113, 35, - 85, 82, 38, 67, 107, 105, 118, 122, 106, 91, - 119, 107, 114, 114, 102, 118, 48, 103, 101, 55, - 65, 70, 74, 47, 7, 5, 2, 14, 30, 33, - 7, 21, 9, 0, 20, 71, 18, 22, 90, 46, - 43, 89, 58, 16, 16, 17, 19, 1, 34, 24, - 6, 7, 24, 16, 106, 107, 62, 58, 110, 26, - 31, 109, 6, 44, 44, 45, 39, 53, 106, 101, - 31, 41, 42, 54, 44, 127, 43, 53, 59, 63, - 53, 113, 38, 62, 58, 50, 195, 197, 207, 137, - 198, 192, 223, 217, 152, 131, 246, 196, 200, 195, - 203, 215, 247, 218, 214, 216, 217, 218, 206, 135, - 146, 218, 222, 216, 194, 222, 213, 217, 227, 241, - 233, 253, 231, 224, 226, 163, 172, 173, 214, 228, - 232, 227, 235, 247, 204, 254, 246, 253, 241, 237, - 209, 252, 252, 242, 247, 244, 228, 173, 180, 243, - 139, 130, 132, 201, 154, 128, 204, 129, 141, 130, - 132, 193, 176, 130, 138, 129, 149, 137, 216, 141, - 135, 143, 153, 211, 210, 186, 158, 152, 130, 158, - 149, 153, 163, 177, 169, 189, 167, 160, 162, 237, - 177, 168, 169, 177, 182, 162, 160, 235, 140, 190, - 182, 189, 177, 173, 145, 188, 188, 178, 183, 180, - 164, 237, 244, 245, 92, 78, 70, 77, 65, 93, - 12, 68, 86, 70, 77, 82, 6, 80, 69, 86, - 26, 93, 87, 76, 80, 91, 123, 88, 70, 101, - 85, 95, 82, 88, 70, 120, 111, 127, 105, 77, - 111, 123, 109, 91, 103, 109, 100, 110, 116, 74, - 101, 107, 123, 124, 125, 107, 36, 63, 106, 120, - 124, 119, 127, 99, 54, 122, 113, 97, 11, 15, - 9, 29, 15, 79, 5, 30, 66, 13, 15, 21, - 70, 4, 11, 23, 8, 30, 27, 13, 80, 95, - 40, 4, 2, 22, 80, 76, 86, 33, 17, 27, - 46, 36, 58, 4, 47, 33, 45, 42, 39, 49, - 122, 97, 48, 34, 42, 33, 53, 41, 120, 48, - 45, 127, 61, 49, 32, 54, 49, 53, 47, 119, - 53, 49, 206, 206, 204, 137, 218, 192, 140, 206, - 195, 192, 200, 196, 136, 135, 234, 196, 215, 222, - 152, 132, 158, 159, 202, 216, 220, 215, 223, 195, - 150, 192, 213, 198, 170, 226, 230, 224, 250, 230, - 237, 225, 235, 249, 229, 229, 166, 244, 241, 230, - 249, 254, 235, 234, 248, 234, 240, 241, 235, 179, - 189, 177, 240, 246, 253, 249, 202, 159, 135, 201, - 156, 138, 152, 159, 139, 134, 150, 132, 198, 142, - 138, 131, 149, 219, 153, 155, 145, 138, 136, 221, - 132, 150, 158, 149, 153, 133, 162, 144, 164, 175, - 167, 187, 131, 174, 162, 172, 165, 166, 178, 251, - 230, 174, 170, 172, 174, 178, 185, 181, 183, 165, - 185, 185, 242, 160, 165, 178, 181, 178, 167, 166, - 76, 94, 68, 69, 87, 99, 69, 64, 75, 87, - 112, 68, 84, 78, 75, 65, 26, 6, 24, 21, - 30, 105, 93, 81, 71, 86, 16, 12, 22, 27, - 20, 124, 100, 127, 109, 123, 120, 110, 96, 45, - 63, 35, 44, 33, 84, 98, 117, 112, 127, 104, - 108, 77, 103, 111, 121, 110, 50, 46, 48, 89, - 127, 100, 96, 122, 24, 18, 72, 27, 11, 30, - 25, 8, 17, 23, 64, 58, 15, 3, 89, 56, - 64, 91, 42, 28, 10, 13, 21, 24, 4, 26, - 30, 22, 86, 19, 21, 1, 43, 107, 46, 59, - 33, 34, 108, 46, 35, 32, 40, 36, 104, 105, - 106, 24, 96, 123, 10, 60, 42, 45, 53, 56, - 36, 58, 62, 54, 118, 51, 53, 33, 203, 139, - 206, 219, 193, 194, 140, 206, 195, 192, 200, 196, - 134, 193, 205, 203, 211, 200, 208, 220, 218, 145, - 156, 230, 251, 199, 213, 220, 197, 151, 215, 218, - 255, 229, 252, 179, 174, 210, 209, 183, 162, 207, - 239, 224, 226, 238, 234, 226, 186, 255, 249, 237, - 255, 191, 250, 239, 253, 254, 176, 226, 243, 229, - 226, 240, 152, 197, 198, 199, 179, 213, 204, 161, - 141, 130, 132, 136, 136, 128, 196, 129, 155, 143, - 153, 217, 152, 141, 147, 144, 210, 128, 149, 131, - 128, 146, 134, 213, 172, 162, 166, 160, 189, 167, - 169, 169, 236, 227, 155, 136, 178, 162, 169, 182, - 250, 184, 183, 172, 176, 171, 230, 253, 135, 189, - 163, 164, 166, 167, 187, 167, 94, 78, 76, 9, - 79, 72, 75, 95, 71, 68, 65, 85, 79, 72, - 74, 31, 26, 27, 89, 94, 89, 77, 89, 90, - 83, 71, 89, 94, 88, 23, 90, 90, 126, 43, - 123, 124, 126, 127, 99, 127, 118, 102, 100, 69, - 53, 70, 48, 48, 44, 88, 42, 46, 41, 92, - 40, 94, 35, 34, 35, 38, 33, 37, 38, 80, - 92, 93, 42, 90, 92, 91, 41, 46, 87, 33, - 87, 89, 34, 33, 38, 39, 59, 77, 74, 76, - 78, 79, 72, 73, 48, 70, 64, 64, 55, 64, - 76, 68, 11, 8, 13, 8, 124, 14, 121, 126, - 114, 119, 1, 7, 113, 119, 2, 125, 105, 108, - 106, 111, 110, 29, 107, 106, 103, 18, 104, 28, - 55, 62, 58, 17, 207, 205, 201, 220, 194, 219, - 255, 200, 209, 208, 201, 206, 200, 212, 231, 202, - 212, 207, 217, 208, 208, 218, 206, 240, 215, 192, - 195, 208, 209, 210, 245, 198, 249, 238, 252, 192, - 234, 200, 254, 226, 247, 243, 201, 239, 224, 232, - 215, 234, 232, 239, 209, 247, 250, 250, 228, 211, - 243, 254, 245, 218, 243, 238, 192, 250, 133, 135, - 188, 128, 158, 164, 137, 148, 166, 130, 148, 128, - 178, 158, 148, 128, 188, 148, 138, 148, 159, 139, - 149, 147, 149, 167, 137, 129, 147, 180, 129, 134, - 190, 164, 165, 136, 189, 188, 169, 185, 139, 135, - 150, 168, 181, 174, 166, 169, 191, 146, 171, 149, - 183, 177, 183, 148, 182, 243, 237, 241, 250, 247, - 147, 167, 69, 94, 88, 9, 19, 15, 0, 13, - 116, 74, 83, 72, 68, 75, 65, 5, 7, 27, - 20, 25, 118, 86, 88, 89, 87, 93, 16, 12, - 22, 96, 85, 92, 126, 98, 102, 110, 46, 105, - 99, 127, 34, 112, 116, 96, 116, 115, 36, 113, - 115, 118, 125, 90, 113, 115, 112, 120, 113, 103, - 48, 120, 98, 114, 121, 102, 74, 31, 7, 73, - 12, 26, 10, 11, 7, 17, 64, 50, 7, 17, - 1, 1, 90, 91, 17, 13, 27, 18, 15, 83, - 10, 32, 9, 28, 20, 24, 24, 54, 37, 46, - 46, 47, 39, 44, 37, 40, 44, 55, 20, 51, - 39, 35, 33, 23, 59, 47, 49, 54, 15, 42, - 61, 51, 38, 58, 36, 40, 4, 62, 39, 62, - 248, 194, 219, 194, 142, 223, 201, 223, 193, 198, - 206, 213, 239, 201, 199, 202, 215, 210, 214, 222, - 158, 222, 206, 218, 199, 222, 213, 223, 194, 151, - 220, 212, 249, 171, 255, 251, 225, 225, 235, 173, - 246, 250, 240, 228, 168, 167, 193, 253, 234, 254, - 251, 237, 251, 251, 188, 186, 181, 179, 228, 232, - 230, 242, 220, 250, 134, 130, 140, 136, 151, 166, - 130, 139, 141, 167, 129, 149, 131, 180, 129, 150, - 137, 146, 151, 151, 177, 143, 153, 147, 166, 154, - 157, 148, 162, 142, 132, 144, 131, 184, 152, 187, - 167, 162, 173, 191, 187, 128, 172, 174, 181, 162, - 144, 172, 183, 190, 139, 188, 173, 172, 181, 178, - 188, 160, 148, 176, 175, 164, 144, 180, 83, 100, - 78, 126, 75, 74, 71, 110, 71, 81, 84, 64, - 79, 73, 96, 68, 78, 94, 75, 123, 75, 76, - 85, 83, 87, 64, 67, 126, 84, 93, 81, 86, - 126, 66, 102, 111, 97, 78, 111, 110, 109, 118, - 110, 117, 82, 126, 116, 96, 58, 117, 119, 109, - 62, 108, 105, 109, 98, 124, 98, 101, 115, 115, - 80, 112, 25, 8, 26, 0, 30, 27, 5, 2, - 12, 89, 64, 65, 93, 36, 5, 11, 26, 15, - 88, 31, 23, 17, 24, 93, 30, 26, 3, 5, - 86, 0, 29, 1, 34, 107, 59, 57, 43, 44, - 37, 43, 43, 38, 36, 97, 40, 38, 41, 32, - 122, 102, 120, 63, 42, 47, 114, 44, 39, 50, - 62, 37, 57, 32, 49, 39, 132, 194, 198, 203, - 207, 204, 199, 216, 210, 208, 205, 192, 200, 198, - 195, 192, 200, 254, 213, 255, 200, 209, 212, 252, - 245, 128, 211, 200, 217, 205, 213, 140, 219, 179, - 222, 254, 197, 226, 229, 254, 225, 240, 249, 236, - 228, 232, 232, 246, 197, 247, 241, 234, 234, 236, - 232, 228, 226, 246, 195, 221, 194, 199, 228, 231, - 131, 136, 141, 152, 155, 142, 130, 153, 139, 151, - 153, 145, 148, 142, 135, 128, 183, 158, 153, 138, - 139, 141, 153, 144, 151, 157, 132, 176, 148, 132, - 155, 153, 191, 191, 173, 134, 168, 169, 191, 168, - 182, 170, 179, 149, 180, 166, 173, 169, 179, 181, - 191, 168, 171, 190, 178, 169, 187, 167, 169, 129, - 179, 165, 183, 176, 68, 95, 73, 78, 75, 127, - 94, 68, 65, 70, 112, 83, 79, 68, 65, 104, - 95, 90, 75, 76, 76, 90, 81, 88, 92, 71, - 121, 66, 98, 69, 85, 92, 102, 98, 102, 110, - 95, 122, 109, 99, 118, 106, 116, 120, 86, 98, - 118, 102, 127, 117, 108, 120, 121, 122, 32, 61, - 46, 46, 48, 71, 119, 101, 125, 116, 8, 7, - 13, 61, 7, 12, 7, 33, 7, 5, 20, 35, - 9, 21, 0, 0, 8, 41, 17, 30, 22, 11, - 62, 18, 0, 23, 21, 3, 63, 25, 23, 25, - 63, 47, 45, 5, 43, 41, 56, 15, 45, 49, - 36, 36, 52, 19, 45, 38, 49, 8, 49, 35, - 59, 11, 53, 62, 57, 16, 63, 34, 34, 7, - 38, 48, 201, 194, 219, 192, 193, 193, 237, 193, - 208, 198, 193, 197, 223, 135, 199, 202, 212, 213, - 221, 218, 202, 214, 210, 218, 146, 221, 223, 198, - 242, 222, 199, 214, 229, 229, 230, 236, 237, 251, - 229, 227, 229, 163, 238, 238, 241, 167, 231, 234, - 244, 245, 253, 250, 234, 246, 242, 250, 188, 189, - 190, 177, 245, 248, 250, 251, 143, 136, 156, 128, - 128, 136, 204, 139, 131, 138, 140, 132, 130, 201, - 196, 183, 159, 154, 139, 150, 144, 197, 220, 177, - 157, 146, 148, 152, 152, 144, 212, 134, 175, 184, - 187, 160, 161, 161, 191, 227, 236, 237, 131, 251, - 154, 128, 173, 177, 182, 186, 186, 244, 140, 170, - 178, 179, 183, 161, 140, 179, 163, 190, 184, 177, - 89, 119, 26, 74, 118, 26, 110, 99, 110, 115, - 124, 17, 122, 68, 72, 76, 95, 85, 76, 101, - 74, 90, 78, 80, 91, 93, 81, 93, 106, 83, - 81, 67, 111, 103, 103, 121, 99, 106, 98, 121, - 94, 65, 117, 114, 111, 105, 97, 118, 105, 87, - 121, 96, 123, 109, 64, 73, 96, 114, 116, 120, - 120, 112, 68, 121, 11, 31, 14, 6, 28, 2, - 66, 47, 23, 16, 9, 15, 3, 20, 23, 41, - 27, 2, 29, 11, 34, 60, 19, 19, 28, 22, - 19, 5, 31, 24, 26, 6, 22, 8, 39, 39, - 32, 42, 47, 57, 43, 44, 46, 111, 37, 52, - 8, 42, 59, 63, 49, 55, 57, 127, 57, 37, - 49, 59, 49, 63, 49, 50, 39, 123, 132, 133, - 228, 198, 207, 203, 197, 195, 197, 131, 211, 216, - 203, 197, 203, 201, 154, 220, 202, 214, 203, 207, - 207, 147, 156, 157, 252, 222, 215, 211, 221, 219, - 237, 171, 231, 251, 234, 234, 254, 173, 246, 250, - 240, 228, 245, 169, 170, 171, 214, 244, 249, 253, - 247, 241, 251, 189, 243, 224, 227, 244, 226, 228, - 186, 187, 196, 167, 135, 136, 138, 134, 130, 138, - 194, 130, 131, 130, 137, 146, 138, 145, 137, 213, - 214, 215, 178, 144, 157, 153, 155, 157, 151, 209, - 153, 135, 128, 156, 165, 165, 232, 186, 171, 189, - 165, 168, 177, 237, 238, 239, 138, 168, 165, 161, - 179, 181, 191, 249, 173, 166, 177, 191, 189, 191, - 163, 255, 248, 249, 152, 186, 75, 79, 65, 71, - 73, 15, 94, 88, 78, 70, 83, 15, 8, 9, - 104, 74, 91, 95, 81, 87, 89, 31, 76, 82, - 65, 90, 68, 88, 89, 89, 71, 27, 36, 37, - 68, 102, 111, 107, 101, 99, 101, 35, 99, 109, - 105, 116, 97, 97, 58, 107, 119, 106, 119, 107, - 117, 114, 124, 96, 62, 63, 56, 91, 123, 116, - 14, 2, 6, 14, 78, 29, 9, 29, 13, 17, - 20, 18, 72, 73, 74, 41, 21, 26, 28, 16, - 16, 24, 92, 18, 0, 23, 21, 3, 5, 89, - 90, 91, 6, 36, 41, 45, 39, 33, 43, 109, - 35, 32, 35, 46, 51, 41, 48, 101, 53, 43, - 61, 43, 63, 43, 53, 50, 60, 32, 126, 127, - 120, 27, 59, 52, 206, 194, 198, 206, 142, 219, - 222, 204, 198, 202, 206, 198, 134, 212, 205, 194, - 212, 218, 212, 202, 144, 145, 146, 237, 192, 220, - 211, 212, 197, 196, 221, 219, 237, 171, 229, 236, - 253, 252, 237, 234, 231, 240, 174, 175, 168, 239, - 237, 246, 238, 244, 234, 224, 176, 251, 254, 235, - 253, 255, 229, 252, 243, 186, 245, 251, 139, 135, - 145, 154, 135, 156, 194, 137, 128, 150, 147, 132, - 148, 202, 144, 151, 155, 159, 157, 138, 208, 155, - 158, 178, 130, 150, 130, 144, 130, 158, 155, 155, - 234, 188, 169, 186, 238, 172, 173, 163, 161, 166, - 172, 173, 163, 163, 228, 166, 181, 181, 182, 188, - 189, 171, 185, 185, 242, 160, 165, 178, 181, 178, - 167, 166, 76, 94, 68, 69, 87, 76, 67, 67, - 76, 70, 67, 85, 67, 67, 103, 74, 84, 85, - 93, 90, 74, 86, 83, 83, 18, 68, 81, 66, - 22, 83, 93, 70, 105, 100, 102, 103, 107, 108, - 120, 104, 102, 35, 100, 116, 99, 39, 112, 106, - 58, 111, 112, 124, 62, 115, 125, 126, 121, 51, - 127, 119, 54, 123, 125, 118, 15, 5, 27, 12, - 55, 0, 25, 77, 10, 2, 22, 4, 70, 5, - 1, 0, 20, 91, 27, 22, 16, 17, 25, 30, - 6, 22, 20, 81, 5, 2, 23, 22, 47, 56, - 59, 47, 59, 35, 32, 52, 13, 55, 40, 36, - 52, 103, 50, 32, 52, 63, 55, 43, 45, 127, - 43, 56, 32, 54, 112, 53, 63, 36, 55, 58, - 196, 197, 205, 202, 218, 202, 200, 141, 198, 214, - 197, 129, 210, 200, 132, 209, 210, 222, 152, 213, - 223, 220, 215, 157, 221, 213, 144, 221, 223, 212, - 209, 219, 249, 238, 203, 230, 224, 225, 233, 238, - 246, 234, 239, 239, 193, 245, 235, 240, 234, 244, - 217, 236, 234, 247, 188, 242, 226, 231, 249, 254, - 248, 228, 180, 226, 139, 152, 200, 135, 129, 155, - 204, 158, 135, 151, 166, 128, 143, 139, 196, 145, - 149, 219, 159, 156, 144, 154, 142, 156, 134, 150, - 208, 131, 151, 153, 144, 154, 167, 235, 184, 166, - 188, 187, 164, 185, 182, 179, 250, 238, 233, 171, - 171, 166, 187, 183, 176, 182, 173, 171, 230, 190, - 134, 161, 177, 181, 179, 165, 183, 185, 67, 78, - 70, 93, 113, 70, 72, 78, 78, 74, 69, 79, - 82, 120, 87, 64, 89, 73, 93, 77, 76, 90, - 90, 79, 87, 64, 88, 110, 66, 88, 95, 80, - 100, 108, 122, 104, 96, 123, 83, 121, 123, 115, - 101, 64, 101, 100, 97, 118, 105, 79, 119, 114, - 123, 113, 78, 120, 116, 97, 117, 98, 126, 67, - 123, 126, 15, 5, 45, 17, 30, 6, 30, 8, - 17, 42, 14, 34, 9, 9, 10, 0, 25, 15, - 17, 22, 16, 69, 92, 46, 23, 7, 80, 35, - 19, 17, 6, 16, 57, 35, 28, 38, 37, 42, - 34, 31, 39, 48, 53, 45, 50, 103, 52, 55, - 53, 43, 61, 43, 42, 54, 57, 46, 49, 60, - 52, 52, 53, 56, 48, 48, 138, 207, 199, 204, - 221, 143, 194, 194, 214, 131, 197, 217, 207, 212, - 208, 215, 223, 223, 209, 203, 219, 220, 200, 226, - 199, 193, 217, 208, 195, 195, 220, 218, 248, 226, - 242, 232, 250, 230, 227, 227, 221, 224, 239, 229, - 227, 227, 237, 246, 249, 244, 246, 247, 251, 252, - 232, 244, 252, 244, 176, 245, 255, 228, 247, 250, - 132, 133, 141, 138, 154, 134, 130, 138, 204, 205, - 206, 193, 130, 142, 151, 134, 149, 149, 150, 156, - 157, 139, 153, 153, 210, 144, 159, 159, 152, 146, - 151, 129, 163, 164, 166, 233, 162, 160, 191, 185, - 226, 130, 181, 181, 169, 231, 182, 160, 185, 184, - 183, 183, 187, 188, 168, 180, 189, 189, 240, 184, - 165, 247, 176, 188, 89, 74, 74, 69, 75, 75, - 111, 66, 76, 77, 69, 66, 82, 78, 75, 75, - 26, 82, 75, 25, 80, 80, 72, 29, 81, 92, - 94, 95, 83, 84, 64, 80, 110, 72, 103, 103, - 96, 106, 111, 121, 107, 108, 110, 33, 111, 116, - 36, 80, 116, 112, 118, 118, 105, 113, 60, 114, - 96, 119, 117, 99, 54, 99, 109, 101, 15, 36, - 26, 13, 11, 29, 76, 29, 3, 17, 1, 12, - 3, 19, 1, 23, 9, 91, 17, 10, 94, 26, - 17, 13, 6, 10, 35, 8, 27, 21, 27, 25, - 57, 107, 46, 59, 33, 34, 108, 41, 43, 37, - 38, 36, 52, 34, 42, 49, 122, 56, 55, 55, - 48, 58, 63, 41, 59, 60, 62, 34, 23, 59, - 56, 58, 221, 139, 230, 204, 217, 143, 227, 238, - 237, 243, 204, 192, 197, 194, 132, 234, 249, 244, - 152, 215, 209, 203, 156, 220, 222, 223, 223, 198, - 211, 211, 243, 208, 254, 197, 231, 231, 200, 230, - 244, 232, 230, 208, 249, 236, 228, 232, 232, 165, - 232, 254, 233, 236, 251, 236, 232, 189, 230, 250, - 253, 244, 182, 248, 225, 225, 202, 152, 145, 132, - 140, 128, 128, 205, 139, 135, 192, 220, 198, 171, - 139, 132, 158, 146, 150, 158, 222, 223, 154, 143, - 157, 158, 202, 209, 214, 131, 155, 207, 234, 235, - 174, 160, 160, 166, 191, 165, 167, 167, 224, 167, - 167, 174, 168, 182, 175, 184, 187, 188, 173, 172, - 240, 253, 144, 178, 162, 162, 236, 247, 248, 245, - 110, 94, 90, 72, 90, 70, 67, 67, 24, 3, - 110, 19, 6, 84, 65, 70, 79, 75, 92, 88, - 74, 90, 125, 94, 70, 90, 95, 95, 22, 84, - 91, 64, 102, 111, 40, 103, 97, 123, 44, 111, - 103, 35, 110, 116, 106, 107, 103, 100, 118, 119, - 122, 120, 125, 116, 114, 114, 50, 114, 115, 101, - 127, 97, 113, 53, 5, 25, 12, 12, 28, 28, - 76, 12, 1, 23, 9, 23, 3, 71, 11, 23, - 30, 30, 10, 81, 13, 86, 92, 85, 28, 28, - 80, 1, 25, 4, 29, 1, 35, 36, 38, 58, - 110, 63, 35, 62, 43, 55, 41, 46, 40, 111, - 55, 108, 122, 115, 120, 46, 55, 43, 52, 125, - 114, 50, 62, 53, 118, 26, 49, 38, 217, 202, - 207, 204, 225, 223, 201, 195, 237, 209, 196, 196, - 212, 135, 204, 196, 204, 222, 152, 215, 209, 159, - 253, 222, 209, 220, 197, 223, 194, 254, 208, 153, - 170, 219, 231, 250, 231, 251, 229, 226, 236, 202, - 228, 161, 187, 167, 201, 224, 233, 232, 249, 254, - 251, 208, 236, 248, 252, 220, 226, 245, 243, 229, - 180, 253, 139, 157, 141, 201, 128, 128, 204, 190, - 155, 142, 130, 142, 138, 174, 128, 201, 218, 171, - 151, 138, 151, 139, 149, 146, 156, 186, 148, 209, - 203, 215, 185, 144, 185, 184, 169, 174, 171, 128, - 188, 168, 172, 147, 175, 178, 175, 179, 173, 170, - 180, 251, 176, 184, 168, 186, 252, 179, 189, 243, - 145, 178, 181, 184, 161, 187, 94, 98, 76, 5, - 14, 127, 67, 94, 75, 87, 73, 78, 72, 110, - 64, 5, 7, 27, 117, 92, 77, 76, 93, 90, - 87, 124, 64, 84, 88, 103, 91, 70, 99, 127, - 97, 102, 96, 47, 100, 108, 116, 102, 32, 111, - 105, 39, 87, 124, 119, 121, 119, 117, 87, 123, - 48, 61, 66, 124, 99, 120, 98, 126, 123, 123, - 35, 15, 72, 84, 78, 34, 9, 30, 17, 2, - 7, 4, 37, 11, 11, 22, 31, 31, 40, 22, - 13, 22, 8, 20, 29, 29, 80, 25, 23, 1, - 17, 85, 36, 36, 104, 8, 45, 44, 35, 56, - 44, 55, 9, 37, 106, 103, 20, 42, 41, 50, - 44, 48, 49, 49, 21, 57, 114, 110, 112, 28, - 51, 36, 39, 52, 205, 206, 235, 197, 193, 220, - 201, 201, 242, 204, 211, 200, 210, 206, 203, 203, - 154, 211, 217, 207, 219, 159, 210, 210, 146, 224, - 201, 220, 212, 216, 216, 252, 238, 167, 168, 217, - 225, 252, 229, 249, 235, 236, 238, 200, 226, 167, - 185, 165, 215, 254, 235, 234, 255, 248, 249, 222, - 224, 234, 224, 229, 249, 214, 231, 230, 143, 159, - 170, 136, 130, 142, 130, 142, 135, 144, 192, 137, - 135, 145, 129, 197, 148, 148, 216, 184, 157, 156, - 147, 136, 156, 135, 185, 149, 187, 146, 135, 134, - 171, 172, 173, 138, 188, 182, 188, 185, 173, 130, - 179, 178, 163, 179, 134, 164, 182, 186, 182, 186, - 187, 172, 252, 181, 179, 165, 181, 241, 184, 184, - 244, 148, 89, 88, 77, 93, 103, 75, 111, 95, - 91, 83, 84, 78, 103, 68, 71, 74, 79, 85, - 76, 25, 87, 76, 28, 79, 87, 66, 69, 88, - 68, 82, 80, 21, 108, 100, 122, 41, 67, 106, - 127, 126, 99, 100, 101, 66, 116, 126, 116, 113, - 117, 90, 107, 106, 123, 107, 94, 124, 126, 114, - 126, 114, 115, 100, 58, 53, 43, 8, 11, 6, - 27, 1, 24, 77, 11, 7, 64, 92, 70, 36, - 5, 11, 26, 15, 88, 31, 23, 17, 24, 93, - 19, 16, 19, 30, 3, 25, 0, 85, 61, 34, - 60, 33, 110, 38, 40, 109, 127, 99, 3, 46, - 40, 41, 33, 38, 46, 50, 55, 55, 126, 49, - 61, 48, 55, 5, 53, 63, 50, 56, 38, 27, - 203, 198, 205, 224, 221, 233, 205, 219, 205, 214, - 210, 200, 210, 194, 231, 202, 212, 213, 221, 218, - 202, 214, 211, 211, 225, 199, 209, 197, 211, 244, - 198, 208, 235, 255, 225, 230, 224, 219, 245, 253, - 231, 205, 225, 236, 227, 189, 164, 165, 204, 254, - 246, 253, 241, 237, 166, 189, 178, 213, 241, 231, - 249, 229, 253, 225, 143, 209, 200, 170, 129, 129, - 130, 136, 129, 151, 137, 142, 136, 148, 222, 197, - 147, 149, 145, 141, 151, 158, 144, 148, 136, 146, - 132, 152, 153, 153, 218, 219, 228, 136, 167, 167, - 160, 170, 175, 185, 171, 172, 174, 178, 252, 231, - 173, 171, 179, 175, 177, 184, 178, 182, 166, 184, - 182, 243, 163, 164, 181, 180, 177, 166, 89, 77, - 93, 69, 66, 86, 90, 72, 76, 71, 79, 83, - 104, 70, 73, 64, 121, 90, 86, 30, 74, 31, - 90, 84, 92, 87, 16, 85, 83, 81, 85, 64, - 102, 127, 40, 106, 97, 97, 98, 104, 97, 119, - 105, 110, 104, 39, 109, 107, 124, 116, 56, 127, - 113, 109, 60, 107, 119, 125, 116, 126, 100, 55, - 41, 53, 74, 10, 6, 13, 78, 8, 30, 2, - 23, 19, 64, 92, 70, 36, 22, 0, 27, 15, - 29, 89, 29, 10, 15, 9, 29, 30, 80, 18, - 25, 25, 26, 16, 41, 63, 33, 38, 32, 60, - 108, 36, 49, 99, 36, 36, 40, 46, 33, 33, - 122, 61, 55, 43, 126, 41, 57, 51, 54, 60, - 34, 113, 107, 119, 55, 58, 196, 197, 205, 202, - 218, 198, 195, 195, 235, 205, 198, 206, 231, 195, - 192, 133, 206, 222, 219, 209, 208, 214, 223, 220, - 222, 147, 243, 222, 216, 217, 209, 214, 254, 226, - 231, 231, 199, 225, 234, 226, 162, 234, 243, 161, - 226, 226, 234, 236, 255, 255, 246, 252, 233, 209, - 253, 240, 247, 208, 255, 227, 243, 173, 180, 252, - 132, 130, 156, 128, 143, 131, 133, 151, 131, 151, - 137, 142, 136, 201, 202, 203, 182, 148, 159, 158, - 155, 141, 198, 221, 155, 157, 153, 133, 159, 150, - 152, 156, 176, 174, 172, 233, 189, 186, 175, 174, - 167, 176, 179, 167, 179, 171, 168, 188, 153, 180, - 170, 188, 228, 255, 181, 179, 187, 167, 185, 176, - 186, 190, 174, 176, 78, 11, 91, 92, 77, 76, - 73, 94, 81, 69, 85, 77, 74, 94, 69, 70, - 89, 84, 77, 87, 74, 118, 82, 91, 93, 112, - 101, 98, 98, 120, 121, 106, 89, 82, 69, 75, - 65, 67, 83, 78, 77, 77, 78, 68, 69, 83, - 77, 74, 84, 83, 81, 74, 74, 80, 78, 84, - 81, 82, 92, 78, 69, 78, 89, 87, 37, 39, - 55, 42, 33, 33, 34, 40, 33, 55, 41, 46, - 40, 56, 45, 33, 35, 20, 13, 89, 22, 30, - 10, 24, 82, 30, 31, 3, 19, 87, 0, 29, - 43, 37, 104, 38, 32, 42, 108, 44, 33, 55, - 41, 55, 35, 103, 39, 42, 52, 53, 61, 58, - 42, 54, 51, 51, 126, 115, 41, 62, 35, 119, - 39, 61, 197, 222, 196, 205, 142, 220, 220, 200, - 193, 202, 198, 216, 134, 196, 203, 203, 212, 222, - 219, 205, 215, 208, 210, 244, 214, 147, 192, 208, - 196, 214, 217, 208, 254, 238, 250, 169, 250, 224, - 172, 234, 231, 247, 160, 242, 255, 234, 230, 234, - 246, 232, 225, 244, 252, 240, 240, 212, 252, 245, - 255, 227, 243, 230, 225, 240, 153, 159, 184, 136, - 156, 142, 129, 136, 150, 134, 146, 146, 191, 136, - 145, 197, 151, 142, 139, 141, 222, 140, 140, 152, - 145, 154, 150, 136, 214, 165, 155, 154, 190, 235, - 167, 187, 238, 186, 162, 169, 167, 177, 172, 168, - 163, 181, 157, 170, 175, 251, 176, 184, 168, 186, - 252, 176, 189, 161, 181, 241, 162, 191, 181, 187, - 10, 68, 70, 76, 14, 78, 79, 89, 75, 85, - 69, 1, 69, 72, 74, 75, 95, 88, 76, 80, - 81, 81, 16, 29, 75, 92, 69, 17, 69, 95, - 91, 64, 102, 111, 40, 122, 126, 106, 111, 100, - 100, 122, 32, 98, 105, 105, 106, 96, 121, 111, - 113, 118, 112, 86, 120, 61, 98, 114, 98, 112, - 123, 114, 96, 112, 24, 75, 28, 6, 78, 8, - 9, 25, 66, 5, 21, 21, 19, 21, 1, 69, - 25, 20, 22, 13, 12, 30, 31, 9, 1, 38, - 30, 21, 19, 5, 24, 28, 47, 57, 1, 45, - 29, 42, 62, 36, 39, 10, 36, 14, 52, 35, - 33, 55, 122, 46, 40, 61, 63, 43, 57, 18, - 32, 55, 53, 35, 118, 37, 49, 56, 197, 221, - 205, 198, 220, 203, 201, 223, 246, 218, 208, 196, - 239, 195, 253, 202, 207, 155, 208, 216, 200, 218, - 156, 208, 221, 193, 213, 145, 194, 223, 213, 219, - 170, 228, 230, 236, 174, 238, 239, 249, 235, 245, - 229, 161, 229, 232, 234, 235, 255, 248, 236, 240, - 241, 241, 176, 189, 235, 252, 229, 177, 229, 255, - 251, 224, 134, 143, 200, 154, 158, 138, 143, 132, - 132, 154, 192, 130, 137, 137, 138, 128, 153, 143, - 145, 150, 144, 182, 152, 221, 130, 146, 130, 144, - 155, 146, 128, 144, 184, 235, 188, 166, 238, 168, - 169, 185, 226, 140, 178, 165, 163, 181, 144, 188, - 170, 190, 150, 182, 254, 178, 189, 169, 177, 187, - 185, 191, 177, 247, 183, 186, 68, 69, 77, 74, - 90, 70, 67, 67, 118, 81, 65, 69, 67, 9, - 4, 106, 72, 95, 93, 75, 30, 86, 82, 91, - 93, 9, 16, 82, 87, 89, 19, 65, 42, 109, - 97, 103, 106, 47, 99, 127, 102, 102, 114, 78, - 116, 99, 97, 119, 58, 115, 113, 106, 106, 112, - 110, 100, 65, 103, 127, 97, 69, 99, 123, 101, - 38, 2, 5, 0, 26, 59, 30, 67, 17, 23, - 15, 17, 43, 6, 22, 14, 31, 15, 10, 28, - 15, 10, 25, 14, 6, 1, 21, 0, 3, 18, - 7, 1, 57, 10, 36, 37, 33, 56, 108, 42, - 48, 44, 53, 49, 102, 40, 54, 33, 63, 41, - 43, 54, 44, 59, 57, 47, 33, 42, 61, 51, - 57, 59, 39, 25, 195, 216, 220, 231, 207, 194, - 201, 222, 219, 206, 194, 206, 202, 212, 202, 192, - 205, 232, 193, 212, 220, 208, 208, 206, 254, 218, - 195, 197, 248, 214, 217, 208, 200, 249, 233, 231, - 234, 230, 226, 234, 199, 238, 245, 237, 231, 243, - 235, 247, 215, 250, 234, 242, 251, 235, 188, 207, - 247, 227, 252, 240, 239, 195, 230, 244, 142, 130, - 134, 142, 206, 188, 133, 128, 151, 143, 129, 149, - 137, 149, 182, 128, 139, 142, 157, 138, 138, 223, - 142, 152, 152, 150, 147, 133, 147, 147, 212, 145, - 191, 174, 232, 189, 161, 239, 184, 191, 163, 167, - 169, 175, 161, 231, 180, 183, 181, 175, 189, 186, - 170, 182, 179, 179, 242, 160, 169, 162, 162, 178, - 185, 251, 10, 104, 64, 76, 77, 68, 12, 84, - 77, 86, 82, 1, 85, 66, 80, 81, 83, 85, - 95, 74, 30, 23, 123, 88, 92, 86, 66, 80, - 90, 23, 71, 80, 126, 127, 97, 103, 105, 124, - 44, 32, 60, 35, 84, 115, 103, 99, 109, 107, - 125, 59, 104, 107, 113, 107, 121, 126, 102, 122, - 127, 127, 63, 84, 46, 73, 45, 2, 28, 5, - 15, 13, 65, 63, 23, 13, 14, 4, 20, 59, - 6, 16, 19, 23, 28, 10, 34, 77, 31, 37, - 71, 49, 62, 61, 38, 43, 68, 41, 41, 39, - 33, 44, 32, 59, 16, 57, 39, 49, 45, 40, - 40, 38, 40, 25, 62, 62, 46, 60, 50, 48, - 44, 48, 55, 61, 36, 13, 20, 34, 39, 60, - 196, 206, 219, 218, 226, 206, 213, 200, 208, 255, - 244, 211, 199, 195, 205, 203, 221, 235, 212, 216, - 202, 217, 211, 207, 223, 157, 242, 196, 197, 222, - 218, 208, 249, 248, 196, 232, 247, 234, 254, 209, - 193, 236, 242, 228, 168, 228, 247, 202, 232, 255, - 253, 235, 190, 237, 249, 236, 231, 246, 227, 229, - 182, 229, 241, 255, 143, 136, 156, 140, 138, 207, - 136, 152, 135, 195, 148, 142, 198, 192, 167, 138, - 148, 157, 145, 139, 147, 223, 136, 143, 147, 151, - 153, 159, 145, 215, 155, 155, 234, 185, 173, 168, - 162, 239, 175, 162, 172, 173, 165, 162, 178, 174, - 171, 171, 250, 172, 177, 173, 182, 255, 174, 168, - 188, 189, 185, 191, 177, 247, 167, 188, 71, 94, - 68, 72, 90, 64, 94, 10, 2, 80, 69, 85, - 82, 78, 74, 66, 20, 27, 123, 81, 91, 92, - 87, 29, 75, 92, 69, 67, 22, 68, 81, 65, - 126, 98, 102, 110, 125, 47, 36, 74, 103, 109, - 101, 115, 103, 107, 36, 118, 127, 111, 108, 112, - 112, 120, 111, 61, 63, 45, 48, 82, 121, 121, - 114, 124, 24, 6, 9, 29, 7, 0, 2, 30, - 66, 69, 64, 54, 7, 21, 10, 12, 20, 28, - 11, 80, 23, 12, 61, 30, 6, 26, 6, 20, - 18, 22, 0, 16, 37, 59, 45, 39, 1, 41, - 42, 62, 39, 55, 35, 45, 41, 52, 33, 10, - 60, 61, 43, 60, 42, 59, 61, 36, 33, 60, - 32, 52, 56, 3, 61, 56, 207, 200, 196, 198, - 221, 202, 248, 196, 207, 198, 201, 197, 197, 200, - 202, 203, 223, 216, 204, 208, 209, 209, 245, 217, - 215, 203, 211, 217, 215, 217, 211, 208, 195, 239, - 251, 240, 227, 237, 227, 225, 203, 231, 227, 238, - 232, 243, 229, 236, 244, 254, 234, 208, 250, 235, - 245, 240, 247, 201, 255, 255, 243, 227, 253, 248, - 143, 177, 135, 135, 139, 166, 130, 139, 141, 144, - 133, 146, 149, 142, 139, 139, 137, 147, 151, 149, - 151, 155, 157, 132, 129, 128, 149, 130, 133, 158, - 155, 155, 137, 164, 166, 189, 175, 166, 162, 168, - 176, 176, 161, 178, 181, 174, 163, 171, 183, 190, - 182, 173, 173, 156, 189, 179, 178, 167, 240, 183, - 191, 185, 176, 245, 75, 76, 79, 91, 75, 72, - 77, 89, 75, 76, 78, 1, 81, 78, 80, 77, - 26, 72, 72, 92, 93, 86, 90, 84, 87, 87, - 16, 95, 87, 90, 81, 21, 89, 127, 105, 123, - 122, 47, 124, 127, 109, 96, 101, 114, 117, 110, - 106, 98, 52, 53, 54, 57, 69, 76, 104, 120, - 98, 51, 62, 63, 56, 55, 79, 72, 80, 75, - 59, 29, 11, 31, 76, 67, 66, 34, 7, 6, - 20, 2, 3, 4, 14, 18, 23, 23, 94, 23, - 21, 14, 6, 28, 2, 8, 88, 89, 90, 85, - 57, 36, 61, 59, 45, 42, 108, 37, 43, 48, - 52, 46, 52, 62, 100, 38, 53, 46, 54, 45, - 126, 113, 124, 28, 53, 52, 34, 52, 49, 54, - 32, 60, 197, 197, 136, 193, 199, 220, 216, 194, - 208, 218, 128, 199, 207, 201, 205, 214, 210, 222, - 220, 151, 158, 228, 245, 201, 215, 222, 195, 145, - 213, 216, 193, 219, 254, 177, 168, 169, 254, 253, - 227, 238, 231, 240, 243, 228, 226, 169, 208, 236, - 249, 240, 200, 235, 241, 252, 249, 238, 225, 250, - 254, 246, 182, 241, 253, 251, 131, 152, 128, 140, - 138, 193, 204, 182, 182, 140, 148, 128, 138, 199, - 148, 151, 149, 152, 157, 138, 141, 150, 146, 154, - 210, 135, 153, 156, 147, 205, 212, 213, 185, 229, - 232, 157, 161, 187, 173, 161, 226, 179, 178, 174, - 165, 162, 183, 182, 191, 191, 248, 176, 170, 186, - 177, 174, 232, 243, 254, 241, 132, 178, 167, 160, - 70, 95, 8, 72, 73, 72, 94, 72, 69, 66, - 84, 68, 66, 7, 77, 81, 95, 86, 75, 3, - 30, 124, 93, 83, 21, 71, 16, 87, 95, 89, - 80, 21, 99, 101, 108, 96, 109, 110, 120, 98, - 112, 35, 119, 104, 114, 111, 36, 98, 115, 109, - 125, 119, 62, 113, 125, 112, 119, 80, 113, 127, - 118, 99, 52, 115, 3, 5, 12, 73, 15, 8, - 11, 31, 7, 4, 1, 21, 9, 21, 68, 3, - 21, 9, 88, 10, 27, 19, 25, 30, 6, 22, - 20, 81, 6, 22, 6, 20, 39, 46, 60, 44, - 60, 60, 39, 40, 59, 21, 33, 45, 51, 34, - 100, 40, 47, 40, 44, 121, 60, 58, 124, 58, - 32, 54, 49, 37, 51, 37, 116, 33, 194, 202, - 198, 137, 158, 223, 201, 223, 203, 204, 196, 236, - 211, 203, 208, 204, 202, 215, 209, 220, 204, 234, - 210, 214, 220, 220, 199, 223, 150, 213, 213, 198, - 239, 171, 248, 236, 252, 230, 227, 233, 193, 185, - 220, 198, 239, 243, 232, 228, 248, 182, 202, 236, - 240, 241, 249, 239, 206, 241, 229, 248, 250, 243, - 231, 201, 216, 136, 176, 220, 172, 161, 160, 189, - 190, 211, 188, 130, 138, 142, 129, 139, 142, 167, - 140, 156, 140, 146, 149, 147, 147, 159, 172, 149, - 147, 129, 145, 153, 165, 187, 165, 172, 160, 187, - 144, 143, 183, 176, 169, 175, 163, 180, 183, 137, - 187, 162, 189, 171, 130, 139, 174, 188, 182, 186, - 190, 182, 134, 187, 181, 161, 76, 68, 90, 68, - 0, 109, 89, 94, 75, 77, 69, 82, 85, 107, - 69, 92, 95, 73, 100, 113, 87, 76, 72, 82, - 64, 74, 108, 97, 83, 69, 93, 90, 110, 37, - 107, 122, 99, 71, 72, 90, 91, 65, 97, 114, - 99, 87, 97, 119, 115, 116, 124, 73, 123, 109, - 117, 114, 118, 94, 101, 125, 98, 126, 100, 121, - 19, 14, 26, 32, 0, 31, 25, 25, 66, 19, - 1, 19, 7, 10, 1, 17, 31, 9, 11, 58, - 68, 35, 59, 20, 6, 31, 17, 19, 91, 37, - 1, 27, 36, 46, 58, 21, 44, 58, 37, 33, - 38, 48, 28, 115, 37, 31, 113, 7, 20, 23, - 8, 5, 110, 3, 63, 49, 59, 54, 62, 37, - 10, 35, 49, 39, 199, 194, 198, 200, 194, 243, - 200, 200, 212, 198, 204, 206, 214, 202, 193, 203, - 206, 231, 250, 204, 205, 214, 210, 216, 193, 192, - 252, 208, 207, 210, 198, 233, 222, 249, 233, 237, - 231, 225, 235, 221, 238, 226, 244, 231, 233, 245, - 233, 171, 216, 238, 235, 240, 240, 250, 239, 238, - 222, 242, 233, 244, 228, 203, 217, 250, 142, 158, - 132, 140, 157, 179, 169, 149, 135, 128, 149, 149, - 143, 136, 138, 160, 148, 143, 145, 141, 135, 209, - 159, 142, 187, 157, 128, 132, 130, 167, 149, 135, - 171, 166, 173, 189, 171, 189, 191, 237, 239, 227, - 176, 160, 180, 166, 169, 160, 174, 190, 170, 249, - 252, 253, 252, 188, 190, 161, 181, 176, 178, 174, - 244, 176, 82, 66, 91, 93, 93, 124, 79, 95, - 75, 83, 84, 106, 67, 94, 109, 75, 89, 84, - 74, 75, 91, 92, 72, 29, 94, 86, 94, 86, - 66, 95, 20, 90, 108, 43, 94, 104, 124, 102, - 109, 99, 118, 112, 46, 33, 79, 115, 36, 104, - 111, 104, 108, 57, 124, 122, 60, 120, 100, 118, - 126, 49, 62, 124, 113, 108, 74, 70, 72, 31, - 15, 3, 25, 8, 66, 19, 1, 8, 20, 20, - 77, 40, 31, 22, 26, 28, 12, 95, 8, 4, - 2, 22, 80, 28, 3, 4, 0, 85, 40, 46, - 104, 0, 13, 32, 33, 61, 35, 49, 33, 35, - 42, 34, 11, 39, 48, 62, 59, 45, 45, 127, - 40, 36, 34, 54, 112, 62, 48, 119, 2, 52, - 216, 194, 201, 199, 218, 220, 130, 141, 235, 215, - 128, 204, 211, 212, 208, 133, 216, 222, 152, 240, - 253, 208, 209, 205, 211, 193, 209, 211, 218, 210, - 226, 212, 248, 226, 233, 231, 250, 252, 172, 228, - 246, 230, 237, 161, 226, 232, 225, 246, 186, 245, - 247, 237, 190, 235, 244, 248, 178, 224, 241, 252, - 243, 183, 224, 236, 154, 142, 200, 157, 134, 142, - 152, 205, 131, 151, 148, 147, 143, 133, 145, 145, - 159, 159, 216, 154, 146, 158, 143, 142, 210, 158, - 149, 156, 148, 146, 134, 219, 234, 130, 188, 233, - 163, 186, 191, 185, 226, 161, 165, 225, 136, 168, - 176, 229, 169, 174, 168, 169, 177, 173, 168, 184, - 182, 243, 185, 191, 166, 162, 160, 245, 90, 74, - 90, 72, 67, 74, 88, 72, 80, 3, 84, 88, - 86, 66, 4, 13, 83, 85, 92, 80, 93, 94, - 72, 82, 64, 122, 94, 85, 95, 84, 85, 65, - 101, 121, 40, 96, 125, 47, 109, 97, 112, 102, - 97, 101, 127, 39, 101, 97, 126, 126, 124, 85, - 119, 113, 121, 91, 125, 97, 125, 112, 98, 99, - 113, 113, 60, 10, 4, 28, 11, 32, 30, 9, - 7, 17, 19, 41, 15, 20, 16, 10, 8, 2, - 42, 28, 15, 10, 25, 14, 6, 35, 17, 3, - 23, 26, 17, 1, 47, 57, 59, 47, 60, 32, - 33, 57, 45, 23, 50, 32, 34, 34, 55, 13, - 51, 40, 44, 54, 44, 38, 14, 56, 35, 38, - 53, 34, 34, 7, 53, 39, 203, 198, 205, 221, - 203, 221, 223, 203, 205, 209, 195, 196, 244, 194, - 200, 202, 219, 223, 247, 248, 203, 203, 212, 239, - 215, 192, 197, 221, 194, 242, 218, 214, 248, 242, - 248, 253, 235, 235, 222, 232, 228, 241, 229, 242, - 238, 211, 235, 238, 255, 245, 205, 234, 251, 204, - 253, 235, 247, 247, 196, 254, 253, 242, 250, 230, - 166, 130, 134, 130, 186, 138, 148, 153, 178, 130, - 147, 146, 145, 136, 150, 129, 178, 148, 148, 157, - 155, 141, 172, 156, 129, 128, 135, 158, 132, 147, - 167, 148, 188, 174, 152, 168, 189, 188, 187, 162, - 176, 167, 180, 179, 167, 163, 165, 167, 182, 190, - 139, 160, 179, 189, 179, 177, 163, 166, 191, 165, - 179, 164, 135, 172, 71, 73, 71, 69, 90, 70, - 79, 70, 106, 74, 83, 85, 73, 85, 93, 118, - 67, 86, 90, 86, 82, 82, 85, 83, 71, 71, - 85, 121, 95, 68, 64, 90, 120, 114, 91, 112, - 99, 109, 99, 97, 102, 98, 121, 73, 111, 116, - 112, 106, 104, 98, 75, 96, 115, 125, 115, 113, - 100, 124, 124, 100, 123, 114, 85, 123, 11, 7, - 17, 26, 7, 28, 63, 20, 15, 1, 15, 13, - 21, 30, 9, 7, 21, 23, 53, 24, 14, 12, - 5, 16, 16, 28, 28, 60, 23, 7, 61, 17, - 30, 57, 41, 45, 47, 45, 32, 40, 17, 58, - 45, 35, 41, 43, 23, 60, 55, 57, 55, 53, - 126, 50, 61, 45, 114, 53, 63, 35, 118, 119, - 53, 57, 216, 206, 201, 205, 215, 143, 201, 213, - 203, 208, 212, 210, 242, 213, 197, 193, 219, 217, - 212, 220, 158, 222, 210, 217, 146, 194, 197, 222, - 194, 210, 199, 149, 249, 242, 229, 235, 225, 227, - 172, 236, 240, 230, 160, 245, 238, 226, 164, 246, - 251, 246, 253, 183, 190, 210, 253, 237, 226, 250, - 254, 246, 182, 254, 231, 181, 140, 132, 154, 139, - 135, 139, 136, 136, 140, 195, 148, 142, 198, 142, - 144, 150, 159, 151, 158, 173, 140, 158, 152, 156, - 144, 159, 149, 209, 151, 153, 144, 213, 190, 162, - 171, 162, 189, 239, 164, 164, 177, 183, 175, 179, - 191, 231, 183, 188, 183, 185, 183, 181, 254, 190, - 174, 184, 242, 167, 184, 180, 246, 164, 181, 184, - 79, 5, 8, 100, 79, 95, 92, 68, 76, 68, - 0, 72, 85, 7, 66, 74, 72, 89, 81, 93, - 90, 90, 82, 29, 70, 92, 16, 88, 66, 68, - 81, 89, 108, 95, 122, 104, 106, 110, 110, 97, - 103, 35, 97, 111, 98, 39, 105, 108, 116, 110, - 108, 124, 109, 63, 116, 116, 97, 103, 127, 99, - 111, 55, 103, 108, 7, 9, 7, 5, 78, 14, - 30, 8, 66, 23, 8, 4, 70, 20, 5, 8, - 31, 85, 88, 52, 31, 15, 12, 20, 28, 20, - 80, 24, 5, 87, 18, 26, 56, 41, 33, 45, - 42, 42, 34, 109, 54, 44, 96, 40, 50, 52, - 33, 41, 60, 15, 42, 56, 58, 62, 62, 49, - 55, 115, 49, 63, 50, 119, 48, 52, 211, 216, - 136, 193, 199, 220, 216, 194, 208, 218, 128, 210, - 223, 202, 198, 202, 214, 155, 217, 203, 219, 159, - 200, 213, 215, 147, 195, 208, 219, 210, 154, 149, - 199, 234, 248, 249, 231, 225, 235, 173, 235, 240, - 160, 231, 233, 245, 230, 236, 254, 255, 253, 247, - 190, 235, 243, 189, 251, 231, 227, 244, 250, 241, - 192, 231, 139, 143, 137, 139, 130, 138, 204, 140, - 140, 135, 192, 151, 137, 139, 145, 136, 159, 219, - 153, 151, 159, 147, 133, 142, 155, 128, 208, 130, - 143, 154, 150, 154, 166, 235, 169, 187, 171, 239, - 184, 165, 167, 227, 179, 160, 171, 162, 234, 229, - 151, 186, 168, 169, 183, 177, 187, 253, 187, 160, - 240, 183, 185, 165, 182, 188, 78, 79, 77, 71, - 14, 91, 67, 13, 75, 87, 83, 68, 74, 65, - 4, 8, 4, 27, 97, 86, 75, 31, 84, 92, - 68, 86, 16, 95, 89, 67, 20, 69, 101, 120, - 123, 96, 108, 102, 96, 100, 118, 122, 32, 117, - 105, 39, 103, 119, 127, 122, 108, 124, 62, 108, - 101, 112, 112, 124, 124, 98, 54, 122, 117, 101, - 26, 2, 6, 14, 78, 13, 9, 14, 3, 22, - 19, 4, 70, 14, 16, 69, 29, 20, 12, 89, - 10, 16, 92, 30, 27, 1, 19, 29, 19, 87, - 7, 12, 39, 41, 39, 37, 61, 111, 33, 44, - 50, 51, 41, 47, 33, 103, 108, 22, 35, 54, - 58, 54, 50, 30, 63, 62, 61, 38, 62, 37, - 6, 54, 61, 39, 249, 210, 197, 203, 193, 195, - 140, 144, 130, 143, 128, 224, 197, 196, 203, 208, - 212, 207, 152, 132, 158, 238, 201, 220, 220, 199, - 223, 198, 211, 197, 118, 28, 170, 218, 253, 232, - 224, 251, 227, 250, 231, 241, 160, 205, 202, 196, - 168, 165, 168, 171, 169, 161, 176, 191, 221, 241, - 254, 179, 226, 248, 241, 255, 224, 230, 202, 153, - 141, 154, 139, 157, 154, 136, 134, 139, 148, 149, - 150, 148, 222, 202, 213, 138, 141, 152, 144, 139, - 147, 138, 151, 129, 222, 146, 153, 154, 219, 133, - 184, 162, 190, 168, 173, 182, 164, 185, 182, 179, - 179, 251, 233, 232, 179, 178, 173, 245, 169, 172, - 191, 177, 168, 178, 165, 182, 162, 255, 181, 184, - 185, 250, 94, 78, 90, 68, 93, 2, 67, 75, - 15, 86, 83, 68, 78, 83, 80, 85, 73, 1, - 23, 22, 79, 74, 93, 83, 70, 92, 71, 84, - 68, 25, 87, 90, 103, 36, 96, 125, 122, 127, - 127, 55, 45, 44, 118, 51, 40, 125, 107, 117, - 115, 118, 54, 122, 113, 114, 51, 106, 123, 119, - 119, 116, 98, 56, 120, 124, 28, 14, 11, 1, - 15, 27, 66, 5, 22, 14, 12, 94, 7, 23, - 13, 58, 25, 26, 20, 21, 13, 66, 89, 72, - 48, 86, 69, 53, 80, 31, 27, 6, 62, 37, - 41, 36, 43, 114, 61, 56, 35, 45, 52, 46, - 49, 34, 54, 107, 57, 52, 53, 127, 53, 58, - 37, 96, 103, 4, 30, 53, 27, 39, 99, 103, - 157, 232, 223, 232, 204, 247, 234, 226, 237, 249, - 212, 219, 234, 200, 239, 213, 226, 207, 129, 242, - 230, 201, 244, 251, 148, 223, 209, 223, 209, 138, - 209, 219, 172, 227, 252, 253, 254, 252, 182, 162, - 173, 246, 240, 229, 231, 243, 225, 246, 180, 234, - 237, 248, 240, 235, 243, 234, 247, 225, 190, 242, - 249, 250, 187, 196, 159, 138, 134, 157, 129, 152, - 137, 159, 138, 151, 148, 145, 149, 221, 203, 202, - 139, 142, 153, 151, 138, 144, 139, 152, 128, 221, - 147, 158, 155, 216, 132, 135, 163, 168, 161, 167, - 169, 167, 184, 185, 178, 176, 250, 238, 233, 166, - 167, 166, 181, 174, 182, 173, 173, 241, 173, 168, - 179, 189, 164, 190, 161, 178, 166, 251, 73, 68, - 69, 126, 75, 15, 68, 76, 84, 70, 0, 82, - 67, 83, 4, 80, 74, 27, 76, 81, 91, 31, - 88, 88, 84, 82, 69, 93, 66, 23, 64, 71, - 107, 111, 97, 103, 105, 47, 105, 99, 116, 106, - 114, 110, 104, 106, 97, 107, 110, 59, 126, 118, - 108, 63, 101, 114, 103, 51, 103, 120, 98, 127, - 52, 87, 3, 5, 9, 7, 13, 10, 76, 36, - 12, 5, 15, 65, 11, 8, 0, 0, 84, 71, - 26, 11, 64, 67, 30, 15, 76, 42, 31, 4, - 86, 26, 21, 12, 106, 40, 39, 39, 32, 42, - 47, 57, 98, 55, 47, 97, 52, 34, 37, 41, - 122, 57, 42, 54, 53, 58, 46, 125, 37, 59, - 53, 63, 118, 46, 59, 32, 138, 202, 218, 204, - 142, 221, 201, 204, 198, 218, 128, 213, 201, 135, - 215, 209, 219, 201, 204, 153, 202, 205, 221, 217, - 219, 221, 215, 159, 245, 216, 193, 217, 238, 171, - 230, 230, 250, 175, 224, 226, 227, 231, 160, 243, - 227, 246, 241, 236, 232, 254, 252, 185, 255, 236, - 239, 248, 255, 241, 252, 232, 182, 246, 225, 225, - 133, 134, 137, 157, 135, 140, 141, 129, 142, 154, - 192, 175, 135, 138, 129, 223, 218, 219, 170, 156, - 143, 138, 153, 142, 134, 154, 158, 150, 183, 132, - 135, 144, 167, 169, 164, 176, 244, 239, 142, 164, - 172, 167, 169, 175, 161, 231, 182, 160, 190, 178, - 170, 188, 189, 171, 252, 170, 179, 160, 240, 176, - 166, 167, 184, 188, 79, 79, 8, 93, 65, 15, - 98, 76, 79, 70, 26, 1, 6, 117, 65, 65, - 83, 73, 93, 90, 74, 111, 93, 73, 90, 9, - 16, 127, 87, 90, 81, 21, 105, 106, 102, 41, - 96, 96, 120, 45, 96, 102, 32, 100, 107, 119, - 112, 124, 78, 115, 125, 57, 119, 107, 121, 112, - 50, 100, 121, 101, 126, 55, 103, 116, 7, 14, - 72, 7, 15, 2, 9, 77, 3, 15, 18, 4, - 7, 3, 29, 69, 31, 3, 17, 10, 10, 12, - 41, 86, 60, 18, 29, 20, 86, 20, 27, 0, - 38, 47, 104, 42, 33, 33, 56, 44, 43, 45, - 51, 123, 102, 10, 37, 44, 54, 29, 42, 54, - 51, 30, 56, 57, 32, 54, 35, 34, 118, 62, - 39, 117, 196, 222, 196, 197, 142, 192, 222, 141, - 199, 206, 208, 213, 223, 211, 193, 221, 206, 148, - 200, 213, 223, 214, 210, 129, 240, 225, 142, 187, - 138, 245, 230, 139, 170, 206, 229, 235, 235, 235, - 232, 232, 230, 163, 233, 236, 231, 224, 225, 165, - 166, 242, 245, 254, 190, 236, 238, 254, 175, 240, - 249, 245, 172, 244, 251, 248, 154, 138, 134, 144, - 130, 128, 139, 130, 220, 223, 162, 179, 216, 147, - 129, 157, 142, 212, 144, 141, 147, 147, 159, 146, - 159, 131, 145, 159, 143, 155, 155, 146, 165, 152, - 173, 189, 186, 166, 162, 170, 177, 142, 161, 175, - 167, 160, 161, 183, 244, 150, 185, 176, 178, 140, - 185, 175, 164, 182, 162, 255, 155, 182, 189, 185, - 127, 88, 77, 122, 125, 99, 111, 66, 76, 77, - 69, 66, 82, 78, 75, 75, 111, 72, 93, 25, - 109, 108, 112, 29, 81, 92, 94, 95, 83, 84, - 64, 92, 101, 101, 91, 108, 122, 123, 101, 99, - 101, 112, 77, 96, 104, 102, 99, 96, 104, 53, - 85, 120, 119, 115, 79, 120, 96, 101, 117, 99, - 56, 90, 117, 124, 6, 39, 7, 14, 7, 1, - 45, 24, 22, 11, 5, 15, 18, 14, 7, 4, - 14, 18, 23, 23, 94, 19, 19, 26, 27, 29, - 35, 20, 2, 3, 29, 27, 45, 56, 5, 40, - 32, 46, 43, 40, 48, 109, 13, 32, 47, 43, - 23, 32, 40, 45, 61, 43, 112, 18, 61, 52, - 62, 3, 49, 34, 37, 32, 59, 39, 206, 234, - 221, 221, 198, 202, 194, 217, 203, 192, 193, 213, - 207, 200, 202, 133, 202, 218, 203, 202, 201, 208, - 206, 217, 225, 214, 196, 197, 223, 217, 211, 198, - 199, 234, 230, 232, 233, 234, 254, 163, 207, 226, - 233, 237, 213, 226, 246, 243, 255, 233, 182, 212, - 255, 246, 240, 206, 223, 199, 192, 194, 243, 229, - 226, 240, 152, 191, 129, 132, 139, 128, 153, 153, - 177, 174, 180, 177, 198, 148, 129, 151, 140, 158, - 138, 217, 138, 150, 145, 152, 157, 134, 132, 221, - 214, 154, 135, 166, 175, 191, 188, 160, 160, 168, - 191, 128, 163, 173, 161, 166, 163, 181, 234, 136, - 187, 178, 180, 138, 187, 173, 170, 184, 160, 253, - 157, 176, 191, 187, 135, 152, 126, 123, 123, 76, - 92, 89, 73, 95, 113, 110, 116, 113, 6, 84, - 65, 87, 76, 94, 74, 106, 91, 75, 72, 84, - 92, 84, 67, 124, 87, 89, 85, 82, 111, 121, - 38, 68, 111, 102, 96, 94, 103, 113, 118, 100, - 116, 41, 73, 100, 115, 119, 75, 84, 74, 79, - 76, 114, 96, 103, 67, 92, 66, 71, 52, 101, - 5, 25, 28, 57, 15, 6, 30, 46, 13, 15, - 15, 19, 37, 8, 8, 10, 8, 74, 59, 22, - 18, 16, 14, 79, 33, 10, 29, 19, 25, 27, - 7, 85, 38, 34, 59, 61, 110, 33, 45, 32, - 39, 99, 35, 32, 40, 103, 42, 42, 46, 123, - 58, 60, 126, 58, 49, 45, 38, 42, 3, 48, - 59, 50, 116, 38, 211, 198, 202, 198, 194, 220, - 140, 193, 203, 208, 212, 129, 200, 198, 201, 192, - 154, 218, 212, 203, 219, 222, 216, 196, 146, 214, - 200, 216, 197, 195, 154, 149, 197, 249, 236, 236, - 252, 175, 197, 233, 184, 163, 160, 211, 227, 246, - 241, 224, 233, 239, 209, 253, 164, 191, 200, 239, - 243, 247, 249, 255, 241, 183, 251, 229, 143, 153, - 137, 157, 135, 128, 130, 205, 144, 134, 147, 148, - 138, 147, 192, 179, 149, 151, 141, 148, 155, 223, - 157, 147, 147, 159, 137, 130, 159, 132, 212, 150, - 171, 167, 171, 188, 162, 174, 184, 164, 173, 173, - 224, 167, 180, 168, 169, 229, 174, 178, 187, 178, - 173, 255, 180, 180, 161, 167, 191, 163, 175, 247, - 189, 166, 10, 69, 71, 93, 14, 78, 64, 65, - 77, 84, 69, 69, 6, 65, 75, 87, 26, 27, - 89, 91, 81, 77, 72, 88, 86, 29, 16, 98, - 79, 90, 86, 90, 102, 43, 53, 41, 97, 127, - 120, 100, 109, 109, 85, 111, 98, 98, 118, 105, - 115, 126, 106, 80, 106, 122, 113, 92, 113, 103, - 121, 126, 120, 86, 115, 114, 24, 14, 27, 26, - 1, 29, 42, 1, 3, 4, 35, 0, 10, 4, - 17, 9, 27, 15, 23, 11, 68, 95, 61, 17, - 23, 1, 4, 52, 24, 22, 22, 25, 47, 47, - 1, 58, 13, 32, 32, 34, 48, 42, 46, 38, - 7, 43, 33, 55, 46, 29, 49, 53, 42, 58, - 46, 28, 62, 54, 34, 37, 24, 50, 49, 49, - 233, 196, 198, 207, 199, 221, 193, 249, 208, 194, - 196, 200, 200, 192, 225, 221, 202, 210, 202, 220, - 251, 199, 204, 212, 192, 202, 228, 216, 219, 210, - 208, 209, 199, 198, 241, 240, 247, 246, 172, 197, - 202, 185, 237, 236, 188, 244, 247, 171, 252, 253, - 254, 255, 248, 249, 206, 248, 226, 246, 241, 229, - 215, 251, 241, 231, 158, 170, 139, 157, 135, 128, - 130, 158, 176, 134, 144, 132, 135, 147, 169, 132, - 130, 184, 151, 140, 144, 139, 174, 152, 130, 150, - 145, 133, 166, 146, 134, 156, 165, 175, 133, 160, - 160, 186, 184, 168, 177, 144, 165, 160, 180, 164, - 172, 132, 182, 190, 170, 173, 151, 155, 159, 178, - 188, 183, 185, 165, 191, 184, 186, 146, 88, 68, - 93, 89, 93, 110, 79, 89, 75, 76, 78, 82, - 101, 72, 74, 65, 83, 79, 81, 86, 80, 76, - 105, 83, 86, 86, 86, 88, 88, 82, 80, 102, - 115, 102, 106, 102, 98, 32, 78, 120, 113, 106, - 110, 100, 117, 116, 75, 103, 112, 126, 123, 109, - 87, 113, 122, 114, 83, 112, 115, 126, 99, 121, - 96, 58, 40, 30, 27, 0, 0, 10, 31, 30, - 45, 1, 10, 4, 5, 19, 45, 11, 28, 20, - 49, 10, 45, 26, 16, 24, 17, 7, 21, 21, - 53, 24, 25, 24, 35, 56, 59, 32, 33, 33, - 13, 63, 32, 42, 52, 51, 39, 32, 33, 22, - 35, 54, 58, 54, 50, 11, 53, 48, 55, 21, - 34, 48, 59, 50, 23, 58, 196, 205, 193, 206, - 199, 219, 201, 192, 246, 202, 195, 202, 134, 138, - 132, 241, 211, 216, 211, 153, 147, 159, 141, 201, - 219, 208, 219, 194, 226, 222, 215, 222, 170, 233, - 233, 251, 253, 204, 224, 248, 241, 247, 229, 243, - 197, 242, 247, 241, 245, 246, 219, 246, 242, 240, - 238, 209, 247, 229, 245, 253, 223, 228, 215, 253, - 143, 136, 131, 140, 138, 187, 137, 149, 150, 160, - 143, 141, 137, 149, 166, 132, 153, 144, 159, 139, - 145, 138, 146, 154, 177, 156, 156, 158, 132, 180, - 155, 153, 165, 185, 155, 189, 183, 163, 169, 154, - 171, 183, 168, 130, 169, 171, 171, 183, 137, 175, - 161, 181, 187, 136, 181, 185, 166, 187, 147, 190, - 186, 162, 185, 187, 105, 68, 70, 77, 71, 91, - 69, 66, 76, 106, 84, 68, 75, 100, 75, 75, - 94, 82, 76, 80, 81, 81, 104, 68, 66, 86, - 115, 94, 88, 83, 93, 65, 99, 100, 102, 95, - 111, 99, 121, 104, 65, 108, 108, 116, 107, 105, - 53, 74, 124, 125, 107, 124, 106, 92, 115, 113, - 103, 126, 126, 35, 89, 113, 114, 102, 15, 31, - 43, 6, 2, 26, 1, 3, 80, 49, 1, 15, - 1, 2, 55, 0, 22, 30, 27, 13, 17, 13, - 46, 28, 28, 20, 21, 37, 15, 7, 17, 48, - 36, 47, 7, 47, 40, 60, 41, 57, 4, 49, - 47, 44, 18, 40, 2, 44, 56, 52, 54, 56, - 61, 60, 53, 17, 55, 37, 53, 61, 26, 50, - 34, 48, 198, 254, 219, 204, 237, 218, 223, 217, - 205, 206, 233, 210, 227, 201, 197, 199, 214, 222, - 220, 250, 223, 207, 200, 212, 221, 221, 246, 222, - 216, 195, 247, 218, 230, 228, 250, 202, 239, 255, - 248, 228, 237, 237, 198, 238, 232, 243, 194, 228, - 247, 242, 244, 224, 208, 254, 241, 248, 209, 242, - 224, 229, 255, 248, 250, 211, 133, 133, 156, 186, - 135, 149, 137, 189, 141, 138, 142, 149, 170, 142, - 138, 128, 181, 139, 140, 144, 145, 145, 143, 170, - 155, 135, 152, 178, 158, 146, 151, 158, 136, 164, - 176, 158, 167, 187, 164, 131, 183, 174, 165, 179, - 175, 164, 147, 172, 174, 179, 155, 182, 178, 176, - 174, 155, 189, 189, 164, 156, 183, 175, 189, 184, - 95, 70, 127, 64, 74, 91, 68, 97, 75, 77, - 69, 114, 82, 94, 72, 64, 104, 72, 75, 112, - 74, 90, 81, 78, 96, 64, 67, 98, 83, 67, - 64, 92, 100, 108, 123, 75, 123, 124, 101, 99, - 103, 112, 115, 33, 72, 98, 115, 118, 58, 73, - 125, 108, 106, 122, 110, 110, 122, 103, 100, 97, - 44, 56, 59, 115, 15, 14, 12, 26, 64, 29, - 9, 24, 22, 6, 18, 18, 72, 4, 11, 8, - 85, 9, 29, 12, 10, 26, 14, 14, 93, 17, - 5, 2, 31, 25, 17, 6, 57, 37, 45, 62, - 61, 13, 14, 14, 98, 22, 11, 41, 50, 51, - 52, 127, 117, 116, 62, 60, 59, 59, 47, 115, - 48, 49, 51, 56, 120, 52, 59, 123, 223, 192, - 135, 199, 203, 216, 223, 130, 214, 198, 195, 201, - 200, 200, 200, 202, 221, 194, 151, 203, 205, 204, - 146, 197, 223, 223, 143, 212, 210, 222, 192, 220, - 229, 229, 181, 252, 229, 194, 237, 255, 233, 230, - 244, 241, 243, 235, 247, 224, 242, 239, 236, 233, - 164, 176, 179, 251, 247, 246, 244, 226, 184, 250, - 245, 231, 129, 142, 156, 158, 143, 155, 143, 133, - 204, 128, 143, 140, 201, 138, 133, 151, 145, 158, - 140, 142, 159, 139, 159, 149, 221, 158, 145, 131, - 157, 146, 128, 133, 191, 167, 187, 172, 225, 157, - 191, 190, 139, 183, 165, 172, 143, 180, 133, 166, - 174, 178, 174, 188, 139, 173, 176, 184, 188, 178, - 178, 189, 179, 179, 151, 239, 118, 108, 65, 93, - 66, 78, 78, 0, 112, 86, 78, 79, 67, 85, - 120, 71, 79, 82, 84, 93, 77, 99, 14, 94, - 106, 6, 114, 127, 122, 103, 104, 5, 86, 104, - 100, 96, 107, 97, 120, 81, 118, 102, 114, 108, - 111, 105, 101, 105, 70, 127, 125, 111, 123, 115, - 115, 109, 127, 118, 126, 101, 74, 85, 97, 102, - 3, 5, 13, 26, 29, 35, 13, 20, 7, 17, - 60, 53, 20, 6, 0, 12, 20, 28, 40, 21, - 31, 11, 26, 18, 0, 30, 94, 51, 3, 4, - 29, 27, 47, 56, 59, 5, 47, 54, 41, 63, - 30, 22, 52, 40, 42, 52, 24, 17, 40, 58, - 60, 48, 48, 56, 12, 47, 61, 39, 53, 50, - 34, 62, 59, 59, 246, 255, 218, 200, 202, 198, - 194, 202, 242, 209, 207, 213, 195, 196, 208, 202, - 200, 149, 219, 202, 206, 218, 206, 212, 221, 215, - 220, 216, 219, 222, 192, 250, 248, 239, 237, 251, - 253, 175, 224, 228, 239, 234, 244, 210, 227, 243, - 240, 236, 244, 252, 235, 212, 255, 241, 253, 250, - 247, 225, 190, 197, 228, 246, 240, 252, 132, 140, - 184, 155, 129, 155, 137, 142, 150, 138, 143, 143, - 200, 168, 150, 129, 159, 137, 139, 181, 151, 146, - 149, 137, 147, 135, 153, 158, 152, 217, 164, 144, - 184, 162, 167, 173, 157, 170, 184, 185, 171, 173, - 167, 178, 139, 166, 170, 164, 189, 190, 170, 247, - 138, 173, 189, 185, 187, 189, 183, 129, 164, 184, - 160, 176, 73, 95, 65, 70, 64, 1, 99, 95, - 70, 70, 82, 82, 106, 78, 73, 76, 78, 90, - 76, 80, 81, 81, 18, 113, 91, 94, 89, 69, - 117, 66, 70, 71, 111, 101, 124, 89, 111, 123, - 100, 94, 109, 118, 110, 101, 79, 115, 97, 104, - 105, 111, 119, 107, 127, 120, 121, 89, 115, 103, - 113, 66, 98, 120, 102, 116, 13, 14, 72, 0, - 29, 79, 8, 4, 17, 19, 15, 18, 3, 3, - 43, 49, 42, 51, 23, 21, 26, 26, 14, 50, - 38, 35, 38, 16, 26, 2, 17, 54, 37, 37, - 44, 32, 58, 38, 35, 35, 6, 34, 52, 32, - 9, 55, 33, 55, 59, 53, 60, 104, 17, 47, - 57, 47, 51, 61, 52, 99, 21, 56, 58, 49, - 195, 223, 193, 198, 192, 230, 216, 200, 207, 208, - 239, 209, 195, 213, 197, 203, 222, 248, 205, 202, - 202, 208, 209, 238, 198, 193, 217, 223, 209, 248, - 196, 208, 248, 234, 230, 237, 205, 250, 255, 249, - 237, 238, 211, 248, 235, 229, 235, 233, 213, 235, - 253, 235, 255, 241, 248, 222, 231, 224, 228, 254, - 251, 211, 245, 225, 143, 164, 152, 140, 156, 142, - 130, 137, 161, 150, 147, 149, 137, 138, 165, 134, - 153, 148, 141, 151, 138, 176, 140, 152, 128, 146, - 158, 149, 181, 130, 135, 129, 165, 166, 155, 172, - 162, 170, 175, 185, 173, 177, 143, 177, 163, 181, - 165, 171, 190, 148, 186, 179, 187, 188, 168, 141, - 160, 188, 160, 180, 164, 163, 173, 154, 90, 78, - 90, 72, 64, 75, 99, 79, 72, 70, 67, 85, - 118, 85, 75, 85, 95, 73, 76, 64, 109, 90, - 80, 88, 81, 71, 95, 67, 101, 67, 85, 71, - 126, 43, 122, 108, 125, 123, 99, 127, 103, 35, - 114, 100, 96, 117, 97, 118, 114, 59, 108, 118, - 117, 122, 114, 91, 115, 122, 124, 116, 114, 55, - 96, 122, 74, 25, 13, 26, 26, 0, 30, 8, - 66, 19, 18, 4, 16, 14, 11, 16, 9, 91, - 11, 28, 13, 12, 21, 18, 28, 93, 76, 51, - 36, 73, 36, 25, 47, 42, 59, 44, 110, 35, - 35, 42, 43, 45, 96, 32, 33, 38, 45, 43, - 116, 29, 57, 48, 50, 127, 40, 50, 114, 55, - 53, 50, 36, 46, 36, 33, 138, 228, 233, 252, - 250, 231, 140, 223, 199, 208, 212, 206, 212, 194, - 132, 209, 213, 208, 221, 215, 251, 209, 216, 157, - 192, 214, 195, 197, 217, 197, 209, 149, 248, 238, - 238, 251, 235, 252, 228, 173, 246, 236, 235, 228, - 232, 198, 241, 241, 242, 244, 234, 240, 234, 230, - 188, 200, 192, 223, 176, 249, 247, 228, 180, 251, - 133, 159, 200, 143, 129, 154, 130, 137, 164, 130, - 137, 141, 198, 147, 139, 197, 153, 148, 150, 151, - 155, 156, 136, 221, 134, 156, 208, 158, 183, 130, - 128, 157, 234, 241, 232, 143, 175, 166, 160, 237, - 182, 172, 224, 166, 163, 179, 228, 176, 169, 190, - 170, 249, 183, 177, 186, 178, 242, 233, 240, 157, - 191, 180, 177, 187, 73, 78, 8, 90, 75, 93, - 90, 68, 65, 70, 0, 116, 116, 107, 4, 77, - 91, 72, 24, 87, 81, 75, 28, 91, 93, 70, - 94, 85, 112, 86, 93, 89, 111, 111, 40, 125, - 97, 47, 111, 98, 108, 109, 101, 98, 114, 61, - 36, 55, 43, 45, 41, 43, 43, 44, 36, 45, - 34, 35, 32, 37, 34, 36, 57, 64, 4, 0, - 6, 6, 25, 1, 65, 93, 82, 87, 82, 88, - 75, 95, 84, 80, 72, 73, 85, 74, 74, 71, - 78, 68, 95, 50, 49, 65, 78, 65, 70, 71, - 122, 121, 125, 122, 125, 120, 124, 125, 114, 115, - 112, 117, 117, 106, 17, 43, 49, 53, 55, 46, - 48, 114, 108, 109, 102, 97, 105, 124, 110, 103, - 97, 103, 152, 134, 155, 157, 150, 157, 149, 128, - 227, 226, 144, 153, 144, 227, 193, 195, 219, 206, - 212, 205, 158, 204, 200, 207, 219, 221, 215, 156, - 156, 154, 132, 133, 185, 184, 185, 164, 191, 191, - 188, 189, 178, 174, 176, 177, 182, 183, 181, 168, - 219, 218, 169, 160, 172, 217, 253, 244, 254, 179, - 228, 254, 182, 244, 251, 251, 132, 142, 139, 157, - 206, 155, 131, 205, 141, 162, 149, 149, 142, 199, - 204, 151, 159, 136, 140, 150, 140, 154, 220, 137, - 157, 152, 149, 159, 223, 205, 212, 188, 174, 174, - 166, 189, 167, 187, 181, 237, 177, 166, 178, 183, - 163, 181, 228, 172, 169, 251, 173, 183, 191, 169, - 189, 180, 190, 178, 178, 189, 179, 247, 186, 186, - 93, 109, 73, 64, 66, 74, 72, 13, 86, 76, - 0, 83, 67, 84, 80, 74, 72, 94, 24, 74, - 91, 76, 79, 84, 93, 93, 10, 17, 94, 67, - 64, 69, 121, 49, 39, 38, 105, 110, 120, 104, - 117, 98, 121, 47, 103, 100, 103, 106, 111, 117, - 108, 106, 48, 110, 105, 124, 124, 103, 127, 102, - 115, 101, 58, 118, 5, 6, 71, 8, 30, 6, - 67, 27, 83, 76, 7, 0, 18, 2, 19, 4, - 3, 84, 17, 29, 27, 17, 8, 20, 6, 10, - 47, 20, 24, 19, 4, 26, 35, 37, 60, 29, - 60, 54, 108, 57, 45, 99, 39, 36, 50, 103, - 45, 33, 63, 53, 44, 48, 42, 38, 124, 56, - 60, 55, 32, 62, 63, 57, 32, 117, 204, 217, - 199, 196, 142, 195, 195, 206, 195, 207, 200, 206, - 213, 211, 197, 213, 211, 148, 206, 136, 145, 216, - 221, 201, 215, 196, 209, 200, 153, 208, 209, 193, - 213, 238, 230, 237, 254, 224, 229, 227, 246, 240, - 212, 243, 255, 167, 240, 234, 186, 252, 253, 237, - 190, 250, 242, 249, 226, 252, 249, 255, 226, 228, - 180, 243, 152, 132, 133, 201, 130, 128, 143, 140, - 142, 139, 143, 146, 146, 139, 141, 134, 159, 149, - 155, 156, 159, 143, 149, 210, 132, 194, 223, 131, - 131, 155, 145, 134, 158, 185, 177, 233, 186, 160, - 236, 170, 167, 183, 224, 173, 175, 164, 161, 171, - 185, 190, 171, 249, 184, 173, 179, 176, 242, 191, - 191, 178, 183, 187, 188, 186, 89, 95, 64, 76, - 79, 67, 88, 69, 107, 71, 69, 79, 82, 78, - 80, 92, 26, 83, 93, 88, 82, 75, 84, 7, - 18, 127, 89, 82, 83, 89, 87, 80, 71, 106, - 102, 104, 105, 106, 126, 45, 119, 112, 101, 115, - 38, 84, 109, 98, 116, 126, 124, 86, 107, 107, - 60, 127, 107, 51, 99, 116, 100, 97, 113, 103, - 38, 2, 11, 12, 0, 12, 9, 77, 15, 2, - 14, 0, 1, 2, 22, 69, 29, 30, 12, 89, - 12, 10, 16, 24, 1, 83, 21, 3, 4, 24, - 6, 79, 106, 7, 33, 42, 43, 33, 47, 40, - 98, 14, 33, 47, 39, 32, 33, 55, 96, 123, - 52, 48, 45, 43, 57, 51, 55, 33, 112, 33, - 57, 37, 32, 117, 197, 219, 205, 199, 199, 203, - 220, 223, 205, 197, 201, 205, 195, 200, 194, 195, - 214, 210, 214, 220, 225, 222, 223, 222, 215, 192, - 195, 253, 223, 212, 209, 219, 233, 238, 219, 236, - 252, 249, 229, 238, 231, 210, 245, 224, 232, 243, - 235, 242, 255, 233, 204, 252, 236, 242, 245, 243, - 243, 255, 166, 243, 242, 242, 165, 167, 137, 218, - 197, 222, 136, 216, 142, 192, 214, 211, 130, 215, - 203, 133, 129, 135, 155, 214, 206, 154, 206, 204, - 159, 158, 194, 145, 201, 192, 151, 195, 160, 135, - 179, 235, 188, 166, 238, 168, 169, 185, 226, 175, - 169, 162, 163, 169, 167, 160, 169, 251, 190, 171, - 177, 178, 252, 174, 183, 161, 166, 180, 164, 247, - 163, 188, 94, 67, 8, 90, 75, 67, 74, 13, - 81, 74, 71, 79, 67, 67, 4, 70, 95, 73, - 76, 114, 91, 76, 72, 79, 87, 95, 16, 93, - 95, 68, 64, 80, 100, 98, 102, 110, 46, 122, - 126, 97, 56, 35, 60, 105, 55, 57, 93, 106, - 111, 59, 123, 120, 112, 63, 114, 114, 101, 51, - 98, 116, 98, 98, 102, 123, 74, 31, 7, 73, - 26, 7, 9, 77, 3, 19, 16, 13, 15, 4, - 5, 17, 19, 20, 22, 87, 66, 80, 20, 76, - 76, 52, 53, 37, 57, 39, 32, 60, 5, 5, - 27, 25, 1, 28, 24, 44, 50, 51, 44, 40, - 37, 38, 48, 44, 53, 53, 119, 33, 115, 40, - 43, 42, 127, 53, 63, 35, 59, 122, 33, 39, - 198, 206, 198, 202, 193, 203, 201, 201, 206, 204, - 195, 192, 202, 207, 203, 214, 206, 249, 202, 214, - 201, 204, 217, 207, 146, 193, 213, 194, 195, 219, - 192, 149, 176, 171, 205, 228, 254, 251, 245, 173, - 240, 230, 243, 241, 233, 233, 247, 224, 180, 181, - 184, 220, 240, 235, 245, 233, 235, 179, 173, 177, - 219, 242, 249, 247, 143, 153, 200, 206, 201, 207, - 129, 132, 145, 144, 137, 143, 129, 164, 222, 185, - 189, 146, 140, 149, 159, 157, 209, 175, 135, 157, - 158, 148, 132, 171, 150, 128, 163, 167, 172, 186, - 146, 253, 175, 149, 247, 129, 142, 141, 150, 155, - 244, 153, 185, 183, 177, 188, 176, 171, 128, 169, - 183, 161, 189, 184, 184, 182, 184, 137, 78, 78, - 94, 76, 66, 64, 92, 64, 71, 77, 84, 125, - 100, 82, 87, 76, 84, 94, 75, 74, 114, 94, - 69, 88, 64, 111, 100, 67, 87, 83, 93, 91, - 109, 91, 100, 104, 122, 105, 99, 127, 111, 45, - 66, 116, 117, 110, 106, 96, 105, 104, 84, 120, - 103, 122, 110, 65, 86, 114, 100, 112, 84, 126, - 122, 113, 3, 5, 15, 53, 45, 0, 2, 27, - 7, 17, 20, 4, 20, 20, 56, 54, 14, 9, - 17, 23, 25, 43, 19, 49, 29, 16, 17, 29, - 31, 13, 17, 17, 25, 63, 58, 32, 32, 40, - 15, 34, 44, 53, 37, 51, 50, 34, 54, 107, - 57, 40, 59, 54, 48, 41, 57, 47, 38, 23, - 53, 61, 51, 48, 53, 33, 207, 255, 205, 197, - 203, 200, 222, 204, 207, 230, 205, 192, 207, 203, - 233, 192, 201, 200, 221, 215, 217, 218, 206, 206, - 255, 210, 222, 208, 209, 210, 198, 143, 170, 226, - 230, 224, 250, 230, 237, 225, 235, 249, 225, 245, - 239, 232, 234, 171, 180, 181, 213, 252, 237, 236, - 249, 243, 245, 246, 226, 210, 247, 249, 179, 225, - 202, 136, 154, 140, 143, 155, 137, 205, 171, 174, - 133, 146, 149, 130, 138, 130, 159, 137, 216, 159, - 140, 144, 145, 221, 134, 138, 128, 148, 214, 186, - 145, 134, 185, 174, 166, 174, 171, 189, 236, 186, - 171, 183, 168, 225, 168, 166, 169, 160, 250, 251, - 185, 181, 172, 186, 189, 185, 171, 243, 181, 169, - 191, 164, 160, 166, 4, 102, 77, 90, 93, 74, - 66, 74, 71, 81, 83, 108, 71, 73, 69, 66, - 95, 73, 2, 25, 30, 82, 89, 78, 65, 86, - 94, 86, 83, 69, 71, 21, 125, 110, 122, 108, - 46, 99, 99, 108, 102, 102, 100, 47, 75, 98, - 119, 118, 127, 117, 127, 124, 108, 108, 81, 124, - 124, 114, 119, 116, 100, 45, 52, 124, 4, 2, - 28, 0, 15, 3, 5, 23, 3, 23, 9, 14, - 8, 71, 2, 12, 20, 18, 11, 17, 27, 27, - 82, 60, 1, 0, 21, 5, 5, 50, 12, 22, - 34, 42, 38, 46, 43, 60, 13, 46, 33, 44, - 53, 47, 50, 52, 23, 60, 55, 57, 55, 53, - 45, 16, 44, 41, 59, 60, 62, 2, 51, 37, - 61, 48, 217, 239, 201, 208, 236, 206, 222, 222, - 225, 209, 217, 209, 210, 200, 229, 198, 217, 212, - 205, 215, 202, 204, 253, 206, 193, 214, 196, 243, - 215, 219, 213, 219, 233, 238, 251, 198, 254, 234, - 226, 194, 240, 231, 229, 243, 245, 202, 225, 246, - 233, 250, 255, 252, 237, 207, 243, 238, 251, 231, - 249, 254, 248, 218, 241, 230, 153, 138, 143, 140, - 157, 160, 156, 136, 140, 167, 133, 141, 143, 145, - 129, 151, 159, 159, 185, 138, 141, 154, 136, 176, - 151, 128, 131, 144, 145, 146, 135, 166, 175, 184, - 187, 160, 161, 161, 191, 142, 173, 173, 180, 160, - 175, 169, 161, 183, 169, 136, 182, 184, 174, 172, - 180, 178, 166, 151, 177, 165, 183, 251, 244, 156, - 110, 17, 8, 5, 14, 97, 77, 64, 71, 25, - 0, 13, 6, 101, 69, 73, 91, 85, 91, 92, - 4, 31, 113, 88, 65, 64, 81, 86, 83, 118, - 87, 86, 101, 126, 102, 125, 79, 124, 127, 104, - 118, 74, 100, 67, 103, 107, 101, 107, 121, 126, - 86, 124, 106, 107, 117, 115, 117, 71, 105, 97, - 115, 86, 119, 118, 5, 30, 6, 29, 47, 11, - 8, 4, 22, 10, 15, 15, 7, 11, 45, 11, - 28, 20, 60, 28, 13, 28, 14, 20, 2, 7, - 25, 30, 24, 58, 29, 27, 35, 38, 61, 36, - 13, 39, 45, 35, 37, 38, 9, 18, 9, 6, - 39, 38, 53, 46, 54, 45, 23, 59, 8, 50, - 38, 50, 60, 19, 55, 59, 53, 59, 201, 206, - 233, 223, 207, 198, 192, 204, 192, 207, 197, 227, - 199, 203, 197, 203, 217, 222, 234, 220, 205, 218, - 206, 203, 215, 215, 242, 208, 218, 214, 218, 214, - 239, 223, 231, 253, 239, 227, 197, 227, 215, 208, - 196, 213, 233, 243, 229, 233, 211, 245, 218, 205, - 221, 219, 249, 255, 230, 214, 225, 228, 255, 227, - 237, 208, 155, 158, 129, 157, 151, 166, 130, 175, - 182, 160, 204, 193, 168, 134, 137, 128, 218, 182, - 157, 138, 141, 158, 155, 152, 183, 139, 147, 153, - 151, 153, 147, 144, 143, 179, 171, 161, 175, 161, - 171, 168, 139, 167, 133, 185, 165, 175, 165, 171, - 189, 190, 150, 184, 179, 186, 143, 184, 161, 160, - 185, 190, 184, 164, 151, 186, 68, 95, 73, 64, - 64, 74, 94, 100, 70, 110, 69, 82, 85, 70, - 67, 64, 117, 75, 93, 87, 122, 90, 80, 84, - 68, 86, 66, 84, 82, 118, 71, 70, 111, 127, - 91, 112, 99, 109, 99, 97, 75, 103, 83, 117, - 103, 115, 113, 118, 89, 105, 125, 120, 106, 118, - 115, 115, 70, 122, 125, 116, 58, 55, 71, 108, - 7, 9, 7, 5, 84, 79, 64, 77, 50, 17, - 9, 2, 3, 93, 68, 73, 90, 40, 17, 29, - 27, 69, 92, 81, 82, 39, 9, 1, 19, 77, - 84, 56, 47, 56, 59, 40, 41, 42, 3, 61, - 39, 45, 15, 51, 34, 34, 54, 10, 40, 63, - 61, 43, 23, 59, 27, 47, 61, 38, 32, 24, - 50, 7, 59, 38, 195, 223, 193, 198, 192, 230, - 200, 249, 205, 215, 193, 205, 247, 210, 197, 203, - 206, 210, 204, 192, 248, 214, 208, 209, 215, 215, - 225, 196, 215, 217, 192, 220, 254, 242, 219, 224, - 234, 234, 207, 226, 239, 238, 229, 239, 242, 203, - 229, 246, 238, 206, 232, 253, 255, 235, 249, 201, - 251, 254, 245, 222, 228, 243, 241, 231, 190, 146, - 152, 140, 167, 139, 184, 132, 143, 134, 169, 143, - 160, 136, 150, 134, 159, 190, 128, 137, 151, 141, - 157, 137, 155, 156, 158, 165, 159, 154, 145, 161, - 184, 162, 175, 174, 171, 189, 156, 191, 171, 160, - 165, 149, 180, 166, 173, 169, 149, 189, 190, 170, - 187, 171, 147, 175, 187, 180, 185, 191, 183, 187, - 135, 161, 75, 95, 93, 90, 111, 75, 72, 68, - 86, 74, 79, 79, 71, 75, 109, 75, 92, 84, - 113, 77, 91, 82, 79, 17, 18, 124, 64, 84, - 88, 23, 68, 71, 99, 104, 109, 51, 46, 66, - 105, 126, 113, 98, 103, 100, 73, 119, 97, 107, - 74, 116, 107, 112, 106, 118, 115, 115, 93, 99, - 117, 127, 70, 101, 125, 118, 15, 36, 24, 12, - 0, 32, 30, 9, 7, 17, 41, 5, 42, 14, - 21, 16, 19, 31, 25, 13, 23, 16, 18, 45, - 0, 26, 19, 20, 37, 14, 25, 23, 37, 39, - 114, 105, 110, 10, 52, 61, 6, 34, 52, 36, - 124, 103, 100, 11, 59, 54, 61, 99, 126, 18, - 57, 46, 33, 50, 55, 52, 25, 39, 32, 60, - 197, 197, 251, 204, 220, 198, 201, 232, 218, 211, - 201, 211, 199, 211, 205, 202, 212, 255, 217, 205, - 219, 236, 217, 207, 219, 214, 228, 200, 198, 210, - 152, 149, 220, 234, 228, 252, 235, 181, 172, 197, - 237, 239, 233, 229, 231, 254, 247, 214, 255, 232, - 235, 240, 241, 241, 239, 206, 247, 231, 227, 220, - 243, 228, 231, 244, 141, 142, 187, 140, 157, 156, - 133, 130, 140, 144, 163, 142, 136, 147, 133, 140, - 148, 158, 138, 181, 145, 139, 175, 137, 151, 131, - 189, 152, 152, 187, 155, 129, 135, 170, 176, 133, - 161, 187, 153, 163, 166, 166, 178, 173, 175, 162, - 182, 139, 187, 182, 189, 152, 168, 190, 181, 177, - 179, 177, 188, 180, 144, 162, 160, 160, 88, 78, - 91, 104, 88, 78, 69, 65, 67, 65, 76, 68, - 105, 87, 80, 76, 85, 85, 75, 118, 78, 75, - 85, 82, 92, 96, 85, 67, 95, 82, 125, 81, - 69, 123, 124, 96, 97, 97, 88, 116, 114, 102, - 83, 117, 116, 110, 111, 96, 74, 105, 113, 122, - 123, 83, 125, 110, 102, 71, 98, 112, 114, 126, - 122, 114, 46, 10, 28, 12, 56, 14, 30, 4, - 3, 1, 12, 4, 50, 14, 7, 14, 54, 18, - 11, 13, 42, 13, 29, 25, 23, 73, 80, 93, - 86, 38, 0, 12, 112, 107, 100, 105, 1, 61, - 40, 40, 48, 99, 41, 37, 124, 103, 23, 44, - 61, 53, 57, 53, 100, 127, 17, 52, 60, 7, - 34, 48, 50, 50, 2, 58, 198, 222, 197, 204, - 227, 198, 194, 141, 214, 209, 193, 197, 195, 135, - 210, 202, 214, 206, 213, 220, 253, 133, 224, 250, - 219, 199, 220, 208, 212, 154, 230, 192, 228, 229, - 237, 251, 210, 237, 249, 228, 238, 231, 243, 221, - 180, 228, 220, 176, 216, 213, 212, 201, 194, 175, - 192, 254, 254, 250, 245, 255, 226, 203, 224, 240, - 152, 134, 129, 135, 143, 131, 176, 137, 135, 149, - 133, 141, 137, 151, 137, 128, 148, 143, 164, 187, - 139, 140, 149, 147, 151, 128, 131, 189, 151, 142, - 145, 135, 150, 159, 186, 168, 170, 166, 162, 170, - 146, 175, 161, 181, 160, 168, 182, 168, 244, 153, - 173, 170, 183, 177, 185, 174, 161, 159, 177, 168, - 179, 165, 136, 157, 67, 88, 92, 70, 92, 86, - 112, 108, 69, 68, 82, 68, 65, 70, 80, 76, - 85, 85, 75, 101, 118, 86, 79, 73, 93, 65, - 73, 112, 81, 80, 70, 80, 109, 106, 124, 96, - 97, 97, 92, 98, 117, 102, 114, 85, 116, 102, - 96, 96, 105, 75, 121, 107, 127, 114, 121, 105, - 119, 97, 99, 63, 117, 100, 89, 116, 18, 63, - 26, 8, 10, 10, 58, 2, 14, 22, 13, 4, - 43, 6, 28, 69, 14, 9, 25, 29, 27, 95, - 10, 18, 30, 6, 29, 20, 34, 24, 0, 20, - 38, 29, 39, 37, 59, 34, 41, 25, 45, 55, - 33, 45, 102, 49, 43, 41, 47, 54, 61, 13, - 55, 50, 57, 20, 60, 39, 53, 35, 32, 54, - 56, 1, 195, 198, 205, 137, 199, 193, 216, 200, - 208, 213, 193, 205, 138, 135, 215, 192, 217, 249, - 217, 202, 215, 204, 234, 210, 222, 198, 221, 212, - 255, 217, 192, 208, 248, 253, 233, 229, 204, 238, - 255, 228, 241, 163, 246, 238, 234, 242, 233, 224, - 186, 242, 246, 237, 251, 237, 234, 252, 254, 191, - 176, 226, 243, 244, 208, 240, 134, 159, 137, 175, - 135, 131, 152, 136, 144, 165, 137, 141, 146, 130, - 150, 197, 152, 130, 216, 189, 155, 147, 136, 156, - 222, 211, 213, 179, 151, 132, 157, 134, 152, 170, - 188, 160, 161, 137, 165, 161, 182, 166, 178, 135, - 175, 171, 176, 160, 168, 251, 186, 160, 254, 157, - 189, 174, 187, 160, 240, 163, 183, 163, 189, 186, - 6, 11, 13, 100, 79, 87, 118, 66, 76, 70, - 104, 68, 79, 64, 76, 81, 119, 90, 64, 25, - 68, 80, 82, 88, 18, 91, 85, 88, 81, 95, - 64, 25, 42, 127, 97, 106, 101, 124, 65, 100, - 108, 89, 111, 111, 99, 79, 97, 108, 125, 115, - 108, 84, 119, 113, 60, 103, 125, 125, 117, 49, - 126, 114, 125, 114, 2, 31, 68, 73, 26, 6, - 15, 6, 17, 32, 21, 18, 18, 8, 9, 49, - 19, 24, 19, 42, 23, 5, 25, 62, 7, 0, - 4, 30, 27, 87, 0, 28, 41, 32, 104, 58, - 39, 53, 41, 15, 35, 49, 16, 51, 47, 36, - 33, 17, 35, 43, 61, 10, 42, 59, 31, 60, - 62, 48, 37, 61, 55, 35, 61, 58, 196, 255, - 209, 217, 203, 143, 208, 141, 246, 204, 212, 192, - 202, 135, 198, 196, 214, 218, 214, 218, 219, 133, - 156, 233, 221, 199, 209, 221, 244, 214, 216, 212, - 228, 232, 237, 169, 254, 234, 254, 238, 231, 237, - 244, 190, 175, 184, 215, 224, 246, 254, 251, 237, - 251, 251, 188, 233, 251, 254, 245, 177, 255, 249, - 180, 243, 133, 153, 139, 140, 206, 129, 131, 153, - 194, 130, 140, 141, 137, 144, 129, 129, 218, 157, - 151, 139, 222, 223, 147, 143, 150, 150, 130, 209, - 130, 142, 132, 144, 131, 165, 171, 166, 188, 189, - 169, 174, 182, 227, 147, 141, 233, 147, 148, 229, - 170, 169, 177, 186, 187, 255, 177, 184, 179, 160, - 165, 163, 179, 186, 177, 187, 94, 17, 8, 14, - 9, 15, 65, 72, 67, 80, 85, 83, 67, 74, - 65, 75, 78, 27, 89, 85, 82, 80, 75, 88, - 86, 31, 16, 83, 67, 67, 20, 18, 45, 43, - 101, 108, 111, 124, 121, 127, 103, 110, 101, 111, - 114, 39, 119, 96, 118, 126, 123, 109, 123, 123, - 50, 61, 66, 127, 117, 112, 101, 114, 56, 53, - 9, 4, 26, 27, 11, 12, 24, 77, 49, 47, - 79, 53, 54, 71, 20, 4, 8, 26, 21, 28, - 10, 26, 14, 14, 49, 28, 30, 31, 19, 20, - 0, 28, 37, 37, 7, 59, 42, 42, 62, 109, - 11, 7, 15, 51, 34, 34, 54, 101, 46, 34, - 40, 60, 10, 22, 26, 14, 38, 60, 32, 113, - 58, 56, 39, 38, 138, 240, 252, 219, 128, 143, - 255, 225, 130, 204, 198, 199, 213, 194, 208, 133, - 225, 232, 204, 214, 206, 159, 208, 210, 193, 192, - 228, 195, 152, 151, 231, 249, 170, 228, 238, 239, - 253, 234, 248, 217, 227, 232, 229, 161, 246, 245, - 235, 227, 243, 239, 184, 194, 202, 254, 247, 248, - 178, 227, 226, 254, 240, 254, 224, 209, 139, 159, - 141, 198, 186, 134, 129, 136, 177, 140, 149, 147, - 133, 130, 176, 140, 151, 158, 216, 144, 144, 223, - 154, 146, 128, 144, 149, 178, 204, 171, 179, 156, - 190, 167, 169, 171, 227, 157, 185, 163, 172, 166, - 178, 157, 164, 178, 173, 169, 190, 168, 132, 235, - 189, 135, 233, 159, 156, 159, 128, 141, 230, 139, - 183, 185, 67, 78, 70, 93, 114, 91, 73, 95, - 79, 74, 78, 64, 74, 123, 64, 64, 76, 94, - 84, 86, 78, 82, 89, 83, 70, 111, 114, 68, - 69, 94, 90, 80, 121, 120, 68, 104, 119, 106, - 126, 81, 86, 113, 97, 101, 111, 105, 99, 85, - 118, 122, 108, 127, 113, 109, 113, 51, 80, 102, - 99, 120, 120, 114, 103, 102, 38, 10, 17, 12, - 28, 51, 46, 24, 17, 10, 14, 4, 21, 20, - 43, 7, 16, 30, 27, 13, 13, 35, 51, 15, - 22, 22, 2, 37, 15, 7, 17, 6, 22, 4, - 58, 45, 43, 61, 24, 52, 50, 38, 110, 34, - 53, 2, 60, 53, 51, 41, 57, 45, 55, 48, - 50, 31, 39, 42, 3, 52, 58, 59, 56, 58, - 222, 216, 250, 192, 221, 196, 128, 141, 134, 241, - 201, 210, 205, 139, 132, 128, 159, 155, 233, 205, - 199, 133, 156, 157, 230, 193, 158, 194, 194, 216, - 196, 143, 170, 171, 219, 197, 76, 47, 227, 235, - 228, 240, 229, 245, 188, 167, 70, 37, 234, 233, - 241, 250, 251, 165, 188, 189, 253, 245, 246, 226, - 243, 227, 174, 181, 202, 191, 184, 201, 158, 157, - 133, 142, 135, 217, 192, 201, 198, 129, 139, 151, - 218, 219, 208, 182, 189, 176, 213, 221, 218, 191, - 159, 146, 151, 155, 221, 157, 163, 184, 188, 166, - 188, 182, 158, 168, 179, 182, 165, 178, 178, 151, - 165, 183, 187, 182, 189, 173, 187, 173, 175, 155, - 226, 227, 224, 225, 230, 231, 132, 229, 106, 11, - 92, 70, 14, 15, 127, 89, 82, 25, 0, 104, - 85, 100, 86, 92, 74, 79, 87, 23, 70, 82, - 80, 110, 75, 94, 82, 94, 90, 99, 77, 69, - 111, 77, 125, 125, 123, 125, 105, 126, 65, 108, - 110, 117, 116, 102, 103, 113, 78, 98, 104, 124, - 76, 112, 115, 105, 65, 106, 125, 115, 121, 123, - 52, 98, 11, 24, 72, 7, 1, 27, 76, 11, - 13, 22, 14, 5, 70, 1, 11, 23, 90, 22, - 29, 10, 13, 30, 27, 24, 82, 94, 78, 81, - 86, 4, 13, 24, 40, 36, 36, 0, 42, 111, - 113, 109, 101, 34, 51, 50, 47, 32, 42, 40, - 63, 53, 44, 42, 59, 44, 47, 52, 61, 61, - 56, 62, 58, 62, 48, 52, 211, 216, 205, 218, - 221, 198, 195, 195, 225, 204, 206, 213, 199, 206, - 202, 192, 200, 255, 221, 213, 202, 222, 156, 223, - 211, 193, 195, 245, 211, 219, 192, 212, 170, 253, - 233, 229, 251, 234, 172, 225, 237, 247, 243, 192, - 225, 224, 246, 224, 253, 250, 236, 252, 250, 191, - 216, 210, 223, 208, 241, 253, 245, 226, 248, 244, - 158, 130, 135, 135, 206, 141, 141, 158, 139, 144, - 176, 147, 143, 132, 129, 197, 150, 158, 142, 156, - 146, 140, 220, 145, 155, 158, 153, 133, 184, 152, - 128, 213, 185, 190, 184, 185, 161, 189, 184, 168, - 166, 227, 172, 164, 176, 162, 168, 182, 158, 148, - 149, 249, 188, 166, 252, 169, 187, 190, 181, 149, - 153, 154, 244, 183, 83, 11, 92, 64, 77, 68, - 95, 13, 65, 76, 85, 79, 82, 115, 77, 70, - 81, 72, 24, 90, 81, 74, 82, 73, 122, 86, - 89, 90, 95, 89, 20, 116, 121, 99, 97, 69, - 111, 124, 120, 64, 99, 113, 107, 67, 111, 99, - 69, 118, 113, 86, 113, 125, 110, 112, 117, 115, - 102, 80, 42, 77, 81, 126, 96, 121, 11, 9, - 69, 59, 27, 1, 2, 8, 16, 63, 2, 20, - 15, 11, 0, 22, 38, 73, 27, 33, 75, 61, - 50, 49, 34, 47, 64, 45, 21, 27, 29, 16, - 36, 63, 20, 61, 43, 61, 33, 36, 44, 34, - 44, 29, 34, 34, 50, 32, 54, 52, 40, 52, - 59, 49, 40, 1, 16, 38, 35, 56, 56, 50, - 39, 38, 230, 202, 209, 204, 220, 243, 248, 223, - 195, 199, 201, 207, 193, 247, 200, 196, 206, 221, - 215, 203, 211, 145, 254, 200, 193, 218, 222, 212, - 197, 196, 248, 212, 243, 238, 250, 213, 198, 230, - 255, 249, 237, 241, 249, 221, 199, 224, 227, 247, - 255, 252, 249, 237, 247, 240, 242, 238, 206, 219, - 249, 226, 226, 248, 230, 236, 171, 140, 143, 155, - 139, 136, 141, 153, 139, 140, 142, 169, 131, 142, - 143, 128, 148, 186, 139, 145, 151, 209, 159, 142, - 129, 156, 133, 131, 149, 146, 182, 128, 163, 167, - 172, 233, 168, 189, 163, 160, 138, 170, 179, 181, - 169, 181, 189, 229, 174, 162, 168, 188, 146, 186, - 170, 184, 190, 225, 128, 163, 191, 180, 177, 245, - 73, 67, 73, 71, 73, 74, 95, 13, 65, 76, - 85, 79, 82, 7, 70, 68, 72, 72, 106, 88, - 80, 88, 89, 29, 80, 82, 66, 66, 98, 94, - 87, 94, 121, 89, 109, 127, 107, 125, 127, 108, - 110, 79, 101, 111, 97, 115, 108, 87, 127, 109, - 125, 107, 109, 126, 112, 61, 94, 118, 126, 118, - 98, 127, 87, 116, 6, 8, 29, 5, 15, 27, - 5, 2, 12, 67, 52, 24, 22, 2, 39, 95, - 38, 60, 17, 13, 18, 30, 30, 80, 32, 6, - 30, 31, 19, 5, 40, 23, 63, 34, 36, 45, - 61, 19, 126, 46, 26, 118, 2, 15, 10, 23, - 24, 117, 6, 56, 52, 48, 59, 49, 40, 1, - 38, 54, 34, 60, 63, 57, 53, 57, 246, 207, - 205, 223, 203, 195, 195, 221, 207, 198, 206, 213, - 250, 229, 209, 214, 211, 213, 221, 202, 205, 243, - 221, 196, 215, 193, 236, 229, 196, 214, 208, 220, - 228, 236, 216, 229, 239, 251, 234, 226, 240, 238, - 174, 195, 243, 244, 237, 235, 255, 232, 235, 213, - 255, 230, 249, 239, 206, 219, 249, 226, 226, 248, - 230, 236, 182, 170, 143, 142, 156, 138, 139, 140, - 150, 138, 143, 143, 149, 187, 172, 140, 137, 143, - 151, 139, 135, 190, 155, 154, 128, 150, 151, 144, - 130, 158, 155, 155, 152, 174, 190, 172, 188, 188, - 173, 161, 236, 160, 179, 131, 175, 163, 228, 132, - 169, 176, 154, 176, 186, 158, 175, 182, 147, 180, - 183, 163, 179, 176, 181, 161, 79, 79, 8, 93, - 71, 76, 71, 94, 2, 11, 108, 64, 85, 83, - 13, 113, 83, 86, 93, 125, 91, 83, 93, 68, - 102, 90, 93, 84, 26, 23, 89, 70, 73, 49, - 84, 78, 103, 123, 96, 108, 96, 46, 82, 116, - 104, 105, 97, 119, 70, 121, 109, 112, 114, 123, - 111, 65, 32, 112, 72, 36, 84, 89, 88, 69, - 54, 91, 52, 10, 2, 6, 9, 3, 22, 63, - 20, 4, 20, 10, 13, 11, 27, 23, 36, 29, - 27, 9, 25, 17, 29, 3, 29, 20, 24, 3, - 40, 55, 63, 56, 33, 39, 43, 60, 63, 1, - 35, 58, 37, 51, 26, 19, 54, 36, 62, 50, - 54, 62, 14, 51, 61, 41, 52, 60, 34, 60, - 120, 21, 33, 38, 195, 197, 205, 218, 221, 227, - 205, 212, 199, 209, 252, 233, 207, 212, 208, 202, - 200, 194, 228, 248, 217, 216, 206, 216, 213, 210, - 196, 216, 217, 217, 199, 233, 194, 226, 251, 253, - 225, 253, 245, 204, 229, 228, 242, 228, 225, 230, - 240, 236, 245, 245, 204, 240, 253, 244, 208, 252, - 225, 231, 209, 246, 241, 229, 241, 242, 139, 159, - 141, 141, 192, 140, 159, 185, 139, 142, 133, 181, - 143, 138, 129, 197, 137, 143, 153, 141, 151, 140, - 136, 148, 145, 128, 166, 158, 154, 130, 153, 144, - 234, 187, 186, 166, 168, 166, 160, 168, 148, 172, - 172, 180, 171, 162, 228, 179, 187, 183, 173, 188, - 136, 136, 157, 141, 155, 189, 166, 176, 186, 190, - 176, 245, 126, 67, 65, 90, 14, 103, 69, 94, - 86, 76, 82, 72, 69, 70, 72, 97, 91, 79, - 89, 122, 75, 76, 72, 82, 95, 19, 89, 66, - 22, 86, 64, 65, 107, 104, 96, 108, 106, 47, - 120, 98, 34, 106, 110, 101, 111, 100, 101, 113, - 117, 105, 56, 59, 60, 49, 60, 75, 115, 127, - 101, 116, 101, 55, 119, 122, 31, 5, 28, 73, - 25, 6, 0, 1, 66, 1, 5, 65, 21, 30, - 10, 6, 18, 9, 23, 23, 23, 5, 25, 25, - 82, 4, 25, 5, 30, 87, 29, 27, 46, 34, - 43, 40, 58, 32, 62, 45, 49, 99, 35, 46, - 51, 41, 48, 107, 122, 24, 57, 53, 50, 127, - 15, 56, 38, 5, 49, 61, 35, 50, 116, 60, - 196, 216, 220, 204, 207, 203, 128, 141, 205, 209, - 128, 194, 212, 194, 197, 209, 223, 155, 214, 220, - 201, 159, 156, 202, 219, 199, 216, 222, 195, 195, - 148, 212, 254, 255, 233, 234, 230, 230, 226, 234, - 162, 247, 239, 161, 239, 233, 224, 236, 249, 250, - 236, 246, 236, 214, 242, 254, 253, 225, 226, 244, - 245, 227, 180, 250, 140, 141, 155, 140, 154, 207, - 184, 132, 129, 136, 147, 193, 219, 199, 196, 190, - 167, 219, 183, 217, 211, 223, 220, 181, 210, 222, - 208, 209, 186, 215, 217, 213, 234, 136, 232, 228, - 238, 139, 163, 186, 172, 150, 176, 225, 186, 231, - 136, 164, 169, 175, 248, 228, 254, 255, 160, 253, - 132, 188, 188, 164, 187, 178, 244, 232, 10, 111, - 73, 80, 108, 78, 94, 108, 81, 72, 115, 72, - 92, 66, 102, 76, 94, 104, 81, 67, 91, 115, - 93, 78, 70, 96, 89, 75, 83, 120, 68, 80, - 100, 67, 97, 110, 102, 67, 99, 122, 82, 113, - 101, 119, 111, 104, 113, 118, 89, 119, 119, 106, - 123, 75, 110, 124, 118, 118, 99, 64, 99, 120, - 96, 112, 43, 24, 27, 12, 26, 57, 3, 1, - 23, 14, 5, 32, 21, 12, 68, 39, 19, 31, - 88, 85, 94, 44, 21, 7, 23, 73, 80, 93, - 86, 62, 16, 79, 106, 103, 104, 10, 34, 32, - 63, 40, 38, 121, 96, 109, 102, 5, 45, 33, - 96, 123, 116, 121, 31, 44, 55, 103, 114, 127, - 112, 19, 63, 51, 7, 60, 208, 206, 146, 137, - 130, 143, 237, 222, 201, 240, 201, 219, 195, 157, - 132, 225, 219, 207, 217, 153, 205, 218, 206, 212, - 215, 192, 144, 146, 205, 135, 201, 246, 176, 215, - 207, 224, 250, 227, 237, 239, 175, 209, 245, 239, - 232, 226, 246, 217, 248, 238, 241, 245, 250, 236, - 192, 175, 241, 203, 165, 211, 216, 219, 196, 201, - 218, 183, 139, 133, 135, 138, 130, 153, 190, 151, - 133, 147, 139, 142, 138, 132, 150, 167, 156, 156, - 136, 154, 144, 146, 130, 158, 149, 159, 130, 171, - 182, 128, 185, 162, 166, 172, 189, 188, 128, 172, - 187, 166, 178, 157, 146, 181, 165, 161, 179, 181, - 191, 137, 178, 190, 168, 187, 189, 161, 189, 255, - 148, 162, 167, 188, 68, 78, 91, 90, 98, 78, - 85, 72, 80, 127, 109, 78, 66, 82, 72, 64, - 73, 103, 113, 87, 90, 86, 95, 92, 70, 92, - 66, 66, 106, 126, 90, 81, 99, 104, 105, 125, - 97, 125, 34, 110, 113, 79, 105, 111, 99, 88, - 35, 126, 42, 102, 63, 57, 122, 126, 104, 124, - 50, 96, 117, 99, 127, 114, 103, 53, 26, 25, - 7, 25, 11, 29, 24, 4, 7, 16, 44, 4, - 16, 2, 8, 69, 30, 26, 12, 24, 94, 12, - 25, 15, 27, 22, 3, 81, 85, 12, 68, 8, - 6, 46, 62, 44, 34, 16, 3, 35, 98, 55, - 41, 34, 45, 8, 42, 101, 56, 58, 42, 121, - 61, 51, 51, 46, 55, 6, 32, 53, 55, 35, - 49, 1, 211, 219, 205, 197, 199, 193, 201, 254, - 199, 209, 201, 196, 213, 203, 205, 203, 223, 247, - 221, 207, 219, 211, 245, 211, 214, 218, 211, 208, - 194, 216, 198, 149, 235, 231, 250, 236, 239, 235, - 245, 173, 227, 231, 228, 228, 226, 235, 237, 235, - 255, 210, 246, 253, 251, 231, 244, 244, 225, 231, - 255, 227, 255, 244, 245, 249, 174, 138, 156, 136, - 212, 207, 163, 131, 171, 141, 137, 149, 220, 199, - 171, 139, 175, 139, 156, 152, 138, 154, 198, 221, - 189, 157, 179, 157, 147, 150, 134, 207, 234, 132, - 166, 157, 188, 182, 139, 168, 182, 142, 169, 175, - 139, 166, 188, 166, 175, 168, 172, 182, 179, 151, - 181, 174, 166, 188, 162, 184, 181, 182, 184, 145, - 75, 95, 73, 106, 91, 92, 88, 66, 79, 3, - 72, 72, 85, 83, 75, 87, 83, 88, 89, 85, - 30, 91, 93, 73, 83, 19, 81, 93, 68, 82, - 85, 81, 115, 43, 105, 109, 106, 106, 104, 89, - 107, 110, 101, 33, 117, 111, 109, 99, 110, 72, - 112, 118, 105, 63, 112, 116, 124, 118, 48, 124, - 119, 101, 127, 112, 24, 39, 1, 7, 11, 60, - 9, 31, 11, 6, 19, 40, 2, 8, 2, 3, - 9, 30, 12, 16, 16, 12, 8, 28, 28, 16, - 21, 63, 23, 26, 17, 60, 36, 56, 60, 40, - 32, 44, 41, 109, 44, 34, 45, 36, 5, 125, - 24, 2, 51, 47, 52, 56, 60, 114, 14, 40, - 60, 61, 53, 35, 10, 53, 33, 60, 198, 207, - 219, 245, 156, 204, 244, 152, 224, 237, 236, 241, - 250, 151, 248, 198, 214, 210, 221, 215, 202, 227, - 200, 216, 192, 222, 217, 223, 215, 219, 232, 209, - 239, 253, 237, 229, 225, 255, 225, 232, 236, 247, - 220, 195, 243, 244, 237, 235, 255, 232, 235, 213, - 255, 230, 249, 239, 206, 199, 226, 240, 242, 254, - 250, 242, 186, 135, 137, 157, 136, 128, 158, 128, - 204, 161, 149, 146, 143, 137, 129, 150, 137, 183, - 153, 128, 155, 141, 160, 176, 157, 151, 133, 157, - 147, 132, 168, 166, 190, 185, 169, 189, 171, 168, - 165, 168, 177, 159, 147, 181, 180, 166, 176, 160, - 189, 162, 246, 186, 173, 152, 185, 179, 183, 161, - 177, 189, 149, 182, 186, 242, 94, 11, 75, 65, - 79, 65, 75, 72, 2, 80, 84, 83, 71, 83, - 65, 66, 67, 27, 75, 92, 74, 75, 85, 83, - 85, 64, 16, 70, 94, 94, 88, 80, 42, 120, - 124, 123, 111, 123, 105, 106, 123, 35, 115, 117, - 103, 115, 97, 37, 115, 104, 56, 110, 113, 109, - 119, 116, 124, 116, 124, 126, 113, 100, 71, 97, - 24, 10, 28, 12, 9, 22, 93, 67, 82, 34, - 14, 65, 3, 31, 7, 0, 10, 15, 17, 22, - 16, 95, 20, 28, 1, 83, 31, 18, 21, 2, - 6, 7, 47, 47, 104, 62, 38, 38, 32, 40, - 98, 48, 52, 51, 39, 51, 33, 34, 35, 123, - 59, 43, 59, 62, 40, 52, 60, 52, 126, 113, - 19, 47, 55, 48, 218, 223, 193, 198, 192, 149, - 140, 151, 130, 236, 206, 232, 200, 206, 208, 204, - 219, 215, 209, 195, 219, 242, 217, 201, 192, 218, - 211, 194, 229, 195, 198, 212, 254, 238, 239, 240, - 174, 248, 237, 254, 162, 224, 242, 228, 231, 243, - 225, 225, 180, 181, 182, 163, 190, 208, 242, 222, - 224, 246, 241, 229, 243, 243, 199, 225, 152, 138, - 156, 140, 137, 150, 204, 158, 150, 130, 146, 149, - 131, 131, 202, 203, 212, 186, 150, 217, 155, 135, - 159, 152, 130, 135, 153, 158, 152, 215, 156, 148, - 185, 235, 167, 170, 173, 186, 190, 191, 167, 167, - 224, 182, 174, 174, 168, 160, 250, 168, 172, 171, - 191, 171, 185, 186, 171, 243, 162, 164, 184, 185, - 189, 187, 77, 5, 8, 108, 86, 76, 73, 93, - 86, 74, 79, 79, 28, 7, 30, 5, 104, 78, - 86, 106, 74, 77, 93, 73, 87, 84, 73, 17, - 65, 86, 71, 21, 121, 127, 103, 121, 126, 106, - 104, 35, 44, 45, 65, 111, 38, 98, 124, 102, - 127, 107, 108, 112, 113, 113, 60, 117, 115, 96, - 48, 126, 117, 116, 97, 103, 24, 14, 12, 73, - 25, 7, 5, 1, 7, 67, 19, 21, 20, 6, - 16, 0, 29, 2, 88, 10, 10, 16, 12, 13, - 27, 29, 23, 95, 86, 50, 12, 22, 47, 59, - 60, 32, 33, 33, 118, 109, 120, 99, 19, 53, - 41, 55, 5, 43, 122, 62, 32, 58, 59, 47, - 40, 52, 61, 61, 112, 57, 55, 36, 116, 58, - 201, 200, 221, 219, 220, 202, 200, 141, 213, 203, - 201, 205, 195, 135, 215, 209, 200, 218, 204, 220, - 217, 198, 156, 217, 211, 199, 209, 145, 210, 210, - 216, 208, 254, 226, 230, 238, 160, 175, 201, 245, - 225, 230, 240, 245, 239, 232, 234, 191, 186, 161, - 184, 203, 251, 242, 243, 235, 247, 192, 228, 227, - 247, 227, 241, 242, 147, 203, 159, 136, 157, 207, - 158, 136, 143, 140, 150, 132, 130, 201, 202, 203, - 187, 149, 216, 156, 134, 156, 153, 141, 134, 154, - 159, 159, 214, 159, 149, 134, 234, 164, 171, 170, - 187, 189, 190, 168, 166, 227, 183, 169, 175, 171, - 161, 229, 169, 175, 170, 184, 170, 186, 187, 164, - 242, 161, 181, 188, 185, 161, 189, 187, 77, 5, - 8, 108, 86, 76, 73, 93, 86, 74, 79, 79, - 28, 7, 30, 5, 125, 94, 76, 116, 91, 75, - 78, 84, 81, 64, 98, 68, 88, 23, 112, 84, - 126, 110, 39, 93, 103, 98, 105, 90, 109, 113, - 107, 104, 104, 96, 36, 113, 115, 118, 125, 74, - 106, 126, 104, 120, 50, 92, 98, 117, 115, 101, - 46, 53, 74, 4, 26, 13, 11, 29, 76, 14, - 3, 13, 3, 4, 10, 71, 22, 0, 11, 14, - 29, 10, 10, 60, 29, 19, 17, 22, 28, 81, - 25, 5, 16, 16, 56, 107, 11, 38, 32, 33, - 41, 46, 54, 42, 47, 47, 124, 103, 5, 38, - 57, 52, 45, 55, 42, 101, 124, 12, 39, 50, - 62, 37, 63, 35, 45, 111, 138, 228, 218, 205, - 203, 221, 140, 228, 230, 153, 128, 242, 207, 195, - 193, 159, 154, 244, 202, 221, 219, 205, 156, 201, - 203, 195, 213, 139, 150, 227, 198, 220, 237, 236, - 237, 251, 174, 255, 254, 228, 225, 230, 186, 161, - 210, 245, 229, 236, 246, 242, 246, 254, 190, 240, - 250, 251, 225, 246, 228, 171, 182, 196, 224, 250, - 154, 203, 132, 134, 157, 156, 214, 205, 182, 130, - 139, 132, 198, 151, 150, 138, 156, 146, 140, 195, - 222, 187, 157, 137, 151, 220, 164, 152, 155, 146, - 206, 213, 153, 164, 189, 187, 173, 170, 246, 237, - 144, 166, 177, 180, 163, 180, 176, 140, 190, 225, - 248, 249, 157, 179, 179, 174, 183, 243, 161, 165, - 175, 237, 244, 133, 69, 88, 65, 93, 71, 64, - 66, 13, 65, 79, 79, 82, 67, 7, 86, 64, - 75, 78, 93, 74, 74, 111, 83, 78, 91, 71, - 89, 94, 88, 23, 125, 113, 48, 43, 68, 96, - 96, 100, 44, 66, 65, 76, 32, 115, 99, 118, - 113, 96, 105, 111, 84, 112, 112, 116, 60, 82, - 81, 92, 62, 49, 68, 114, 101, 96, 15, 24, - 28, 32, 10, 85, 76, 34, 16, 7, 5, 19, - 52, 2, 21, 16, 31, 8, 12, 41, 31, 13, - 29, 16, 23, 7, 21, 3, 5, 38, 1, 20, - 36, 63, 33, 61, 55, 11, 41, 43, 43, 45, - 41, 53, 47, 40, 42, 22, 63, 47, 44, 48, - 48, 56, 18, 60, 63, 54, 3, 61, 63, 39, - 36, 52, 205, 206, 251, 221, 193, 223, 224, 194, - 209, 208, 233, 213, 195, 202, 215, 241, 219, 208, - 221, 233, 204, 208, 218, 212, 198, 250, 196, 212, - 219, 196, 245, 209, 238, 226, 252, 224, 225, 225, - 237, 225, 210, 226, 242, 224, 235, 226, 240, 224, - 232, 232, 215, 235, 250, 250, 238, 238, 178, 244, - 226, 254, 227, 231, 180, 229, 134, 138, 139, 128, - 128, 136, 204, 159, 135, 146, 149, 132, 149, 147, - 171, 151, 158, 158, 138, 138, 222, 152, 142, 146, - 135, 131, 222, 209, 164, 146, 133, 128, 175, 184, - 188, 128, 170, 245, 236, 153, 167, 187, 180, 146, - 163, 179, 176, 172, 180, 188, 145, 173, 187, 178, - 157, 190, 177, 188, 165, 191, 162, 132, 177, 161, - 94, 66, 70, 78, 103, 91, 73, 64, 96, 76, - 79, 77, 67, 70, 74, 118, 95, 79, 76, 80, - 80, 88, 117, 73, 87, 94, 121, 95, 66, 82, - 83, 80, 120, 88, 109, 125, 122, 102, 98, 106, - 75, 119, 101, 108, 68, 104, 107, 105, 127, 122, - 118, 74, 105, 118, 104, 126, 122, 118, 98, 66, - 115, 99, 96, 124, 4, 12, 33, 29, 11, 2, - 56, 4, 15, 6, 58, 14, 8, 2, 41, 4, - 20, 26, 31, 28, 12, 44, 25, 9, 6, 26, - 30, 22, 63, 3, 17, 24, 30, 34, 37, 44, - 8, 61, 45, 32, 39, 0, 47, 47, 32, 46, - 35, 22, 63, 47, 44, 48, 48, 56, 21, 41, - 55, 62, 20, 48, 34, 50, 0, 60, 199, 206, - 251, 204, 218, 219, 197, 195, 197, 234, 212, 196, - 203, 247, 197, 214, 201, 204, 215, 203, 218, 236, - 217, 201, 198, 218, 222, 214, 255, 195, 209, 216, - 217, 238, 228, 236, 237, 251, 227, 255, 209, 230, - 244, 245, 239, 233, 227, 204, 238, 254, 245, 205, - 247, 242, 249, 199, 253, 253, 245, 194, 243, 227, - 224, 252, 132, 140, 161, 157, 139, 130, 184, 136, - 154, 151, 161, 147, 131, 134, 183, 128, 142, 143, - 145, 151, 153, 182, 136, 152, 159, 160, 137, 156, - 148, 152, 152, 166, 175, 191, 188, 160, 160, 168, - 133, 185, 167, 174, 144, 164, 180, 174, 171, 161, - 137, 190, 172, 173, 183, 177, 187, 148, 166, 182, - 189, 130, 162, 165, 189, 187, 77, 120, 77, 93, - 90, 70, 66, 74, 107, 87, 69, 76, 103, 68, - 80, 76, 85, 85, 107, 92, 74, 75, 85, 83, - 85, 90, 68, 84, 91, 103, 91, 92, 100, 127, - 123, 90, 107, 123, 120, 100, 108, 100, 73, 117, - 99, 106, 64, 106, 111, 121, 116, 124, 77, 122, - 104, 105, 123, 125, 119, 88, 98, 114, 121, 70, - 6, 2, 12, 12, 28, 60, 9, 25, 22, 10, - 14, 6, 47, 19, 1, 8, 41, 30, 20, 28, - 29, 11, 19, 15, 62, 28, 19, 16, 26, 30, - 14, 16, 46, 24, 45, 61, 58, 38, 34, 42, - 11, 55, 37, 44, 0, 46, 40, 32, 9, 62, - 44, 45, 55, 49, 59, 20, 38, 54, 61, 23, - 57, 57, 32, 6, 207, 223, 220, 192, 192, 200, - 229, 217, 199, 206, 236, 206, 200, 192, 247, 192, - 206, 207, 209, 215, 217, 246, 200, 216, 223, 244, - 194, 222, 195, 199, 231, 208, 254, 255, 225, 231, - 233, 198, 248, 232, 239, 192, 239, 237, 233, 245, - 215, 224, 238, 239, 241, 247, 249, 214, 232, 248, - 255, 192, 255, 228, 248, 243, 199, 240, 158, 159, - 129, 135, 137, 166, 152, 136, 143, 162, 140, 132, - 148, 147, 183, 128, 142, 143, 145, 151, 153, 182, - 136, 152, 159, 188, 177, 132, 130, 159, 167, 144, - 190, 191, 161, 167, 169, 134, 184, 168, 175, 145, - 161, 165, 175, 168, 136, 170, 185, 186, 180, 176, - 164, 186, 184, 142, 183, 167, 164, 184, 184, 176, - 157, 161, 79, 70, 108, 70, 91, 77, 64, 72, - 117, 74, 84, 73, 106, 78, 74, 78, 105, 94, - 76, 77, 87, 81, 91, 116, 70, 86, 93, 99, - 69, 68, 103, 80, 126, 127, 97, 103, 105, 70, - 120, 104, 111, 66, 108, 104, 97, 105, 105, 96, - 116, 111, 75, 124, 106, 107, 117, 115, 117, 90, - 100, 116, 123, 71, 117, 124, 24, 40, 7, 5, - 1, 29, 63, 8, 22, 23, 9, 15, 1, 46, - 16, 0, 23, 56, 23, 23, 26, 22, 8, 20, - 29, 29, 35, 20, 2, 3, 29, 27, 45, 2, - 60, 44, 35, 3, 37, 35, 39, 12, 48, 53, - 47, 40, 42, 54, 9, 62, 44, 45, 55, 49, - 59, 20, 38, 54, 61, 19, 63, 48, 0, 48, - 210, 223, 233, 219, 203, 206, 255, 200, 214, 215, - 201, 207, 193, 238, 208, 192, 215, 253, 209, 219, - 209, 209, 221, 222, 209, 218, 252, 212, 192, 210, - 216, 250, 250, 255, 225, 230, 224, 252, 223, 232, - 246, 247, 233, 239, 225, 206, 240, 224, 247, 214, - 241, 247, 241, 235, 253, 232, 224, 252, 214, 248, - 244, 248, 250, 244, 137, 136, 129, 165, 139, 153, - 137, 129, 173, 147, 148, 136, 137, 137, 151, 182, - 159, 143, 140, 144, 144, 152, 181, 137, 151, 158, - 162, 144, 152, 144, 145, 166, 175, 167, 173, 170, - 186, 160, 190, 158, 167, 183, 180, 168, 168, 160, - 141, 177, 191, 182, 154, 182, 177, 179, 185, 188, - 188, 159, 191, 178, 183, 187, 189, 175, 79, 79, - 123, 76, 90, 91, 69, 67, 69, 106, 84, 68, - 75, 100, 72, 80, 73, 79, 93, 75, 125, 80, - 80, 82, 64, 90, 94, 86, 122, 82, 66, 80, - 102, 88, 109, 125, 122, 102, 98, 106, 75, 119, - 101, 108, 73, 117, 96, 96, 104, 73, 125, 104, - 107, 122, 111, 105, 66, 114, 98, 112, 123, 114, - 96, 112, 24, 24, 59, 12, 26, 27, 5, 3, - 5, 42, 20, 4, 11, 46, 7, 10, 20, 30, - 28, 56, 29, 11, 21, 18, 28, 83, 38, 16, - 26, 2, 17, 79, 106, 34, 59, 29, 43, 34, - 60, 34, 48, 34, 50, 56, 4, 38, 54, 22, - 50, 52, 47, 28, 38, 43, 57, 51, 33, 58, - 63, 63, 5, 63, 59, 34, 239, 211, 220, 204, - 192, 220, 197, 194, 204, 239, 201, 207, 195, 244, - 204, 202, 205, 249, 217, 202, 219, 243, 217, 203, - 215, 223, 245, 201, 194, 210, 218, 198, 227, 228, - 230, 197, 235, 249, 233, 225, 199, 251, 244, 228, - 232, 244, 237, 234, 244, 217, 249, 250, 245, 220, - 243, 241, 253, 225, 213, 233, 226, 242, 250, 230, - 131, 132, 134, 171, 129, 157, 136, 136, 144, 160, - 143, 141, 137, 149, 161, 157, 142, 158, 150, 138, - 151, 144, 146, 177, 147, 145, 149, 157, 180, 150, - 135, 144, 134, 174, 190, 172, 162, 155, 169, 181, - 182, 143, 175, 162, 167, 171, 151, 177, 181, 169, - 185, 190, 187, 172, 137, 174, 183, 161, 132, 163, - 183, 179, 177, 166, 105, 74, 70, 14, 90, 15, - 74, 68, 76, 71, 0, 64, 72, 94, 4, 86, - 78, 84, 74, 88, 89, 90, 127, 92, 92, 20, - 68, 17, 85, 69, 81, 84, 126, 110, 40, 122, - 122, 96, 126, 108, 101, 102, 32, 110, 96, 39, - 112, 124, 106, 126, 34, 57, 81, 109, 120, 120, - 96, 96, 88, 120, 101, 99, 123, 103, 19, 40, - 29, 26, 26, 0, 1, 77, 17, 23, 18, 8, - 8, 0, 39, 10, 20, 31, 17, 13, 23, 16, - 18, 50, 2, 22, 2, 16, 24, 19, 55, 0, - 57, 63, 39, 36, 110, 43, 45, 57, 39, 21, - 33, 45, 51, 34, 16, 60, 42, 62, 27, 44, - 45, 43, 51, 48, 114, 32, 41, 60, 52, 56, - 56, 22, 223, 216, 220, 198, 195, 143, 205, 206, - 193, 204, 213, 207, 210, 228, 209, 214, 206, 212, - 213, 153, 205, 218, 208, 216, 209, 199, 223, 195, - 229, 210, 216, 208, 233, 255, 237, 237, 199, 251, - 233, 224, 205, 241, 228, 228, 244, 167, 244, 233, - 251, 248, 241, 247, 249, 191, 239, 233, 224, 242, - 228, 244, 241, 238, 180, 226, 152, 132, 134, 142, - 206, 140, 153, 159, 144, 134, 142, 149, 198, 148, - 144, 132, 142, 158, 171, 141, 140, 158, 136, 152, - 149, 138, 208, 151, 159, 153, 157, 134, 162, 174, - 172, 242, 231, 239, 236, 172, 182, 227, 166, 174, - 180, 231, 141, 139, 137, 143, 138, 140, 147, 154, - 146, 137, 129, 140, 131, 148, 154, 146, 151, 129, - 99, 100, 102, 118, 103, 107, 120, 68, 79, 70, - 79, 84, 82, 7, 75, 67, 26, 76, 89, 80, - 74, 86, 82, 90, 18, 82, 83, 82, 83, 68, - 71, 21, 126, 100, 99, 108, 96, 67, 99, 110, - 99, 111, 83, 117, 105, 117, 101, 98, 127, 104, - 68, 79, 113, 115, 105, 112, 119, 82, 126, 112, - 122, 110, 103, 124, 25, 59, 26, 6, 10, 26, - 15, 25, 43, 39, 49, 20, 9, 19, 13, 11, - 29, 56, 13, 11, 12, 26, 18, 30, 11, 58, - 52, 32, 3, 24, 0, 16, 14, 46, 36, 40, - 55, 30, 57, 34, 54, 42, 46, 38, 18, 62, - 52, 32, 22, 52, 44, 10, 55, 37, 57, 19, - 61, 39, 57, 62, 56, 54, 56, 3, 203, 199, - 221, 204, 253, 219, 201, 221, 234, 202, 211, 213, - 201, 213, 221, 241, 195, 203, 221, 239, 209, 211, - 201, 208, 215, 231, 201, 193, 211, 243, 209, 217, - 254, 234, 203, 232, 226, 236, 249, 225, 227, 247, - 233, 238, 232, 211, 253, 245, 255, 214, 241, 247, - 200, 240, 240, 232, 255, 246, 209, 255, 247, 251, - 237, 230, 131, 152, 188, 128, 141, 132, 191, 132, - 152, 134, 161, 141, 138, 136, 147, 166, 155, 151, - 155, 140, 146, 158, 136, 152, 160, 150, 145, 157, - 130, 158, 153, 144, 158, 162, 171, 162, 189, 142, - 160, 161, 173, 180, 131, 160, 170, 164, 177, 169, - 187, 175, 189, 139, 187, 190, 176, 169, 187, 190, - 181, 133, 164, 182, 176, 176, 89, 106, 68, 69, - 65, 88, 111, 76, 78, 64, 85, 77, 71, 83, - 65, 119, 95, 90, 84, 77, 87, 82, 89, 107, - 93, 95, 69, 92, 83, 118, 88, 89, 101, 124, - 75, 104, 98, 108, 121, 97, 99, 119, 101, 83, - 99, 102, 104, 113, 115, 118, 125, 90, 118, 126, - 114, 122, 119, 82, 124, 125, 121, 96, 85, 119, - 8, 25, 13, 31, 7, 14, 24, 8, 50, 17, - 9, 2, 3, 37, 29, 49, 19, 24, 19, 42, - 23, 5, 25, 48, 19, 7, 5, 3, 31, 3, - 13, 49, 43, 63, 45, 15, 59, 59, 57, 63, - 39, 0, 47, 47, 50, 53, 37, 38, 46, 15, - 33, 41, 59, 22, 50, 46, 38, 33, 37, 60, - 51, 57, 32, 20, 206, 207, 193, 221, 199, 192, - 194, 204, 206, 234, 206, 199, 201, 232, 194, 195, - 151, 254, 192, 218, 214, 222, 210, 218, 215, 229, - 213, 223, 210, 216, 198, 149, 226, 234, 251, 169, - 224, 224, 248, 173, 241, 246, 240, 241, 233, 245, - 240, 220, 245, 238, 234, 185, 242, 246, 255, 248, - 252, 224, 245, 177, 242, 248, 241, 230, 202, 133, - 135, 157, 206, 142, 128, 129, 141, 148, 192, 149, - 142, 142, 151, 197, 153, 148, 150, 151, 155, 156, - 136, 148, 157, 157, 165, 130, 147, 133, 176, 144, - 167, 164, 154, 172, 175, 163, 128, 162, 161, 162, - 172, 146, 178, 168, 182, 164, 189, 190, 171, 133, - 150, 182, 175, 169, 189, 161, 169, 129, 185, 164, - 157, 177, 16, 11, 4, 9, 105, 93, 67, 88, - 82, 106, 68, 27, 6, 11, 4, 102, 85, 86, - 85, 92, 80, 75, 6, 29, 98, 65, 16, 12, - 22, 99, 70, 27, 122, 121, 40, 52, 46, 91, - 126, 35, 109, 101, 102, 114, 99, 115, 36, 56, - 58, 88, 109, 106, 106, 112, 113, 94, 65, 71, - 92, 92, 66, 84, 46, 73, 45, 2, 28, 5, - 15, 13, 65, 63, 23, 13, 14, 4, 20, 59, - 6, 16, 19, 23, 28, 10, 34, 77, 31, 37, - 71, 49, 62, 61, 38, 43, 68, 41, 41, 39, - 33, 44, 32, 59, 16, 57, 39, 49, 45, 40, - 40, 38, 40, 25, 62, 62, 46, 60, 50, 48, - 44, 48, 55, 61, 36, 13, 20, 34, 39, 60, - 196, 206, 219, 218, 226, 206, 213, 200, 208, 255, - 244, 211, 199, 195, 205, 203, 221, 235, 212, 216, - 202, 217, 211, 207, 223, 157, 242, 196, 197, 222, - 218, 208, 249, 248, 196, 232, 247, 234, 254, 209, - 192, 246, 243, 232, 232, 226, 247, 246, 213, 249, - 242, 252, 253, 235, 239, 193, 221, 225, 244, 244, - 228, 195, 237, 229, 143, 152, 180, 165, 135, 130, - 133, 153, 173, 145, 132, 132, 148, 179, 157, 149, - 159, 213, 155, 138, 222, 223, 177, 146, 150, 154, - 150, 136, 214, 152, 134, 145, 175, 185, 232, 234, - 157, 187, 163, 189, 226, 175, 175, 178, 181, 231, - 180, 183, 179, 184, 189, 249, 173, 183, 179, 168, - 190, 183, 240, 179, 179, 247, 184, 176, 89, 88, - 8, 93, 70, 78, 66, 13, 78, 74, 77, 72, - 82, 7, 84, 87, 83, 88, 93, 109, 95, 84, - 89, 29, 66, 65, 95, 87, 95, 67, 20, 69, - 120, 98, 107, 108, 46, 124, 100, 98, 119, 111, - 100, 33, 100, 98, 36, 104, 117, 105, 125, 57, - 106, 119, 125, 115, 50, 127, 121, 124, 127, 99, - 52, 101, 24, 2, 11, 12, 61, 27, 3, 29, - 66, 15, 15, 18, 21, 71, 20, 23, 19, 24, - 29, 89, 13, 23, 19, 8, 30, 23, 80, 19, - 19, 87, 25, 26, 56, 46, 104, 61, 38, 46, - 34, 109, 46, 42, 45, 40, 50, 103, 52, 55, - 51, 56, 61, 13, 63, 52, 57, 125, 34, 33, - 63, 55, 63, 35, 116, 37, 216, 194, 203, 204, - 142, 220, 196, 194, 215, 207, 196, 129, 196, 194, - 132, 201, 223, 200, 203, 153, 202, 215, 221, 211, - 146, 223, 217, 220, 223, 195, 148, 197, 248, 226, - 235, 236, 195, 196, 216, 222, 246, 236, 240, 161, - 234, 232, 247, 246, 186, 235, 234, 240, 253, 250, - 188, 238, 250, 252, 229, 253, 242, 183, 246, 240, - 202, 135, 141, 154, 157, 207, 152, 133, 131, 141, - 192, 140, 135, 149, 143, 128, 142, 219, 153, 138, - 149, 223, 140, 143, 155, 144, 149, 178, 204, 171, - 179, 156, 190, 167, 169, 171, 227, 157, 185, 163, - 172, 166, 178, 157, 164, 178, 173, 169, 190, 168, - 132, 235, 189, 135, 233, 159, 156, 159, 128, 141, - 230, 139, 183, 185, 67, 78, 70, 93, 114, 91, - 73, 95, 79, 74, 78, 64, 74, 123, 64, 64, - 76, 94, 84, 86, 78, 82, 89, 83, 70, 111, - 114, 68, 69, 94, 90, 80, 121, 120, 68, 104, - 119, 106, 126, 81, 86, 113, 97, 101, 111, 105, - 99, 85, 118, 122, 108, 127, 113, 109, 113, 51, - 80, 102, 99, 120, 120, 114, 103, 102, 38, 10, - 17, 12, 28, 51, 46, 24, 17, 10, 14, 4, - 21, 20, 43, 7, 16, 30, 27, 13, 13, 35, - 51, 15, 22, 22, 2, 37, 15, 7, 17, 6, - 22, 6, 41, 59, 37, 42, 56, 2, 48, 39, - 37, 51, 18, 62, 52, 32, 116, 56, 43, 13, - 63, 52, 57, 125, 34, 33, 63, 55, 63, 35, - 116, 37, 216, 194, 203, 204, 142, 220, 196, 194, - 215, 207, 196, 129, 196, 194, 132, 200, 213, 201, - 221, 153, 202, 215, 221, 211, 146, 222, 209, 195, - 221, 210, 192, 149, 235, 248, 227, 169, 254, 253, - 229, 238, 231, 208, 244, 238, 246, 167, 232, 234, - 233, 232, 184, 233, 236, 246, 255, 248, 178, 224, - 248, 254, 227, 251, 240, 181, 136, 142, 200, 132, - 129, 157, 137, 205, 150, 139, 129, 143, 198, 138, - 133, 151, 145, 158, 140, 217, 156, 150, 152, 221, - 130, 129, 153, 146, 147, 163, 149, 158, 175, 235, - 184, 187, 161, 169, 165, 185, 226, 179, 178, 168, - 165, 162, 228, 182, 178, 180, 173, 181, 186, 255, - 190, 184, 242, 191, 181, 162, 165, 247, 160, 189, - 75, 69, 8, 68, 79, 93, 71, 72, 86, 3, - 66, 72, 66, 7, 84, 87, 83, 88, 93, 106, - 106, 111, 104, 79, 91, 84, 87, 84, 68, 23, - 68, 71, 99, 104, 109, 74, 52, 83, 75, 100, - 118, 111, 97, 99, 43, 85, 113, 107, 116, 126, - 106, 69, 124, 106, 117, 113, 118, 96, 76, 35, - 117, 79, 33, 87, 36, 39, 56, 53, 94, 51, - 15, 1, 11, 6, 14, 21, 58, 19, 1, 23, - 23, 18, 22, 24, 18, 35, 24, 24, 4, 22, - 28, 30, 6, 26, 17, 27, 62, 23, 10, 60, - 61, 38, 34, 40, 49, 48, 12, 32, 63, 34, - 54, 25, 14, 41, 57, 61, 55, 49, 59, 13, - 62, 50, 36, 55, 57, 37, 57, 123, 232, 222, - 219, 192, 192, 202, 223, 222, 238, 194, 217, 196, - 212, 251, 230, 208, 201, 210, 214, 220, 205, 204, - 243, 223, 216, 214, 211, 197, 197, 235, 251, 199, - 238, 238, 250, 221, 247, 255, 233, 254, 222, 208, - 244, 238, 246, 200, 246, 225, 255, 233, 204, 224, - 238, 250, 178, 254, 225, 192, 228, 254, 230, 183, - 248, 250, 153, 152, 200, 153, 156, 134, 143, 136, - 194, 144, 136, 142, 147, 139, 128, 197, 152, 158, - 216, 149, 155, 140, 143, 221, 134, 155, 145, 159, - 214, 131, 134, 156, 173, 172, 173, 187, 238, 191, - 190, 164, 161, 166, 148, 160, 173, 162, 228, 181, - 168, 180, 190, 176, 170, 255, 172, 175, 187, 176, - 181, 241, 165, 191, 187, 160, 70, 79, 8, 75, - 75, 15, 65, 66, 80, 70, 0, 85, 78, 70, - 74, 5, 78, 73, 81, 94, 89, 90, 78, 29, - 66, 65, 89, 82, 83, 100, 64, 90, 122, 43, - 100, 102, 125, 124, 44, 125, 112, 106, 99, 100, - 38, 116, 108, 106, 111, 119, 124, 57, 124, 122, - 60, 112, 125, 97, 117, 49, 98, 127, 117, 123, - 74, 31, 26, 0, 9, 8, 9, 31, 66, 19, - 18, 8, 5, 2, 48, 4, 17, 30, 88, 9, - 12, 16, 26, 20, 6, 83, 0, 3, 31, 20, - 17, 85, 57, 35, 39, 60, 34, 43, 108, 47, - 39, 99, 44, 36, 53, 52, 100, 49, 50, 58, - 54, 121, 42, 45, 53, 58, 53, 54, 34, 113, - 38, 37, 61, 54, 207, 255, 218, 200, 199, 195, - 197, 195, 197, 131, 243, 213, 201, 215, 240, 215, - 151, 232, 236, 203, 223, 214, 208, 212, 220, 212, - 144, 222, 208, 209, 199, 208, 254, 200, 178, 213, - 201, 230, 248, 225, 227, 225, 173, 211, 243, 233, - 234, 224, 232, 199, 250, 236, 247, 243, 248, 238, - 206, 161, 243, 201, 163, 213, 218, 217, 186, 183, - 216, 181, 141, 131, 133, 136, 140, 151, 188, 149, - 131, 149, 137, 140, 148, 154, 148, 165, 154, 154, - 138, 152, 158, 156, 128, 156, 147, 153, 128, 169, - 136, 190, 187, 160, 160, 170, 191, 190, 142, 162, - 185, 164, 180, 155, 144, 183, 187, 191, 177, 183, - 185, 143, 176, 188, 166, 181, 191, 163, 187, 249, - 150, 160, 89, 66, 70, 76, 93, 92, 96, 76, - 91, 70, 82, 125, 100, 82, 87, 76, 84, 94, - 75, 74, 113, 93, 86, 88, 81, 71, 67, 109, - 121, 69, 80, 80, 120, 95, 113, 121, 107, 124, - 80, 89, 112, 98, 105, 109, 111, 105, 99, 86, - 110, 116, 104, 86, 108, 123, 121, 111, 70, 106, - 96, 116, 56, 116, 103, 60, 67, 69, 72, 32, - 10, 79, 81, 77, 41, 2, 7, 8, 45, 0, - 72, 69, 54, 18, 22, 28, 94, 61, 14, 24, - 19, 24, 60, 24, 24, 18, 84, 23, 56, 46, - 41, 34, 110, 35, 37, 35, 39, 48, 108, 97, - 22, 40, 45, 43, 46, 40, 120, 127, 126, 25, - 53, 58, 39, 33, 53, 34, 21, 109, 8, 18, - 195, 223, 196, 200, 204, 130, 254, 216, 204, 205, - 197, 211, 250, 197, 209, 204, 214, 223, 203, 229, - 140, 220, 228, 136, 240, 253, 252, 225, 234, 135, - 232, 214, 230, 226, 237, 231, 250, 211, 248, 232, - 240, 238, 233, 239, 231, 235, 216, 225, 255, 237, - 253, 245, 241, 239, 241, 248, 252, 231, 204, 211, - 227, 228, 253, 251, 143, 152, 155, 165, 143, 150, - 137, 159, 190, 183, 146, 128, 130, 142, 138, 130, - 170, 151, 153, 141, 152, 144, 142, 144, 220, 177, - 133, 130, 159, 153, 145, 134, 185, 135, 169, 176, - 171, 189, 144, 133, 171, 176, 180, 174, 180, 190, - 152, 132, 189, 188, 170, 188, 185, 190, 168, 180, - 189, 189, 163, 141, 158, 190, 167, 161, 69, 89, - 81, 104, 73, 72, 94, 72, 69, 66, 84, 72, - 73, 73, 116, 74, 83, 85, 76, 74, 127, 81, - 88, 123, 91, 84, 69, 67, 83, 68, 26, 86, - 121, 73, 103, 113, 93, 102, 118, 104, 64, 108, - 120, 33, 117, 110, 126, 96, 74, 61, 94, 57, - 51, 63, 54, 85, 94, 80, 66, 116, 120, 124, - 123, 93, 3, 12, 0, 70, 34, 0, 27, 44, - 6, 21, 78, 65, 37, 11, 5, 22, 9, 18, - 27, 56, 26, 9, 82, 93, 58, 26, 23, 25, - 89, 59, 27, 2, 8, 57, 33, 42, 37, 111, - 63, 36, 56, 38, 1, 38, 33, 53, 33, 34, - 59, 47, 49, 54, 48, 127, 47, 41, 43, 63, - 53, 20, 46, 35, 49, 59, 217, 194, 199, 199, - 130, 143, 137, 228, 204, 213, 197, 211, 213, 206, - 203, 203, 150, 155, 157, 234, 214, 208, 203, 157, - 197, 218, 211, 218, 197, 245, 193, 220, 230, 239, - 168, 234, 251, 253, 254, 232, 236, 247, 160, 227, - 231, 245, 197, 198, 219, 211, 212, 191, 201, 221, - 249, 250, 251, 253, 170, 177, 182, 235, 180, 208, - 132, 143, 210, 201, 206, 128, 158, 137, 135, 145, - 192, 140, 137, 131, 141, 131, 131, 219, 138, 156, - 143, 138, 153, 142, 134, 211, 159, 131, 146, 146, - 134, 213, 186, 167, 169, 170, 167, 161, 171, 237, - 176, 166, 177, 180, 163, 180, 176, 135, 187, 168, - 189, 148, 191, 167, 136, 175, 179, 183, 185, 191, - 177, 134, 161, 180, 68, 95, 65, 93, 87, 126, - 89, 66, 86, 74, 78, 70, 107, 70, 92, 113, - 72, 90, 92, 80, 80, 88, 109, 72, 83, 93, - 68, 88, 66, 78, 117, 71, 104, 98, 124, 123, - 111, 104, 105, 94, 123, 110, 98, 110, 106, 116, - 71, 109, 127, 120, 115, 124, 122, 94, 112, 113, - 125, 100, 84, 120, 101, 118, 118, 121, 15, 40, - 7, 5, 1, 29, 42, 2, 16, 14, 1, 21, - 45, 14, 10, 1, 15, 15, 27, 63, 23, 29, - 19, 19, 19, 16, 19, 24, 58, 18, 2, 16, - 38, 56, 10, 40, 61, 42, 28, 40, 48, 42, - 47, 37, 102, 36, 43, 43, 46, 58, 49, 55, - 45, 127, 53, 51, 114, 22, 40, 50, 58, 34, - 48, 48, 206, 248, 220, 208, 194, 202, 223, 224, - 195, 219, 201, 204, 211, 202, 233, 204, 212, 210, - 213, 204, 211, 246, 210, 222, 192, 214, 221, 212, - 216, 195, 240, 220, 231, 238, 230, 250, 231, 224, - 226, 204, 238, 239, 239, 246, 194, 238, 247, 228, - 248, 247, 253, 218, 241, 243, 243, 239, 163, 210, - 252, 253, 249, 224, 208, 252, 153, 138, 138, 133, - 139, 172, 131, 129, 141, 145, 210, 177, 131, 149, - 141, 138, 158, 182, 141, 149, 138, 150, 140, 145, - 155, 150, 130, 209, 159, 132, 212, 153, 175, 184, - 187, 233, 186, 167, 173, 163, 226, 142, 181, 173, - 178, 174, 180, 169, 179, 190, 170, 148, 183, 177, - 181, 176, 167, 190, 240, 184, 165, 247, 185, 186, - 88, 78, 8, 93, 70, 78, 66, 13, 111, 86, - 76, 85, 79, 87, 72, 76, 95, 73, 117, 88, - 70, 86, 81, 72, 95, 113, 81, 66, 83, 103, - 81, 71, 99, 100, 108, 41, 109, 96, 98, 121, - 99, 106, 110, 114, 38, 110, 106, 37, 95, 99, - 123, 117, 107, 123, 121, 121, 66, 118, 98, 120, - 121, 115, 103, 69, 4, 7, 41, 5, 11, 29, - 24, 30, 33, 12, 14, 21, 7, 14, 10, 0, - 8, 43, 22, 21, 63, 19, 25, 15, 6, 39, - 17, 3, 17, 18, 0, 35, 43, 39, 61, 44, - 24, 46, 32, 56, 39, 48, 22, 32, 42, 50, - 33, 12, 46, 62, 53, 42, 8, 62, 48, 40, - 55, 26, 36, 52, 59, 30, 32, 48, 199, 216, - 251, 221, 203, 223, 223, 238, 205, 214, 206, 213, - 227, 201, 197, 199, 214, 222, 235, 214, 203, 209, - 216, 206, 230, 218, 221, 212, 255, 217, 224, 199, - 235, 239, 237, 202, 225, 225, 248, 236, 235, 237, - 229, 243, 210, 238, 233, 224, 211, 245, 204, 235, - 255, 251, 249, 201, 251, 254, 245, 216, 248, 196, - 241, 246, 133, 133, 140, 154, 190, 163, 168, 132, - 144, 134, 131, 149, 143, 136, 138, 177, 147, 150, - 157, 163, 145, 145, 153, 180, 156, 149, 159, 184, - 146, 181, 149, 134, 175, 158, 188, 170, 129, 169, - 170, 190, 167, 183, 132, 168, 181, 183, 168, 164, - 163, 149, 185, 180, 187, 140, 168, 188, 188, 183, - 177, 163, 178, 147, 189, 166, 90, 71, 73, 80, - 96, 78, 65, 72, 113, 66, 86, 68, 6, 85, - 65, 68, 86, 79, 81, 84, 91, 31, 72, 79, - 83, 87, 85, 17, 65, 94, 64, 93, 42, 120, - 124, 123, 111, 97, 107, 104, 34, 119, 105, 108, - 99, 61, 36, 81, 104, 122, 124, 124, 87, 123, - 60, 32, 50, 51, 68, 120, 123, 114, 52, 40, - 74, 18, 17, 16, 23, 66, 33, 32, 79, 7, - 4, 65, 46, 47, 94, 8, 23, 65, 11, 10, - 80, 25, 26, 27, 82, 31, 17, 2, 2, 35, - 6, 20, 46, 46, 12, 40, 58, 42, 108, 112, - 98, 16, 33, 55, 35, 103, 54, 32, 59, 55, - 44, 48, 51, 58, 124, 41, 32, 50, 52, 52, - 118, 32, 61, 33, 194, 139, 219, 221, 220, 206, - 194, 202, 199, 131, 212, 200, 203, 194, 158, 133, - 223, 195, 209, 202, 202, 218, 216, 233, 192, 210, - 212, 212, 197, 244, 219, 192, 228, 255, 168, 169, - 250, 253, 237, 233, 231, 240, 212, 238, 213, 230, - 242, 224, 186, 207, 240, 252, 236, 250, 188, 244, - 225, 179, 254, 254, 182, 248, 250, 240, 202, 136, - 128, 128, 130, 139, 204, 155, 135, 141, 132, 142, - 148, 170, 145, 137, 142, 146, 216, 143, 155, 145, - 152, 146, 128, 221, 208, 178, 158, 158, 152, 145, - 234, 189, 173, 167, 170, 160, 190, 237, 181, 170, - 180, 169, 230, 172, 161, 188, 250, 230, 248, 249, - 172, 186, 168, 168, 160, 189, 240, 181, 191, 164, - 183, 186, 68, 69, 77, 74, 90, 74, 72, 13, - 82, 74, 78, 70, 6, 85, 65, 86, 79, 87, - 76, 109, 76, 94, 88, 84, 92, 84, 16, 71, - 83, 89, 80, 90, 120, 43, 105, 101, 124, 106, - 109, 105, 123, 35, 114, 100, 97, 110, 119, 113, - 127, 105, 125, 125, 48, 63, 83, 115, 126, 106, - 48, 126, 120, 114, 52, 97, 24, 10, 12, 0, - 0, 8, 76, 27, 7, 13, 4, 14, 20, 71, - 7, 4, 20, 91, 26, 28, 94, 13, 25, 26, - 27, 0, 4, 20, 4, 18, 16, 91, 62, 57, - 41, 45, 39, 33, 43, 27, 39, 45, 36, 46, - 52, 49, 33, 43, 62, 52, 42, 26, 50, 48, - 47, 56, 54, 115, 32, 62, 37, 62, 32, 60, - 197, 197, 136, 202, 207, 193, 139, 217, 130, 193, - 197, 129, 197, 203, 203, 214, 223, 223, 152, 216, - 217, 222, 213, 211, 253, 213, 214, 145, 155, 151, - 241, 205, 233, 227, 233, 231, 233, 234, 220, 236, - 246, 235, 212, 238, 194, 230, 240, 228, 216, 250, - 235, 252, 206, 237, 243, 249, 231, 240, 228, 208, - 229, 228, 241, 225, 187, 158, 135, 157, 135, 129, - 139, 172, 145, 144, 133, 149, 171, 130, 151, 150, - 155, 156, 157, 170, 135, 146, 158, 146, 158, 157, - 149, 134, 184, 150, 153, 144, 234, 162, 187, 233, - 160, 186, 160, 161, 226, 172, 178, 225, 163, 170, - 180, 177, 163, 181, 189, 174, 151, 171, 185, 176, - 161, 136, 240, 250, 246, 152, 186, 185, 83, 11, - 101, 72, 92, 68, 73, 89, 2, 76, 82, 69, - 67, 85, 4, 81, 67, 75, 93, 25, 87, 76, - 28, 92, 94, 95, 95, 70, 83, 83, 68, 71, - 99, 104, 109, 68, 97, 107, 101, 107, 107, 96, - 97, 117, 105, 117, 80, 124, 106, 126, 126, 118, - 108, 124, 121, 72, 97, 118, 68, 120, 117, 124, - 103, 83, 5, 25, 32, 0, 29, 27, 3, 31, - 27, 36, 18, 14, 19, 23, 55, 0, 14, 15, - 17, 23, 25, 12, 47, 4, 28, 7, 24, 20, - 2, 30, 23, 60, 62, 46, 37, 5, 39, 34, - 37, 57, 11, 37, 20, 46, 51, 36, 44, 32, - 62, 23, 49, 52, 55, 43, 124, 52, 52, 115, - 36, 62, 35, 52, 60, 48, 206, 231, 229, 253, - 250, 236, 150, 241, 229, 202, 212, 205, 199, 197, - 137, 247, 207, 213, 214, 220, 204, 227, 222, 200, - 219, 223, 212, 194, 234, 133, 215, 237, 191, 201, - 198, 197, 222, 211, 188, 209, 225, 239, 233, 228, - 232, 243, 216, 241, 255, 233, 245, 240, 240, 254, - 240, 193, 246, 246, 230, 244, 250, 248, 228, 248, - 143, 133, 156, 181, 172, 154, 159, 132, 140, 134, - 147, 146, 170, 134, 157, 128, 136, 167, 172, 139, - 159, 155, 149, 147, 149, 163, 156, 144, 130, 145, - 155, 135, 167, 229, 138, 188, 189, 166, 162, 168, - 177, 176, 140, 160, 191, 162, 182, 153, 152, 174, - 171, 176, 176, 186, 175, 174, 157, 177, 186, 180, - 181, 163, 167, 137, 101, 89, 76, 76, 92, 123, - 85, 93, 71, 80, 124, 109, 79, 74, 77, 81, - 115, 93, 108, 86, 75, 92, 84, 88, 86, 124, - 66, 85, 83, 69, 96, 76, 122, 110, 38, 106, - 125, 120, 101, 121, 106, 35, 116, 115, 111, 96, - 99, 96, 104, 59, 104, 107, 119, 124, 121, 61, - 115, 103, 48, 92, 119, 101, 127, 112, 30, 34, - 14, 61, 1, 26, 15, 5, 7, 7, 45, 0, - 20, 12, 1, 17, 90, 18, 30, 89, 10, 16, - 9, 30, 26, 22, 20, 60, 61, 35, 32, 38, - 62, 36, 56, 105, 34, 38, 33, 36, 54, 16, - 20, 13, 5, 125, 24, 2, 51, 47, 52, 56, - 60, 114, 14, 40, 60, 61, 53, 35, 10, 53, - 33, 60, 198, 207, 219, 245, 156, 204, 244, 152, - 224, 237, 236, 241, 250, 151, 248, 198, 214, 210, - 221, 215, 202, 227, 200, 216, 192, 222, 217, 223, - 215, 219, 232, 209, 239, 253, 237, 229, 225, 255, - 225, 232, 236, 247, 220, 195, 243, 244, 237, 235, - 255, 232, 235, 213, 255, 230, 249, 239, 206, 199, - 226, 240, 242, 254, 250, 242, 186, 135, 137, 157, - 136, 128, 158, 128, 204, 161, 149, 146, 143, 137, - 129, 150, 137, 183, 153, 128, 155, 141, 160, 191, - 135, 128, 153, 159, 147, 132, 135, 186, 168, 161, - 173, 170, 186, 188, 144, 130, 176, 167, 165, 179, - 146, 190, 180, 160, 169, 135, 139, 173, 177, 175, - 144, 180, 191, 186, 164, 158, 164, 179, 177, 167, - 126, 82, 88, 76, 0, 76, 95, 94, 82, 76, - 84, 114, 95, 74, 70, 74, 86, 114, 92 - }; - - internal static string[] 5 = new string[2068]; - - private static string 6(int P_0, int P_1, int P_2) - { - string text = Encoding.UTF8.GetString(4, P_1, P_2); - 5[P_0] = text; - return text; - } - - public static string ?() - { - return 5[0] ?? 6(0, 0, 11); - } - - public static string ?() - { - return 5[1] ?? 6(1, 11, 2); - } - - public static string ?() - { - return 5[2] ?? 6(2, 13, 3); - } - - public static string ?() - { - return 5[3] ?? 6(3, 16, 27); - } - - public static string ?() - { - return 5[4] ?? 6(4, 43, 13); - } - - public static string ?() - { - return 5[5] ?? 6(5, 56, 8); - } - - public static string ?() - { - return 5[6] ?? 6(6, 64, 8); - } - - public static string ?() - { - return 5[7] ?? 6(7, 72, 17); - } - - public static string ?() - { - return 5[8] ?? 6(8, 89, 18); - } - - public static string ?() - { - return 5[9] ?? 6(9, 107, 19); - } - - public static string ?() - { - return 5[10] ?? 6(10, 126, 18); - } - - public static string ?() - { - return 5[11] ?? 6(11, 144, 16); - } - - public static string ?() - { - return 5[12] ?? 6(12, 160, 20); - } - - public static string ?() - { - return 5[13] ?? 6(13, 180, 28); - } - - public static string ?() - { - return 5[14] ?? 6(14, 208, 12); - } - - public static string ?() - { - return 5[15] ?? 6(15, 220, 39); - } - - public static string ?() - { - return 5[16] ?? 6(16, 259, 16); - } - - public static string ?() - { - return 5[17] ?? 6(17, 275, 0); - } - - public static string ?() - { - return 5[18] ?? 6(18, 275, 3); - } - - public static string ?() - { - return 5[19] ?? 6(19, 278, 8); - } - - public static string ?() - { - return 5[20] ?? 6(20, 286, 7); - } - - public static string ?() - { - return 5[21] ?? 6(21, 293, 6); - } - - public static string ?() - { - return 5[22] ?? 6(22, 299, 47); - } - - public static string ?() - { - return 5[23] ?? 6(23, 346, 9); - } - - public static string ?() - { - return 5[24] ?? 6(24, 355, 51); - } - - public static string ?() - { - return 5[25] ?? 6(25, 406, 7); - } - - public static string ?() - { - return 5[26] ?? 6(26, 413, 7); - } - - public static string ?() - { - return 5[27] ?? 6(27, 420, 1); - } - - public static string ?() - { - return 5[28] ?? 6(28, 421, 2); - } - - public static string ?() - { - return 5[29] ?? 6(29, 423, 1); - } - - public static string ?() - { - return 5[30] ?? 6(30, 424, 4); - } - - public static string ?() - { - return 5[31] ?? 6(31, 428, 44); - } - - public static string ?() - { - return 5[32] ?? 6(32, 472, 17); - } - - public static string ?() - { - return 5[33] ?? 6(33, 489, 16); - } - - public static string ?() - { - return 5[34] ?? 6(34, 505, 7); - } - - public static string ?() - { - return 5[35] ?? 6(35, 512, 42); - } - - public static string ?() - { - return 5[36] ?? 6(36, 554, 36); - } - - public static string ?() - { - return 5[37] ?? 6(37, 590, 33); - } - - public static string ?() - { - return 5[38] ?? 6(38, 623, 51); - } - - public static string ?() - { - return 5[39] ?? 6(39, 674, 9); - } - - public static string ?() - { - return 5[40] ?? 6(40, 683, 11); - } - - public static string ?() - { - return 5[41] ?? 6(41, 694, 42); - } - - public static string ?() - { - return 5[42] ?? 6(42, 736, 2); - } - - public static string ?() - { - return 5[43] ?? 6(43, 738, 26); - } - - public static string ?() - { - return 5[44] ?? 6(44, 764, 15); - } - - public static string ?() - { - return 5[45] ?? 6(45, 779, 36); - } - - public static string ?() - { - return 5[46] ?? 6(46, 815, 21); - } - - public static string ?() - { - return 5[47] ?? 6(47, 836, 16); - } - - public static string ?() - { - return 5[48] ?? 6(48, 852, 32); - } - - public static string ?() - { - return 5[49] ?? 6(49, 884, 14); - } - - public static string ?() - { - return 5[50] ?? 6(50, 898, 23); - } - - public static string ?() - { - return 5[51] ?? 6(51, 921, 21); - } - - public static string ?() - { - return 5[52] ?? 6(52, 942, 31); - } - - public static string ?() - { - return 5[53] ?? 6(53, 973, 23); - } - - public static string ?() - { - return 5[54] ?? 6(54, 996, 33); - } - - public static string ?() - { - return 5[55] ?? 6(55, 1029, 26); - } - - public static string ?() - { - return 5[56] ?? 6(56, 1055, 14); - } - - public static string ?() - { - return 5[57] ?? 6(57, 1069, 9); - } - - public static string ?() - { - return 5[58] ?? 6(58, 1078, 27); - } - - public static string ?() - { - return 5[59] ?? 6(59, 1105, 28); - } - - public static string ?() - { - return 5[60] ?? 6(60, 1133, 26); - } - - public static string ?() - { - return 5[61] ?? 6(61, 1159, 45); - } - - public static string ?() - { - return 5[62] ?? 6(62, 1204, 15); - } - - public static string ?() - { - return 5[63] ?? 6(63, 1219, 8); - } - - public static string ?() - { - return 5[64] ?? 6(64, 1227, 26); - } - - public static string ?() - { - return 5[65] ?? 6(65, 1253, 28); - } - - public static string ?() - { - return 5[66] ?? 6(66, 1281, 22); - } - - public static string ?() - { - return 5[67] ?? 6(67, 1303, 23); - } - - public static string ?() - { - return 5[68] ?? 6(68, 1326, 11); - } - - public static string ?() - { - return 5[69] ?? 6(69, 1337, 6); - } - - public static string ?() - { - return 5[70] ?? 6(70, 1343, 22); - } - - public static string ?() - { - return 5[71] ?? 6(71, 1365, 23); - } - - public static string ?() - { - return 5[72] ?? 6(72, 1388, 33); - } - - public static string ?() - { - return 5[73] ?? 6(73, 1421, 15); - } - - public static string ?() - { - return 5[74] ?? 6(74, 1436, 27); - } - - public static string ?() - { - return 5[75] ?? 6(75, 1463, 38); - } - - public static string ?() - { - return 5[76] ?? 6(76, 1501, 13); - } - - public static string ?() - { - return 5[77] ?? 6(77, 1514, 23); - } - - public static string ?() - { - return 5[78] ?? 6(78, 1537, 53); - } - - public static string ?() - { - return 5[79] ?? 6(79, 1590, 6); - } - - public static string ?() - { - return 5[80] ?? 6(80, 1596, 13); - } - - public static string ?() - { - return 5[81] ?? 6(81, 1609, 34); - } - - public static string ?() - { - return 5[82] ?? 6(82, 1643, 18); - } - - public static string ?() - { - return 5[83] ?? 6(83, 1661, 20); - } - - public static string ?() - { - return 5[84] ?? 6(84, 1681, 23); - } - - public static string ?() - { - return 5[85] ?? 6(85, 1704, 10); - } - - public static string ?() - { - return 5[86] ?? 6(86, 1714, 31); - } - - public static string ?() - { - return 5[87] ?? 6(87, 1745, 21); - } - - public static string ?() - { - return 5[88] ?? 6(88, 1766, 16); - } - - public static string ?() - { - return 5[89] ?? 6(89, 1782, 16); - } - - public static string ?() - { - return 5[90] ?? 6(90, 1798, 23); - } - - public static string ?() - { - return 5[91] ?? 6(91, 1821, 12); - } - - public static string ?() - { - return 5[92] ?? 6(92, 1833, 23); - } - - public static string ?() - { - return 5[93] ?? 6(93, 1856, 21); - } - - public static string ?() - { - return 5[94] ?? 6(94, 1877, 23); - } - - public static string ?() - { - return 5[95] ?? 6(95, 1900, 13); - } - - public static string ?() - { - return 5[96] ?? 6(96, 1913, 5); - } - - public static string ?() - { - return 5[97] ?? 6(97, 1918, 28); - } - - public static string ?() - { - return 5[98] ?? 6(98, 1946, 41); - } - - public static string ?() - { - return 5[99] ?? 6(99, 1987, 18); - } - - public static string ?() - { - return 5[100] ?? 6(100, 2005, 26); - } - - public static string ?() - { - return 5[101] ?? 6(101, 2031, 10); - } - - public static string ?() - { - return 5[102] ?? 6(102, 2041, 6); - } - - public static string ?() - { - return 5[103] ?? 6(103, 2047, 17); - } - - public static string ?() - { - return 5[104] ?? 6(104, 2064, 5); - } - - public static string ?() - { - return 5[105] ?? 6(105, 2069, 12); - } - - public static string ?() - { - return 5[106] ?? 6(106, 2081, 18); - } - - public static string ?() - { - return 5[107] ?? 6(107, 2099, 37); - } - - public static string ?() - { - return 5[108] ?? 6(108, 2136, 18); - } - - public static string ?() - { - return 5[109] ?? 6(109, 2154, 18); - } - - public static string ?() - { - return 5[110] ?? 6(110, 2172, 20); - } - - public static string ?() - { - return 5[111] ?? 6(111, 2192, 20); - } - - public static string ?() - { - return 5[112] ?? 6(112, 2212, 20); - } - - public static string ?() - { - return 5[113] ?? 6(113, 2232, 9); - } - - public static string ?() - { - return 5[114] ?? 6(114, 2241, 14); - } - - public static string ?() - { - return 5[115] ?? 6(115, 2255, 18); - } - - public static string ?() - { - return 5[116] ?? 6(116, 2273, 8); - } - - public static string ?() - { - return 5[117] ?? 6(117, 2281, 19); - } - - public static string ?() - { - return 5[118] ?? 6(118, 2300, 27); - } - - public static string ?() - { - return 5[119] ?? 6(119, 2327, 17); - } - - public static string ?() - { - return 5[120] ?? 6(120, 2344, 16); - } - - public static string ?() - { - return 5[121] ?? 6(121, 2360, 13); - } - - public static string ?() - { - return 5[122] ?? 6(122, 2373, 13); - } - - public static string ?() - { - return 5[123] ?? 6(123, 2386, 28); - } - - public static string ?() - { - return 5[124] ?? 6(124, 2414, 17); - } - - public static string ?() - { - return 5[125] ?? 6(125, 2431, 6); - } - - public static string ?() - { - return 5[126] ?? 6(126, 2437, 21); - } - - public static string ?() - { - return 5[127] ?? 6(127, 2458, 16); - } - - public static string ??() - { - return 5[128] ?? 6(128, 2474, 10); - } - - public static string ??() - { - return 5[129] ?? 6(129, 2484, 23); - } - - public static string ??() - { - return 5[130] ?? 6(130, 2507, 18); - } - - public static string ??() - { - return 5[131] ?? 6(131, 2525, 24); - } - - public static string ??() - { - return 5[132] ?? 6(132, 2549, 31); - } - - public static string ??() - { - return 5[133] ?? 6(133, 2580, 5); - } - - public static string ??() - { - return 5[134] ?? 6(134, 2585, 5); - } - - public static string ??() - { - return 5[135] ?? 6(135, 2590, 6); - } - - public static string ??() - { - return 5[136] ?? 6(136, 2596, 11); - } - - public static string ??() - { - return 5[137] ?? 6(137, 2607, 7); - } - - public static string ??() - { - return 5[138] ?? 6(138, 2614, 19); - } - - public static string ??() - { - return 5[139] ?? 6(139, 2633, 15); - } - - public static string ??() - { - return 5[140] ?? 6(140, 2648, 16); - } - - public static string ??() - { - return 5[141] ?? 6(141, 2664, 25); - } - - public static string ??() - { - return 5[142] ?? 6(142, 2689, 15); - } - - public static string ??() - { - return 5[143] ?? 6(143, 2704, 34); - } - - public static string ??() - { - return 5[144] ?? 6(144, 2738, 30); - } - - public static string ??() - { - return 5[145] ?? 6(145, 2768, 27); - } - - public static string ??() - { - return 5[146] ?? 6(146, 2795, 15); - } - - public static string ??() - { - return 5[147] ?? 6(147, 2810, 15); - } - - public static string ??() - { - return 5[148] ?? 6(148, 2825, 17); - } - - public static string ??() - { - return 5[149] ?? 6(149, 2842, 15); - } - - public static string ??() - { - return 5[150] ?? 6(150, 2857, 9); - } - - public static string ??() - { - return 5[151] ?? 6(151, 2866, 16); - } - - public static string ??() - { - return 5[152] ?? 6(152, 2882, 28); - } - - public static string ??() - { - return 5[153] ?? 6(153, 2910, 36); - } - - public static string ??() - { - return 5[154] ?? 6(154, 2946, 10); - } - - public static string ??() - { - return 5[155] ?? 6(155, 2956, 9); - } - - public static string ??() - { - return 5[156] ?? 6(156, 2965, 9); - } - - public static string ??() - { - return 5[157] ?? 6(157, 2974, 8); - } - - public static string ??() - { - return 5[158] ?? 6(158, 2982, 10); - } - - public static string ??() - { - return 5[159] ?? 6(159, 2992, 9); - } - - public static string ??() - { - return 5[160] ?? 6(160, 3001, 13); - } - - public static string ??() - { - return 5[161] ?? 6(161, 3014, 26); - } - - public static string ??() - { - return 5[162] ?? 6(162, 3040, 9); - } - - public static string ??() - { - return 5[163] ?? 6(163, 3049, 26); - } - - public static string ??() - { - return 5[164] ?? 6(164, 3075, 35); - } - - public static string ??() - { - return 5[165] ?? 6(165, 3110, 28); - } - - public static string ??() - { - return 5[166] ?? 6(166, 3138, 27); - } - - public static string ??() - { - return 5[167] ?? 6(167, 3165, 28); - } - - public static string ??() - { - return 5[168] ?? 6(168, 3193, 37); - } - - public static string ??() - { - return 5[169] ?? 6(169, 3230, 30); - } - - public static string ??() - { - return 5[170] ?? 6(170, 3260, 29); - } - - public static string ??() - { - return 5[171] ?? 6(171, 3289, 27); - } - - public static string ??() - { - return 5[172] ?? 6(172, 3316, 36); - } - - public static string ??() - { - return 5[173] ?? 6(173, 3352, 29); - } - - public static string ??() - { - return 5[174] ?? 6(174, 3381, 28); - } - - public static string ??() - { - return 5[175] ?? 6(175, 3409, 21); - } - - public static string ??() - { - return 5[176] ?? 6(176, 3430, 9); - } - - public static string ??() - { - return 5[177] ?? 6(177, 3439, 16); - } - - public static string ??() - { - return 5[178] ?? 6(178, 3455, 21); - } - - public static string ??() - { - return 5[179] ?? 6(179, 3476, 11); - } - - public static string ??() - { - return 5[180] ?? 6(180, 3487, 14); - } - - public static string ??() - { - return 5[181] ?? 6(181, 3501, 12); - } - - public static string ??() - { - return 5[182] ?? 6(182, 3513, 3); - } - - public static string ??() - { - return 5[183] ?? 6(183, 3516, 11); - } - - public static string ??() - { - return 5[184] ?? 6(184, 3527, 35); - } - - public static string ??() - { - return 5[185] ?? 6(185, 3562, 42); - } - - public static string ??() - { - return 5[186] ?? 6(186, 3604, 13); - } - - public static string ??() - { - return 5[187] ?? 6(187, 3617, 44); - } - - public static string ??() - { - return 5[188] ?? 6(188, 3661, 51); - } - - public static string ??() - { - return 5[189] ?? 6(189, 3712, 29); - } - - public static string ??() - { - return 5[190] ?? 6(190, 3741, 1); - } - - public static string ??() - { - return 5[191] ?? 6(191, 3742, 1); - } - - public static string ??() - { - return 5[192] ?? 6(192, 3743, 1); - } - - public static string ??() - { - return 5[193] ?? 6(193, 3744, 4); - } - - public static string ??() - { - return 5[194] ?? 6(194, 3748, 8); - } - - public static string ??() - { - return 5[195] ?? 6(195, 3756, 6); - } - - public static string ??() - { - return 5[196] ?? 6(196, 3762, 4); - } - - public static string ??() - { - return 5[197] ?? 6(197, 3766, 34); - } - - public static string ??() - { - return 5[198] ?? 6(198, 3800, 41); - } - - public static string ??() - { - return 5[199] ?? 6(199, 3841, 12); - } - - public static string ??() - { - return 5[200] ?? 6(200, 3853, 8); - } - - public static string ??() - { - return 5[201] ?? 6(201, 3861, 8); - } - - public static string ??() - { - return 5[202] ?? 6(202, 3869, 3); - } - - public static string ??() - { - return 5[203] ?? 6(203, 3872, 22); - } - - public static string ??() - { - return 5[204] ?? 6(204, 3894, 19); - } - - public static string ??() - { - return 5[205] ?? 6(205, 3913, 23); - } - - public static string ??() - { - return 5[206] ?? 6(206, 3936, 13); - } - - public static string ??() - { - return 5[207] ?? 6(207, 3949, 55); - } - - public static string ??() - { - return 5[208] ?? 6(208, 4004, 13); - } - - public static string ??() - { - return 5[209] ?? 6(209, 4017, 5); - } - - public static string ??() - { - return 5[210] ?? 6(210, 4022, 51); - } - - public static string ??() - { - return 5[211] ?? 6(211, 4073, 49); - } - - public static string ??() - { - return 5[212] ?? 6(212, 4122, 18); - } - - public static string ??() - { - return 5[213] ?? 6(213, 4140, 43); - } - - public static string ??() - { - return 5[214] ?? 6(214, 4183, 44); - } - - public static string ??() - { - return 5[215] ?? 6(215, 4227, 12); - } - - public static string ??() - { - return 5[216] ?? 6(216, 4239, 9); - } - - public static string ??() - { - return 5[217] ?? 6(217, 4248, 41); - } - - public static string ??() - { - return 5[218] ?? 6(218, 4289, 18); - } - - public static string ??() - { - return 5[219] ?? 6(219, 4307, 50); - } - - public static string ??() - { - return 5[220] ?? 6(220, 4357, 15); - } - - public static string ??() - { - return 5[221] ?? 6(221, 4372, 24); - } - - public static string ??() - { - return 5[222] ?? 6(222, 4396, 56); - } - - public static string ??() - { - return 5[223] ?? 6(223, 4452, 33); - } - - public static string ??() - { - return 5[224] ?? 6(224, 4485, 34); - } - - public static string ??() - { - return 5[225] ?? 6(225, 4519, 43); - } - - public static string ??() - { - return 5[226] ?? 6(226, 4562, 53); - } - - public static string ??() - { - return 5[227] ?? 6(227, 4615, 45); - } - - public static string ??() - { - return 5[228] ?? 6(228, 4660, 46); - } - - public static string ??() - { - return 5[229] ?? 6(229, 4706, 43); - } - - public static string ??() - { - return 5[230] ?? 6(230, 4749, 62); - } - - public static string ??() - { - return 5[231] ?? 6(231, 4811, 54); - } - - public static string ??() - { - return 5[232] ?? 6(232, 4865, 62); - } - - public static string ??() - { - return 5[233] ?? 6(233, 4927, 54); - } - - public static string ??() - { - return 5[234] ?? 6(234, 4981, 55); - } - - public static string ??() - { - return 5[235] ?? 6(235, 5036, 47); - } - - public static string ??() - { - return 5[236] ?? 6(236, 5083, 48); - } - - public static string ??() - { - return 5[237] ?? 6(237, 5131, 45); - } - - public static string ??() - { - return 5[238] ?? 6(238, 5176, 37); - } - - public static string ??() - { - return 5[239] ?? 6(239, 5213, 75); - } - - public static string ??() - { - return 5[240] ?? 6(240, 5288, 41); - } - - public static string ??() - { - return 5[241] ?? 6(241, 5329, 11); - } - - public static string ??() - { - return 5[242] ?? 6(242, 5340, 32); - } - - public static string ??() - { - return 5[243] ?? 6(243, 5372, 8); - } - - public static string ??() - { - return 5[244] ?? 6(244, 5380, 19); - } - - public static string ??() - { - return 5[245] ?? 6(245, 5399, 34); - } - - public static string ??() - { - return 5[246] ?? 6(246, 5433, 24); - } - - public static string ??() - { - return 5[247] ?? 6(247, 5457, 24); - } - - public static string ??() - { - return 5[248] ?? 6(248, 5481, 7); - } - - public static string ??() - { - return 5[249] ?? 6(249, 5488, 6); - } - - public static string ??() - { - return 5[250] ?? 6(250, 5494, 41); - } - - public static string ??() - { - return 5[251] ?? 6(251, 5535, 44); - } - - public static string ??() - { - return 5[252] ?? 6(252, 5579, 35); - } - - public static string ??() - { - return 5[253] ?? 6(253, 5614, 37); - } - - public static string ??() - { - return 5[254] ?? 6(254, 5651, 14); - } - - public static string ??() - { - return 5[255] ?? 6(255, 5665, 48); - } - - public static string ??() - { - return 5[256] ?? 6(256, 5713, 9); - } - - public static string ??() - { - return 5[257] ?? 6(257, 5722, 21); - } - - public static string ??() - { - return 5[258] ?? 6(258, 5743, 50); - } - - public static string ??() - { - return 5[259] ?? 6(259, 5793, 9); - } - - public static string ??() - { - return 5[260] ?? 6(260, 5802, 23); - } - - public static string ??() - { - return 5[261] ?? 6(261, 5825, 27); - } - - public static string ??() - { - return 5[262] ?? 6(262, 5852, 21); - } - - public static string ??() - { - return 5[263] ?? 6(263, 5873, 3); - } - - public static string ??() - { - return 5[264] ?? 6(264, 5876, 7); - } - - public static string ??() - { - return 5[265] ?? 6(265, 5883, 12); - } - - public static string ??() - { - return 5[266] ?? 6(266, 5895, 10); - } - - public static string ??() - { - return 5[267] ?? 6(267, 5905, 28); - } - - public static string ??() - { - return 5[268] ?? 6(268, 5933, 40); - } - - public static string ??() - { - return 5[269] ?? 6(269, 5973, 25); - } - - public static string ??() - { - return 5[270] ?? 6(270, 5998, 14); - } - - public static string ??() - { - return 5[271] ?? 6(271, 6012, 32); - } - - public static string ??() - { - return 5[272] ?? 6(272, 6044, 33); - } - - public static string ??() - { - return 5[273] ?? 6(273, 6077, 27); - } - - public static string ??() - { - return 5[274] ?? 6(274, 6104, 19); - } - - public static string ??() - { - return 5[275] ?? 6(275, 6123, 22); - } - - public static string ??() - { - return 5[276] ?? 6(276, 6145, 8); - } - - public static string ??() - { - return 5[277] ?? 6(277, 6153, 29); - } - - public static string ??() - { - return 5[278] ?? 6(278, 6182, 19); - } - - public static string ??() - { - return 5[279] ?? 6(279, 6201, 4); - } - - public static string ??() - { - return 5[280] ?? 6(280, 6205, 12); - } - - public static string ??() - { - return 5[281] ?? 6(281, 6217, 40); - } - - public static string ??() - { - return 5[282] ?? 6(282, 6257, 5); - } - - public static string ??() - { - return 5[283] ?? 6(283, 6262, 6); - } - - public static string ??() - { - return 5[284] ?? 6(284, 6268, 10); - } - - public static string ??() - { - return 5[285] ?? 6(285, 6278, 6); - } - - public static string ??() - { - return 5[286] ?? 6(286, 6284, 1); - } - - public static string ??() - { - return 5[287] ?? 6(287, 6285, 1); - } - - public static string ??() - { - return 5[288] ?? 6(288, 6286, 1); - } - - public static string ??() - { - return 5[289] ?? 6(289, 6287, 1); - } - - public static string ??() - { - return 5[290] ?? 6(290, 6288, 1); - } - - public static string ??() - { - return 5[291] ?? 6(291, 6289, 1); - } - - public static string ??() - { - return 5[292] ?? 6(292, 6290, 14); - } - - public static string ??() - { - return 5[293] ?? 6(293, 6304, 4); - } - - public static string ??() - { - return 5[294] ?? 6(294, 6308, 1); - } - - public static string ??() - { - return 5[295] ?? 6(295, 6309, 1); - } - - public static string ??() - { - return 5[296] ?? 6(296, 6310, 18); - } - - public static string ??() - { - return 5[297] ?? 6(297, 6328, 5); - } - - public static string ??() - { - return 5[298] ?? 6(298, 6333, 58); - } - - public static string ??() - { - return 5[299] ?? 6(299, 6391, 33); - } - - public static string ??() - { - return 5[300] ?? 6(300, 6424, 2); - } - - public static string ??() - { - return 5[301] ?? 6(301, 6426, 61); - } - - public static string ??() - { - return 5[302] ?? 6(302, 6487, 10); - } - - public static string ??() - { - return 5[303] ?? 6(303, 6497, 32); - } - - public static string ??() - { - return 5[304] ?? 6(304, 6529, 13); - } - - public static string ??() - { - return 5[305] ?? 6(305, 6542, 1); - } - - public static string ??() - { - return 5[306] ?? 6(306, 6543, 1); - } - - public static string ??() - { - return 5[307] ?? 6(307, 6544, 12); - } - - public static string ??() - { - return 5[308] ?? 6(308, 6556, 13); - } - - public static string ??() - { - return 5[309] ?? 6(309, 6569, 21); - } - - public static string ??() - { - return 5[310] ?? 6(310, 6590, 10); - } - - public static string ??() - { - return 5[311] ?? 6(311, 6600, 7); - } - - public static string ??() - { - return 5[312] ?? 6(312, 6607, 6); - } - - public static string ??() - { - return 5[313] ?? 6(313, 6613, 11); - } - - public static string ??() - { - return 5[314] ?? 6(314, 6624, 6); - } - - public static string ??() - { - return 5[315] ?? 6(315, 6630, 4); - } - - public static string ??() - { - return 5[316] ?? 6(316, 6634, 7); - } - - public static string ??() - { - return 5[317] ?? 6(317, 6641, 8); - } - - public static string ??() - { - return 5[318] ?? 6(318, 6649, 31); - } - - public static string ??() - { - return 5[319] ?? 6(319, 6680, 18); - } - - public static string ??() - { - return 5[320] ?? 6(320, 6698, 25); - } - - public static string ??() - { - return 5[321] ?? 6(321, 6723, 1); - } - - public static string ??() - { - return 5[322] ?? 6(322, 6724, 9); - } - - public static string ??() - { - return 5[323] ?? 6(323, 6733, 11); - } - - public static string ??() - { - return 5[324] ?? 6(324, 6744, 8); - } - - public static string ??() - { - return 5[325] ?? 6(325, 6752, 13); - } - - public static string ??() - { - return 5[326] ?? 6(326, 6765, 6); - } - - public static string ??() - { - return 5[327] ?? 6(327, 6771, 3); - } - - public static string ??() - { - return 5[328] ?? 6(328, 6774, 5); - } - - public static string ??() - { - return 5[329] ?? 6(329, 6779, 23); - } - - public static string ??() - { - return 5[330] ?? 6(330, 6802, 1); - } - - public static string ??() - { - return 5[331] ?? 6(331, 6803, 1); - } - - public static string ??() - { - return 5[332] ?? 6(332, 6804, 2); - } - - public static string ??() - { - return 5[333] ?? 6(333, 6806, 5); - } - - public static string ??() - { - return 5[334] ?? 6(334, 6811, 8); - } - - public static string ??() - { - return 5[335] ?? 6(335, 6819, 8); - } - - public static string ??() - { - return 5[336] ?? 6(336, 6827, 11); - } - - public static string ??() - { - return 5[337] ?? 6(337, 6838, 28); - } - - public static string ??() - { - return 5[338] ?? 6(338, 6866, 35); - } - - public static string ??() - { - return 5[339] ?? 6(339, 6901, 1); - } - - public static string ??() - { - return 5[340] ?? 6(340, 6902, 1); - } - - public static string ??() - { - return 5[341] ?? 6(341, 6903, 2); - } - - public static string ??() - { - return 5[342] ?? 6(342, 6905, 6); - } - - public static string ??() - { - return 5[343] ?? 6(343, 6911, 1); - } - - public static string ??() - { - return 5[344] ?? 6(344, 6912, 6); - } - - public static string ??() - { - return 5[345] ?? 6(345, 6918, 8); - } - - public static string ??() - { - return 5[346] ?? 6(346, 6926, 10); - } - - public static string ??() - { - return 5[347] ?? 6(347, 6936, 10); - } - - public static string ??() - { - return 5[348] ?? 6(348, 6946, 12); - } - - public static string ??() - { - return 5[349] ?? 6(349, 6958, 14); - } - - public static string ??() - { - return 5[350] ?? 6(350, 6972, 6); - } - - public static string ??() - { - return 5[351] ?? 6(351, 6978, 8); - } - - public static string ??() - { - return 5[352] ?? 6(352, 6986, 10); - } - - public static string ??() - { - return 5[353] ?? 6(353, 6996, 10); - } - - public static string ??() - { - return 5[354] ?? 6(354, 7006, 12); - } - - public static string ??() - { - return 5[355] ?? 6(355, 7018, 14); - } - - public static string ??() - { - return 5[356] ?? 6(356, 7032, 57); - } - - public static string ??() - { - return 5[357] ?? 6(357, 7089, 24); - } - - public static string ??() - { - return 5[358] ?? 6(358, 7113, 5); - } - - public static string ??() - { - return 5[359] ?? 6(359, 7118, 3); - } - - public static string ??() - { - return 5[360] ?? 6(360, 7121, 6); - } - - public static string ??() - { - return 5[361] ?? 6(361, 7127, 2); - } - - public static string ??() - { - return 5[362] ?? 6(362, 7129, 13); - } - - public static string ??() - { - return 5[363] ?? 6(363, 7142, 22); - } - - public static string ??() - { - return 5[364] ?? 6(364, 7164, 19); - } - - public static string ??() - { - return 5[365] ?? 6(365, 7183, 14); - } - - public static string ??() - { - return 5[366] ?? 6(366, 7197, 42); - } - - public static string ??() - { - return 5[367] ?? 6(367, 7239, 50); - } - - public static string ??() - { - return 5[368] ?? 6(368, 7289, 22); - } - - public static string ??() - { - return 5[369] ?? 6(369, 7311, 6); - } - - public static string ??() - { - return 5[370] ?? 6(370, 7317, 7); - } - - public static string ??() - { - return 5[371] ?? 6(371, 7324, 16); - } - - public static string ??() - { - return 5[372] ?? 6(372, 7340, 16); - } - - public static string ??() - { - return 5[373] ?? 6(373, 7356, 6); - } - - public static string ??() - { - return 5[374] ?? 6(374, 7362, 6); - } - - public static string ??() - { - return 5[375] ?? 6(375, 7368, 9); - } - - public static string ??() - { - return 5[376] ?? 6(376, 7377, 14); - } - - public static string ??() - { - return 5[377] ?? 6(377, 7391, 22); - } - - public static string ??() - { - return 5[378] ?? 6(378, 7413, 3); - } - - public static string ??() - { - return 5[379] ?? 6(379, 7416, 2); - } - - public static string ??() - { - return 5[380] ?? 6(380, 7418, 12); - } - - public static string ??() - { - return 5[381] ?? 6(381, 7430, 16); - } - - public static string ??() - { - return 5[382] ?? 6(382, 7446, 15); - } - - public static string ??() - { - return 5[383] ?? 6(383, 7461, 13); - } - - public static string ??() - { - return 5[384] ?? 6(384, 7474, 44); - } - - public static string ??() - { - return 5[385] ?? 6(385, 7518, 40); - } - - public static string ??() - { - return 5[386] ?? 6(386, 7558, 35); - } - - public static string ??() - { - return 5[387] ?? 6(387, 7593, 39); - } - - public static string ??() - { - return 5[388] ?? 6(388, 7632, 15); - } - - public static string ??() - { - return 5[389] ?? 6(389, 7647, 8); - } - - public static string ??() - { - return 5[390] ?? 6(390, 7655, 4); - } - - public static string ??() - { - return 5[391] ?? 6(391, 7659, 5); - } - - public static string ??() - { - return 5[392] ?? 6(392, 7664, 6); - } - - public static string ??() - { - return 5[393] ?? 6(393, 7670, 19); - } - - public static string ??() - { - return 5[394] ?? 6(394, 7689, 4); - } - - public static string ??() - { - return 5[395] ?? 6(395, 7693, 14); - } - - public static string ??() - { - return 5[396] ?? 6(396, 7707, 66); - } - - public static string ??() - { - return 5[397] ?? 6(397, 7773, 54); - } - - public static string ??() - { - return 5[398] ?? 6(398, 7827, 16); - } - - public static string ??() - { - return 5[399] ?? 6(399, 7843, 8); - } - - public static string ??() - { - return 5[400] ?? 6(400, 7851, 9); - } - - public static string ??() - { - return 5[401] ?? 6(401, 7860, 7); - } - - public static string ??() - { - return 5[402] ?? 6(402, 7867, 14); - } - - public static string ??() - { - return 5[403] ?? 6(403, 7881, 15); - } - - public static string ??() - { - return 5[404] ?? 6(404, 7896, 8); - } - - public static string ??() - { - return 5[405] ?? 6(405, 7904, 7); - } - - public static string ??() - { - return 5[406] ?? 6(406, 7911, 11); - } - - public static string ??() - { - return 5[407] ?? 6(407, 7922, 10); - } - - public static string ??() - { - return 5[408] ?? 6(408, 7932, 10); - } - - public static string ??() - { - return 5[409] ?? 6(409, 7942, 20); - } - - public static string ??() - { - return 5[410] ?? 6(410, 7962, 7); - } - - public static string ??() - { - return 5[411] ?? 6(411, 7969, 3); - } - - public static string ??() - { - return 5[412] ?? 6(412, 7972, 4); - } - - public static string ??() - { - return 5[413] ?? 6(413, 7976, 5); - } - - public static string ??() - { - return 5[414] ?? 6(414, 7981, 10); - } - - public static string ??() - { - return 5[415] ?? 6(415, 7991, 10); - } - - public static string ??() - { - return 5[416] ?? 6(416, 8001, 22); - } - - public static string ??() - { - return 5[417] ?? 6(417, 8023, 19); - } - - public static string ??() - { - return 5[418] ?? 6(418, 8042, 15); - } - - public static string ??() - { - return 5[419] ?? 6(419, 8057, 31); - } - - public static string ??() - { - return 5[420] ?? 6(420, 8088, 12); - } - - public static string ??() - { - return 5[421] ?? 6(421, 8100, 14); - } - - public static string ??() - { - return 5[422] ?? 6(422, 8114, 15); - } - - public static string ??() - { - return 5[423] ?? 6(423, 8129, 13); - } - - public static string ??() - { - return 5[424] ?? 6(424, 8142, 16); - } - - public static string ??() - { - return 5[425] ?? 6(425, 8158, 22); - } - - public static string ??() - { - return 5[426] ?? 6(426, 8180, 18); - } - - public static string ??() - { - return 5[427] ?? 6(427, 8198, 16); - } - - public static string ??() - { - return 5[428] ?? 6(428, 8214, 15); - } - - public static string ??() - { - return 5[429] ?? 6(429, 8229, 17); - } - - public static string ??() - { - return 5[430] ?? 6(430, 8246, 18); - } - - public static string ??() - { - return 5[431] ?? 6(431, 8264, 16); - } - - public static string ??() - { - return 5[432] ?? 6(432, 8280, 10); - } - - public static string ??() - { - return 5[433] ?? 6(433, 8290, 5); - } - - public static string ??() - { - return 5[434] ?? 6(434, 8295, 2); - } - - public static string ??() - { - return 5[435] ?? 6(435, 8297, 8); - } - - public static string ??() - { - return 5[436] ?? 6(436, 8305, 8); - } - - public static string ??() - { - return 5[437] ?? 6(437, 8313, 6); - } - - public static string ??() - { - return 5[438] ?? 6(438, 8319, 3); - } - - public static string ??() - { - return 5[439] ?? 6(439, 8322, 2); - } - - public static string ??() - { - return 5[440] ?? 6(440, 8324, 2); - } - - public static string ??() - { - return 5[441] ?? 6(441, 8326, 2); - } - - public static string ??() - { - return 5[442] ?? 6(442, 8328, 1); - } - - public static string ??() - { - return 5[443] ?? 6(443, 8329, 10); - } - - public static string ??() - { - return 5[444] ?? 6(444, 8339, 14); - } - - public static string ??() - { - return 5[445] ?? 6(445, 8353, 12); - } - - public static string ??() - { - return 5[446] ?? 6(446, 8365, 20); - } - - public static string ??() - { - return 5[447] ?? 6(447, 8385, 13); - } - - public static string ??() - { - return 5[448] ?? 6(448, 8398, 14); - } - - public static string ??() - { - return 5[449] ?? 6(449, 8412, 14); - } - - public static string ??() - { - return 5[450] ?? 6(450, 8426, 20); - } - - public static string ??() - { - return 5[451] ?? 6(451, 8446, 20); - } - - public static string ??() - { - return 5[452] ?? 6(452, 8466, 19); - } - - public static string ??() - { - return 5[453] ?? 6(453, 8485, 15); - } - - public static string ??() - { - return 5[454] ?? 6(454, 8500, 15); - } - - public static string ??() - { - return 5[455] ?? 6(455, 8515, 16); - } - - public static string ??() - { - return 5[456] ?? 6(456, 8531, 22); - } - - public static string ??() - { - return 5[457] ?? 6(457, 8553, 18); - } - - public static string ??() - { - return 5[458] ?? 6(458, 8571, 17); - } - - public static string ??() - { - return 5[459] ?? 6(459, 8588, 17); - } - - public static string ??() - { - return 5[460] ?? 6(460, 8605, 8); - } - - public static string ??() - { - return 5[461] ?? 6(461, 8613, 12); - } - - public static string ??() - { - return 5[462] ?? 6(462, 8625, 25); - } - - public static string ??() - { - return 5[463] ?? 6(463, 8650, 26); - } - - public static string ??() - { - return 5[464] ?? 6(464, 8676, 28); - } - - public static string ??() - { - return 5[465] ?? 6(465, 8704, 37); - } - - public static string ??() - { - return 5[466] ?? 6(466, 8741, 23); - } - - public static string ??() - { - return 5[467] ?? 6(467, 8764, 5); - } - - public static string ??() - { - return 5[468] ?? 6(468, 8769, 14); - } - - public static string ??() - { - return 5[469] ?? 6(469, 8783, 19); - } - - public static string ??() - { - return 5[470] ?? 6(470, 8802, 17); - } - - public static string ??() - { - return 5[471] ?? 6(471, 8819, 12); - } - - public static string ??() - { - return 5[472] ?? 6(472, 8831, 10); - } - - public static string ??() - { - return 5[473] ?? 6(473, 8841, 15); - } - - public static string ??() - { - return 5[474] ?? 6(474, 8856, 12); - } - - public static string ??() - { - return 5[475] ?? 6(475, 8868, 11); - } - - public static string ??() - { - return 5[476] ?? 6(476, 8879, 10); - } - - public static string ??() - { - return 5[477] ?? 6(477, 8889, 9); - } - - public static string ??() - { - return 5[478] ?? 6(478, 8898, 14); - } - - public static string ??() - { - return 5[479] ?? 6(479, 8912, 8); - } - - public static string ??() - { - return 5[480] ?? 6(480, 8920, 4); - } - - public static string ??() - { - return 5[481] ?? 6(481, 8924, 14); - } - - public static string ??() - { - return 5[482] ?? 6(482, 8938, 15); - } - - public static string ??() - { - return 5[483] ?? 6(483, 8953, 14); - } - - public static string ??() - { - return 5[484] ?? 6(484, 8967, 27); - } - - public static string ??() - { - return 5[485] ?? 6(485, 8994, 18); - } - - public static string ??() - { - return 5[486] ?? 6(486, 9012, 40); - } - - public static string ??() - { - return 5[487] ?? 6(487, 9052, 30); - } - - public static string ??() - { - return 5[488] ?? 6(488, 9082, 39); - } - - public static string ??() - { - return 5[489] ?? 6(489, 9121, 17); - } - - public static string ??() - { - return 5[490] ?? 6(490, 9138, 24); - } - - public static string ??() - { - return 5[491] ?? 6(491, 9162, 10); - } - - public static string ??() - { - return 5[492] ?? 6(492, 9172, 1); - } - - public static string ??() - { - return 5[493] ?? 6(493, 9173, 2); - } - - public static string ??() - { - return 5[494] ?? 6(494, 9175, 3); - } - - public static string ??() - { - return 5[495] ?? 6(495, 9178, 9); - } - - public static string ??() - { - return 5[496] ?? 6(496, 9187, 8); - } - - public static string ??() - { - return 5[497] ?? 6(497, 9195, 4); - } - - public static string ??() - { - return 5[498] ?? 6(498, 9199, 32); - } - - public static string ??() - { - return 5[499] ?? 6(499, 9231, 3); - } - - public static string ??() - { - return 5[500] ?? 6(500, 9234, 5); - } - - public static string ??() - { - return 5[501] ?? 6(501, 9239, 7); - } - - public static string ??() - { - return 5[502] ?? 6(502, 9246, 7); - } - - public static string ??() - { - return 5[503] ?? 6(503, 9253, 15); - } - - public static string ??() - { - return 5[504] ?? 6(504, 9268, 12); - } - - public static string ??() - { - return 5[505] ?? 6(505, 9280, 5); - } - - public static string ??() - { - return 5[506] ?? 6(506, 9285, 1); - } - - public static string ??() - { - return 5[507] ?? 6(507, 9286, 7); - } - - public static string ??() - { - return 5[508] ?? 6(508, 9293, 12); - } - - public static string ??() - { - return 5[509] ?? 6(509, 9305, 10); - } - - public static string ??() - { - return 5[510] ?? 6(510, 9315, 15); - } - - public static string ??() - { - return 5[511] ?? 6(511, 9330, 15); - } - - public static string ??() - { - return 5[512] ?? 6(512, 9345, 22); - } - - public static string ??() - { - return 5[513] ?? 6(513, 9367, 2); - } - - public static string ??() - { - return 5[514] ?? 6(514, 9369, 6); - } - - public static string ??() - { - return 5[515] ?? 6(515, 9375, 3); - } - - public static string ??() - { - return 5[516] ?? 6(516, 9378, 11); - } - - public static string ??() - { - return 5[517] ?? 6(517, 9389, 18); - } - - public static string ??() - { - return 5[518] ?? 6(518, 9407, 7); - } - - public static string ??() - { - return 5[519] ?? 6(519, 9414, 33); - } - - public static string ??() - { - return 5[520] ?? 6(520, 9447, 8); - } - - public static string ??() - { - return 5[521] ?? 6(521, 9455, 5); - } - - public static string ??() - { - return 5[522] ?? 6(522, 9460, 7); - } - - public static string ??() - { - return 5[523] ?? 6(523, 9467, 7); - } - - public static string ??() - { - return 5[524] ?? 6(524, 9474, 7); - } - - public static string ??() - { - return 5[525] ?? 6(525, 9481, 17); - } - - public static string ??() - { - return 5[526] ?? 6(526, 9498, 7); - } - - public static string ??() - { - return 5[527] ?? 6(527, 9505, 7); - } - - public static string ??() - { - return 5[528] ?? 6(528, 9512, 7); - } - - public static string ??() - { - return 5[529] ?? 6(529, 9519, 7); - } - - public static string ??() - { - return 5[530] ?? 6(530, 9526, 17); - } - - public static string ??() - { - return 5[531] ?? 6(531, 9543, 7); - } - - public static string ??() - { - return 5[532] ?? 6(532, 9550, 7); - } - - public static string ??() - { - return 5[533] ?? 6(533, 9557, 7); - } - - public static string ??() - { - return 5[534] ?? 6(534, 9564, 7); - } - - public static string ??() - { - return 5[535] ?? 6(535, 9571, 7); - } - - public static string ??() - { - return 5[536] ?? 6(536, 9578, 7); - } - - public static string ??() - { - return 5[537] ?? 6(537, 9585, 7); - } - - public static string ??() - { - return 5[538] ?? 6(538, 9592, 7); - } - - public static string ??() - { - return 5[539] ?? 6(539, 9599, 7); - } - - public static string ??() - { - return 5[540] ?? 6(540, 9606, 7); - } - - public static string ??() - { - return 5[541] ?? 6(541, 9613, 7); - } - - public static string ??() - { - return 5[542] ?? 6(542, 9620, 7); - } - - public static string ??() - { - return 5[543] ?? 6(543, 9627, 7); - } - - public static string ??() - { - return 5[544] ?? 6(544, 9634, 7); - } - - public static string ??() - { - return 5[545] ?? 6(545, 9641, 7); - } - - public static string ??() - { - return 5[546] ?? 6(546, 9648, 7); - } - - public static string ??() - { - return 5[547] ?? 6(547, 9655, 7); - } - - public static string ??() - { - return 5[548] ?? 6(548, 9662, 7); - } - - public static string ??() - { - return 5[549] ?? 6(549, 9669, 7); - } - - public static string ??() - { - return 5[550] ?? 6(550, 9676, 7); - } - - public static string ??() - { - return 5[551] ?? 6(551, 9683, 7); - } - - public static string ??() - { - return 5[552] ?? 6(552, 9690, 7); - } - - public static string ??() - { - return 5[553] ?? 6(553, 9697, 7); - } - - public static string ??() - { - return 5[554] ?? 6(554, 9704, 7); - } - - public static string ??() - { - return 5[555] ?? 6(555, 9711, 7); - } - - public static string ??() - { - return 5[556] ?? 6(556, 9718, 7); - } - - public static string ??() - { - return 5[557] ?? 6(557, 9725, 17); - } - - public static string ??() - { - return 5[558] ?? 6(558, 9742, 7); - } - - public static string ??() - { - return 5[559] ?? 6(559, 9749, 7); - } - - public static string ??() - { - return 5[560] ?? 6(560, 9756, 7); - } - - public static string ??() - { - return 5[561] ?? 6(561, 9763, 7); - } - - public static string ??() - { - return 5[562] ?? 6(562, 9770, 7); - } - - public static string ??() - { - return 5[563] ?? 6(563, 9777, 7); - } - - public static string ??() - { - return 5[564] ?? 6(564, 9784, 7); - } - - public static string ??() - { - return 5[565] ?? 6(565, 9791, 7); - } - - public static string ??() - { - return 5[566] ?? 6(566, 9798, 7); - } - - public static string ??() - { - return 5[567] ?? 6(567, 9805, 7); - } - - public static string ??() - { - return 5[568] ?? 6(568, 9812, 7); - } - - public static string ??() - { - return 5[569] ?? 6(569, 9819, 7); - } - - public static string ??() - { - return 5[570] ?? 6(570, 9826, 7); - } - - public static string ??() - { - return 5[571] ?? 6(571, 9833, 7); - } - - public static string ??() - { - return 5[572] ?? 6(572, 9840, 7); - } - - public static string ??() - { - return 5[573] ?? 6(573, 9847, 7); - } - - public static string ??() - { - return 5[574] ?? 6(574, 9854, 7); - } - - public static string ??() - { - return 5[575] ?? 6(575, 9861, 17); - } - - public static string ??() - { - return 5[576] ?? 6(576, 9878, 7); - } - - public static string ??() - { - return 5[577] ?? 6(577, 9885, 7); - } - - public static string ??() - { - return 5[578] ?? 6(578, 9892, 7); - } - - public static string ??() - { - return 5[579] ?? 6(579, 9899, 7); - } - - public static string ??() - { - return 5[580] ?? 6(580, 9906, 7); - } - - public static string ??() - { - return 5[581] ?? 6(581, 9913, 7); - } - - public static string ??() - { - return 5[582] ?? 6(582, 9920, 7); - } - - public static string ??() - { - return 5[583] ?? 6(583, 9927, 7); - } - - public static string ??() - { - return 5[584] ?? 6(584, 9934, 7); - } - - public static string ??() - { - return 5[585] ?? 6(585, 9941, 7); - } - - public static string ??() - { - return 5[586] ?? 6(586, 9948, 7); - } - - public static string ??() - { - return 5[587] ?? 6(587, 9955, 7); - } - - public static string ??() - { - return 5[588] ?? 6(588, 9962, 7); - } - - public static string ??() - { - return 5[589] ?? 6(589, 9969, 7); - } - - public static string ??() - { - return 5[590] ?? 6(590, 9976, 7); - } - - public static string ??() - { - return 5[591] ?? 6(591, 9983, 17); - } - - public static string ??() - { - return 5[592] ?? 6(592, 10000, 7); - } - - public static string ??() - { - return 5[593] ?? 6(593, 10007, 7); - } - - public static string ??() - { - return 5[594] ?? 6(594, 10014, 7); - } - - public static string ??() - { - return 5[595] ?? 6(595, 10021, 7); - } - - public static string ??() - { - return 5[596] ?? 6(596, 10028, 7); - } - - public static string ??() - { - return 5[597] ?? 6(597, 10035, 7); - } - - public static string ??() - { - return 5[598] ?? 6(598, 10042, 7); - } - - public static string ??() - { - return 5[599] ?? 6(599, 10049, 7); - } - - public static string ??() - { - return 5[600] ?? 6(600, 10056, 17); - } - - public static string ??() - { - return 5[601] ?? 6(601, 10073, 7); - } - - public static string ??() - { - return 5[602] ?? 6(602, 10080, 7); - } - - public static string ??() - { - return 5[603] ?? 6(603, 10087, 7); - } - - public static string ??() - { - return 5[604] ?? 6(604, 10094, 7); - } - - public static string ??() - { - return 5[605] ?? 6(605, 10101, 7); - } - - public static string ??() - { - return 5[606] ?? 6(606, 10108, 7); - } - - public static string ??() - { - return 5[607] ?? 6(607, 10115, 7); - } - - public static string ??() - { - return 5[608] ?? 6(608, 10122, 7); - } - - public static string ??() - { - return 5[609] ?? 6(609, 10129, 7); - } - - public static string ??() - { - return 5[610] ?? 6(610, 10136, 7); - } - - public static string ??() - { - return 5[611] ?? 6(611, 10143, 7); - } - - public static string ??() - { - return 5[612] ?? 6(612, 10150, 7); - } - - public static string ??() - { - return 5[613] ?? 6(613, 10157, 7); - } - - public static string ??() - { - return 5[614] ?? 6(614, 10164, 7); - } - - public static string ??() - { - return 5[615] ?? 6(615, 10171, 8); - } - - public static string ??() - { - return 5[616] ?? 6(616, 10179, 8); - } - - public static string ??() - { - return 5[617] ?? 6(617, 10187, 8); - } - - public static string ??() - { - return 5[618] ?? 6(618, 10195, 8); - } - - public static string ??() - { - return 5[619] ?? 6(619, 10203, 8); - } - - public static string ??() - { - return 5[620] ?? 6(620, 10211, 8); - } - - public static string ??() - { - return 5[621] ?? 6(621, 10219, 8); - } - - public static string ??() - { - return 5[622] ?? 6(622, 10227, 8); - } - - public static string ??() - { - return 5[623] ?? 6(623, 10235, 8); - } - - public static string ??() - { - return 5[624] ?? 6(624, 10243, 11); - } - - public static string ??() - { - return 5[625] ?? 6(625, 10254, 10); - } - - public static string ??() - { - return 5[626] ?? 6(626, 10264, 10); - } - - public static string ??() - { - return 5[627] ?? 6(627, 10274, 10); - } - - public static string ??() - { - return 5[628] ?? 6(628, 10284, 10); - } - - public static string ??() - { - return 5[629] ?? 6(629, 10294, 10); - } - - public static string ??() - { - return 5[630] ?? 6(630, 10304, 10); - } - - public static string ??() - { - return 5[631] ?? 6(631, 10314, 10); - } - - public static string ??() - { - return 5[632] ?? 6(632, 10324, 10); - } - - public static string ??() - { - return 5[633] ?? 6(633, 10334, 10); - } - - public static string ??() - { - return 5[634] ?? 6(634, 10344, 7); - } - - public static string ??() - { - return 5[635] ?? 6(635, 10351, 7); - } - - public static string ??() - { - return 5[636] ?? 6(636, 10358, 7); - } - - public static string ??() - { - return 5[637] ?? 6(637, 10365, 7); - } - - public static string ??() - { - return 5[638] ?? 6(638, 10372, 7); - } - - public static string ??() - { - return 5[639] ?? 6(639, 10379, 7); - } - - public static string ??() - { - return 5[640] ?? 6(640, 10386, 7); - } - - public static string ??() - { - return 5[641] ?? 6(641, 10393, 6); - } - - public static string ??() - { - return 5[642] ?? 6(642, 10399, 13); - } - - public static string ??() - { - return 5[643] ?? 6(643, 10412, 9); - } - - public static string ??() - { - return 5[644] ?? 6(644, 10421, 6); - } - - public static string ??() - { - return 5[645] ?? 6(645, 10427, 5); - } - - public static string ??() - { - return 5[646] ?? 6(646, 10432, 9); - } - - public static string ??() - { - return 5[647] ?? 6(647, 10441, 7); - } - - public static string ??() - { - return 5[648] ?? 6(648, 10448, 5); - } - - public static string ??() - { - return 5[649] ?? 6(649, 10453, 9); - } - - public static string ??() - { - return 5[650] ?? 6(650, 10462, 5); - } - - public static string ??() - { - return 5[651] ?? 6(651, 10467, 10); - } - - public static string ??() - { - return 5[652] ?? 6(652, 10477, 17); - } - - public static string ??() - { - return 5[653] ?? 6(653, 10494, 20); - } - - public static string ??() - { - return 5[654] ?? 6(654, 10514, 5); - } - - public static string ??() - { - return 5[655] ?? 6(655, 10519, 12); - } - - public static string ??() - { - return 5[656] ?? 6(656, 10531, 12); - } - - public static string ??() - { - return 5[657] ?? 6(657, 10543, 8); - } - - public static string ??() - { - return 5[658] ?? 6(658, 10551, 5); - } - - public static string ??() - { - return 5[659] ?? 6(659, 10556, 6); - } - - public static string ??() - { - return 5[660] ?? 6(660, 10562, 9); - } - - public static string ??() - { - return 5[661] ?? 6(661, 10571, 19); - } - - public static string ??() - { - return 5[662] ?? 6(662, 10590, 6); - } - - public static string ??() - { - return 5[663] ?? 6(663, 10596, 5); - } - - public static string ??() - { - return 5[664] ?? 6(664, 10601, 14); - } - - public static string ??() - { - return 5[665] ?? 6(665, 10615, 12); - } - - public static string ??() - { - return 5[666] ?? 6(666, 10627, 8); - } - - public static string ??() - { - return 5[667] ?? 6(667, 10635, 6); - } - - public static string ??() - { - return 5[668] ?? 6(668, 10641, 5); - } - - public static string ??() - { - return 5[669] ?? 6(669, 10646, 5); - } - - public static string ??() - { - return 5[670] ?? 6(670, 10651, 8); - } - - public static string ??() - { - return 5[671] ?? 6(671, 10659, 12); - } - - public static string ??() - { - return 5[672] ?? 6(672, 10671, 5); - } - - public static string ??() - { - return 5[673] ?? 6(673, 10676, 6); - } - - public static string ??() - { - return 5[674] ?? 6(674, 10682, 11); - } - - public static string ??() - { - return 5[675] ?? 6(675, 10693, 4); - } - - public static string ??() - { - return 5[676] ?? 6(676, 10697, 10); - } - - public static string ??() - { - return 5[677] ?? 6(677, 10707, 12); - } - - public static string ??() - { - return 5[678] ?? 6(678, 10719, 10); - } - - public static string ??() - { - return 5[679] ?? 6(679, 10729, 17); - } - - public static string ??() - { - return 5[680] ?? 6(680, 10746, 11); - } - - public static string ??() - { - return 5[681] ?? 6(681, 10757, 18); - } - - public static string ??() - { - return 5[682] ?? 6(682, 10775, 13); - } - - public static string ??() - { - return 5[683] ?? 6(683, 10788, 14); - } - - public static string ??() - { - return 5[684] ?? 6(684, 10802, 21); - } - - public static string ??() - { - return 5[685] ?? 6(685, 10823, 4); - } - - public static string ??() - { - return 5[686] ?? 6(686, 10827, 15); - } - - public static string ??() - { - return 5[687] ?? 6(687, 10842, 4); - } - - public static string ??() - { - return 5[688] ?? 6(688, 10846, 4); - } - - public static string ??() - { - return 5[689] ?? 6(689, 10850, 11); - } - - public static string ??() - { - return 5[690] ?? 6(690, 10861, 16); - } - - public static string ??() - { - return 5[691] ?? 6(691, 10877, 21); - } - - public static string ??() - { - return 5[692] ?? 6(692, 10898, 6); - } - - public static string ??() - { - return 5[693] ?? 6(693, 10904, 13); - } - - public static string ??() - { - return 5[694] ?? 6(694, 10917, 18); - } - - public static string ??() - { - return 5[695] ?? 6(695, 10935, 4); - } - - public static string ??() - { - return 5[696] ?? 6(696, 10939, 11); - } - - public static string ??() - { - return 5[697] ?? 6(697, 10950, 9); - } - - public static string ??() - { - return 5[698] ?? 6(698, 10959, 8); - } - - public static string ??() - { - return 5[699] ?? 6(699, 10967, 8); - } - - public static string ??() - { - return 5[700] ?? 6(700, 10975, 5); - } - - public static string ??() - { - return 5[701] ?? 6(701, 10980, 15); - } - - public static string ??() - { - return 5[702] ?? 6(702, 10995, 15); - } - - public static string ??() - { - return 5[703] ?? 6(703, 11010, 25); - } - - public static string ??() - { - return 5[704] ?? 6(704, 11035, 21); - } - - public static string ??() - { - return 5[705] ?? 6(705, 11056, 5); - } - - public static string ??() - { - return 5[706] ?? 6(706, 11061, 5); - } - - public static string ??() - { - return 5[707] ?? 6(707, 11066, 14); - } - - public static string ??() - { - return 5[708] ?? 6(708, 11080, 5); - } - - public static string ??() - { - return 5[709] ?? 6(709, 11085, 5); - } - - public static string ??() - { - return 5[710] ?? 6(710, 11090, 8); - } - - public static string ??() - { - return 5[711] ?? 6(711, 11098, 7); - } - - public static string ??() - { - return 5[712] ?? 6(712, 11105, 4); - } - - public static string ??() - { - return 5[713] ?? 6(713, 11109, 5); - } - - public static string ??() - { - return 5[714] ?? 6(714, 11114, 7); - } - - public static string ??() - { - return 5[715] ?? 6(715, 11121, 6); - } - - public static string ??() - { - return 5[716] ?? 6(716, 11127, 13); - } - - public static string ??() - { - return 5[717] ?? 6(717, 11140, 12); - } - - public static string ??() - { - return 5[718] ?? 6(718, 11152, 12); - } - - public static string ??() - { - return 5[719] ?? 6(719, 11164, 9); - } - - public static string ??() - { - return 5[720] ?? 6(720, 11173, 8); - } - - public static string ??() - { - return 5[721] ?? 6(721, 11181, 7); - } - - public static string ??() - { - return 5[722] ?? 6(722, 11188, 7); - } - - public static string ??() - { - return 5[723] ?? 6(723, 11195, 7); - } - - public static string ??() - { - return 5[724] ?? 6(724, 11202, 7); - } - - public static string ??() - { - return 5[725] ?? 6(725, 11209, 7); - } - - public static string ??() - { - return 5[726] ?? 6(726, 11216, 37); - } - - public static string ??() - { - return 5[727] ?? 6(727, 11253, 33); - } - - public static string ??() - { - return 5[728] ?? 6(728, 11286, 34); - } - - public static string ??() - { - return 5[729] ?? 6(729, 11320, 44); - } - - public static string ??() - { - return 5[730] ?? 6(730, 11364, 38); - } - - public static string ??() - { - return 5[731] ?? 6(731, 11402, 40); - } - - public static string ??() - { - return 5[732] ?? 6(732, 11442, 38); - } - - public static string ??() - { - return 5[733] ?? 6(733, 11480, 31); - } - - public static string ??() - { - return 5[734] ?? 6(734, 11511, 41); - } - - public static string ??() - { - return 5[735] ?? 6(735, 11552, 31); - } - - public static string ??() - { - return 5[736] ?? 6(736, 11583, 36); - } - - public static string ??() - { - return 5[737] ?? 6(737, 11619, 32); - } - - public static string ??() - { - return 5[738] ?? 6(738, 11651, 36); - } - - public static string ??() - { - return 5[739] ?? 6(739, 11687, 32); - } - - public static string ??() - { - return 5[740] ?? 6(740, 11719, 28); - } - - public static string ??() - { - return 5[741] ?? 6(741, 11747, 34); - } - - public static string ??() - { - return 5[742] ?? 6(742, 11781, 26); - } - - public static string ??() - { - return 5[743] ?? 6(743, 11807, 24); - } - - public static string ??() - { - return 5[744] ?? 6(744, 11831, 20); - } - - public static string ??() - { - return 5[745] ?? 6(745, 11851, 21); - } - - public static string ??() - { - return 5[746] ?? 6(746, 11872, 21); - } - - public static string ??() - { - return 5[747] ?? 6(747, 11893, 22); - } - - public static string ??() - { - return 5[748] ?? 6(748, 11915, 25); - } - - public static string ??() - { - return 5[749] ?? 6(749, 11940, 25); - } - - public static string ??() - { - return 5[750] ?? 6(750, 11965, 21); - } - - public static string ??() - { - return 5[751] ?? 6(751, 11986, 21); - } - - public static string ??() - { - return 5[752] ?? 6(752, 12007, 24); - } - - public static string ??() - { - return 5[753] ?? 6(753, 12031, 27); - } - - public static string ??() - { - return 5[754] ?? 6(754, 12058, 21); - } - - public static string ??() - { - return 5[755] ?? 6(755, 12079, 21); - } - - public static string ??() - { - return 5[756] ?? 6(756, 12100, 22); - } - - public static string ??() - { - return 5[757] ?? 6(757, 12122, 22); - } - - public static string ??() - { - return 5[758] ?? 6(758, 12144, 25); - } - - public static string ??() - { - return 5[759] ?? 6(759, 12169, 21); - } - - public static string ??() - { - return 5[760] ?? 6(760, 12190, 18); - } - - public static string ??() - { - return 5[761] ?? 6(761, 12208, 28); - } - - public static string ??() - { - return 5[762] ?? 6(762, 12236, 27); - } - - public static string ??() - { - return 5[763] ?? 6(763, 12263, 35); - } - - public static string ??() - { - return 5[764] ?? 6(764, 12298, 33); - } - - public static string ??() - { - return 5[765] ?? 6(765, 12331, 29); - } - - public static string ??() - { - return 5[766] ?? 6(766, 12360, 30); - } - - public static string ??() - { - return 5[767] ?? 6(767, 12390, 30); - } - - public static string ??() - { - return 5[768] ?? 6(768, 12420, 34); - } - - public static string ??() - { - return 5[769] ?? 6(769, 12454, 34); - } - - public static string ??() - { - return 5[770] ?? 6(770, 12488, 30); - } - - public static string ??() - { - return 5[771] ?? 6(771, 12518, 30); - } - - public static string ??() - { - return 5[772] ?? 6(772, 12548, 33); - } - - public static string ??() - { - return 5[773] ?? 6(773, 12581, 36); - } - - public static string ??() - { - return 5[774] ?? 6(774, 12617, 30); - } - - public static string ??() - { - return 5[775] ?? 6(775, 12647, 31); - } - - public static string ??() - { - return 5[776] ?? 6(776, 12678, 34); - } - - public static string ??() - { - return 5[777] ?? 6(777, 12712, 30); - } - - public static string ??() - { - return 5[778] ?? 6(778, 12742, 27); - } - - public static string ??() - { - return 5[779] ?? 6(779, 12769, 37); - } - - public static string ??() - { - return 5[780] ?? 6(780, 12806, 36); - } - - public static string ??() - { - return 5[781] ?? 6(781, 12842, 33); - } - - public static string ??() - { - return 5[782] ?? 6(782, 12875, 33); - } - - public static string ??() - { - return 5[783] ?? 6(783, 12908, 38); - } - - public static string ??() - { - return 5[784] ?? 6(784, 12946, 34); - } - - public static string ??() - { - return 5[785] ?? 6(785, 12980, 39); - } - - public static string ??() - { - return 5[786] ?? 6(786, 13019, 35); - } - - public static string ??() - { - return 5[787] ?? 6(787, 13054, 39); - } - - public static string ??() - { - return 5[788] ?? 6(788, 13093, 32); - } - - public static string ??() - { - return 5[789] ?? 6(789, 13125, 32); - } - - public static string ??() - { - return 5[790] ?? 6(790, 13157, 37); - } - - public static string ??() - { - return 5[791] ?? 6(791, 13194, 33); - } - - public static string ??() - { - return 5[792] ?? 6(792, 13227, 29); - } - - public static string ??() - { - return 5[793] ?? 6(793, 13256, 29); - } - - public static string ??() - { - return 5[794] ?? 6(794, 13285, 25); - } - - public static string ??() - { - return 5[795] ?? 6(795, 13310, 35); - } - - public static string ??() - { - return 5[796] ?? 6(796, 13345, 26); - } - - public static string ??() - { - return 5[797] ?? 6(797, 13371, 26); - } - - public static string ??() - { - return 5[798] ?? 6(798, 13397, 26); - } - - public static string ??() - { - return 5[799] ?? 6(799, 13423, 30); - } - - public static string ??() - { - return 5[800] ?? 6(800, 13453, 26); - } - - public static string ??() - { - return 5[801] ?? 6(801, 13479, 30); - } - - public static string ??() - { - return 5[802] ?? 6(802, 13509, 32); - } - - public static string ??() - { - return 5[803] ?? 6(803, 13541, 26); - } - - public static string ??() - { - return 5[804] ?? 6(804, 13567, 36); - } - - public static string ??() - { - return 5[805] ?? 6(805, 13603, 26); - } - - public static string ??() - { - return 5[806] ?? 6(806, 13629, 29); - } - - public static string ??() - { - return 5[807] ?? 6(807, 13658, 26); - } - - public static string ??() - { - return 5[808] ?? 6(808, 13684, 26); - } - - public static string ??() - { - return 5[809] ?? 6(809, 13710, 27); - } - - public static string ??() - { - return 5[810] ?? 6(810, 13737, 33); - } - - public static string ??() - { - return 5[811] ?? 6(811, 13770, 27); - } - - public static string ??() - { - return 5[812] ?? 6(812, 13797, 30); - } - - public static string ??() - { - return 5[813] ?? 6(813, 13827, 23); - } - - public static string ??() - { - return 5[814] ?? 6(814, 13850, 26); - } - - public static string ??() - { - return 5[815] ?? 6(815, 13876, 32); - } - - public static string ??() - { - return 5[816] ?? 6(816, 13908, 35); - } - - public static string ??() - { - return 5[817] ?? 6(817, 13943, 21); - } - - public static string ??() - { - return 5[818] ?? 6(818, 13964, 23); - } - - public static string ??() - { - return 5[819] ?? 6(819, 13987, 26); - } - - public static string ??() - { - return 5[820] ?? 6(820, 14013, 24); - } - - public static string ??() - { - return 5[821] ?? 6(821, 14037, 20); - } - - public static string ??() - { - return 5[822] ?? 6(822, 14057, 13); - } - - public static string ??() - { - return 5[823] ?? 6(823, 14070, 22); - } - - public static string ??() - { - return 5[824] ?? 6(824, 14092, 25); - } - - public static string ??() - { - return 5[825] ?? 6(825, 14117, 21); - } - - public static string ??() - { - return 5[826] ?? 6(826, 14138, 27); - } - - public static string ??() - { - return 5[827] ?? 6(827, 14165, 25); - } - - public static string ??() - { - return 5[828] ?? 6(828, 14190, 15); - } - - public static string ??() - { - return 5[829] ?? 6(829, 14205, 28); - } - - public static string ??() - { - return 5[830] ?? 6(830, 14233, 26); - } - - public static string ??() - { - return 5[831] ?? 6(831, 14259, 16); - } - - public static string ??() - { - return 5[832] ?? 6(832, 14275, 15); - } - - public static string ??() - { - return 5[833] ?? 6(833, 14290, 16); - } - - public static string ??() - { - return 5[834] ?? 6(834, 14306, 27); - } - - public static string ??() - { - return 5[835] ?? 6(835, 14333, 23); - } - - public static string ??() - { - return 5[836] ?? 6(836, 14356, 29); - } - - public static string ??() - { - return 5[837] ?? 6(837, 14385, 27); - } - - public static string ??() - { - return 5[838] ?? 6(838, 14412, 11); - } - - public static string ??() - { - return 5[839] ?? 6(839, 14423, 9); - } - - public static string ??() - { - return 5[840] ?? 6(840, 14432, 14); - } - - public static string ??() - { - return 5[841] ?? 6(841, 14446, 13); - } - - public static string ??() - { - return 5[842] ?? 6(842, 14459, 41); - } - - public static string ??() - { - return 5[843] ?? 6(843, 14500, 37); - } - - public static string ??() - { - return 5[844] ?? 6(844, 14537, 40); - } - - public static string ??() - { - return 5[845] ?? 6(845, 14577, 12); - } - - public static string ??() - { - return 5[846] ?? 6(846, 14589, 38); - } - - public static string ??() - { - return 5[847] ?? 6(847, 14627, 34); - } - - public static string ??() - { - return 5[848] ?? 6(848, 14661, 45); - } - - public static string ??() - { - return 5[849] ?? 6(849, 14706, 36); - } - - public static string ??() - { - return 5[850] ?? 6(850, 14742, 32); - } - - public static string ??() - { - return 5[851] ?? 6(851, 14774, 33); - } - - public static string ??() - { - return 5[852] ?? 6(852, 14807, 32); - } - - public static string ??() - { - return 5[853] ?? 6(853, 14839, 37); - } - - public static string ??() - { - return 5[854] ?? 6(854, 14876, 42); - } - - public static string ??() - { - return 5[855] ?? 6(855, 14918, 42); - } - - public static string ??() - { - return 5[856] ?? 6(856, 14960, 46); - } - - public static string ??() - { - return 5[857] ?? 6(857, 15006, 35); - } - - public static string ??() - { - return 5[858] ?? 6(858, 15041, 38); - } - - public static string ??() - { - return 5[859] ?? 6(859, 15079, 39); - } - - public static string ??() - { - return 5[860] ?? 6(860, 15118, 42); - } - - public static string ??() - { - return 5[861] ?? 6(861, 15160, 36); - } - - public static string ??() - { - return 5[862] ?? 6(862, 15196, 46); - } - - public static string ??() - { - return 5[863] ?? 6(863, 15242, 34); - } - - public static string ??() - { - return 5[864] ?? 6(864, 15276, 23); - } - - public static string ??() - { - return 5[865] ?? 6(865, 15299, 40); - } - - public static string ??() - { - return 5[866] ?? 6(866, 15339, 27); - } - - public static string ??() - { - return 5[867] ?? 6(867, 15366, 33); - } - - public static string ??() - { - return 5[868] ?? 6(868, 15399, 33); - } - - public static string ??() - { - return 5[869] ?? 6(869, 15432, 41); - } - - public static string ??() - { - return 5[870] ?? 6(870, 15473, 22); - } - - public static string ??() - { - return 5[871] ?? 6(871, 15495, 15); - } - - public static string ??() - { - return 5[872] ?? 6(872, 15510, 39); - } - - public static string ??() - { - return 5[873] ?? 6(873, 15549, 34); - } - - public static string ??() - { - return 5[874] ?? 6(874, 15583, 34); - } - - public static string ??() - { - return 5[875] ?? 6(875, 15617, 21); - } - - public static string ??() - { - return 5[876] ?? 6(876, 15638, 37); - } - - public static string ??() - { - return 5[877] ?? 6(877, 15675, 40); - } - - public static string ??() - { - return 5[878] ?? 6(878, 15715, 35); - } - - public static string ??() - { - return 5[879] ?? 6(879, 15750, 33); - } - - public static string ??() - { - return 5[880] ?? 6(880, 15783, 38); - } - - public static string ??() - { - return 5[881] ?? 6(881, 15821, 36); - } - - public static string ??() - { - return 5[882] ?? 6(882, 15857, 41); - } - - public static string ??() - { - return 5[883] ?? 6(883, 15898, 42); - } - - public static string ??() - { - return 5[884] ?? 6(884, 15940, 38); - } - - public static string ??() - { - return 5[885] ?? 6(885, 15978, 43); - } - - public static string ??() - { - return 5[886] ?? 6(886, 16021, 7); - } - - public static string ??() - { - return 5[887] ?? 6(887, 16028, 17); - } - - public static string ??() - { - return 5[888] ?? 6(888, 16045, 16); - } - - public static string ??() - { - return 5[889] ?? 6(889, 16061, 9); - } - - public static string ??() - { - return 5[890] ?? 6(890, 16070, 21); - } - - public static string ??() - { - return 5[891] ?? 6(891, 16091, 26); - } - - public static string ??() - { - return 5[892] ?? 6(892, 16117, 31); - } - - public static string ??() - { - return 5[893] ?? 6(893, 16148, 11); - } - - public static string ??() - { - return 5[894] ?? 6(894, 16159, 23); - } - - public static string ??() - { - return 5[895] ?? 6(895, 16182, 28); - } - - public static string ??() - { - return 5[896] ?? 6(896, 16210, 16); - } - - public static string ??() - { - return 5[897] ?? 6(897, 16226, 23); - } - - public static string ??() - { - return 5[898] ?? 6(898, 16249, 23); - } - - public static string ??() - { - return 5[899] ?? 6(899, 16272, 22); - } - - public static string ??() - { - return 5[900] ?? 6(900, 16294, 20); - } - - public static string ??() - { - return 5[901] ?? 6(901, 16314, 17); - } - - public static string ??() - { - return 5[902] ?? 6(902, 16331, 25); - } - - public static string ??() - { - return 5[903] ?? 6(903, 16356, 25); - } - - public static string ??() - { - return 5[904] ?? 6(904, 16381, 35); - } - - public static string ??() - { - return 5[905] ?? 6(905, 16416, 31); - } - - public static string ??() - { - return 5[906] ?? 6(906, 16447, 17); - } - - public static string ??() - { - return 5[907] ?? 6(907, 16464, 17); - } - - public static string ??() - { - return 5[908] ?? 6(908, 16481, 15); - } - - public static string ??() - { - return 5[909] ?? 6(909, 16496, 17); - } - - public static string ??() - { - return 5[910] ?? 6(910, 16513, 15); - } - - public static string ??() - { - return 5[911] ?? 6(911, 16528, 25); - } - - public static string ??() - { - return 5[912] ?? 6(912, 16553, 24); - } - - public static string ??() - { - return 5[913] ?? 6(913, 16577, 9); - } - - public static string ??() - { - return 5[914] ?? 6(914, 16586, 26); - } - - public static string ??() - { - return 5[915] ?? 6(915, 16612, 19); - } - - public static string ??() - { - return 5[916] ?? 6(916, 16631, 16); - } - - public static string ??() - { - return 5[917] ?? 6(917, 16647, 31); - } - - public static string ??() - { - return 5[918] ?? 6(918, 16678, 31); - } - - public static string ??() - { - return 5[919] ?? 6(919, 16709, 32); - } - - public static string ??() - { - return 5[920] ?? 6(920, 16741, 22); - } - - public static string ??() - { - return 5[921] ?? 6(921, 16763, 15); - } - - public static string ??() - { - return 5[922] ?? 6(922, 16778, 20); - } - - public static string ??() - { - return 5[923] ?? 6(923, 16798, 21); - } - - public static string ??() - { - return 5[924] ?? 6(924, 16819, 20); - } - - public static string ??() - { - return 5[925] ?? 6(925, 16839, 19); - } - - public static string ??() - { - return 5[926] ?? 6(926, 16858, 20); - } - - public static string ??() - { - return 5[927] ?? 6(927, 16878, 28); - } - - public static string ??() - { - return 5[928] ?? 6(928, 16906, 32); - } - - public static string ??() - { - return 5[929] ?? 6(929, 16938, 6); - } - - public static string ??() - { - return 5[930] ?? 6(930, 16944, 64); - } - - public static string ??() - { - return 5[931] ?? 6(931, 17008, 15); - } - - public static string ??() - { - return 5[932] ?? 6(932, 17023, 23); - } - - public static string ??() - { - return 5[933] ?? 6(933, 17046, 17); - } - - public static string ??() - { - return 5[934] ?? 6(934, 17063, 54); - } - - public static string ??() - { - return 5[935] ?? 6(935, 17117, 56); - } - - public static string ??() - { - return 5[936] ?? 6(936, 17173, 36); - } - - public static string ??() - { - return 5[937] ?? 6(937, 17209, 37); - } - - public static string ??() - { - return 5[938] ?? 6(938, 17246, 39); - } - - public static string ??() - { - return 5[939] ?? 6(939, 17285, 5); - } - - public static string ??() - { - return 5[940] ?? 6(940, 17290, 9); - } - - public static string ??() - { - return 5[941] ?? 6(941, 17299, 10); - } - - public static string ??() - { - return 5[942] ?? 6(942, 17309, 13); - } - - public static string ??() - { - return 5[943] ?? 6(943, 17322, 17); - } - - public static string ??() - { - return 5[944] ?? 6(944, 17339, 20); - } - - public static string ??() - { - return 5[945] ?? 6(945, 17359, 32); - } - - public static string ??() - { - return 5[946] ?? 6(946, 17391, 3); - } - - public static string ??() - { - return 5[947] ?? 6(947, 17394, 51); - } - - public static string ??() - { - return 5[948] ?? 6(948, 17445, 1); - } - - public static string ??() - { - return 5[949] ?? 6(949, 17446, 30); - } - - public static string ??() - { - return 5[950] ?? 6(950, 17476, 52); - } - - public static string ??() - { - return 5[951] ?? 6(951, 17528, 25); - } - - public static string ??() - { - return 5[952] ?? 6(952, 17553, 26); - } - - public static string ??() - { - return 5[953] ?? 6(953, 17579, 40); - } - - public static string ??() - { - return 5[954] ?? 6(954, 17619, 40); - } - - public static string ??() - { - return 5[955] ?? 6(955, 17659, 4); - } - - public static string ??() - { - return 5[956] ?? 6(956, 17663, 24); - } - - public static string ??() - { - return 5[957] ?? 6(957, 17687, 12); - } - - public static string ??() - { - return 5[958] ?? 6(958, 17699, 2); - } - - public static string ??() - { - return 5[959] ?? 6(959, 17701, 9); - } - - public static string ??() - { - return 5[960] ?? 6(960, 17710, 9); - } - - public static string ??() - { - return 5[961] ?? 6(961, 17719, 7); - } - - public static string ??() - { - return 5[962] ?? 6(962, 17726, 10); - } - - public static string ??() - { - return 5[963] ?? 6(963, 17736, 8); - } - - public static string ??() - { - return 5[964] ?? 6(964, 17744, 13); - } - - public static string ??() - { - return 5[965] ?? 6(965, 17757, 13); - } - - public static string ??() - { - return 5[966] ?? 6(966, 17770, 7); - } - - public static string ??() - { - return 5[967] ?? 6(967, 17777, 6); - } - - public static string ??() - { - return 5[968] ?? 6(968, 17783, 5); - } - - public static string ??() - { - return 5[969] ?? 6(969, 17788, 10); - } - - public static string ??() - { - return 5[970] ?? 6(970, 17798, 12); - } - - public static string ??() - { - return 5[971] ?? 6(971, 17810, 11); - } - - public static string ??() - { - return 5[972] ?? 6(972, 17821, 22); - } - - public static string ??() - { - return 5[973] ?? 6(973, 17843, 24); - } - - public static string ??() - { - return 5[974] ?? 6(974, 17867, 6); - } - - public static string ??() - { - return 5[975] ?? 6(975, 17873, 7); - } - - public static string ??() - { - return 5[976] ?? 6(976, 17880, 1); - } - - public static string ??() - { - return 5[977] ?? 6(977, 17881, 6); - } - - public static string ??() - { - return 5[978] ?? 6(978, 17887, 11); - } - - public static string ??() - { - return 5[979] ?? 6(979, 17898, 10); - } - - public static string ??() - { - return 5[980] ?? 6(980, 17908, 8); - } - - public static string ??() - { - return 5[981] ?? 6(981, 17916, 4); - } - - public static string ??() - { - return 5[982] ?? 6(982, 17920, 12); - } - - public static string ??() - { - return 5[983] ?? 6(983, 17932, 44); - } - - public static string ??() - { - return 5[984] ?? 6(984, 17976, 6); - } - - public static string ??() - { - return 5[985] ?? 6(985, 17982, 11); - } - - public static string ??() - { - return 5[986] ?? 6(986, 17993, 4); - } - - public static string ??() - { - return 5[987] ?? 6(987, 17997, 7); - } - - public static string ??() - { - return 5[988] ?? 6(988, 18004, 8); - } - - public static string ??() - { - return 5[989] ?? 6(989, 18012, 4); - } - - public static string ??() - { - return 5[990] ?? 6(990, 18016, 9); - } - - public static string ??() - { - return 5[991] ?? 6(991, 18025, 9); - } - - public static string ??() - { - return 5[992] ?? 6(992, 18034, 8); - } - - public static string ??() - { - return 5[993] ?? 6(993, 18042, 4); - } - - public static string ??() - { - return 5[994] ?? 6(994, 18046, 9); - } - - public static string ??() - { - return 5[995] ?? 6(995, 18055, 12); - } - - public static string ??() - { - return 5[996] ?? 6(996, 18067, 18); - } - - public static string ??() - { - return 5[997] ?? 6(997, 18085, 7); - } - - public static string ??() - { - return 5[998] ?? 6(998, 18092, 18); - } - - public static string ??() - { - return 5[999] ?? 6(999, 18110, 13); - } - - public static string ??() - { - return 5[1000] ?? 6(1000, 18123, 2); - } - - public static string ??() - { - return 5[1001] ?? 6(1001, 18125, 38); - } - - public static string ??() - { - return 5[1002] ?? 6(1002, 18163, 16); - } - - public static string ??() - { - return 5[1003] ?? 6(1003, 18179, 14); - } - - public static string ??() - { - return 5[1004] ?? 6(1004, 18193, 20); - } - - public static string ??() - { - return 5[1005] ?? 6(1005, 18213, 4); - } - - public static string ??() - { - return 5[1006] ?? 6(1006, 18217, 13); - } - - public static string ??() - { - return 5[1007] ?? 6(1007, 18230, 4); - } - - public static string ??() - { - return 5[1008] ?? 6(1008, 18234, 2); - } - - public static string ??() - { - return 5[1009] ?? 6(1009, 18236, 2); - } - - public static string ??() - { - return 5[1010] ?? 6(1010, 18238, 5); - } - - public static string ??() - { - return 5[1011] ?? 6(1011, 18243, 8); - } - - public static string ??() - { - return 5[1012] ?? 6(1012, 18251, 16); - } - - public static string ??() - { - return 5[1013] ?? 6(1013, 18267, 8); - } - - public static string ??() - { - return 5[1014] ?? 6(1014, 18275, 6); - } - - public static string ??() - { - return 5[1015] ?? 6(1015, 18281, 10); - } - - public static string ??() - { - return 5[1016] ?? 6(1016, 18291, 18); - } - - public static string ??() - { - return 5[1017] ?? 6(1017, 18309, 5); - } - - public static string ??() - { - return 5[1018] ?? 6(1018, 18314, 16); - } - - public static string ??() - { - return 5[1019] ?? 6(1019, 18330, 10); - } - - public static string ??() - { - return 5[1020] ?? 6(1020, 18340, 18); - } - - public static string ??() - { - return 5[1021] ?? 6(1021, 18358, 2); - } - - public static string ??() - { - return 5[1022] ?? 6(1022, 18360, 3); - } - - public static string ??() - { - return 5[1023] ?? 6(1023, 18363, 12); - } - - public static string ??() - { - return 5[1024] ?? 6(1024, 18375, 10); - } - - public static string ??() - { - return 5[1025] ?? 6(1025, 18385, 11); - } - - public static string ??() - { - return 5[1026] ?? 6(1026, 18396, 17); - } - - public static string ??() - { - return 5[1027] ?? 6(1027, 18413, 8); - } - - public static string ??() - { - return 5[1028] ?? 6(1028, 18421, 8); - } - - public static string ??() - { - return 5[1029] ?? 6(1029, 18429, 9); - } - - public static string ??() - { - return 5[1030] ?? 6(1030, 18438, 22); - } - - public static string ??() - { - return 5[1031] ?? 6(1031, 18460, 17); - } - - public static string ??() - { - return 5[1032] ?? 6(1032, 18477, 14); - } - - public static string ??() - { - return 5[1033] ?? 6(1033, 18491, 28); - } - - public static string ??() - { - return 5[1034] ?? 6(1034, 18519, 19); - } - - public static string ??() - { - return 5[1035] ?? 6(1035, 18538, 132); - } - - public static string ??() - { - return 5[1036] ?? 6(1036, 18670, 20); - } - - public static string ??() - { - return 5[1037] ?? 6(1037, 18690, 24); - } - - public static string ??() - { - return 5[1038] ?? 6(1038, 18714, 22); - } - - public static string ??() - { - return 5[1039] ?? 6(1039, 18736, 17); - } - - public static string ??() - { - return 5[1040] ?? 6(1040, 18753, 19); - } - - public static string ??() - { - return 5[1041] ?? 6(1041, 18772, 24); - } - - public static string ??() - { - return 5[1042] ?? 6(1042, 18796, 18); - } - - public static string ??() - { - return 5[1043] ?? 6(1043, 18814, 16); - } - - public static string ??() - { - return 5[1044] ?? 6(1044, 18830, 20); - } - - public static string ??() - { - return 5[1045] ?? 6(1045, 18850, 27); - } - - public static string ??() - { - return 5[1046] ?? 6(1046, 18877, 18); - } - - public static string ??() - { - return 5[1047] ?? 6(1047, 18895, 17); - } - - public static string ??() - { - return 5[1048] ?? 6(1048, 18912, 29); - } - - public static string ??() - { - return 5[1049] ?? 6(1049, 18941, 26); - } - - public static string ??() - { - return 5[1050] ?? 6(1050, 18967, 22); - } - - public static string ??() - { - return 5[1051] ?? 6(1051, 18989, 10); - } - - public static string ??() - { - return 5[1052] ?? 6(1052, 18999, 18); - } - - public static string ??() - { - return 5[1053] ?? 6(1053, 19017, 14); - } - - public static string ??() - { - return 5[1054] ?? 6(1054, 19031, 23); - } - - public static string ??() - { - return 5[1055] ?? 6(1055, 19054, 23); - } - - public static string ??() - { - return 5[1056] ?? 6(1056, 19077, 9); - } - - public static string ??() - { - return 5[1057] ?? 6(1057, 19086, 54); - } - - public static string ??() - { - return 5[1058] ?? 6(1058, 19140, 36); - } - - public static string ??() - { - return 5[1059] ?? 6(1059, 19176, 58); - } - - public static string ??() - { - return 5[1060] ?? 6(1060, 19234, 15); - } - - public static string ??() - { - return 5[1061] ?? 6(1061, 19249, 25); - } - - public static string ??() - { - return 5[1062] ?? 6(1062, 19274, 28); - } - - public static string ??() - { - return 5[1063] ?? 6(1063, 19302, 17); - } - - public static string ??() - { - return 5[1064] ?? 6(1064, 19319, 7); - } - - public static string ??() - { - return 5[1065] ?? 6(1065, 19326, 9); - } - - public static string ??() - { - return 5[1066] ?? 6(1066, 19335, 13); - } - - public static string ??() - { - return 5[1067] ?? 6(1067, 19348, 13); - } - - public static string ??() - { - return 5[1068] ?? 6(1068, 19361, 10); - } - - public static string ??() - { - return 5[1069] ?? 6(1069, 19371, 11); - } - - public static string ??() - { - return 5[1070] ?? 6(1070, 19382, 12); - } - - public static string ??() - { - return 5[1071] ?? 6(1071, 19394, 9); - } - - public static string ??() - { - return 5[1072] ?? 6(1072, 19403, 45); - } - - public static string ??() - { - return 5[1073] ?? 6(1073, 19448, 4); - } - - public static string ??() - { - return 5[1074] ?? 6(1074, 19452, 19); - } - - public static string ??() - { - return 5[1075] ?? 6(1075, 19471, 12); - } - - public static string ??() - { - return 5[1076] ?? 6(1076, 19483, 18); - } - - public static string ??() - { - return 5[1077] ?? 6(1077, 19501, 13); - } - - public static string ??() - { - return 5[1078] ?? 6(1078, 19514, 17); - } - - public static string ??() - { - return 5[1079] ?? 6(1079, 19531, 13); - } - - public static string ??() - { - return 5[1080] ?? 6(1080, 19544, 17); - } - - public static string ??() - { - return 5[1081] ?? 6(1081, 19561, 29); - } - - public static string ??() - { - return 5[1082] ?? 6(1082, 19590, 27); - } - - public static string ??() - { - return 5[1083] ?? 6(1083, 19617, 14); - } - - public static string ??() - { - return 5[1084] ?? 6(1084, 19631, 18); - } - - public static string ??() - { - return 5[1085] ?? 6(1085, 19649, 25); - } - - public static string ??() - { - return 5[1086] ?? 6(1086, 19674, 34); - } - - public static string ??() - { - return 5[1087] ?? 6(1087, 19708, 13); - } - - public static string ??() - { - return 5[1088] ?? 6(1088, 19721, 21); - } - - public static string ??() - { - return 5[1089] ?? 6(1089, 19742, 47); - } - - public static string ??() - { - return 5[1090] ?? 6(1090, 19789, 8); - } - - public static string ??() - { - return 5[1091] ?? 6(1091, 19797, 7); - } - - public static string ??() - { - return 5[1092] ?? 6(1092, 19804, 5); - } - - public static string ??() - { - return 5[1093] ?? 6(1093, 19809, 10); - } - - public static string ??() - { - return 5[1094] ?? 6(1094, 19819, 4); - } - - public static string ??() - { - return 5[1095] ?? 6(1095, 19823, 7); - } - - public static string ??() - { - return 5[1096] ?? 6(1096, 19830, 8); - } - - public static string ??() - { - return 5[1097] ?? 6(1097, 19838, 12); - } - - public static string ??() - { - return 5[1098] ?? 6(1098, 19850, 2); - } - - public static string ??() - { - return 5[1099] ?? 6(1099, 19852, 4); - } - - public static string ??() - { - return 5[1100] ?? 6(1100, 19856, 30); - } - - public static string ??() - { - return 5[1101] ?? 6(1101, 19886, 8); - } - - public static string ??() - { - return 5[1102] ?? 6(1102, 19894, 16); - } - - public static string ??() - { - return 5[1103] ?? 6(1103, 19910, 18); - } - - public static string ??() - { - return 5[1104] ?? 6(1104, 19928, 12); - } - - public static string ??() - { - return 5[1105] ?? 6(1105, 19940, 14); - } - - public static string ??() - { - return 5[1106] ?? 6(1106, 19954, 6); - } - - public static string ??() - { - return 5[1107] ?? 6(1107, 19960, 5); - } - - public static string ??() - { - return 5[1108] ?? 6(1108, 19965, 49); - } - - public static string ??() - { - return 5[1109] ?? 6(1109, 20014, 48); - } - - public static string ??() - { - return 5[1110] ?? 6(1110, 20062, 52); - } - - public static string ??() - { - return 5[1111] ?? 6(1111, 20114, 51); - } - - public static string ??() - { - return 5[1112] ?? 6(1112, 20165, 54); - } - - public static string ??() - { - return 5[1113] ?? 6(1113, 20219, 53); - } - - public static string ??() - { - return 5[1114] ?? 6(1114, 20272, 44); - } - - public static string ??() - { - return 5[1115] ?? 6(1115, 20316, 42); - } - - public static string ??() - { - return 5[1116] ?? 6(1116, 20358, 13); - } - - public static string ??() - { - return 5[1117] ?? 6(1117, 20371, 17); - } - - public static string ??() - { - return 5[1118] ?? 6(1118, 20388, 26); - } - - public static string ??() - { - return 5[1119] ?? 6(1119, 20414, 15); - } - - public static string ??() - { - return 5[1120] ?? 6(1120, 20429, 29); - } - - public static string ??() - { - return 5[1121] ?? 6(1121, 20458, 15); - } - - public static string ??() - { - return 5[1122] ?? 6(1122, 20473, 10); - } - - public static string ??() - { - return 5[1123] ?? 6(1123, 20483, 11); - } - - public static string ??() - { - return 5[1124] ?? 6(1124, 20494, 15); - } - - public static string ??() - { - return 5[1125] ?? 6(1125, 20509, 12); - } - - public static string ??() - { - return 5[1126] ?? 6(1126, 20521, 6); - } - - public static string ??() - { - return 5[1127] ?? 6(1127, 20527, 9); - } - - public static string ??() - { - return 5[1128] ?? 6(1128, 20536, 11); - } - - public static string ??() - { - return 5[1129] ?? 6(1129, 20547, 30); - } - - public static string ??() - { - return 5[1130] ?? 6(1130, 20577, 37); - } - - public static string ??() - { - return 5[1131] ?? 6(1131, 20614, 10); - } - - public static string ??() - { - return 5[1132] ?? 6(1132, 20624, 48); - } - - public static string ??() - { - return 5[1133] ?? 6(1133, 20672, 13); - } - - public static string ??() - { - return 5[1134] ?? 6(1134, 20685, 49); - } - - public static string ??() - { - return 5[1135] ?? 6(1135, 20734, 14); - } - - public static string ??() - { - return 5[1136] ?? 6(1136, 20748, 38); - } - - public static string ??() - { - return 5[1137] ?? 6(1137, 20786, 7); - } - - public static string ??() - { - return 5[1138] ?? 6(1138, 20793, 23); - } - - public static string ??() - { - return 5[1139] ?? 6(1139, 20816, 32); - } - - public static string ??() - { - return 5[1140] ?? 6(1140, 20848, 30); - } - - public static string ??() - { - return 5[1141] ?? 6(1141, 20878, 11); - } - - public static string ??() - { - return 5[1142] ?? 6(1142, 20889, 24); - } - - public static string ??() - { - return 5[1143] ?? 6(1143, 20913, 31); - } - - public static string ??() - { - return 5[1144] ?? 6(1144, 20944, 97); - } - - public static string ??() - { - return 5[1145] ?? 6(1145, 21041, 10); - } - - public static string ??() - { - return 5[1146] ?? 6(1146, 21051, 17); - } - - public static string ??() - { - return 5[1147] ?? 6(1147, 21068, 34); - } - - public static string ??() - { - return 5[1148] ?? 6(1148, 21102, 107); - } - - public static string ??() - { - return 5[1149] ?? 6(1149, 21209, 11); - } - - public static string ??() - { - return 5[1150] ?? 6(1150, 21220, 7); - } - - public static string ??() - { - return 5[1151] ?? 6(1151, 21227, 12); - } - - public static string ??() - { - return 5[1152] ?? 6(1152, 21239, 12); - } - - public static string ??() - { - return 5[1153] ?? 6(1153, 21251, 11); - } - - public static string ??() - { - return 5[1154] ?? 6(1154, 21262, 100); - } - - public static string ??() - { - return 5[1155] ?? 6(1155, 21362, 22); - } - - public static string ??() - { - return 5[1156] ?? 6(1156, 21384, 5); - } - - public static string ??() - { - return 5[1157] ?? 6(1157, 21389, 14); - } - - public static string ??() - { - return 5[1158] ?? 6(1158, 21403, 16); - } - - public static string ??() - { - return 5[1159] ?? 6(1159, 21419, 13); - } - - public static string ??() - { - return 5[1160] ?? 6(1160, 21432, 4); - } - - public static string ??() - { - return 5[1161] ?? 6(1161, 21436, 9); - } - - public static string ??() - { - return 5[1162] ?? 6(1162, 21445, 7); - } - - public static string ??() - { - return 5[1163] ?? 6(1163, 21452, 6); - } - - public static string ??() - { - return 5[1164] ?? 6(1164, 21458, 7); - } - - public static string ??() - { - return 5[1165] ?? 6(1165, 21465, 8); - } - - public static string ??() - { - return 5[1166] ?? 6(1166, 21473, 18); - } - - public static string ??() - { - return 5[1167] ?? 6(1167, 21491, 5); - } - - public static string ??() - { - return 5[1168] ?? 6(1168, 21496, 15); - } - - public static string ??() - { - return 5[1169] ?? 6(1169, 21511, 7); - } - - public static string ??() - { - return 5[1170] ?? 6(1170, 21518, 18); - } - - public static string ??() - { - return 5[1171] ?? 6(1171, 21536, 8); - } - - public static string ??() - { - return 5[1172] ?? 6(1172, 21544, 8); - } - - public static string ??() - { - return 5[1173] ?? 6(1173, 21552, 13); - } - - public static string ??() - { - return 5[1174] ?? 6(1174, 21565, 17); - } - - public static string ??() - { - return 5[1175] ?? 6(1175, 21582, 111); - } - - public static string ??() - { - return 5[1176] ?? 6(1176, 21693, 114); - } - - public static string ??() - { - return 5[1177] ?? 6(1177, 21807, 165); - } - - public static string ??() - { - return 5[1178] ?? 6(1178, 21972, 8); - } - - public static string ??() - { - return 5[1179] ?? 6(1179, 21980, 4); - } - - public static string ??() - { - return 5[1180] ?? 6(1180, 21984, 10); - } - - public static string ??() - { - return 5[1181] ?? 6(1181, 21994, 11); - } - - public static string ??() - { - return 5[1182] ?? 6(1182, 22005, 4); - } - - public static string ??() - { - return 5[1183] ?? 6(1183, 22009, 8); - } - - public static string ??() - { - return 5[1184] ?? 6(1184, 22017, 9); - } - - public static string ??() - { - return 5[1185] ?? 6(1185, 22026, 2); - } - - public static string ??() - { - return 5[1186] ?? 6(1186, 22028, 12); - } - - public static string ??() - { - return 5[1187] ?? 6(1187, 22040, 10); - } - - public static string ??() - { - return 5[1188] ?? 6(1188, 22050, 8); - } - - public static string ??() - { - return 5[1189] ?? 6(1189, 22058, 11); - } - - public static string ??() - { - return 5[1190] ?? 6(1190, 22069, 8); - } - - public static string ??() - { - return 5[1191] ?? 6(1191, 22077, 12); - } - - public static string ??() - { - return 5[1192] ?? 6(1192, 22089, 8); - } - - public static string ??() - { - return 5[1193] ?? 6(1193, 22097, 8); - } - - public static string ??() - { - return 5[1194] ?? 6(1194, 22105, 17); - } - - public static string ??() - { - return 5[1195] ?? 6(1195, 22122, 11); - } - - public static string ??() - { - return 5[1196] ?? 6(1196, 22133, 43); - } - - public static string ??() - { - return 5[1197] ?? 6(1197, 22176, 21); - } - - public static string ??() - { - return 5[1198] ?? 6(1198, 22197, 5); - } - - public static string ??() - { - return 5[1199] ?? 6(1199, 22202, 5); - } - - public static string ??() - { - return 5[1200] ?? 6(1200, 22207, 8); - } - - public static string ??() - { - return 5[1201] ?? 6(1201, 22215, 46); - } - - public static string ??() - { - return 5[1202] ?? 6(1202, 22261, 46); - } - - public static string ??() - { - return 5[1203] ?? 6(1203, 22307, 11); - } - - public static string ??() - { - return 5[1204] ?? 6(1204, 22318, 4); - } - - public static string ??() - { - return 5[1205] ?? 6(1205, 22322, 45); - } - - public static string ??() - { - return 5[1206] ?? 6(1206, 22367, 4); - } - - public static string ??() - { - return 5[1207] ?? 6(1207, 22371, 23); - } - - public static string ??() - { - return 5[1208] ?? 6(1208, 22394, 27); - } - - public static string ??() - { - return 5[1209] ?? 6(1209, 22421, 36); - } - - public static string ??() - { - return 5[1210] ?? 6(1210, 22457, 45); - } - - public static string ??() - { - return 5[1211] ?? 6(1211, 22502, 3); - } - - public static string ??() - { - return 5[1212] ?? 6(1212, 22505, 28); - } - - public static string ??() - { - return 5[1213] ?? 6(1213, 22533, 16); - } - - public static string ??() - { - return 5[1214] ?? 6(1214, 22549, 19); - } - - public static string ??() - { - return 5[1215] ?? 6(1215, 22568, 124); - } - - public static string ??() - { - return 5[1216] ?? 6(1216, 22692, 1); - } - - public static string ??() - { - return 5[1217] ?? 6(1217, 22693, 1); - } - - public static string ??() - { - return 5[1218] ?? 6(1218, 22694, 1); - } - - public static string ??() - { - return 5[1219] ?? 6(1219, 22695, 1); - } - - public static string ??() - { - return 5[1220] ?? 6(1220, 22696, 1); - } - - public static string ??() - { - return 5[1221] ?? 6(1221, 22697, 10); - } - - public static string ??() - { - return 5[1222] ?? 6(1222, 22707, 16); - } - - public static string ??() - { - return 5[1223] ?? 6(1223, 22723, 16); - } - - public static string ??() - { - return 5[1224] ?? 6(1224, 22739, 133); - } - - public static string ??() - { - return 5[1225] ?? 6(1225, 22872, 15); - } - - public static string ??() - { - return 5[1226] ?? 6(1226, 22887, 14); - } - - public static string ??() - { - return 5[1227] ?? 6(1227, 22901, 16); - } - - public static string ??() - { - return 5[1228] ?? 6(1228, 22917, 9); - } - - public static string ??() - { - return 5[1229] ?? 6(1229, 22926, 65); - } - - public static string ??() - { - return 5[1230] ?? 6(1230, 22991, 31); - } - - public static string ??() - { - return 5[1231] ?? 6(1231, 23022, 48); - } - - public static string ??() - { - return 5[1232] ?? 6(1232, 23070, 8); - } - - public static string ??() - { - return 5[1233] ?? 6(1233, 23078, 70); - } - - public static string ??() - { - return 5[1234] ?? 6(1234, 23148, 36); - } - - public static string ??() - { - return 5[1235] ?? 6(1235, 23184, 9); - } - - public static string ??() - { - return 5[1236] ?? 6(1236, 23193, 26); - } - - public static string ??() - { - return 5[1237] ?? 6(1237, 23219, 4); - } - - public static string ??() - { - return 5[1238] ?? 6(1238, 23223, 14); - } - - public static string ??() - { - return 5[1239] ?? 6(1239, 23237, 30); - } - - public static string ??() - { - return 5[1240] ?? 6(1240, 23267, 4); - } - - public static string ??() - { - return 5[1241] ?? 6(1241, 23271, 2); - } - - public static string ??() - { - return 5[1242] ?? 6(1242, 23273, 30); - } - - public static string ??() - { - return 5[1243] ?? 6(1243, 23303, 11); - } - - public static string ??() - { - return 5[1244] ?? 6(1244, 23314, 11); - } - - public static string ??() - { - return 5[1245] ?? 6(1245, 23325, 21); - } - - public static string ??() - { - return 5[1246] ?? 6(1246, 23346, 14); - } - - public static string ??() - { - return 5[1247] ?? 6(1247, 23360, 8); - } - - public static string ??() - { - return 5[1248] ?? 6(1248, 23368, 14); - } - - public static string ??() - { - return 5[1249] ?? 6(1249, 23382, 8); - } - - public static string ??() - { - return 5[1250] ?? 6(1250, 23390, 12); - } - - public static string ??() - { - return 5[1251] ?? 6(1251, 23402, 14); - } - - public static string ??() - { - return 5[1252] ?? 6(1252, 23416, 12); - } - - public static string ??() - { - return 5[1253] ?? 6(1253, 23428, 17); - } - - public static string ??() - { - return 5[1254] ?? 6(1254, 23445, 19); - } - - public static string ??() - { - return 5[1255] ?? 6(1255, 23464, 16); - } - - public static string ??() - { - return 5[1256] ?? 6(1256, 23480, 20); - } - - public static string ??() - { - return 5[1257] ?? 6(1257, 23500, 9); - } - - public static string ??() - { - return 5[1258] ?? 6(1258, 23509, 11); - } - - public static string ??() - { - return 5[1259] ?? 6(1259, 23520, 14); - } - - public static string ??() - { - return 5[1260] ?? 6(1260, 23534, 15); - } - - public static string ??() - { - return 5[1261] ?? 6(1261, 23549, 15); - } - - public static string ??() - { - return 5[1262] ?? 6(1262, 23564, 71); - } - - public static string ??() - { - return 5[1263] ?? 6(1263, 23635, 78); - } - - public static string ??() - { - return 5[1264] ?? 6(1264, 23713, 80); - } - - public static string ??() - { - return 5[1265] ?? 6(1265, 23793, 77); - } - - public static string ??() - { - return 5[1266] ?? 6(1266, 23870, 80); - } - - public static string ??() - { - return 5[1267] ?? 6(1267, 23950, 4); - } - - public static string ??() - { - return 5[1268] ?? 6(1268, 23954, 93); - } - - public static string ??() - { - return 5[1269] ?? 6(1269, 24047, 17); - } - - public static string ??() - { - return 5[1270] ?? 6(1270, 24064, 9); - } - - public static string ??() - { - return 5[1271] ?? 6(1271, 24073, 12); - } - - public static string ??() - { - return 5[1272] ?? 6(1272, 24085, 9); - } - - public static string ??() - { - return 5[1273] ?? 6(1273, 24094, 43); - } - - public static string ??() - { - return 5[1274] ?? 6(1274, 24137, 29); - } - - public static string ??() - { - return 5[1275] ?? 6(1275, 24166, 38); - } - - public static string ??() - { - return 5[1276] ?? 6(1276, 24204, 22); - } - - public static string ??() - { - return 5[1277] ?? 6(1277, 24226, 127); - } - - public static string ??() - { - return 5[1278] ?? 6(1278, 24353, 39); - } - - public static string ??() - { - return 5[1279] ?? 6(1279, 24392, 29); - } - - public static string ??() - { - return 5[1280] ?? 6(1280, 24421, 30); - } - - public static string ??() - { - return 5[1281] ?? 6(1281, 24451, 153); - } - - public static string ??() - { - return 5[1282] ?? 6(1282, 24604, 53); - } - - public static string ??() - { - return 5[1283] ?? 6(1283, 24657, 21); - } - - public static string ??() - { - return 5[1284] ?? 6(1284, 24678, 38); - } - - public static string ??() - { - return 5[1285] ?? 6(1285, 24716, 15); - } - - public static string ??() - { - return 5[1286] ?? 6(1286, 24731, 21); - } - - public static string ??() - { - return 5[1287] ?? 6(1287, 24752, 38); - } - - public static string ??() - { - return 5[1288] ?? 6(1288, 24790, 2); - } - - public static string ??() - { - return 5[1289] ?? 6(1289, 24792, 21); - } - - public static string ??() - { - return 5[1290] ?? 6(1290, 24813, 32); - } - - public static string ??() - { - return 5[1291] ?? 6(1291, 24845, 10); - } - - public static string ??() - { - return 5[1292] ?? 6(1292, 24855, 4); - } - - public static string ??() - { - return 5[1293] ?? 6(1293, 24859, 1); - } - - public static string ??() - { - return 5[1294] ?? 6(1294, 24860, 20); - } - - public static string ??() - { - return 5[1295] ?? 6(1295, 24880, 24); - } - - public static string ??() - { - return 5[1296] ?? 6(1296, 24904, 5); - } - - public static string ??() - { - return 5[1297] ?? 6(1297, 24909, 9); - } - - public static string ??() - { - return 5[1298] ?? 6(1298, 24918, 11); - } - - public static string ??() - { - return 5[1299] ?? 6(1299, 24929, 47); - } - - public static string ??() - { - return 5[1300] ?? 6(1300, 24976, 18); - } - - public static string ??() - { - return 5[1301] ?? 6(1301, 24994, 36); - } - - public static string ??() - { - return 5[1302] ?? 6(1302, 25030, 20); - } - - public static string ??() - { - return 5[1303] ?? 6(1303, 25050, 39); - } - - public static string ??() - { - return 5[1304] ?? 6(1304, 25089, 23); - } - - public static string ??() - { - return 5[1305] ?? 6(1305, 25112, 48); - } - - public static string ??() - { - return 5[1306] ?? 6(1306, 25160, 23); - } - - public static string ??() - { - return 5[1307] ?? 6(1307, 25183, 41); - } - - public static string ??() - { - return 5[1308] ?? 6(1308, 25224, 11); - } - - public static string ??() - { - return 5[1309] ?? 6(1309, 25235, 39); - } - - public static string ??() - { - return 5[1310] ?? 6(1310, 25274, 9); - } - - public static string ??() - { - return 5[1311] ?? 6(1311, 25283, 9); - } - - public static string ??() - { - return 5[1312] ?? 6(1312, 25292, 6); - } - - public static string ??() - { - return 5[1313] ?? 6(1313, 25298, 6); - } - - public static string ??() - { - return 5[1314] ?? 6(1314, 25304, 34); - } - - public static string ??() - { - return 5[1315] ?? 6(1315, 25338, 36); - } - - public static string ??() - { - return 5[1316] ?? 6(1316, 25374, 2); - } - - public static string ??() - { - return 5[1317] ?? 6(1317, 25376, 10); - } - - public static string ??() - { - return 5[1318] ?? 6(1318, 25386, 12); - } - - public static string ??() - { - return 5[1319] ?? 6(1319, 25398, 24); - } - - public static string ??() - { - return 5[1320] ?? 6(1320, 25422, 1); - } - - public static string ??() - { - return 5[1321] ?? 6(1321, 25423, 66); - } - - public static string ??() - { - return 5[1322] ?? 6(1322, 25489, 8); - } - - public static string ??() - { - return 5[1323] ?? 6(1323, 25497, 11); - } - - public static string ??() - { - return 5[1324] ?? 6(1324, 25508, 6); - } - - public static string ??() - { - return 5[1325] ?? 6(1325, 25514, 9); - } - - public static string ??() - { - return 5[1326] ?? 6(1326, 25523, 4); - } - - public static string ??() - { - return 5[1327] ?? 6(1327, 25527, 6); - } - - public static string ??() - { - return 5[1328] ?? 6(1328, 25533, 25); - } - - public static string ??() - { - return 5[1329] ?? 6(1329, 25558, 5); - } - - public static string ??() - { - return 5[1330] ?? 6(1330, 25563, 7); - } - - public static string ??() - { - return 5[1331] ?? 6(1331, 25570, 15); - } - - public static string ??() - { - return 5[1332] ?? 6(1332, 25585, 11); - } - - public static string ??() - { - return 5[1333] ?? 6(1333, 25596, 18); - } - - public static string ??() - { - return 5[1334] ?? 6(1334, 25614, 6); - } - - public static string ??() - { - return 5[1335] ?? 6(1335, 25620, 10); - } - - public static string ??() - { - return 5[1336] ?? 6(1336, 25630, 24); - } - - public static string ??() - { - return 5[1337] ?? 6(1337, 25654, 18); - } - - public static string ??() - { - return 5[1338] ?? 6(1338, 25672, 14); - } - - public static string ??() - { - return 5[1339] ?? 6(1339, 25686, 19); - } - - public static string ??() - { - return 5[1340] ?? 6(1340, 25705, 11); - } - - public static string ??() - { - return 5[1341] ?? 6(1341, 25716, 2); - } - - public static string ??() - { - return 5[1342] ?? 6(1342, 25718, 15); - } - - public static string ??() - { - return 5[1343] ?? 6(1343, 25733, 7); - } - - public static string ??() - { - return 5[1344] ?? 6(1344, 25740, 10); - } - - public static string ??() - { - return 5[1345] ?? 6(1345, 25750, 9); - } - - public static string ??() - { - return 5[1346] ?? 6(1346, 25759, 25); - } - - public static string ??() - { - return 5[1347] ?? 6(1347, 25784, 26); - } - - public static string ??() - { - return 5[1348] ?? 6(1348, 25810, 10); - } - - public static string ??() - { - return 5[1349] ?? 6(1349, 25820, 10); - } - - public static string ??() - { - return 5[1350] ?? 6(1350, 25830, 15); - } - - public static string ??() - { - return 5[1351] ?? 6(1351, 25845, 15); - } - - public static string ??() - { - return 5[1352] ?? 6(1352, 25860, 4); - } - - public static string ??() - { - return 5[1353] ?? 6(1353, 25864, 7); - } - - public static string ??() - { - return 5[1354] ?? 6(1354, 25871, 13); - } - - public static string ??() - { - return 5[1355] ?? 6(1355, 25884, 9); - } - - public static string ??() - { - return 5[1356] ?? 6(1356, 25893, 23); - } - - public static string ??() - { - return 5[1357] ?? 6(1357, 25916, 9); - } - - public static string ??() - { - return 5[1358] ?? 6(1358, 25925, 9); - } - - public static string ??() - { - return 5[1359] ?? 6(1359, 25934, 15); - } - - public static string ??() - { - return 5[1360] ?? 6(1360, 25949, 14); - } - - public static string ??() - { - return 5[1361] ?? 6(1361, 25963, 5); - } - - public static string ??() - { - return 5[1362] ?? 6(1362, 25968, 5); - } - - public static string ??() - { - return 5[1363] ?? 6(1363, 25973, 5); - } - - public static string ??() - { - return 5[1364] ?? 6(1364, 25978, 6); - } - - public static string ??() - { - return 5[1365] ?? 6(1365, 25984, 13); - } - - public static string ??() - { - return 5[1366] ?? 6(1366, 25997, 13); - } - - public static string ??() - { - return 5[1367] ?? 6(1367, 26010, 14); - } - - public static string ??() - { - return 5[1368] ?? 6(1368, 26024, 13); - } - - public static string ??() - { - return 5[1369] ?? 6(1369, 26037, 13); - } - - public static string ??() - { - return 5[1370] ?? 6(1370, 26050, 7); - } - - public static string ??() - { - return 5[1371] ?? 6(1371, 26057, 13); - } - - public static string ??() - { - return 5[1372] ?? 6(1372, 26070, 9); - } - - public static string ??() - { - return 5[1373] ?? 6(1373, 26079, 9); - } - - public static string ??() - { - return 5[1374] ?? 6(1374, 26088, 4); - } - - public static string ??() - { - return 5[1375] ?? 6(1375, 26092, 2); - } - - public static string ??() - { - return 5[1376] ?? 6(1376, 26094, 14); - } - - public static string ??() - { - return 5[1377] ?? 6(1377, 26108, 5); - } - - public static string ??() - { - return 5[1378] ?? 6(1378, 26113, 9); - } - - public static string ??() - { - return 5[1379] ?? 6(1379, 26122, 9); - } - - public static string ??() - { - return 5[1380] ?? 6(1380, 26131, 16); - } - - public static string ??() - { - return 5[1381] ?? 6(1381, 26147, 21); - } - - public static string ??() - { - return 5[1382] ?? 6(1382, 26168, 15); - } - - public static string ??() - { - return 5[1383] ?? 6(1383, 26183, 5); - } - - public static string ??() - { - return 5[1384] ?? 6(1384, 26188, 11); - } - - public static string ??() - { - return 5[1385] ?? 6(1385, 26199, 12); - } - - public static string ??() - { - return 5[1386] ?? 6(1386, 26211, 11); - } - - public static string ??() - { - return 5[1387] ?? 6(1387, 26222, 9); - } - - public static string ??() - { - return 5[1388] ?? 6(1388, 26231, 4); - } - - public static string ??() - { - return 5[1389] ?? 6(1389, 26235, 12); - } - - public static string ??() - { - return 5[1390] ?? 6(1390, 26247, 9); - } - - public static string ??() - { - return 5[1391] ?? 6(1391, 26256, 8); - } - - public static string ??() - { - return 5[1392] ?? 6(1392, 26264, 11); - } - - public static string ??() - { - return 5[1393] ?? 6(1393, 26275, 21); - } - - public static string ??() - { - return 5[1394] ?? 6(1394, 26296, 45); - } - - public static string ??() - { - return 5[1395] ?? 6(1395, 26341, 6); - } - - public static string ??() - { - return 5[1396] ?? 6(1396, 26347, 58); - } - - public static string ??() - { - return 5[1397] ?? 6(1397, 26405, 11); - } - - public static string ??() - { - return 5[1398] ?? 6(1398, 26416, 53); - } - - public static string ??() - { - return 5[1399] ?? 6(1399, 26469, 7); - } - - public static string ??() - { - return 5[1400] ?? 6(1400, 26476, 8); - } - - public static string ??() - { - return 5[1401] ?? 6(1401, 26484, 3); - } - - public static string ??() - { - return 5[1402] ?? 6(1402, 26487, 7); - } - - public static string ??() - { - return 5[1403] ?? 6(1403, 26494, 150); - } - - public static string ??() - { - return 5[1404] ?? 6(1404, 26644, 6); - } - - public static string ??() - { - return 5[1405] ?? 6(1405, 26650, 5); - } - - public static string ??() - { - return 5[1406] ?? 6(1406, 26655, 12); - } - - public static string ??() - { - return 5[1407] ?? 6(1407, 26667, 57); - } - - public static string ??() - { - return 5[1408] ?? 6(1408, 26724, 56); - } - - public static string ??() - { - return 5[1409] ?? 6(1409, 26780, 11); - } - - public static string ??() - { - return 5[1410] ?? 6(1410, 26791, 9); - } - - public static string ??() - { - return 5[1411] ?? 6(1411, 26800, 7); - } - - public static string ??() - { - return 5[1412] ?? 6(1412, 26807, 23); - } - - public static string ??() - { - return 5[1413] ?? 6(1413, 26830, 9); - } - - public static string ??() - { - return 5[1414] ?? 6(1414, 26839, 8); - } - - public static string ??() - { - return 5[1415] ?? 6(1415, 26847, 13); - } - - public static string ??() - { - return 5[1416] ?? 6(1416, 26860, 8); - } - - public static string ??() - { - return 5[1417] ?? 6(1417, 26868, 8); - } - - public static string ??() - { - return 5[1418] ?? 6(1418, 26876, 14); - } - - public static string ??() - { - return 5[1419] ?? 6(1419, 26890, 19); - } - - public static string ??() - { - return 5[1420] ?? 6(1420, 26909, 19); - } - - public static string ??() - { - return 5[1421] ?? 6(1421, 26928, 17); - } - - public static string ??() - { - return 5[1422] ?? 6(1422, 26945, 20); - } - - public static string ??() - { - return 5[1423] ?? 6(1423, 26965, 21); - } - - public static string ??() - { - return 5[1424] ?? 6(1424, 26986, 21); - } - - public static string ??() - { - return 5[1425] ?? 6(1425, 27007, 29); - } - - public static string ??() - { - return 5[1426] ?? 6(1426, 27036, 27); - } - - public static string ??() - { - return 5[1427] ?? 6(1427, 27063, 58); - } - - public static string ??() - { - return 5[1428] ?? 6(1428, 27121, 35); - } - - public static string ??() - { - return 5[1429] ?? 6(1429, 27156, 25); - } - - public static string ??() - { - return 5[1430] ?? 6(1430, 27181, 27); - } - - public static string ??() - { - return 5[1431] ?? 6(1431, 27208, 27); - } - - public static string ??() - { - return 5[1432] ?? 6(1432, 27235, 24); - } - - public static string ??() - { - return 5[1433] ?? 6(1433, 27259, 33); - } - - public static string ??() - { - return 5[1434] ?? 6(1434, 27292, 19); - } - - public static string ??() - { - return 5[1435] ?? 6(1435, 27311, 47); - } - - public static string ??() - { - return 5[1436] ?? 6(1436, 27358, 47); - } - - public static string ??() - { - return 5[1437] ?? 6(1437, 27405, 40); - } - - public static string ??() - { - return 5[1438] ?? 6(1438, 27445, 42); - } - - public static string ??() - { - return 5[1439] ?? 6(1439, 27487, 34); - } - - public static string ??() - { - return 5[1440] ?? 6(1440, 27521, 27); - } - - public static string ??() - { - return 5[1441] ?? 6(1441, 27548, 39); - } - - public static string ??() - { - return 5[1442] ?? 6(1442, 27587, 32); - } - - public static string ??() - { - return 5[1443] ?? 6(1443, 27619, 43); - } - - public static string ??() - { - return 5[1444] ?? 6(1444, 27662, 28); - } - - public static string ??() - { - return 5[1445] ?? 6(1445, 27690, 35); - } - - public static string ??() - { - return 5[1446] ?? 6(1446, 27725, 7); - } - - public static string ??() - { - return 5[1447] ?? 6(1447, 27732, 12); - } - - public static string ??() - { - return 5[1448] ?? 6(1448, 27744, 34); - } - - public static string ??() - { - return 5[1449] ?? 6(1449, 27778, 6); - } - - public static string ??() - { - return 5[1450] ?? 6(1450, 27784, 17); - } - - public static string ??() - { - return 5[1451] ?? 6(1451, 27801, 39); - } - - public static string ??() - { - return 5[1452] ?? 6(1452, 27840, 33); - } - - public static string ??() - { - return 5[1453] ?? 6(1453, 27873, 31); - } - - public static string ??() - { - return 5[1454] ?? 6(1454, 27904, 6); - } - - public static string ??() - { - return 5[1455] ?? 6(1455, 27910, 7); - } - - public static string ??() - { - return 5[1456] ?? 6(1456, 27917, 14); - } - - public static string ??() - { - return 5[1457] ?? 6(1457, 27931, 14); - } - - public static string ??() - { - return 5[1458] ?? 6(1458, 27945, 17); - } - - public static string ??() - { - return 5[1459] ?? 6(1459, 27962, 36); - } - - public static string ??() - { - return 5[1460] ?? 6(1460, 27998, 53); - } - - public static string ??() - { - return 5[1461] ?? 6(1461, 28051, 23); - } - - public static string ??() - { - return 5[1462] ?? 6(1462, 28074, 47); - } - - public static string ??() - { - return 5[1463] ?? 6(1463, 28121, 3); - } - - public static string ??() - { - return 5[1464] ?? 6(1464, 28124, 7); - } - - public static string ??() - { - return 5[1465] ?? 6(1465, 28131, 4); - } - - public static string ??() - { - return 5[1466] ?? 6(1466, 28135, 33); - } - - public static string ??() - { - return 5[1467] ?? 6(1467, 28168, 9); - } - - public static string ??() - { - return 5[1468] ?? 6(1468, 28177, 17); - } - - public static string ??() - { - return 5[1469] ?? 6(1469, 28194, 15); - } - - public static string ??() - { - return 5[1470] ?? 6(1470, 28209, 11); - } - - public static string ??() - { - return 5[1471] ?? 6(1471, 28220, 8); - } - - public static string ??() - { - return 5[1472] ?? 6(1472, 28228, 9); - } - - public static string ??() - { - return 5[1473] ?? 6(1473, 28237, 165); - } - - public static string ??() - { - return 5[1474] ?? 6(1474, 28402, 15); - } - - public static string ??() - { - return 5[1475] ?? 6(1475, 28417, 8); - } - - public static string ??() - { - return 5[1476] ?? 6(1476, 28425, 5); - } - - public static string ??() - { - return 5[1477] ?? 6(1477, 28430, 36); - } - - public static string ??() - { - return 5[1478] ?? 6(1478, 28466, 9); - } - - public static string ??() - { - return 5[1479] ?? 6(1479, 28475, 34); - } - - public static string ??() - { - return 5[1480] ?? 6(1480, 28509, 20); - } - - public static string ??() - { - return 5[1481] ?? 6(1481, 28529, 16); - } - - public static string ??() - { - return 5[1482] ?? 6(1482, 28545, 17); - } - - public static string ??() - { - return 5[1483] ?? 6(1483, 28562, 2); - } - - public static string ??() - { - return 5[1484] ?? 6(1484, 28564, 24); - } - - public static string ??() - { - return 5[1485] ?? 6(1485, 28588, 43); - } - - public static string ??() - { - return 5[1486] ?? 6(1486, 28631, 6); - } - - public static string ??() - { - return 5[1487] ?? 6(1487, 28637, 9); - } - - public static string ??() - { - return 5[1488] ?? 6(1488, 28646, 8); - } - - public static string ??() - { - return 5[1489] ?? 6(1489, 28654, 7); - } - - public static string ??() - { - return 5[1490] ?? 6(1490, 28661, 12); - } - - public static string ??() - { - return 5[1491] ?? 6(1491, 28673, 7); - } - - public static string ??() - { - return 5[1492] ?? 6(1492, 28680, 14); - } - - public static string ??() - { - return 5[1493] ?? 6(1493, 28694, 13); - } - - public static string ??() - { - return 5[1494] ?? 6(1494, 28707, 18); - } - - public static string ??() - { - return 5[1495] ?? 6(1495, 28725, 16); - } - - public static string ??() - { - return 5[1496] ?? 6(1496, 28741, 26); - } - - public static string ??() - { - return 5[1497] ?? 6(1497, 28767, 18); - } - - public static string ??() - { - return 5[1498] ?? 6(1498, 28785, 12); - } - - public static string ??() - { - return 5[1499] ?? 6(1499, 28797, 6); - } - - public static string ??() - { - return 5[1500] ?? 6(1500, 28803, 8); - } - - public static string ??() - { - return 5[1501] ?? 6(1501, 28811, 11); - } - - public static string ??() - { - return 5[1502] ?? 6(1502, 28822, 14); - } - - public static string ??() - { - return 5[1503] ?? 6(1503, 28836, 7); - } - - public static string ??() - { - return 5[1504] ?? 6(1504, 28843, 7); - } - - public static string ??() - { - return 5[1505] ?? 6(1505, 28850, 11); - } - - public static string ??() - { - return 5[1506] ?? 6(1506, 28861, 21); - } - - public static string ??() - { - return 5[1507] ?? 6(1507, 28882, 11); - } - - public static string ??() - { - return 5[1508] ?? 6(1508, 28893, 13); - } - - public static string ??() - { - return 5[1509] ?? 6(1509, 28906, 3); - } - - public static string ??() - { - return 5[1510] ?? 6(1510, 28909, 9); - } - - public static string ??() - { - return 5[1511] ?? 6(1511, 28918, 12); - } - - public static string ??() - { - return 5[1512] ?? 6(1512, 28930, 16); - } - - public static string ??() - { - return 5[1513] ?? 6(1513, 28946, 15); - } - - public static string ??() - { - return 5[1514] ?? 6(1514, 28961, 10); - } - - public static string ??() - { - return 5[1515] ?? 6(1515, 28971, 10); - } - - public static string ??() - { - return 5[1516] ?? 6(1516, 28981, 4); - } - - public static string ??() - { - return 5[1517] ?? 6(1517, 28985, 6); - } - - public static string ??() - { - return 5[1518] ?? 6(1518, 28991, 11); - } - - public static string ??() - { - return 5[1519] ?? 6(1519, 29002, 7); - } - - public static string ??() - { - return 5[1520] ?? 6(1520, 29009, 15); - } - - public static string ??() - { - return 5[1521] ?? 6(1521, 29024, 10); - } - - public static string ??() - { - return 5[1522] ?? 6(1522, 29034, 12); - } - - public static string ??() - { - return 5[1523] ?? 6(1523, 29046, 19); - } - - public static string ??() - { - return 5[1524] ?? 6(1524, 29065, 25); - } - - public static string ??() - { - return 5[1525] ?? 6(1525, 29090, 8); - } - - public static string ??() - { - return 5[1526] ?? 6(1526, 29098, 6); - } - - public static string ??() - { - return 5[1527] ?? 6(1527, 29104, 12); - } - - public static string ??() - { - return 5[1528] ?? 6(1528, 29116, 10); - } - - public static string ??() - { - return 5[1529] ?? 6(1529, 29126, 9); - } - - public static string ??() - { - return 5[1530] ?? 6(1530, 29135, 8); - } - - public static string ??() - { - return 5[1531] ?? 6(1531, 29143, 8); - } - - public static string ??() - { - return 5[1532] ?? 6(1532, 29151, 16); - } - - public static string ??() - { - return 5[1533] ?? 6(1533, 29167, 7); - } - - public static string ??() - { - return 5[1534] ?? 6(1534, 29174, 7); - } - - public static string ??() - { - return 5[1535] ?? 6(1535, 29181, 10); - } - - public static string ??() - { - return 5[1536] ?? 6(1536, 29191, 13); - } - - public static string ??() - { - return 5[1537] ?? 6(1537, 29204, 14); - } - - public static string ??() - { - return 5[1538] ?? 6(1538, 29218, 4); - } - - public static string ??() - { - return 5[1539] ?? 6(1539, 29222, 7); - } - - public static string ??() - { - return 5[1540] ?? 6(1540, 29229, 14); - } - - public static string ??() - { - return 5[1541] ?? 6(1541, 29243, 11); - } - - public static string ??() - { - return 5[1542] ?? 6(1542, 29254, 11); - } - - public static string ??() - { - return 5[1543] ?? 6(1543, 29265, 14); - } - - public static string ??() - { - return 5[1544] ?? 6(1544, 29279, 12); - } - - public static string ??() - { - return 5[1545] ?? 6(1545, 29291, 11); - } - - public static string ??() - { - return 5[1546] ?? 6(1546, 29302, 14); - } - - public static string ??() - { - return 5[1547] ?? 6(1547, 29316, 19); - } - - public static string ??() - { - return 5[1548] ?? 6(1548, 29335, 14); - } - - public static string ??() - { - return 5[1549] ?? 6(1549, 29349, 19); - } - - public static string ??() - { - return 5[1550] ?? 6(1550, 29368, 9); - } - - public static string ??() - { - return 5[1551] ?? 6(1551, 29377, 11); - } - - public static string ??() - { - return 5[1552] ?? 6(1552, 29388, 16); - } - - public static string ??() - { - return 5[1553] ?? 6(1553, 29404, 8); - } - - public static string ??() - { - return 5[1554] ?? 6(1554, 29412, 10); - } - - public static string ??() - { - return 5[1555] ?? 6(1555, 29422, 7); - } - - public static string ??() - { - return 5[1556] ?? 6(1556, 29429, 18); - } - - public static string ??() - { - return 5[1557] ?? 6(1557, 29447, 14); - } - - public static string ??() - { - return 5[1558] ?? 6(1558, 29461, 9); - } - - public static string ??() - { - return 5[1559] ?? 6(1559, 29470, 9); - } - - public static string ??() - { - return 5[1560] ?? 6(1560, 29479, 8); - } - - public static string ??() - { - return 5[1561] ?? 6(1561, 29487, 12); - } - - public static string ??() - { - return 5[1562] ?? 6(1562, 29499, 24); - } - - public static string ??() - { - return 5[1563] ?? 6(1563, 29523, 7); - } - - public static string ??() - { - return 5[1564] ?? 6(1564, 29530, 6); - } - - public static string ??() - { - return 5[1565] ?? 6(1565, 29536, 6); - } - - public static string ??() - { - return 5[1566] ?? 6(1566, 29542, 13); - } - - public static string ??() - { - return 5[1567] ?? 6(1567, 29555, 16); - } - - public static string ??() - { - return 5[1568] ?? 6(1568, 29571, 16); - } - - public static string ??() - { - return 5[1569] ?? 6(1569, 29587, 13); - } - - public static string ??() - { - return 5[1570] ?? 6(1570, 29600, 10); - } - - public static string ??() - { - return 5[1571] ?? 6(1571, 29610, 11); - } - - public static string ??() - { - return 5[1572] ?? 6(1572, 29621, 15); - } - - public static string ??() - { - return 5[1573] ?? 6(1573, 29636, 16); - } - - public static string ??() - { - return 5[1574] ?? 6(1574, 29652, 7); - } - - public static string ??() - { - return 5[1575] ?? 6(1575, 29659, 7); - } - - public static string ??() - { - return 5[1576] ?? 6(1576, 29666, 12); - } - - public static string ??() - { - return 5[1577] ?? 6(1577, 29678, 8); - } - - public static string ??() - { - return 5[1578] ?? 6(1578, 29686, 14); - } - - public static string ??() - { - return 5[1579] ?? 6(1579, 29700, 16); - } - - public static string ??() - { - return 5[1580] ?? 6(1580, 29716, 170); - } - - public static string ??() - { - return 5[1581] ?? 6(1581, 29886, 14); - } - - public static string ??() - { - return 5[1582] ?? 6(1582, 29900, 16); - } - - public static string ??() - { - return 5[1583] ?? 6(1583, 29916, 11); - } - - public static string ??() - { - return 5[1584] ?? 6(1584, 29927, 12); - } - - public static string ??() - { - return 5[1585] ?? 6(1585, 29939, 12); - } - - public static string ??() - { - return 5[1586] ?? 6(1586, 29951, 18); - } - - public static string ??() - { - return 5[1587] ?? 6(1587, 29969, 19); - } - - public static string ??() - { - return 5[1588] ?? 6(1588, 29988, 26); - } - - public static string ??() - { - return 5[1589] ?? 6(1589, 30014, 11); - } - - public static string ??() - { - return 5[1590] ?? 6(1590, 30025, 18); - } - - public static string ??() - { - return 5[1591] ?? 6(1591, 30043, 16); - } - - public static string ??() - { - return 5[1592] ?? 6(1592, 30059, 24); - } - - public static string ??() - { - return 5[1593] ?? 6(1593, 30083, 13); - } - - public static string ??() - { - return 5[1594] ?? 6(1594, 30096, 22); - } - - public static string ??() - { - return 5[1595] ?? 6(1595, 30118, 13); - } - - public static string ??() - { - return 5[1596] ?? 6(1596, 30131, 22); - } - - public static string ??() - { - return 5[1597] ?? 6(1597, 30153, 14); - } - - public static string ??() - { - return 5[1598] ?? 6(1598, 30167, 16); - } - - public static string ??() - { - return 5[1599] ?? 6(1599, 30183, 12); - } - - public static string ??() - { - return 5[1600] ?? 6(1600, 30195, 18); - } - - public static string ??() - { - return 5[1601] ?? 6(1601, 30213, 18); - } - - public static string ??() - { - return 5[1602] ?? 6(1602, 30231, 5); - } - - public static string ??() - { - return 5[1603] ?? 6(1603, 30236, 15); - } - - public static string ??() - { - return 5[1604] ?? 6(1604, 30251, 1); - } - - public static string ??() - { - return 5[1605] ?? 6(1605, 30252, 2); - } - - public static string ??() - { - return 5[1606] ?? 6(1606, 30254, 39); - } - - public static string ??() - { - return 5[1607] ?? 6(1607, 30293, 11); - } - - public static string ??() - { - return 5[1608] ?? 6(1608, 30304, 36); - } - - public static string ??() - { - return 5[1609] ?? 6(1609, 30340, 23); - } - - public static string ??() - { - return 5[1610] ?? 6(1610, 30363, 5); - } - - public static string ??() - { - return 5[1611] ?? 6(1611, 30368, 56); - } - - public static string ??() - { - return 5[1612] ?? 6(1612, 30424, 10); - } - - public static string ??() - { - return 5[1613] ?? 6(1613, 30434, 8); - } - - public static string ??() - { - return 5[1614] ?? 6(1614, 30442, 10); - } - - public static string ??() - { - return 5[1615] ?? 6(1615, 30452, 3); - } - - public static string ??() - { - return 5[1616] ?? 6(1616, 30455, 11); - } - - public static string ??() - { - return 5[1617] ?? 6(1617, 30466, 15); - } - - public static string ??() - { - return 5[1618] ?? 6(1618, 30481, 9); - } - - public static string ??() - { - return 5[1619] ?? 6(1619, 30490, 13); - } - - public static string ??() - { - return 5[1620] ?? 6(1620, 30503, 13); - } - - public static string ??() - { - return 5[1621] ?? 6(1621, 30516, 11); - } - - public static string ??() - { - return 5[1622] ?? 6(1622, 30527, 9); - } - - public static string ??() - { - return 5[1623] ?? 6(1623, 30536, 6); - } - - public static string ??() - { - return 5[1624] ?? 6(1624, 30542, 13); - } - - public static string ??() - { - return 5[1625] ?? 6(1625, 30555, 146); - } - - public static string ??() - { - return 5[1626] ?? 6(1626, 30701, 10); - } - - public static string ??() - { - return 5[1627] ?? 6(1627, 30711, 3); - } - - public static string ??() - { - return 5[1628] ?? 6(1628, 30714, 4); - } - - public static string ??() - { - return 5[1629] ?? 6(1629, 30718, 4); - } - - public static string ??() - { - return 5[1630] ?? 6(1630, 30722, 7); - } - - public static string ??() - { - return 5[1631] ?? 6(1631, 30729, 7); - } - - public static string ??() - { - return 5[1632] ?? 6(1632, 30736, 1); - } - - public static string ??() - { - return 5[1633] ?? 6(1633, 30737, 6); - } - - public static string ??() - { - return 5[1634] ?? 6(1634, 30743, 10); - } - - public static string ??() - { - return 5[1635] ?? 6(1635, 30753, 3); - } - - public static string ??() - { - return 5[1636] ?? 6(1636, 30756, 10); - } - - public static string ??() - { - return 5[1637] ?? 6(1637, 30766, 9); - } - - public static string ??() - { - return 5[1638] ?? 6(1638, 30775, 9); - } - - public static string ??() - { - return 5[1639] ?? 6(1639, 30784, 3); - } - - public static string ??() - { - return 5[1640] ?? 6(1640, 30787, 8); - } - - public static string ??() - { - return 5[1641] ?? 6(1641, 30795, 1); - } - - public static string ??() - { - return 5[1642] ?? 6(1642, 30796, 5); - } - - public static string ??() - { - return 5[1643] ?? 6(1643, 30801, 6); - } - - public static string ??() - { - return 5[1644] ?? 6(1644, 30807, 8); - } - - public static string ??() - { - return 5[1645] ?? 6(1645, 30815, 24); - } - - public static string ??() - { - return 5[1646] ?? 6(1646, 30839, 2); - } - - public static string ??() - { - return 5[1647] ?? 6(1647, 30841, 2); - } - - public static string ??() - { - return 5[1648] ?? 6(1648, 30843, 3); - } - - public static string ??() - { - return 5[1649] ?? 6(1649, 30846, 2); - } - - public static string ??() - { - return 5[1650] ?? 6(1650, 30848, 1); - } - - public static string ??() - { - return 5[1651] ?? 6(1651, 30849, 4); - } - - public static string ??() - { - return 5[1652] ?? 6(1652, 30853, 6); - } - - public static string ??() - { - return 5[1653] ?? 6(1653, 30859, 8); - } - - public static string ??() - { - return 5[1654] ?? 6(1654, 30867, 4); - } - - public static string ??() - { - return 5[1655] ?? 6(1655, 30871, 10); - } - - public static string ??() - { - return 5[1656] ?? 6(1656, 30881, 19); - } - - public static string ??() - { - return 5[1657] ?? 6(1657, 30900, 4); - } - - public static string ??() - { - return 5[1658] ?? 6(1658, 30904, 36); - } - - public static string ??() - { - return 5[1659] ?? 6(1659, 30940, 13); - } - - public static string ??() - { - return 5[1660] ?? 6(1660, 30953, 10); - } - - public static string ??() - { - return 5[1661] ?? 6(1661, 30963, 7); - } - - public static string ??() - { - return 5[1662] ?? 6(1662, 30970, 7); - } - - public static string ??() - { - return 5[1663] ?? 6(1663, 30977, 16); - } - - public static string ??() - { - return 5[1664] ?? 6(1664, 30993, 10); - } - - public static string ??() - { - return 5[1665] ?? 6(1665, 31003, 11); - } - - public static string ??() - { - return 5[1666] ?? 6(1666, 31014, 5); - } - - public static string ??() - { - return 5[1667] ?? 6(1667, 31019, 14); - } - - public static string ??() - { - return 5[1668] ?? 6(1668, 31033, 17); - } - - public static string ??() - { - return 5[1669] ?? 6(1669, 31050, 18); - } - - public static string ??() - { - return 5[1670] ?? 6(1670, 31068, 13); - } - - public static string ??() - { - return 5[1671] ?? 6(1671, 31081, 7); - } - - public static string ??() - { - return 5[1672] ?? 6(1672, 31088, 11); - } - - public static string ??() - { - return 5[1673] ?? 6(1673, 31099, 18); - } - - public static string ??() - { - return 5[1674] ?? 6(1674, 31117, 11); - } - - public static string ??() - { - return 5[1675] ?? 6(1675, 31128, 11); - } - - public static string ??() - { - return 5[1676] ?? 6(1676, 31139, 4); - } - - public static string ??() - { - return 5[1677] ?? 6(1677, 31143, 4); - } - - public static string ??() - { - return 5[1678] ?? 6(1678, 31147, 3); - } - - public static string ??() - { - return 5[1679] ?? 6(1679, 31150, 3); - } - - public static string ??() - { - return 5[1680] ?? 6(1680, 31153, 8); - } - - public static string ??() - { - return 5[1681] ?? 6(1681, 31161, 159); - } - - public static string ??() - { - return 5[1682] ?? 6(1682, 31320, 6); - } - - public static string ??() - { - return 5[1683] ?? 6(1683, 31326, 10); - } - - public static string ??() - { - return 5[1684] ?? 6(1684, 31336, 12); - } - - public static string ??() - { - return 5[1685] ?? 6(1685, 31348, 6); - } - - public static string ??() - { - return 5[1686] ?? 6(1686, 31354, 24); - } - - public static string ??() - { - return 5[1687] ?? 6(1687, 31378, 10); - } - - public static string ??() - { - return 5[1688] ?? 6(1688, 31388, 5); - } - - public static string ??() - { - return 5[1689] ?? 6(1689, 31393, 8); - } - - public static string ??() - { - return 5[1690] ?? 6(1690, 31401, 6); - } - - public static string ??() - { - return 5[1691] ?? 6(1691, 31407, 15); - } - - public static string ??() - { - return 5[1692] ?? 6(1692, 31422, 16); - } - - public static string ??() - { - return 5[1693] ?? 6(1693, 31438, 157); - } - - public static string ??() - { - return 5[1694] ?? 6(1694, 31595, 7); - } - - public static string ??() - { - return 5[1695] ?? 6(1695, 31602, 6); - } - - public static string ??() - { - return 5[1696] ?? 6(1696, 31608, 23); - } - - public static string ??() - { - return 5[1697] ?? 6(1697, 31631, 9); - } - - public static string ??() - { - return 5[1698] ?? 6(1698, 31640, 8); - } - - public static string ??() - { - return 5[1699] ?? 6(1699, 31648, 167); - } - - public static string ??() - { - return 5[1700] ?? 6(1700, 31815, 4); - } - - public static string ??() - { - return 5[1701] ?? 6(1701, 31819, 15); - } - - public static string ??() - { - return 5[1702] ?? 6(1702, 31834, 14); - } - - public static string ??() - { - return 5[1703] ?? 6(1703, 31848, 12); - } - - public static string ??() - { - return 5[1704] ?? 6(1704, 31860, 4); - } - - public static string ??() - { - return 5[1705] ?? 6(1705, 31864, 8); - } - - public static string ??() - { - return 5[1706] ?? 6(1706, 31872, 5); - } - - public static string ??() - { - return 5[1707] ?? 6(1707, 31877, 20); - } - - public static string ??() - { - return 5[1708] ?? 6(1708, 31897, 27); - } - - public static string ??() - { - return 5[1709] ?? 6(1709, 31924, 61); - } - - public static string ??() - { - return 5[1710] ?? 6(1710, 31985, 5); - } - - public static string ??() - { - return 5[1711] ?? 6(1711, 31990, 8); - } - - public static string ??() - { - return 5[1712] ?? 6(1712, 31998, 24); - } - - public static string ??() - { - return 5[1713] ?? 6(1713, 32022, 31); - } - - public static string ??() - { - return 5[1714] ?? 6(1714, 32053, 16); - } - - public static string ??() - { - return 5[1715] ?? 6(1715, 32069, 9); - } - - public static string ??() - { - return 5[1716] ?? 6(1716, 32078, 2); - } - - public static string ??() - { - return 5[1717] ?? 6(1717, 32080, 6); - } - - public static string ??() - { - return 5[1718] ?? 6(1718, 32086, 5); - } - - public static string ??() - { - return 5[1719] ?? 6(1719, 32091, 5); - } - - public static string ??() - { - return 5[1720] ?? 6(1720, 32096, 5); - } - - public static string ??() - { - return 5[1721] ?? 6(1721, 32101, 4); - } - - public static string ??() - { - return 5[1722] ?? 6(1722, 32105, 2); - } - - public static string ??() - { - return 5[1723] ?? 6(1723, 32107, 10); - } - - public static string ??() - { - return 5[1724] ?? 6(1724, 32117, 12); - } - - public static string ??() - { - return 5[1725] ?? 6(1725, 32129, 6); - } - - public static string ??() - { - return 5[1726] ?? 6(1726, 32135, 7); - } - - public static string ??() - { - return 5[1727] ?? 6(1727, 32142, 7); - } - - public static string ??() - { - return 5[1728] ?? 6(1728, 32149, 8); - } - - public static string ??() - { - return 5[1729] ?? 6(1729, 32157, 4); - } - - public static string ??() - { - return 5[1730] ?? 6(1730, 32161, 4); - } - - public static string ??() - { - return 5[1731] ?? 6(1731, 32165, 3); - } - - public static string ??() - { - return 5[1732] ?? 6(1732, 32168, 13); - } - - public static string ??() - { - return 5[1733] ?? 6(1733, 32181, 6); - } - - public static string ??() - { - return 5[1734] ?? 6(1734, 32187, 16); - } - - public static string ??() - { - return 5[1735] ?? 6(1735, 32203, 4); - } - - public static string ??() - { - return 5[1736] ?? 6(1736, 32207, 4); - } - - public static string ??() - { - return 5[1737] ?? 6(1737, 32211, 8); - } - - public static string ??() - { - return 5[1738] ?? 6(1738, 32219, 6); - } - - public static string ??() - { - return 5[1739] ?? 6(1739, 32225, 10); - } - - public static string ??() - { - return 5[1740] ?? 6(1740, 32235, 7); - } - - public static string ??() - { - return 5[1741] ?? 6(1741, 32242, 7); - } - - public static string ??() - { - return 5[1742] ?? 6(1742, 32249, 11); - } - - public static string ??() - { - return 5[1743] ?? 6(1743, 32260, 11); - } - - public static string ??() - { - return 5[1744] ?? 6(1744, 32271, 16); - } - - public static string ??() - { - return 5[1745] ?? 6(1745, 32287, 138); - } - - public static string ??() - { - return 5[1746] ?? 6(1746, 32425, 5); - } - - public static string ??() - { - return 5[1747] ?? 6(1747, 32430, 17); - } - - public static string ??() - { - return 5[1748] ?? 6(1748, 32447, 11); - } - - public static string ??() - { - return 5[1749] ?? 6(1749, 32458, 22); - } - - public static string ??() - { - return 5[1750] ?? 6(1750, 32480, 6); - } - - public static string ??() - { - return 5[1751] ?? 6(1751, 32486, 7); - } - - public static string ??() - { - return 5[1752] ?? 6(1752, 32493, 12); - } - - public static string ??() - { - return 5[1753] ?? 6(1753, 32505, 10); - } - - public static string ??() - { - return 5[1754] ?? 6(1754, 32515, 10); - } - - public static string ??() - { - return 5[1755] ?? 6(1755, 32525, 9); - } - - public static string ??() - { - return 5[1756] ?? 6(1756, 32534, 23); - } - - public static string ??() - { - return 5[1757] ?? 6(1757, 32557, 9); - } - - public static string ??() - { - return 5[1758] ?? 6(1758, 32566, 14); - } - - public static string ??() - { - return 5[1759] ?? 6(1759, 32580, 8); - } - - public static string ??() - { - return 5[1760] ?? 6(1760, 32588, 10); - } - - public static string ??() - { - return 5[1761] ?? 6(1761, 32598, 9); - } - - public static string ??() - { - return 5[1762] ?? 6(1762, 32607, 16); - } - - public static string ??() - { - return 5[1763] ?? 6(1763, 32623, 20); - } - - public static string ??() - { - return 5[1764] ?? 6(1764, 32643, 36); - } - - public static string ??() - { - return 5[1765] ?? 6(1765, 32679, 10); - } - - public static string ??() - { - return 5[1766] ?? 6(1766, 32689, 16); - } - - public static string ??() - { - return 5[1767] ?? 6(1767, 32705, 12); - } - - public static string ??() - { - return 5[1768] ?? 6(1768, 32717, 6); - } - - public static string ??() - { - return 5[1769] ?? 6(1769, 32723, 12); - } - - public static string ??() - { - return 5[1770] ?? 6(1770, 32735, 13); - } - - public static string ??() - { - return 5[1771] ?? 6(1771, 32748, 137); - } - - public static string ??() - { - return 5[1772] ?? 6(1772, 32885, 7); - } - - public static string ??() - { - return 5[1773] ?? 6(1773, 32892, 62); - } - - public static string ??() - { - return 5[1774] ?? 6(1774, 32954, 4); - } - - public static string ??() - { - return 5[1775] ?? 6(1775, 32958, 8); - } - - public static string ??() - { - return 5[1776] ?? 6(1776, 32966, 3); - } - - public static string ??() - { - return 5[1777] ?? 6(1777, 32969, 62); - } - - public static string ??() - { - return 5[1778] ?? 6(1778, 33031, 21); - } - - public static string ??() - { - return 5[1779] ?? 6(1779, 33052, 23); - } - - public static string ??() - { - return 5[1780] ?? 6(1780, 33075, 11); - } - - public static string ??() - { - return 5[1781] ?? 6(1781, 33086, 19); - } - - public static string ??() - { - return 5[1782] ?? 6(1782, 33105, 61); - } - - public static string ??() - { - return 5[1783] ?? 6(1783, 33166, 5); - } - - public static string ??() - { - return 5[1784] ?? 6(1784, 33171, 23); - } - - public static string ??() - { - return 5[1785] ?? 6(1785, 33194, 62); - } - - public static string ??() - { - return 5[1786] ?? 6(1786, 33256, 6); - } - - public static string ??() - { - return 5[1787] ?? 6(1787, 33262, 67); - } - - public static string ??() - { - return 5[1788] ?? 6(1788, 33329, 8); - } - - public static string ??() - { - return 5[1789] ?? 6(1789, 33337, 23); - } - - public static string ??() - { - return 5[1790] ?? 6(1790, 33360, 62); - } - - public static string ??() - { - return 5[1791] ?? 6(1791, 33422, 12); - } - - public static string ??() - { - return 5[1792] ?? 6(1792, 33434, 13); - } - - public static string ??() - { - return 5[1793] ?? 6(1793, 33447, 12); - } - - public static string ??() - { - return 5[1794] ?? 6(1794, 33459, 5); - } - - public static string ??() - { - return 5[1795] ?? 6(1795, 33464, 8); - } - - public static string ??() - { - return 5[1796] ?? 6(1796, 33472, 21); - } - - public static string ??() - { - return 5[1797] ?? 6(1797, 33493, 13); - } - - public static string ??() - { - return 5[1798] ?? 6(1798, 33506, 12); - } - - public static string ??() - { - return 5[1799] ?? 6(1799, 33518, 9); - } - - public static string ??() - { - return 5[1800] ?? 6(1800, 33527, 10); - } - - public static string ??() - { - return 5[1801] ?? 6(1801, 33537, 10); - } - - public static string ??() - { - return 5[1802] ?? 6(1802, 33547, 6); - } - - public static string ??() - { - return 5[1803] ?? 6(1803, 33553, 12); - } - - public static string ??() - { - return 5[1804] ?? 6(1804, 33565, 15); - } - - public static string ??() - { - return 5[1805] ?? 6(1805, 33580, 17); - } - - public static string ??() - { - return 5[1806] ?? 6(1806, 33597, 11); - } - - public static string ??() - { - return 5[1807] ?? 6(1807, 33608, 13); - } - - public static string ??() - { - return 5[1808] ?? 6(1808, 33621, 11); - } - - public static string ??() - { - return 5[1809] ?? 6(1809, 33632, 8); - } - - public static string ??() - { - return 5[1810] ?? 6(1810, 33640, 11); - } - - public static string ??() - { - return 5[1811] ?? 6(1811, 33651, 12); - } - - public static string ??() - { - return 5[1812] ?? 6(1812, 33663, 22); - } - - public static string ??() - { - return 5[1813] ?? 6(1813, 33685, 13); - } - - public static string ??() - { - return 5[1814] ?? 6(1814, 33698, 16); - } - - public static string ??() - { - return 5[1815] ?? 6(1815, 33714, 21); - } - - public static string ??() - { - return 5[1816] ?? 6(1816, 33735, 22); - } - - public static string ??() - { - return 5[1817] ?? 6(1817, 33757, 29); - } - - public static string ??() - { - return 5[1818] ?? 6(1818, 33786, 8); - } - - public static string ??() - { - return 5[1819] ?? 6(1819, 33794, 13); - } - - public static string ??() - { - return 5[1820] ?? 6(1820, 33807, 15); - } - - public static string ??() - { - return 5[1821] ?? 6(1821, 33822, 20); - } - - public static string ??() - { - return 5[1822] ?? 6(1822, 33842, 28); - } - - public static string ??() - { - return 5[1823] ?? 6(1823, 33870, 25); - } - - public static string ??() - { - return 5[1824] ?? 6(1824, 33895, 4); - } - - public static string ??() - { - return 5[1825] ?? 6(1825, 33899, 18); - } - - public static string ??() - { - return 5[1826] ?? 6(1826, 33917, 18); - } - - public static string ??() - { - return 5[1827] ?? 6(1827, 33935, 18); - } - - public static string ??() - { - return 5[1828] ?? 6(1828, 33953, 26); - } - - public static string ??() - { - return 5[1829] ?? 6(1829, 33979, 26); - } - - public static string ??() - { - return 5[1830] ?? 6(1830, 34005, 26); - } - - public static string ??() - { - return 5[1831] ?? 6(1831, 34031, 19); - } - - public static string ??() - { - return 5[1832] ?? 6(1832, 34050, 19); - } - - public static string ??() - { - return 5[1833] ?? 6(1833, 34069, 19); - } - - public static string ??() - { - return 5[1834] ?? 6(1834, 34088, 19); - } - - public static string ??() - { - return 5[1835] ?? 6(1835, 34107, 19); - } - - public static string ??() - { - return 5[1836] ?? 6(1836, 34126, 17); - } - - public static string ??() - { - return 5[1837] ?? 6(1837, 34143, 17); - } - - public static string ??() - { - return 5[1838] ?? 6(1838, 34160, 17); - } - - public static string ??() - { - return 5[1839] ?? 6(1839, 34177, 17); - } - - public static string ??() - { - return 5[1840] ?? 6(1840, 34194, 17); - } - - public static string ??() - { - return 5[1841] ?? 6(1841, 34211, 17); - } - - public static string ??() - { - return 5[1842] ?? 6(1842, 34228, 17); - } - - public static string ??() - { - return 5[1843] ?? 6(1843, 34245, 28); - } - - public static string ??() - { - return 5[1844] ?? 6(1844, 34273, 15); - } - - public static string ??() - { - return 5[1845] ?? 6(1845, 34288, 15); - } - - public static string ??() - { - return 5[1846] ?? 6(1846, 34303, 15); - } - - public static string ??() - { - return 5[1847] ?? 6(1847, 34318, 16); - } - - public static string ??() - { - return 5[1848] ?? 6(1848, 34334, 16); - } - - public static string ??() - { - return 5[1849] ?? 6(1849, 34350, 16); - } - - public static string ??() - { - return 5[1850] ?? 6(1850, 34366, 16); - } - - public static string ??() - { - return 5[1851] ?? 6(1851, 34382, 16); - } - - public static string ??() - { - return 5[1852] ?? 6(1852, 34398, 25); - } - - public static string ??() - { - return 5[1853] ?? 6(1853, 34423, 25); - } - - public static string ??() - { - return 5[1854] ?? 6(1854, 34448, 14); - } - - public static string ??() - { - return 5[1855] ?? 6(1855, 34462, 20); - } - - public static string ??() - { - return 5[1856] ?? 6(1856, 34482, 20); - } - - public static string ??() - { - return 5[1857] ?? 6(1857, 34502, 20); - } - - public static string ??() - { - return 5[1858] ?? 6(1858, 34522, 22); - } - - public static string ??() - { - return 5[1859] ?? 6(1859, 34544, 22); - } - - public static string ??() - { - return 5[1860] ?? 6(1860, 34566, 32); - } - - public static string ??() - { - return 5[1861] ?? 6(1861, 34598, 41); - } - - public static string ??() - { - return 5[1862] ?? 6(1862, 34639, 24); - } - - public static string ??() - { - return 5[1863] ?? 6(1863, 34663, 27); - } - - public static string ??() - { - return 5[1864] ?? 6(1864, 34690, 31); - } - - public static string ??() - { - return 5[1865] ?? 6(1865, 34721, 33); - } - - public static string ??() - { - return 5[1866] ?? 6(1866, 34754, 23); - } - - public static string ??() - { - return 5[1867] ?? 6(1867, 34777, 8); - } - - public static string ??() - { - return 5[1868] ?? 6(1868, 34785, 14); - } - - public static string ??() - { - return 5[1869] ?? 6(1869, 34799, 13); - } - - public static string ??() - { - return 5[1870] ?? 6(1870, 34812, 17); - } - - public static string ??() - { - return 5[1871] ?? 6(1871, 34829, 13); - } - - public static string ??() - { - return 5[1872] ?? 6(1872, 34842, 14); - } - - public static string ??() - { - return 5[1873] ?? 6(1873, 34856, 18); - } - - public static string ??() - { - return 5[1874] ?? 6(1874, 34874, 20); - } - - public static string ??() - { - return 5[1875] ?? 6(1875, 34894, 14); - } - - public static string ??() - { - return 5[1876] ?? 6(1876, 34908, 13); - } - - public static string ??() - { - return 5[1877] ?? 6(1877, 34921, 13); - } - - public static string ??() - { - return 5[1878] ?? 6(1878, 34934, 10); - } - - public static string ??() - { - return 5[1879] ?? 6(1879, 34944, 22); - } - - public static string ??() - { - return 5[1880] ?? 6(1880, 34966, 30); - } - - public static string ??() - { - return 5[1881] ?? 6(1881, 34996, 13); - } - - public static string ??() - { - return 5[1882] ?? 6(1882, 35009, 13); - } - - public static string ??() - { - return 5[1883] ?? 6(1883, 35022, 16); - } - - public static string ??() - { - return 5[1884] ?? 6(1884, 35038, 11); - } - - public static string ??() - { - return 5[1885] ?? 6(1885, 35049, 9); - } - - public static string ??() - { - return 5[1886] ?? 6(1886, 35058, 13); - } - - public static string ??() - { - return 5[1887] ?? 6(1887, 35071, 14); - } - - public static string ??() - { - return 5[1888] ?? 6(1888, 35085, 15); - } - - public static string ??() - { - return 5[1889] ?? 6(1889, 35100, 12); - } - - public static string ??() - { - return 5[1890] ?? 6(1890, 35112, 42); - } - - public static string ??() - { - return 5[1891] ?? 6(1891, 35154, 17); - } - - public static string ??() - { - return 5[1892] ?? 6(1892, 35171, 1); - } - - public static string ??() - { - return 5[1893] ?? 6(1893, 35172, 2); - } - - public static string ??() - { - return 5[1894] ?? 6(1894, 35174, 4); - } - - public static string ??() - { - return 5[1895] ?? 6(1895, 35178, 4); - } - - public static string ??() - { - return 5[1896] ?? 6(1896, 35182, 24); - } - - public static string ??() - { - return 5[1897] ?? 6(1897, 35206, 31); - } - - public static string ??() - { - return 5[1898] ?? 6(1898, 35237, 28); - } - - public static string ??() - { - return 5[1899] ?? 6(1899, 35265, 9); - } - - public static string ??() - { - return 5[1900] ?? 6(1900, 35274, 17); - } - - public static string ??() - { - return 5[1901] ?? 6(1901, 35291, 10); - } - - public static string ??() - { - return 5[1902] ?? 6(1902, 35301, 11); - } - - public static string ??() - { - return 5[1903] ?? 6(1903, 35312, 7); - } - - public static string ??() - { - return 5[1904] ?? 6(1904, 35319, 17); - } - - public static string ??() - { - return 5[1905] ?? 6(1905, 35336, 11); - } - - public static string ??() - { - return 5[1906] ?? 6(1906, 35347, 10); - } - - public static string ??() - { - return 5[1907] ?? 6(1907, 35357, 20); - } - - public static string ??() - { - return 5[1908] ?? 6(1908, 35377, 25); - } - - public static string ??() - { - return 5[1909] ?? 6(1909, 35402, 27); - } - - public static string ??() - { - return 5[1910] ?? 6(1910, 35429, 28); - } - - public static string ??() - { - return 5[1911] ?? 6(1911, 35457, 28); - } - - public static string ??() - { - return 5[1912] ?? 6(1912, 35485, 28); - } - - public static string ??() - { - return 5[1913] ?? 6(1913, 35513, 30); - } - - public static string ??() - { - return 5[1914] ?? 6(1914, 35543, 12); - } - - public static string ??() - { - return 5[1915] ?? 6(1915, 35555, 18); - } - - public static string ??() - { - return 5[1916] ?? 6(1916, 35573, 24); - } - - public static string ??() - { - return 5[1917] ?? 6(1917, 35597, 12); - } - - public static string ??() - { - return 5[1918] ?? 6(1918, 35609, 22); - } - - public static string ??() - { - return 5[1919] ?? 6(1919, 35631, 43); - } - - public static string ??() - { - return 5[1920] ?? 6(1920, 35674, 4); - } - - public static string ??() - { - return 5[1921] ?? 6(1921, 35678, 4); - } - - public static string ??() - { - return 5[1922] ?? 6(1922, 35682, 4); - } - - public static string ??() - { - return 5[1923] ?? 6(1923, 35686, 21); - } - - public static string ??() - { - return 5[1924] ?? 6(1924, 35707, 7); - } - - public static string ??() - { - return 5[1925] ?? 6(1925, 35714, 11); - } - - public static string ??() - { - return 5[1926] ?? 6(1926, 35725, 11); - } - - public static string ??() - { - return 5[1927] ?? 6(1927, 35736, 5); - } - - public static string ??() - { - return 5[1928] ?? 6(1928, 35741, 8); - } - - public static string ??() - { - return 5[1929] ?? 6(1929, 35749, 12); - } - - public static string ??() - { - return 5[1930] ?? 6(1930, 35761, 6); - } - - public static string ??() - { - return 5[1931] ?? 6(1931, 35767, 3); - } - - public static string ??() - { - return 5[1932] ?? 6(1932, 35770, 3); - } - - public static string ??() - { - return 5[1933] ?? 6(1933, 35773, 151); - } - - public static string ??() - { - return 5[1934] ?? 6(1934, 35924, 2); - } - - public static string ??() - { - return 5[1935] ?? 6(1935, 35926, 14); - } - - public static string ??() - { - return 5[1936] ?? 6(1936, 35940, 47); - } - - public static string ??() - { - return 5[1937] ?? 6(1937, 35987, 49); - } - - public static string ??() - { - return 5[1938] ?? 6(1938, 36036, 47); - } - - public static string ??() - { - return 5[1939] ?? 6(1939, 36083, 49); - } - - public static string ??() - { - return 5[1940] ?? 6(1940, 36132, 3); - } - - public static string ??() - { - return 5[1941] ?? 6(1941, 36135, 52); - } - - public static string ??() - { - return 5[1942] ?? 6(1942, 36187, 152); - } - - public static string ??() - { - return 5[1943] ?? 6(1943, 36339, 54); - } - - public static string ??() - { - return 5[1944] ?? 6(1944, 36393, 52); - } - - public static string ??() - { - return 5[1945] ?? 6(1945, 36445, 54); - } - - public static string ??() - { - return 5[1946] ?? 6(1946, 36499, 3); - } - - public static string ??() - { - return 5[1947] ?? 6(1947, 36502, 13); - } - - public static string ??() - { - return 5[1948] ?? 6(1948, 36515, 150); - } - - public static string ??() - { - return 5[1949] ?? 6(1949, 36665, 49); - } - - public static string ??() - { - return 5[1950] ?? 6(1950, 36714, 51); - } - - public static string ??() - { - return 5[1951] ?? 6(1951, 36765, 49); - } - - public static string ??() - { - return 5[1952] ?? 6(1952, 36814, 51); - } - - public static string ??() - { - return 5[1953] ?? 6(1953, 36865, 13); - } - - public static string ??() - { - return 5[1954] ?? 6(1954, 36878, 4); - } - - public static string ??() - { - return 5[1955] ?? 6(1955, 36882, 15); - } - - public static string ??() - { - return 5[1956] ?? 6(1956, 36897, 158); - } - - public static string ??() - { - return 5[1957] ?? 6(1957, 37055, 2); - } - - public static string ??() - { - return 5[1958] ?? 6(1958, 37057, 7); - } - - public static string ??() - { - return 5[1959] ?? 6(1959, 37064, 4); - } - - public static string ??() - { - return 5[1960] ?? 6(1960, 37068, 4); - } - - public static string ??() - { - return 5[1961] ?? 6(1961, 37072, 10); - } - - public static string ??() - { - return 5[1962] ?? 6(1962, 37082, 10); - } - - public static string ??() - { - return 5[1963] ?? 6(1963, 37092, 8); - } - - public static string ??() - { - return 5[1964] ?? 6(1964, 37100, 16); - } - - public static string ??() - { - return 5[1965] ?? 6(1965, 37116, 165); - } - - public static string ??() - { - return 5[1966] ?? 6(1966, 37281, 7); - } - - public static string ??() - { - return 5[1967] ?? 6(1967, 37288, 8); - } - - public static string ??() - { - return 5[1968] ?? 6(1968, 37296, 6); - } - - public static string ??() - { - return 5[1969] ?? 6(1969, 37302, 1); - } - - public static string ??() - { - return 5[1970] ?? 6(1970, 37303, 2); - } - - public static string ??() - { - return 5[1971] ?? 6(1971, 37305, 1); - } - - public static string ??() - { - return 5[1972] ?? 6(1972, 37306, 5); - } - - public static string ??() - { - return 5[1973] ?? 6(1973, 37311, 8); - } - - public static string ??() - { - return 5[1974] ?? 6(1974, 37319, 12); - } - - public static string ??() - { - return 5[1975] ?? 6(1975, 37331, 13); - } - - public static string ??() - { - return 5[1976] ?? 6(1976, 37344, 10); - } - - public static string ??() - { - return 5[1977] ?? 6(1977, 37354, 17); - } - - public static string ??() - { - return 5[1978] ?? 6(1978, 37371, 12); - } - - public static string ??() - { - return 5[1979] ?? 6(1979, 37383, 12); - } - - public static string ??() - { - return 5[1980] ?? 6(1980, 37395, 10); - } - - public static string ??() - { - return 5[1981] ?? 6(1981, 37405, 17); - } - - public static string ??() - { - return 5[1982] ?? 6(1982, 37422, 2); - } - - public static string ??() - { - return 5[1983] ?? 6(1983, 37424, 3); - } - - public static string ??() - { - return 5[1984] ?? 6(1984, 37427, 2); - } - - public static string ??() - { - return 5[1985] ?? 6(1985, 37429, 7); - } - - public static string ??() - { - return 5[1986] ?? 6(1986, 37436, 8); - } - - public static string ??() - { - return 5[1987] ?? 6(1987, 37444, 21); - } - - public static string ??() - { - return 5[1988] ?? 6(1988, 37465, 22); - } - - public static string ??() - { - return 5[1989] ?? 6(1989, 37487, 22); - } - - public static string ??() - { - return 5[1990] ?? 6(1990, 37509, 25); - } - - public static string ??() - { - return 5[1991] ?? 6(1991, 37534, 16); - } - - public static string ??() - { - return 5[1992] ?? 6(1992, 37550, 7); - } - - public static string ??() - { - return 5[1993] ?? 6(1993, 37557, 17); - } - - public static string ??() - { - return 5[1994] ?? 6(1994, 37574, 6); - } - - public static string ??() - { - return 5[1995] ?? 6(1995, 37580, 4); - } - - public static string ??() - { - return 5[1996] ?? 6(1996, 37584, 3); - } - - public static string ??() - { - return 5[1997] ?? 6(1997, 37587, 15); - } - - public static string ??() - { - return 5[1998] ?? 6(1998, 37602, 37); - } - - public static string ??() - { - return 5[1999] ?? 6(1999, 37639, 7); - } - - public static string ??() - { - return 5[2000] ?? 6(2000, 37646, 7); - } - - public static string ??() - { - return 5[2001] ?? 6(2001, 37653, 9); - } - - public static string ??() - { - return 5[2002] ?? 6(2002, 37662, 9); - } - - public static string ??() - { - return 5[2003] ?? 6(2003, 37671, 18); - } - - public static string ??() - { - return 5[2004] ?? 6(2004, 37689, 18); - } - - public static string ??() - { - return 5[2005] ?? 6(2005, 37707, 16); - } - - public static string ??() - { - return 5[2006] ?? 6(2006, 37723, 14); - } - - public static string ??() - { - return 5[2007] ?? 6(2007, 37737, 17); - } - - public static string ??() - { - return 5[2008] ?? 6(2008, 37754, 14); - } - - public static string ??() - { - return 5[2009] ?? 6(2009, 37768, 17); - } - - public static string ??() - { - return 5[2010] ?? 6(2010, 37785, 38); - } - - public static string ??() - { - return 5[2011] ?? 6(2011, 37823, 18); - } - - public static string ??() - { - return 5[2012] ?? 6(2012, 37841, 8); - } - - public static string ??() - { - return 5[2013] ?? 6(2013, 37849, 11); - } - - public static string ??() - { - return 5[2014] ?? 6(2014, 37860, 6); - } - - public static string ??() - { - return 5[2015] ?? 6(2015, 37866, 10); - } - - public static string ??() - { - return 5[2016] ?? 6(2016, 37876, 9); - } - - public static string ??() - { - return 5[2017] ?? 6(2017, 37885, 5); - } - - public static string ??() - { - return 5[2018] ?? 6(2018, 37890, 10); - } - - public static string ??() - { - return 5[2019] ?? 6(2019, 37900, 12); - } - - public static string ??() - { - return 5[2020] ?? 6(2020, 37912, 20); - } - - public static string ??() - { - return 5[2021] ?? 6(2021, 37932, 11); - } - - public static string ??() - { - return 5[2022] ?? 6(2022, 37943, 13); - } - - public static string ??() - { - return 5[2023] ?? 6(2023, 37956, 11); - } - - public static string ??() - { - return 5[2024] ?? 6(2024, 37967, 8); - } - - public static string ??() - { - return 5[2025] ?? 6(2025, 37975, 6); - } - - public static string ??() - { - return 5[2026] ?? 6(2026, 37981, 13); - } - - public static string ??() - { - return 5[2027] ?? 6(2027, 37994, 11); - } - - public static string ??() - { - return 5[2028] ?? 6(2028, 38005, 19); - } - - public static string ??() - { - return 5[2029] ?? 6(2029, 38024, 49); - } - - public static string ??() - { - return 5[2030] ?? 6(2030, 38073, 8); - } - - public static string ??() - { - return 5[2031] ?? 6(2031, 38081, 23); - } - - public static string ??() - { - return 5[2032] ?? 6(2032, 38104, 17); - } - - public static string ??() - { - return 5[2033] ?? 6(2033, 38121, 58); - } - - public static string ??() - { - return 5[2034] ?? 6(2034, 38179, 14); - } - - public static string ??() - { - return 5[2035] ?? 6(2035, 38193, 28); - } - - public static string ??() - { - return 5[2036] ?? 6(2036, 38221, 38); - } - - public static string ??() - { - return 5[2037] ?? 6(2037, 38259, 32); - } - - public static string ??() - { - return 5[2038] ?? 6(2038, 38291, 77); - } - - public static string ??() - { - return 5[2039] ?? 6(2039, 38368, 13); - } - - public static string ??() - { - return 5[2040] ?? 6(2040, 38381, 6); - } - - public static string ??() - { - return 5[2041] ?? 6(2041, 38387, 37); - } - - public static string ??() - { - return 5[2042] ?? 6(2042, 38424, 14); - } - - public static string ??() - { - return 5[2043] ?? 6(2043, 38438, 14); - } - - public static string ??() - { - return 5[2044] ?? 6(2044, 38452, 12); - } - - public static string ??() - { - return 5[2045] ?? 6(2045, 38464, 12); - } - - public static string ??() - { - return 5[2046] ?? 6(2046, 38476, 13); - } - - public static string ??() - { - return 5[2047] ?? 6(2047, 38489, 24); - } - - public static string ??() - { - return 5[2048] ?? 6(2048, 38513, 8); - } - - public static string ??() - { - return 5[2049] ?? 6(2049, 38521, 1); - } - - public static string ??() - { - return 5[2050] ?? 6(2050, 38522, 3); - } - - public static string ??() - { - return 5[2051] ?? 6(2051, 38525, 33); - } - - public static string ??() - { - return 5[2052] ?? 6(2052, 38558, 20); - } - - public static string ??() - { - return 5[2053] ?? 6(2053, 38578, 23); - } - - public static string ??() - { - return 5[2054] ?? 6(2054, 38601, 13); - } - - public static string ??() - { - return 5[2055] ?? 6(2055, 38614, 13); - } - - public static string ??() - { - return 5[2056] ?? 6(2056, 38627, 14); - } - - public static string ??() - { - return 5[2057] ?? 6(2057, 38641, 16); - } - - public static string ??() - { - return 5[2058] ?? 6(2058, 38657, 4); - } - - public static string ??() - { - return 5[2059] ?? 6(2059, 38661, 160); - } - - public static string ??() - { - return 5[2060] ?? 6(2060, 38821, 22); - } - - public static string ??() - { - return 5[2061] ?? 6(2061, 38843, 15); - } - - public static string ??() - { - return 5[2062] ?? 6(2062, 38858, 17); - } - - public static string ??() - { - return 5[2063] ?? 6(2063, 38875, 4); - } - - public static string ??() - { - return 5[2064] ?? 6(2064, 38879, 10); - } - - public static string ??() - { - return 5[2065] ?? 6(2065, 38889, 3); - } - - public static string ??() - { - return 5[2066] ?? 6(2066, 38892, 155); - } - - public static string ??() - { - return 5[2067] ?? 6(2067, 39047, 12); - } - - static 3E560F35-EA4B-4F47-8302-BE30F80C1E18() - { - for (int i = 0; i < 4.Length; i++) - { - 4[i] = (byte)(4[i] ^ i ^ 0xAA); - } - } - } -} +using System; +using System.Collections; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.ComponentModel; +using System.Diagnostics; +using System.Diagnostics.Metrics; +using System.Drawing; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Http.Json; +using System.Net.Mail; +using System.Net.NetworkInformation; +using System.Net.Security; +using System.Net.Sockets; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters.Binary; +using System.Runtime.Versioning; +using System.Security.Claims; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Text.RegularExpressions; +using System.Threading; +using System.Threading.Tasks; +using System.Web; +using System.Windows.Input; +using System.Xml; +using System.Xml.Linq; +using System.Xml.XPath; +using {C306A0DD-1657-4827-8B17-3122184442EB}; +using AuthenticodeExaminer; +using CancelAllOpenOrdersRequests; +using CommandLine; +using FluentFTP; +using IdentityModel.Client; +using IdentityModel.OidcClient; +using IdentityModel.OidcClient.Browser; +using IdentityModel.OidcClient.Results; +using NGettext; +using NGettext.Loaders; +using Platform.Utils; +using ProtoBuf; +using TradingPlatform.BusinessLayer; +using TradingPlatform.BusinessLayer.Abstractions.Misc; +using TradingPlatform.BusinessLayer.Chart; +using TradingPlatform.BusinessLayer.DataBinding; +using TradingPlatform.BusinessLayer.DataBinding.Exceptions; +using TradingPlatform.BusinessLayer.DataBinding.Mvvm; +using TradingPlatform.BusinessLayer.GlobalVariables; +using TradingPlatform.BusinessLayer.History.Aggregations; +using TradingPlatform.BusinessLayer.History.Storage; +using TradingPlatform.BusinessLayer.Integration; +using TradingPlatform.BusinessLayer.Integration.Limitation; +using TradingPlatform.BusinessLayer.Licence; +using TradingPlatform.BusinessLayer.LocalOrders; +using TradingPlatform.BusinessLayer.Media.Messengers; +using TradingPlatform.BusinessLayer.Modules; +using TradingPlatform.BusinessLayer.Modules.PlaceOrderStrategies; +using TradingPlatform.BusinessLayer.Native; +using TradingPlatform.BusinessLayer.PowerTrades; +using TradingPlatform.BusinessLayer.Serialization; +using TradingPlatform.BusinessLayer.Settings.Condition; +using TradingPlatform.BusinessLayer.Settings.OTP; +using TradingPlatform.BusinessLayer.TimeSync; +using TradingPlatform.BusinessLayer.Utils; +using TradingPlatform.BusinessLayer.Utils.Comparers; +using TradingPlatform.BusinessLayer.Utils.EqualityComparers; +using TradingPlatform.BusinessLayer.Utils.Extensions; +using TradingPlatform.BusinessLayer.Utils.Limitation; +using TradingPlatform.BusinessLayer.Utils.Sounds; +using TradingPlatform.BusinessLayer.Utils.Storage; +using TradingPlatform.BusinessLayer.Utils.TaskSchedulers; +using TradingPlatform.BusinessLayer.Utils.TradingProtection; +using TradingPlatform.BusinessLayer.Utils.UserTradesLocalStorage; +using TradingPlatform.BusinessLayer.VolumeAnalysis.Storage; +using ?; + +[assembly: CompilationRelaxations(8)] +[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] +[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] +[assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")] +[assembly: InternalsVisibleTo("TradingPlatform.BusinessLayer.Tests")] +[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] +[assembly: AssemblyCompany("QUANTOWER")] +[assembly: AssemblyConfiguration("Release")] +[assembly: AssemblyCopyright("Copyright cQUANTOWER 2017")] +[assembly: AssemblyFileVersion("1.144.12.0")] +[assembly: AssemblyInformationalVersion("1.144.12+955059d4fca78a19dda63cf80aa2b7a03c9f0221")] +[assembly: AssemblyProduct("Quantower")] +[assembly: AssemblyTitle("TradingPlatform.BusinessLayer")] +[assembly: AssemblyVersion("1.144.12.0")] +[module: RefSafetyRules(11)] +namespace ? +{ + internal static class ? + { + public static string ?(this Assembly P_0) + { + return P_0.?()?.Product; + } + + public static string ?(this Assembly P_0) + { + object obj = P_0.?()?.Version; + if (obj == null) + { + AssemblyFileVersionAttribute assemblyFileVersionAttribute = P_0.?(); + if (assemblyFileVersionAttribute == null) + { + return null; + } + obj = assemblyFileVersionAttribute.Version; + } + return (string)obj; + } + + public static ? ?(this Assembly P_0) where ? : Attribute + { + return P_0.GetCustomAttributes(typeof(?), inherit: false).FirstOrDefault() as ?; + } + } + internal static class ? + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void ?(Assembly P_0, Assembly P_1) + { + if (P_0.?() != P_1.?()) + { + Environment.Exit(0); + } + if (P_0.?() != P_1.?()) + { + Environment.Exit(0); + } + } + } + internal static class ? + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + internal bool ?(AuthenticodeSignature P_0) + { + return P_0.SigningCertificate.Thumbprint.ToUpper() == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + + internal bool ?(AuthenticodeSignature P_0) + { + return P_0.SigningCertificate.Thumbprint.ToUpper() == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void ?(string P_0) + { + if (!?(P_0)) + { + Environment.Exit(0); + } + } + + internal static bool ?(string P_0) + { + try + { + FileInspector fileInspector = new FileInspector(P_0); + SignatureCheckResult signatureCheckResult = fileInspector.Validate(); + IEnumerable signatures = fileInspector.GetSignatures(); + if (Path.GetFileName(P_0) == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) + { + if (signatureCheckResult != SignatureCheckResult.Valid) + { + return false; + } + if (!signatures.Any((AuthenticodeSignature authenticodeSignature) => authenticodeSignature.SigningCertificate.Thumbprint.ToUpper() == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + return false; + } + } + else + { + if (signatureCheckResult != SignatureCheckResult.Valid && signatureCheckResult != SignatureCheckResult.UntrustedRoot) + { + return false; + } + if (!signatures.Any((AuthenticodeSignature authenticodeSignature) => authenticodeSignature.SigningCertificate.Thumbprint.ToUpper() == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + return false; + } + } + return true; + } + catch (Exception) + { + return false; + } + } + } +} +namespace Platform.Utils +{ + public static class Encryptor + { + [CompilerGenerated] + private static string ?; + + public static string UnicDeviceId + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = text; + } + } + + internal static string ?(string P_0) + { + if (string.IsNullOrEmpty(P_0)) + { + return P_0; + } + string result = string.Empty; + try + { + using Aes aes = Aes.Create(); + byte[] bytes = Encoding.UTF8.GetBytes(UnicDeviceId); + int count = Math.Min(aes.IV.Length, bytes.Length); + byte[] array = new byte[aes.IV.Length]; + Buffer.BlockCopy(bytes, 0, array, 0, count); + using ICryptoTransform transform = aes.CreateEncryptor(array, aes.IV); + using MemoryStream memoryStream = new MemoryStream(); + using (CryptoStream stream = new CryptoStream(memoryStream, transform, CryptoStreamMode.Write)) + { + using StreamWriter streamWriter = new StreamWriter(stream); + streamWriter.Write(P_0); + } + byte[] iV = aes.IV; + byte[] array2 = memoryStream.ToArray(); + byte[] array3 = new byte[iV.Length + array2.Length]; + Buffer.BlockCopy(iV, 0, array3, 0, iV.Length); + Buffer.BlockCopy(array2, 0, array3, iV.Length, array2.Length); + result = Convert.ToBase64String(array3); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + return result; + } + + internal static string ?(string P_0) + { + if (string.IsNullOrEmpty(P_0)) + { + return P_0; + } + string result = null; + try + { + byte[] array = Convert.FromBase64String(P_0); + using Aes aes = Aes.Create(); + byte[] array2 = new byte[aes.IV.Length]; + byte[] array3 = new byte[array.Length - array2.Length]; + Buffer.BlockCopy(array, 0, array2, 0, array2.Length); + Buffer.BlockCopy(array, array2.Length, array3, 0, array.Length - array2.Length); + byte[] bytes = Encoding.UTF8.GetBytes(UnicDeviceId); + int count = Math.Min(aes.IV.Length, bytes.Length); + byte[] array4 = new byte[aes.IV.Length]; + Buffer.BlockCopy(bytes, 0, array4, 0, count); + using ICryptoTransform transform = aes.CreateDecryptor(array4, array2); + using MemoryStream stream = new MemoryStream(array3); + using CryptoStream stream2 = new CryptoStream(stream, transform, CryptoStreamMode.Read); + using StreamReader streamReader = new StreamReader(stream2); + result = streamReader.ReadToEnd(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + return result; + } + } +} +namespace CancelAllOpenOrdersRequests +{ + public class CancelAllOpenOrdersOnSymbolRequest : RequestParameters, ISubTradingOperation + { + [CompilerGenerated] + private readonly SymbolComplexIdentifier ??; + + [CompilerGenerated] + private readonly string[] ??; + + [CompilerGenerated] + private readonly GroupTradingOperation ??; + + public override RequestType Type => RequestType.Custom; + + public SymbolComplexIdentifier SymbolComplexIdentifier + { + [CompilerGenerated] + get + { + return ??; + } + } + + public string[] OrderIdArray + { + [CompilerGenerated] + get + { + return ??; + } + } + + public GroupTradingOperation ParentOperation + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public CancelAllOpenOrdersOnSymbolRequest(SymbolComplexIdentifier symbolComplexIdentifier, params string[] orderIdArray) + { + ?? = symbolComplexIdentifier; + ?? = orderIdArray; + } + } + public class CancelAllOpenOrdersOnAccountRequest : RequestParameters, ISubTradingOperation + { + [CompilerGenerated] + private readonly string ??; + + [CompilerGenerated] + private readonly GroupTradingOperation ??; + + public override RequestType Type => RequestType.Custom; + + public string AccountId + { + [CompilerGenerated] + get + { + return ??; + } + } + + public GroupTradingOperation ParentOperation + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public CancelAllOpenOrdersOnAccountRequest(string accountId) + { + ?? = accountId; + } + } + public class CancelAllOpenOrdersOnSymbolAndAccountRequest : RequestParameters, ISubTradingOperation + { + [CompilerGenerated] + private readonly SymbolComplexIdentifier ??; + + [CompilerGenerated] + private readonly string ??; + + [CompilerGenerated] + private readonly GroupTradingOperation ??; + + public override RequestType Type => RequestType.Custom; + + public SymbolComplexIdentifier SymbolComplexIdentifier + { + [CompilerGenerated] + get + { + return ??; + } + } + + public string AccountId + { + [CompilerGenerated] + get + { + return ??; + } + } + + public GroupTradingOperation ParentOperation + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public CancelAllOpenOrdersOnSymbolAndAccountRequest(SymbolComplexIdentifier symbolComplexIdentifier, string accountId) + { + ?? = symbolComplexIdentifier; + ?? = accountId; + } + } + public static class CancelRules + { + public const string ALLOW_CANCEL_ALL_OPEN_ORDERS_ON_SYMBOL = "Allow CancelAllOpenOrdersOnSymbol"; + + public const string ALLOW_CANCEL_ALL_OPEN_ORDERS_ON_ACCOUNT = "Allow CancelAllOpenOrdersOnAccount"; + + public const string ALLOW_CANCEL_ALL_OPEN_ORDERS_ON_SYMBOL_AND_ACCOUNT = "Allow CancelAllOpenOrdersOnSymbolAndAccount"; + } +} +namespace TradingPlatform.BusinessLayer +{ + public interface IConnectionBindedObject + { + string ConnectionId { get; } + } + public interface IConnectionStateDependent + { + ConnectionDependency GetConnectionStateDependency(); + + void OnConnectionStateChanged(Connection connection, ConnectionStateChangedEventArgs e); + } + public interface IHistoryItem : ICloneable + { + DateTime TimeLeft { get; } + + long TicksLeft { get; set; } + + long TicksRight { get; set; } + + double this[PriceType priceType] { get; } + + VolumeAnalysisData VolumeAnalysisData { get; set; } + + void SetData(string key, object value); + + bool TryGetData(string key, out TData data); + } + public interface IHistoryProcessor : IDisposable + { + SubscribeQuoteType? GetSubscribeQuoteType { get; } + + event HistoryEventHandler NewHistoryItem; + + event HistoryEventHandler HistoryItemUpdated; + + void Initialize(HistoryRequestParameters historyRequestParameters); + + IList AggregateHistory(HistoryHolder historyHolder); + + void ProcessQuote(MessageQuote messageQuote); + + void CorrectHistoryRequestBorders(HistoryRequestParameters historyRequestParameters); + + string GetTimeToNextBar(); + } + public interface IBusinessObjectsProvider + { + /// + /// Gets s list + /// + Symbol[] Symbols { get; } + + /// + /// Gets symbol types list + /// + SymbolType[] SymbolTypes { get; } + + /// + /// Gets s list + /// + Account[] Accounts { get; } + + /// + /// Gets s list + /// + Asset[] Assets { get; } + + /// + /// Gets Exchanges list + /// + Exchange[] Exchanges { get; } + + /// + /// Gets Orders list + /// + Order[] Orders { get; } + + /// + /// Gets Order Types list + /// + OrderType[] OrderTypes { get; } + + /// + /// Gets Positions list + /// + Position[] Positions { get; } + + /// + /// Gets Closed Positions list + /// + ClosedPosition[] ClosedPositions { get; } + + /// + /// Gets Corporate Actions list + /// + CorporateAction[] CorporateActions { get; } + + /// + /// Gets Report Types list + /// + ReportType[] ReportTypes { get; } + + DeliveredAsset[] DeliveredAssets { get; } + + AccountOperation[] AccountOperations { get; } + + /// + /// Gets s list + /// + TradingSignal[] TradingSignals { get; } + } + public interface ICurrentAccount + { + Account CurrentAccount { get; set; } + } + public interface ICurrentSymbol + { + Symbol CurrentSymbol { get; set; } + } + public interface ICustomizable + { + IList Settings { get; set; } + } + public interface ISetAsDefault + { + IList DefaultSetting { get; } + + void SetAsDefault(); + } + public interface ISaveAsTemplate : ISetAsDefault + { + IChartObjectTemplate[] AvailableTemplates { get; } + + void SaveAsTemplate(); + + void ApplyTemplate(IChartObjectTemplate template); + + void RenameTemplate(IChartObjectTemplate template); + + void RemoveTemplate(IChartObjectTemplate template); + } + public interface ICustomizableVisualGroups + { + void ProcessSettingsVisualGroups(IList settings); + } + public interface IHistoryTypeIndicator + { + HistoryType HistoryType { get; } + } +} +namespace ? +{ + internal interface ? + { + void ?(Indicator P_0); + } +} +namespace TradingPlatform.BusinessLayer +{ + public interface IIndicatorsCollection + { + void AddIndicator(Indicator indicator); + + void RemoveIndicator(Indicator indicator); + } + public interface IRangeWatchlistIndicator : IWatchlistIndicator + { + TimeSpan MinHistoryRange { get; } + } + public interface ISessionObserverIndicator + { + ISessionsContainer SessionContainer { get; } + } + public interface IVolumeAnalysisIndicator + { + bool IsRequirePriceLevelsCalculation { get; } + + void VolumeAnalysisData_Loaded(); + } + public interface IWatchlistIndicator + { + int MinHistoryDepths { get; } + } + public interface IOrder : ITradingObject, IUniqueID + { + /// + /// The ID of the order group. This group created when trades done by the MAM account. + /// + string GroupId { get; } + + /// + /// Total quantity of the order + /// + double TotalQuantity { get; } + + /// + /// Gets OrderType + /// + OrderType OrderType { get; } + + /// + /// Gets order price value + /// + double Price { get; } + + /// + /// Gets order trigger price value + /// + double TriggerPrice { get; } + + /// + /// Gets order trailing offset value + /// + double TrailOffset { get; } + + /// + /// Gets orders current status + /// + OrderStatus Status { get; } + + /// + /// Gets orders last update time + /// + DateTime LastUpdateTime { get; } + + /// + /// Gets Position Id. + /// + string PositionId { get; } + + /// + /// Gets StopLoss holder for given order + /// + SlTpHolder StopLoss { get; } + + /// + /// Gets TakeProfit holder for given order + /// + SlTpHolder TakeProfit { get; } + + SlTpHolder[] StopLossItems { get; } + + SlTpHolder[] TakeProfitItems { get; } + + string ConnectionId { get; } + + /// + /// Orders Type Id. It is used for the orders type comparing. + /// + string OrderTypeId { get; } + + /// + /// Gets order TIF(Time-In-Force) type + /// + TimeInForce TimeInForce { get; } + + /// + /// Gets orders expiration time + /// + DateTime ExpirationTime { get; } + + BusinessObjectState State { get; } + + /// + /// Remaining quantity of the order + /// + double RemainingQuantity { get; } + + /// + /// Filled quantity of the order + /// + double FilledQuantity { get; } + + /// + /// Gets open order original status + /// + string OriginalStatus { get; } + + double AverageFillPrice { get; } + + /// + /// Will be triggered on each invocation + /// + event Action Updated; + } + public interface ITradingObject + { + string Id { get; } + + Account Account { get; } + + Symbol Symbol { get; } + + Side Side { get; } + + string Comment { get; } + + AdditionalInfoCollection AdditionalInfo { get; } + } + public interface IUniqueID + { + string UniqueId { get; } + } + public interface IBuyerSellerData + { + string Seller { get; } + + string Buyer { get; } + } + public interface IVolumeTickData + { + VolumeTickDataType VolumeTickDataType { get; } + + long Time { get; } + + double Price { get; } + + double Volume { get; } + + TickDirection TickDirection { get; } + + AggressorFlag AggressorFlag { get; } + } + public enum VolumeTickDataType + { + Ticks, + Lasts + } + public sealed class DefaultSessionsContainer : ISessionsContainer, IMessageBuilder + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal SessionsSet ?(CustomSession P_0) + { + return new SessionsSet + { + Days = P_0.Days, + CertainDates = new DateTime[0], + Sessions = new Session[1] + { + new Session(P_0.Name, P_0.OpenTime, P_0.CloseTime) + } + }; + } + } + + private static DefaultSessionsContainer ??; + + private readonly CustomSession[] ??; + + public static DefaultSessionsContainer Instance + { + get + { + lock (typeof(DefaultSessionsContainer)) + { + if (?? == null) + { + ?? = new DefaultSessionsContainer(); + } + } + return ??; + } + } + + public ISession[] ActiveSessions => ??; + + public TimeZoneInfo TimeZone => null; + + private DefaultSessionsContainer() + { + ?? = new CustomSession[1] + { + new CustomSession + { + Name = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + OpenOffset = TimeSpan.Zero, + CloseOffset = TimeSpan.FromTicks(863999999999L), + Days = Enum.GetValues(typeof(DayOfWeek)).Cast().ToArray(), + Type = SessionType.Main + } + }; + } + + public ISession[] GetSessionsForDate(DateTime dateTime) + { + return ??; + } + + public MessageSessionsContainer BuildMessage() + { + return new MessageSessionsContainer + { + Id = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + Name = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + Description = string.Empty, + Holidays = new HolidayInfo[0], + SessionsSets = ???.Select((CustomSession P_0) => new SessionsSet + { + Days = P_0.Days, + CertainDates = new DateTime[0], + Sessions = new Session[1] + { + new Session(P_0.Name, P_0.OpenTime, P_0.CloseTime) + } + }).ToArray() + }; + } + } + public interface ISession + { + string Name { get; } + + SessionType Type { get; } + + TimeSpan OpenTime { get; } + + TimeSpan CloseTime { get; } + + bool IsPrimary { get; } + } + public interface ISessionsContainer + { + ISession[] ActiveSessions { get; } + + TimeZoneInfo TimeZone { get; } + + ISession[] GetSessionsForDate(DateTime dateTime); + } + public enum SessionType + { + [Description("Main")] + Main, + [Description("Pre-market")] + PreMarket, + [Description("Post-market")] + PostMarket + } + [Published] + public interface IVolumeAnalysisCalculationProgress : IDisposable + { + VolumeAnalysisCalculationState State { get; } + + int ProgressPercent { get; } + + int ProgressBarIndex { get; } + + bool IsAborted { get; } + + VolumeAnalysisCalculationParameters CalculationParameters { get; } + + event EventHandler StateChanged; + + event EventHandler ProgressChanged; + + void AbortLoading(); + + void Wait(CancellationToken token = default(CancellationToken)); + } + [Published] + public interface IVolumeAnalysisCalculationTask : IDisposable + { + VolumeAnalysisData Result { get; } + + IVolumeAnalysisCalculationProgress Progress { get; } + } + /// + /// Defines 'Volume Analysis' calculation result item + /// + public interface IVolumeAnalysisItem + { + double GetValue(VolumeAnalysisField field); + } + /// + /// Contains all user's account information + /// + [Published] + public class Account : BusinessObject, ?, IMessageBuilder, IComparable, IComparable, IEquatable + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private Asset ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private NettingType ??; + + [CompilerGenerated] + private AdditionalInfoCollection ??; + + private readonly ? ??; + + [CompilerGenerated] + private Action ??; + + /// + /// Gets account unique code. + /// + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Obtaining account name. + /// + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Gets base currency of account. Account CCY is always equal to the server CCY in AlgoStudio + /// + public Asset AccountCurrency + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = asset; + } + } + + /// + /// Gets current balance of the account. + /// + public double Balance + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public NettingType NettingType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets additional account information + /// + [NotPublished] + public AdditionalInfoCollection AdditionalInfo + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = additionalInfoCollection; + } + } + + int ?.PriorityIndex => 10; + + ? ?.Rules => ??; + + /// + /// Will be triggered on each account information updating + /// + public event Action Updated + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + [NotPublished] + protected internal Account(string connectionId) + : base(connectionId) + { + ?? = new ?(); + Core.Instance.RulesManager.Defaults.ForEach(delegate(Rule P_0) + { + ??.?(P_0.Name, P_0); + }); + } + + [NotPublished] + protected internal Account(BusinessObjectInfo accountInfo) + : base(accountInfo.ConnectionId) + { + Id = accountInfo.Id; + Name = accountInfo.Name; + State = BusinessObjectState.Fake; + } + + internal void ?(MessageAccount P_0) + { + Id = P_0.AccountId; + Name = P_0.AccountName; + if (P_0.AssetId != null && ConnectionCache != null && ConnectionCache.??.TryGetValue(P_0.AssetId, out var value)) + { + AccountCurrency = value; + } + Balance = P_0.Balance; + NettingType = P_0.NettingType; + if (P_0.AccountAdditionalInfo != null) + { + if (AdditionalInfo == null) + { + AdditionalInfoCollection additionalInfoCollection = (AdditionalInfo = new AdditionalInfoCollection()); + } + foreach (AdditionalInfoItem item in P_0.AccountAdditionalInfo) + { + AdditionalInfo.?(item); + } + } + ???.Invoke(this); + } + + private MessageAccount ?() + { + return new MessageAccount + { + AccountId = Id, + AccountName = Name, + AssetId = AccountCurrency.Id, + Balance = Balance, + AccountAdditionalInfo = AdditionalInfo?.Items.ToList() + }; + } + + MessageAccount IMessageBuilder.BuildMessage() + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(); + } + + /// + /// Gets Account name + /// + /// + [NotPublished] + public override string ToString() + { + return Name; + } + + /// + /// Creates a business object info with an Account data which can be used for the restoring/serialization process. + /// + /// + [NotPublished] + public override BusinessObjectInfo CreateInfo() + { + return new ? + { + ConnectionId = base.ConnectionId, + Id = Id, + Name = Name, + IsCrypto = false + }; + } + + public int CompareTo(object obj) + { + return CompareTo(obj as Account); + } + + public int CompareTo(Account other) + { + if (this == other) + { + return 0; + } + if (other == null) + { + return 1; + } + return string.Compare(Id, other.Id, StringComparison.Ordinal); + } + + public bool Equals(Account other) + { + if (other == null) + { + return false; + } + if (this == other) + { + return true; + } + if (Id == other.Id) + { + return base.ConnectionId == other.ConnectionId; + } + return false; + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + if (this == obj) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((Account)obj); + } + + public override int GetHashCode() + { + return HashCode.Combine(Id, base.ConnectionId); + } + + [CompilerGenerated] + private void ?(Rule P_0) + { + ??.?(P_0.Name, P_0); + } + } + /// + /// The account operation. + /// + public class AccountOperation : BusinessObject, IComparable + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private IList ??; + + private AccountOperationUpdateHandler ??; + + private AccountOperationConfirmationHandler ??; + + private AccountOperationExecuteHandler ??; + + /// + /// Gets the name. + /// + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Gets the button text. + /// + public string ButtonText + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Gets the settings. + /// + public IList Settings + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = list; + } + } + + internal AccountOperation(string P_0) + : base(P_0) + { + } + + /// + /// + /// + /// The settings. + public void Update(IList settings) + { + ???.Invoke(settings); + } + + /// + /// Builds the confirmation. + /// + /// The settings. + /// A string. + public string BuildConfirmation(IList settings) + { + return ???.Invoke(settings); + } + + /// + /// + /// + /// The settings. + public void Execute(IList settings) + { + ???.Invoke(settings); + } + + internal void ?(MessageAccountOperation P_0) + { + Name = P_0.Name; + ButtonText = P_0.ButtonText; + Settings = P_0.Settings.DeepCopy().ToList(); + ?? = P_0.UpdateHandler; + ?? = P_0.BuildConfirmationHandler; + ?? = P_0.ExecuteHandler; + } + + /// + /// Compare to. + /// + /// The obj. + /// An int. + public int CompareTo(object obj) + { + if (!(obj is AccountOperation accountOperation)) + { + return 0; + } + return string.Compare(Name, accountOperation.Name, StringComparison.Ordinal); + } + } + public delegate string AccountOperationConfirmationHandler(IList settings); + public delegate void AccountOperationExecuteHandler(IList settings); + public delegate void AccountOperationUpdateHandler(IList settings); + /// + /// The additional info collection. + /// + public class AdditionalInfoCollection : IEnumerable, IEnumerable, IEquatable + { + private readonly Dictionary ?; + + private readonly object ?; + + private static readonly ListEqualityComparer ?; + + /// + /// Gets the count. + /// + public int Count => ?.Count; + + public AdditionalInfoItem this[string key] + { + get + { + if (TryGetItem(key, out var item)) + { + return item; + } + throw new KeyNotFoundException(); + } + } + + /// + /// Gets the items. + /// + public IEnumerable Items + { + get + { + lock (?) + { + foreach (KeyValuePair item in ?) + { + yield return item.Value.Clone() as AdditionalInfoItem; + } + } + } + } + + static AdditionalInfoCollection() + { + ? = new ListEqualityComparer(EqualityComparer.Default); + } + + /// + /// Initializes a new instance of the class. + /// + public AdditionalInfoCollection() + { + ? = new Dictionary(); + ? = new object(); + } + + /// + /// Initializes a new instance of the class. + /// + /// The items. + public AdditionalInfoCollection(params AdditionalInfoItem[] items) + : this() + { + foreach (AdditionalInfoItem additionalInfoItem in items) + { + ?(additionalInfoItem); + } + } + + /// + /// Try get item. + /// + /// The api key. + /// The item. + /// A bool. + public bool TryGetItem(string apiKey, out AdditionalInfoItem item) + { + item = null; + lock (?) + { + if (?.TryGetValue(apiKey, out var value)) + { + item = value.Clone() as AdditionalInfoItem; + return true; + } + } + return false; + } + + internal void ?(AdditionalInfoItem P_0) + { + lock (?) + { + if (!?.TryGetValue(P_0.Id, out var value)) + { + value = new AdditionalInfoItem(); + ?.Add(P_0.Id, value); + } + value.Update(P_0); + } + } + + internal void ?(IEnumerable P_0) + { + lock (?) + { + foreach (SettingItem item in P_0) + { + if (?.TryGetValue(item.Name, out var value)) + { + value.Value = item.Value; + } + } + } + } + + /// + /// Gets the enumerator. + /// + /// ]]> + public IEnumerator GetEnumerator() + { + return Items.GetEnumerator(); + } + + private IEnumerator ?() + { + return GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(); + } + + /// + /// Tos the string. + /// + /// A string. + public override string ToString() + { + StringBuilder stringBuilder = new StringBuilder(); + using (IEnumerator enumerator = GetEnumerator()) + { + while (enumerator.MoveNext()) + { + AdditionalInfoItem current = enumerator.Current; + if (current.Hidden || !current.Visible) + { + continue; + } + string value = ((current.FormattingDescription == null) ? current.Value.ToString() : current.FormattingDescription.GetFormattedData()); + if (string.IsNullOrEmpty(current.NameKey) && string.IsNullOrEmpty(value)) + { + continue; + } + if (string.IsNullOrEmpty(current.NameKey)) + { + StringBuilder stringBuilder2 = stringBuilder; + StringBuilder stringBuilder3 = stringBuilder2; + StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(2, 1, stringBuilder2); + handler.AppendFormatted(value); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder3.Append(ref handler); + continue; + } + object value2 = current.Value; + if (value2 is bool) + { + if ((bool)value2) + { + StringBuilder stringBuilder2 = stringBuilder; + StringBuilder stringBuilder4 = stringBuilder2; + StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(2, 1, stringBuilder2); + handler.AppendFormatted(current.NameKey); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder4.Append(ref handler); + } + } + else + { + StringBuilder stringBuilder2 = stringBuilder; + StringBuilder stringBuilder5 = stringBuilder2; + StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(5, 2, stringBuilder2); + handler.AppendFormatted(current.NameKey); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + handler.AppendFormatted(value); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder5.Append(ref handler); + } + } + } + return stringBuilder.ToString().TrimEnd(' ', ';'); + } + + public bool Equals(AdditionalInfoCollection other) + { + List x = Items.ToList(); + List y = other.Items.ToList(); + return ?.Equals(x, y); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + if (this == obj) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((AdditionalInfoCollection)obj); + } + + public override int GetHashCode() + { + return ?.GetHashCode(Items.ToList()); + } + } + /// + /// The comparing type. + /// + [DataContract(Name = "ComparingType", Namespace = "TradingPlatform")] + public enum ComparingType + { + [EnumMember] + String, + [EnumMember] + Int, + [EnumMember] + Double, + [EnumMember] + Long, + [EnumMember] + DateTime, + [EnumMember] + Boolean + } + /// + /// The additional info item formating type. + /// + public enum AdditionalInfoItemFormatingType + { + None, + AssetBalance, + CustomAsset, + Percent + } + /// + /// The additional info item. + /// + [ProtoContract] + public class AdditionalInfoItem : ICloneable, IXElementSerialization, IEquatable + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private ComparingType ??; + + [CompilerGenerated] + private object ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private AdditionalInfoItemFormatingType ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private EditingInfo ??; + + [CompilerGenerated] + private IFormattingDescription ??; + + /// + /// ???? ??? ???, ??????????? ??? ?????????? ? ?????? ???? ?????????? + /// + [ProtoMember(1)] + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the group info. + /// + [ProtoMember(2)] + public string GroupInfo + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the sort index. + /// + [ProtoMember(3)] + public int SortIndex + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the name key. + /// + [ProtoMember(4)] + public string NameKey + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the tool tip key. + /// + [ProtoMember(5)] + public string ToolTipKey + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the data type. + /// + [ProtoMember(6)] + public ComparingType DataType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the value. + /// + [ProtoIgnore] + public object Value + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets a value indicating whether hidden. + /// + [ProtoMember(7)] + public bool Hidden + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the formating type. + /// + [ProtoMember(8)] + public AdditionalInfoItemFormatingType FormatingType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// ???????????? ? ?????? ? AccountAdditionalInfoItemFormatingType.CustomAsset ??? ?????????????? ? ???????? ?????? + /// + [ProtoMember(9)] + public string CustomAssetID + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets a value indicating whether visible. + /// + [ProtoMember(10)] + public bool Visible + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets a value indicating whether is link. + /// + [ProtoMember(11)] + public bool IsLink + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(12, IsRequired = false)] + private string ProtoDynamicPropertySurrogateString + { + get + { + if (DataType != ComparingType.String) + { + return null; + } + return (string)Value; + } + set + { + if (DataType == ComparingType.String && text != null) + { + Value = text; + } + } + } + + [ProtoMember(13, IsRequired = false)] + private int? ProtoDynamicPropertySurrogateInt + { + get + { + if (DataType != ComparingType.Int) + { + return null; + } + return (int)Value; + } + set + { + if (DataType == ComparingType.Int && num.HasValue) + { + Value = num; + } + } + } + + [ProtoMember(14, IsRequired = false)] + private double? ProtoDynamicPropertySurrogateDouble + { + get + { + if (DataType != ComparingType.Double) + { + return null; + } + return (double)Value; + } + set + { + if (DataType == ComparingType.Double && num.HasValue) + { + Value = num; + } + } + } + + [ProtoMember(15, IsRequired = false)] + private long? ProtoDynamicPropertySurrogateLong + { + get + { + if (DataType != ComparingType.Long) + { + return null; + } + return (long)Value; + } + set + { + if (DataType == ComparingType.Long && num.HasValue) + { + Value = num; + } + } + } + + [ProtoMember(16, IsRequired = false)] + private DateTime? ProtoDynamicPropertySurrogateDateTime + { + get + { + if (DataType != ComparingType.DateTime) + { + return null; + } + return (DateTime)Value; + } + set + { + if (DataType == ComparingType.DateTime && dateTime.HasValue) + { + Value = dateTime; + } + } + } + + [ProtoMember(17, IsRequired = false)] + private bool? ProtoDynamicPropertySurrogateBoolean + { + get + { + if (DataType != ComparingType.Boolean) + { + return null; + } + return (bool)Value; + } + set + { + if (DataType == ComparingType.Boolean && flag.HasValue) + { + Value = flag; + } + } + } + + /// + /// Gets or Sets the editing info. + /// + public EditingInfo EditingInfo + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the formatting description. + /// + public IFormattingDescription FormattingDescription + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Initializes a new instance of the class. + /// + public AdditionalInfoItem() + { + Visible = true; + } + + /// + /// + /// + /// The item. + public virtual void Update(AdditionalInfoItem item) + { + GroupInfo = item.GroupInfo; + SortIndex = item.SortIndex; + NameKey = item.NameKey; + ToolTipKey = item.ToolTipKey; + DataType = item.DataType; + Value = item.Value; + Hidden = item.Hidden; + Visible = item.Visible; + IsLink = item.IsLink; + Id = item.Id; + FormatingType = item.FormatingType; + CustomAssetID = item.CustomAssetID; + EditingInfo = ((item.EditingInfo == null) ? null : new EditingInfo(item.EditingInfo)); + FormattingDescription = item.FormattingDescription; + } + + /// + /// + /// + /// An object. + public object Clone() + { + AdditionalInfoItem additionalInfoItem = new AdditionalInfoItem(); + additionalInfoItem.Update(this); + return additionalInfoItem; + } + + /// + /// To the XML element. + /// + /// A XElement. + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GroupInfo)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SortIndex)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), NameKey)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ToolTipKey)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)DataType)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Value)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), Hidden)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)FormatingType)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CustomAssetID)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Visible)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsLink)); + return xElement; + } + + /// + /// From the XML element. + /// + /// The element. + /// The deserialization info. + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + Id = xElement.Value; + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + GroupInfo = xElement2.Value; + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + SortIndex = xElement3.ToInt(); + } + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + NameKey = xElement4.Value; + } + XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement5 != null) + { + ToolTipKey = xElement5.Value; + } + XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement6 != null) + { + DataType = (ComparingType)xElement6.ToInt(); + } + XElement xElement7 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement7 != null) + { + Value = DataType switch + { + ComparingType.Int => xElement7.ToInt(), + ComparingType.Double => xElement7.ToDouble(), + ComparingType.Long => xElement7.ToLong(), + ComparingType.DateTime => xElement7.ToDateTime(), + ComparingType.Boolean => xElement7.ToBool(), + _ => xElement7.Value, + }; + } + XElement xElement8 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + if (xElement8 != null) + { + Hidden = xElement8.ToBool(); + } + XElement xElement9 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement9 != null) + { + FormatingType = (AdditionalInfoItemFormatingType)xElement9.ToInt(); + } + XElement xElement10 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement10 != null) + { + CustomAssetID = xElement10.Value; + } + XElement xElement11 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement11 != null) + { + Visible = xElement11.ToBool(); + } + XElement xElement12 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement12 != null) + { + IsLink = xElement12.ToBool(); + } + } + + /// + /// To the string. + /// + /// A string. + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(38, 4); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Id); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(GroupInfo); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Visible); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Hidden); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public bool Equals(AdditionalInfoItem other) + { + if (other == null) + { + return false; + } + if (this == other) + { + return true; + } + if (NameKey == other.NameKey) + { + return object.Equals(Value, other.Value); + } + return false; + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + if (this == obj) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((AdditionalInfoItem)obj); + } + + public override int GetHashCode() + { + return HashCode.Combine(NameKey, Value); + } + } + public class EditingInfo + { + [CompilerGenerated] + private SettingItem ?; + + [CompilerGenerated] + private Action ?; + + public SettingItem SettingItem + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + public Action ValueChanged + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + public EditingInfo() + { + } + + public EditingInfo(EditingInfo origin) + { + SettingItem = origin.SettingItem.GetCopy(); + ValueChanged = origin.ValueChanged; + } + } + /// + /// Defines asset entity + /// + [Published] + public class Asset : BusinessObject, IComparable, IMessageBuilder + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + private double ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private string ??; + + /// + /// Asset id bearer + /// + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Asset name bearer + /// + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Asset description + /// + public string Description + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Defines a number precision of the change value + /// + public double MinimumChange + { + get + { + return ??; + } + set + { + if (?? != value) + { + ?? = value; + Precision = CoreMath.GetValuePrecision((decimal)??); + } + } + } + + /// + /// Gets precision value + /// + public int Precision + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets asset ISO 4217 code + /// + public string IsoCode + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Creates an Asset instance + /// + /// given connection Id + [NotPublished] + public Asset(string connectionId) + : base(connectionId) + { + } + + /// + /// Formats price into precision normalized string + /// + /// + /// + public string FormatPrice(double price) + { + if (!double.IsNaN(price)) + { + return price.Format(Precision); + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); + } + + /// + /// Formats price into concatenated string which contains the precision normalized value and Asset's name + /// + /// + /// + public string FormatPriceWithCurrency(double price) + { + if (!double.IsNaN(price)) + { + return price.Format(Precision) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Name; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); + } + + public string FormatWithCurrency(double value) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(1, 2); + defaultInterpolatedStringHandler.AppendFormatted(value); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + internal void ?(MessageAsset P_0) + { + Id = P_0.Id; + Name = P_0.Name; + Description = P_0.Description; + MinimumChange = P_0.MinimumChange; + IsoCode = P_0.IsoCode; + } + + private MessageAsset ?() + { + return new MessageAsset + { + Id = Id, + Name = Name, + Description = Description, + MinimumChange = MinimumChange, + IsoCode = IsoCode + }; + } + + MessageAsset IMessageBuilder.BuildMessage() + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(); + } + + /// + /// Gets Asset name + /// + /// + [NotPublished] + public override string ToString() + { + return Name; + } + + /// + /// Uses comparison by Assets names + /// + /// + /// + [NotPublished] + public int CompareTo(object obj) + { + if (!(obj is Asset asset)) + { + return 1; + } + return Name.CompareTo(asset.Name); + } + } + [DataContract] + [KnownType(typeof(Account))] + [KnownType(typeof(PnLItem))] + public abstract class BusinessObject : IConnectionBindedObject, IUniqueID + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private BusinessObjectState ??; + + private Connection ??; + + [CompilerGenerated] + private string ??; + + private static long ??; + + public string ConnectionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + public virtual BusinessObjectState State + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected internal set + { + ?? = value; + } + } + + public virtual Connection Connection => ?? ?? (?? = Core.Instance.Connections[ConnectionId]); + + internal virtual ? ConnectionCache => Connection?.??; + + /// + /// Unique ID during active session. Don't use for serialization + /// + public string UniqueId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + internal BusinessObject() + { + } + + internal BusinessObject(string P_0) + { + UniqueId = Interlocked.Increment(ref ??).ToString(); + ConnectionId = P_0; + State = BusinessObjectState.Normal; + } + + [NotPublished] + public virtual BusinessObjectInfo CreateInfo() + { + return new BusinessObjectInfo + { + ConnectionId = ConnectionId + }; + } + } + [DataContract(Name = "AccountStatus", Namespace = "TradingPlatform")] + public enum AccountStatus + { + [EnumMember] + Active, + [EnumMember] + Closed, + [EnumMember] + Halted + } + /// + /// ?????????? ???????????? ????????????? ????? ??? ???? ??????????? + /// + [DataContract(Name = "InstrumentType", Namespace = "TradingPlatform")] + public enum SymbolType + { + [EnumMember] + Unknown, + [EnumMember] + Forex, + [EnumMember] + Equities, + [EnumMember] + CFD, + [EnumMember] + Indexes, + [EnumMember] + Futures, + [EnumMember] + Options, + [EnumMember] + ETF, + [EnumMember] + Crypto, + [EnumMember] + Synthetic, + [EnumMember] + Spot, + [EnumMember] + Forward, + [EnumMember] + FixedIncome, + [EnumMember] + Warrants, + /// + /// ?????? ??? ????????? ?????????? + /// + [EnumMember] + Debentures, + [EnumMember] + Bond, + [EnumMember] + Swap + } + [DataContract(Name = "InstrumentQuotingType", Namespace = "TradingPlatform")] + public enum SymbolQuotingType + { + [EnumMember] + LotSize, + [EnumMember] + TickSizeTickCost, + [EnumMember] + Undefined + } + [DataContract(Name = "OptionCodingStyle", Namespace = "TradingPlatform")] + public enum OptionCodingStyle + { + [EnumMember] + Unspecified, + [EnumMember] + European, + [EnumMember] + American + } + public enum OrderStatus + { + [Description("Unspecified")] + Unspecified, + [Description("Opened")] + Opened, + [Description("Partially Filled")] + PartiallyFilled, + [Description("Filled")] + Filled, + [Description("Cancelled")] + Cancelled, + [Description("Refused")] + Refused, + [Description("Inactive")] + Inactive + } + public enum TimeInForce + { + [Description("Default")] + Default, + [Description("Day")] + Day, + [Description("Fill Or Kill")] + FOK, + [Description("Good Till Cancel")] + GTC, + [Description("Immediate Or Cancel")] + IOC, + [Description("Good Till Date")] + GTD, + [Description("Good Till Time")] + GTT, + [Description("Fill And Kill")] + FAK, + [Description("At The Open")] + ATO, + [Description("At The Close")] + ATC + } + public enum DealTicketType + { + [Description("Info")] + Info, + [Description("Refuse")] + Refuse, + [Description("Order opened")] + OrderOpened, + [Description("Order filled")] + OrderFilled, + [Description("Order partially filled")] + OrderPartiallyFilled, + [Description("Order cancelled")] + OrderCancelled, + [Description("Trading operation request")] + TradingOperationRequest, + [Description("Trading operation success")] + TradingOperationResultSuccess, + [Description("Trading operation refuse")] + TradingOperationResultRefuse, + [Description("Trading signal")] + TradingSignal, + [Description("Terminal update")] + TerminalUpdate, + [Description("License")] + License, + [Description("Connection success")] + ConnectionSuccess, + [Description("Connection lost")] + ConnectionLost + } + public enum DealTicketState + { + Received, + Seen + } + public enum PriceMeasurement + { + Absolute, + Offset + } + [DataContract(Name = "NettingType", Namespace = "TradingPlatform")] + public enum NettingType + { + [Description("Undefined")] + [EnumMember] + Undefined, + [Description("Multiple positions")] + [EnumMember] + MultiPosition, + [Description("Multiple positions per side")] + [EnumMember] + MultiPerSide, + [Description("One position")] + [EnumMember] + OnePosition, + [Description("One position per side")] + [EnumMember] + OnePositionPerSide + } + [DataContract(Name = "InstrumentVolumeType", Namespace = "TradingPlatform")] + public enum SymbolVolumeType + { + [EnumMember] + Volume, + [EnumMember] + Ticks, + [EnumMember] + Disable + } + public enum BusinessObjectState + { + Normal, + Fake + } + [DataContract(Name = "DeltaCalculationType", Namespace = "TradingPlatform")] + public enum DeltaCalculationType + { + [Description("Aggressor flag")] + [EnumMember(Value = "Aggressor flag")] + AggressorFlag, + [Description("Tick direction")] + [EnumMember(Value = "Tick direction")] + TickDirection + } + [DataContract(Name = "AvailableDerivatives", Namespace = "TradingPlatform")] + public enum AvailableDerivatives + { + None, + Unknown, + Present + } + [DataContract(Name = "FutureContractType", Namespace = "TradingPlatform")] + public enum FutureContractType + { + [EnumMember] + Contract, + [EnumMember] + Continuous, + [EnumMember] + Spread + } + public enum GroupOrderType + { + None, + OCO + } + public enum AccountBalanceEventReason + { + New, + Update + } + public enum OptionSerieType + { + Unknown, + Daily, + Week, + Month, + BinaryContracts + } + public class ClosedPosition : Position + { + [CompilerGenerated] + private double ??; + + public double LastTradedPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + internal ClosedPosition(string P_0) + : base(P_0) + { + } + + public override TradingOperationResult Close(double closeQuantity = -1.0) + { + return TradingOperationResult.CreateError(new ClosePositionRequestParameters().RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + + internal override void ?(MessageOpenPosition P_0) + { + base.?(P_0); + if (P_0 is MessageClosedPosition messageClosedPosition) + { + LastTradedPrice = messageClosedPosition.LastTradedPrice; + } + } + } + /// + /// Represents information about corporate action. + /// + [Published] + public class CorporateAction : BusinessObject + { + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private Symbol ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private CorporateActionType ??; + + [CompilerGenerated] + private Action ??; + + /// + /// Get the date and time when trade was executed + /// + public DateTime DateTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + [DataMember(Name = "ID")] + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected set + { + ?? = value; + } + } + + [DataMember(Name = "Instrument")] + public Symbol Symbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected set + { + ?? = value; + } + } + + public string Details + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public CorporateActionType CorporateActionType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Will be triggered on corporate action updating + /// + public event Action Updated + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public CorporateAction(string connectionId) + : base(connectionId) + { + } + + internal void ?(MessageCorporateAction P_0) + { + Id = P_0.CorporateActionId; + if (!string.IsNullOrEmpty(P_0.SymbolId) && ConnectionCache != null && ConnectionCache.SymbolsCache.?(P_0.SymbolId, out var symbol)) + { + Symbol = symbol; + } + DateTime = P_0.DateTime; + Details = P_0.Details; + CorporateActionType = P_0.CorporateActionType; + ???.Invoke(); + } + } + [Published] + [DataContract(Name = "CryptoAccount", Namespace = "TradingPlatform")] + public class CryptoAccount : Account, IMessageBuilder + { + private readonly Dictionary ??; + + [CompilerGenerated] + private EventHandler ??; + + public CryptoAssetBalances[] Balances => ??.Values.ToArray(); + + public event EventHandler BalanceUpdated + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + internal CryptoAccount(string P_0) + : base(P_0) + { + ?? = new Dictionary(); + } + + internal CryptoAccount(BusinessObjectInfo P_0) + : base(P_0) + { + ?? = new Dictionary(); + } + + public bool TryGetAssetBalances(string assetId, out CryptoAssetBalances cryptoAssetBalances) + { + return ??.TryGetValue(assetId, out cryptoAssetBalances); + } + + internal void ?(MessageCryptoAssetBalances P_0) + { + AccountBalanceEventReason reason = AccountBalanceEventReason.Update; + if (!??.TryGetValue(P_0.AssetId, out var value)) + { + value = (??[P_0.AssetId] = new CryptoAssetBalances(base.ConnectionId)); + reason = AccountBalanceEventReason.New; + } + value.?(P_0); + ??.InvokeSafely(this, new CryptoAccountEventArgs(reason, value)); + } + + public override BusinessObjectInfo CreateInfo() + { + ? obj = base.CreateInfo() as ?; + obj.IsCrypto = true; + return obj; + } + + private MessageCryptoAccount ?() + { + return new MessageCryptoAccount + { + AccountId = base.Id, + AccountName = base.Name, + AssetId = base.AccountCurrency?.Id, + Balance = base.Balance, + AccountAdditionalInfo = base.AdditionalInfo?.Items.ToList() + }; + } + + MessageCryptoAccount IMessageBuilder.BuildMessage() + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(); + } + } + [Published] + [DataContract(Name = "CryptoAssetBalances", Namespace = "TradingPlatform")] + public class CryptoAssetBalances : BusinessObject, IMessageBuilder + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private Asset ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private GetAvailableBalanceHandler ??; + + private string ??; + + [DataMember(Name = "AssetId")] + public string AssetId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + public Asset Asset + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = asset; + } + } + + [DataMember(Name = "TotalBalance")] + public double TotalBalance + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = num; + } + } + + [DataMember(Name = "AvailableBalance")] + public double AvailableBalance + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = num; + } + } + + [DataMember(Name = "ReservedBalance")] + public double ReservedBalance + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = num; + } + } + + [DataMember(Name = "TotalInUSD")] + public double TotalInUSD + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = num; + } + } + + [DataMember(Name = "TotalInBTC")] + public double TotalInBTC + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = num; + } + } + + [DataMember(Name = "Debt")] + public double Debt + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = num; + } + } + + [DataMember(Name = "Equity")] + public double Equity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = num; + } + } + + [DataMember(Name = "EquityInBTC")] + public double EquityInBTC + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = num; + } + } + + public DateTime LastUpdateTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + public GetAvailableBalanceHandler AvailableBalanceHandler + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double GetAvailableBalance(OrderRequestParameters requestParameters) + { + double availableBalance = 0.0; + GetAvailableBalanceHandler availableBalanceHandler = AvailableBalanceHandler; + if (availableBalanceHandler != null && availableBalanceHandler(AssetId, requestParameters, out availableBalance)) + { + return availableBalance; + } + return AvailableBalance; + } + + internal CryptoAssetBalances(string P_0) + : base(P_0) + { + } + + internal void ?(MessageCryptoAssetBalances P_0) + { + AssetId = P_0.AssetId; + TotalBalance = P_0.TotalBalance; + AvailableBalance = P_0.AvailableBalance; + ReservedBalance = P_0.ReservedBalance; + TotalInUSD = P_0.TotalInUSD; + TotalInBTC = P_0.TotalInBTC; + Debt = P_0.Debt; + Equity = P_0.Equity; + EquityInBTC = P_0.EquityInBTC; + AvailableBalanceHandler = P_0.AvailableBalanceHandler; + ?? = P_0.AccountId; + if (!string.IsNullOrEmpty(P_0.AssetId) && ConnectionCache.??.TryGetValue(P_0.AssetId, out var value)) + { + Asset = value; + } + LastUpdateTime = Core.Instance.TimeUtils.DateTimeUtcNow; + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(18, 2); + defaultInterpolatedStringHandler.AppendFormatted(AssetId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(TotalBalance); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public MessageCryptoAssetBalances BuildMessage() + { + return new MessageCryptoAssetBalances + { + AssetId = AssetId, + TotalBalance = TotalBalance, + AvailableBalance = AvailableBalance, + ReservedBalance = ReservedBalance, + TotalInUSD = TotalInUSD, + TotalInBTC = TotalInBTC, + Debt = Debt, + Equity = Equity, + EquityInBTC = EquityInBTC, + AvailableBalanceHandler = AvailableBalanceHandler, + AccountId = ?? + }; + } + } + /// + /// Base class for all Custom symbols: Synthetics, Custom Formulas, etc. + /// + public class CustomSymbol : Symbol, IDisposable + { + public CustomSymbol(string connectionID) + : base(connectionID) + { + base.Id = Guid.NewGuid().ToString(); + } + + public virtual void Dispose() + { + } + } +} +namespace ? +{ + internal sealed class ? : HistoricalData + { + [Serializable] + [CompilerGenerated] + private new sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func> ??; + + internal IEnumerable ?(HistoryInterval P_0) + { + return P_0.History; + } + } + + private readonly HistoryStorage ??; + + public ?(HistoryRequestParameters P_0, HistoryStorage P_1) + : base(P_0) + { + ?? = P_1; + } + + private protected override IList ?(HistoryRequestParameters P_0) + { + List list = new List(); + if (?? == null) + { + return list; + } + if (!(P_0.Symbol is HistoricalSymbol historicalSymbol)) + { + return list; + } + if (P_0.FromTime > P_0.ToTime) + { + return list; + } + HistoryAggregation aggregationToDirectDownload = P_0.Aggregation.GetAggregationToDirectDownload(P_0.Symbol.HistoryMetadata); + if (aggregationToDirectDownload == null) + { + return list; + } + HistoryRequestParameters historyRequestParameters = new HistoryRequestParameters(P_0) + { + ForceReload = false, + Aggregation = aggregationToDirectDownload + }; + HistoryStorageInfo info = historicalSymbol.GetInfo(historyRequestParameters.ToDescription(), HistoryStorageInfoScope.StoredIntervals); + if (info == null || !info.StoredIntervals.Any()) + { + return list; + } + DateTime dateTime = info.StoredIntervals.First().From; + if (historyRequestParameters.FromTime < dateTime) + { + historyRequestParameters.FromTime = dateTime; + } + Interval[] array = historyRequestParameters.Interval.Split(base.Symbol.GetHistoryDownloadingStep(historyRequestParameters.Aggregation)).ToArray(); + for (int i = 0; i < array.Length; i++) + { + try + { + if (P_0.CancellationToken.IsCancellationRequested) + { + break; + } + HistoryRequestParameters copy = historyRequestParameters.Copy; + copy.FromTime = array[i].From; + copy.ToTime = array[i].To; + List historyParametersForServerRequest; + List history = ??.Load(copy, out historyParametersForServerRequest).SelectMany((HistoryInterval historyInterval) => historyInterval.History).ToList(); + float num = (float)i / (float)array.Length; + IList collection = ??.AggregateHistory(new HistoryHolder(history, copy, (int)(num * 100f))); + list.AddRange(collection); + P_0.ProgressInfo?.Report(num); + continue; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + return list; + } + } + return list; + } + } +} +namespace TradingPlatform.BusinessLayer +{ + public sealed class HistoricalSymbol : CustomSymbol, IHistoryDataReceiver, IXElementSerialization, IHistoryStorage + { + public const string HISTORICAL_SYMBOL_CONNECTION_ID = "HISTORICAL_SYMBOL_CONNECTION_ID"; + + private string ??; + + private HistoryStorage ??; + + public HistoricalSymbol() + : base(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + base.Id = null; + ?(); + base.Exchange = new Exchange(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + base.Exchange.?(new MessageExchange + { + Id = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + ExchangeName = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + SortIndex = -1 + }); + } + + public void SetLocalStoragePath(string path) + { + if (!(?? == path)) + { + ???.Dispose(); + ?? = path; + ?? = HistoryStorage.Create(??); + ?(); + } + } + + private new void ?() + { + if (string.IsNullOrEmpty(??)) + { + historyMetadata = new HistoryMetadata(); + return; + } + HashSet hashSet = new HashSet(); + HashSet hashSet2 = new HashSet(); + HashSet hashSet3 = new HashSet(); + HashSet hashSet4 = new HashSet(); + HashSet hashSet5 = new HashSet(); + foreach (HistoryDescription allAvailableHistoryDescription in ??.GetAllAvailableHistoryDescriptions()) + { + HistoryStorageInfo info = ??.GetInfo(allAvailableHistoryDescription, HistoryStorageInfoScope.StoredIntervals); + if (info.StoredIntervals == null || !info.StoredIntervals.Any()) + { + continue; + } + hashSet.Add(allAvailableHistoryDescription.Aggregation.Name); + HistoryAggregation aggregation = allAvailableHistoryDescription.Aggregation; + if (!(aggregation is HistoryAggregationTime historyAggregationTime)) + { + if (!(aggregation is HistoryAggregationTick historyAggregationTick)) + { + if (!(aggregation is HistoryAggregationTimeStatistics historyAggregationTimeStatistics)) + { + if (aggregation is HistoryAggregationVolumeProfile historyAggregationVolumeProfile) + { + hashSet3.Add(historyAggregationVolumeProfile.Period); + } + } + else + { + hashSet3.Add(historyAggregationTimeStatistics.Period); + } + } + else + { + hashSet5.Add(historyAggregationTick.HistoryType); + } + } + else + { + hashSet2.Add(historyAggregationTime.Period); + hashSet4.Add(historyAggregationTime.HistoryType); + } + } + historyMetadata = new HistoryMetadata + { + AllowedAggregations = hashSet.ToArray(), + AllowedPeriodsHistoryAggregationTime = hashSet2.ToArray(), + AllowedHistoryTypesHistoryAggregationTime = hashSet4.ToArray(), + AllowedHistoryTypesHistoryAggregationTick = hashSet5.ToArray(), + AllowedPeriodsHistoryAggregationTimeStatistics = hashSet3.ToArray(), + DownloadingStep_Tick = TimeSpan.FromDays(1.0) + }; + } + + private protected override HistoricalData ?(HistoryRequestParameters P_0) + { + return new ?(P_0, ??); + } + + public override List GetAlowedOrderTypes(OrderTypeUsage? usage) + { + return new List(); + } + + public IList Load(HistoryRequestParameters requestParameters, out List historyParametersForServerRequest) + { + historyParametersForServerRequest = new List { requestParameters }; + return ???.Load(requestParameters, out historyParametersForServerRequest); + } + + public void Save(HistoryInterval historyInterval, bool wait = false) + { + if (?? != null) + { + ??.Save(historyInterval, wait); + ?(); + } + } + + public void Delete(HistoryDescription description, Interval interval, bool wait = false) + { + if (?? != null) + { + ??.Delete(description, interval, wait); + ??.?(); + ?(); + } + } + + public HistoryStorageInfo GetInfo(HistoryDescription description, HistoryStorageInfoScope scope) + { + return ???.GetInfo(description, scope); + } + + public List GetAllAvailableHistoryDescriptions() + { + return ??.GetAllAvailableHistoryDescriptions(); + } + + public XElement ToXElement() + { + XElement xElement = new XElement(GetType().Name); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ??)); + MessageSymbol messageSymbol = ((IMessageBuilder)this).BuildMessage(); + xElement.Add(messageSymbol.ToXElement()); + if (base.Product != null) + { + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((IMessageBuilder)base.Product).BuildMessage().ToXElement())); + } + if (base.QuotingCurrency != null) + { + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((IMessageBuilder)base.QuotingCurrency).BuildMessage().ToXElement())); + } + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + SetLocalStoragePath(xElement.Value); + } + string text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + XElement xElement2 = ((!(element.Name == text)) ? element.Element(text) : element); + if (xElement2 != null) + { + MessageSymbol messageSymbol = new MessageSymbol(base.Id); + messageSymbol.FromXElement(xElement2, deserializationInfo); + ?(messageSymbol); + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + XElement xElement4 = xElement3.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + Asset asset = new Asset(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + MessageAsset messageAsset = new MessageAsset(); + messageAsset.FromXElement(xElement4, deserializationInfo); + asset.?(messageAsset); + base.Product = asset; + } + } + XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement5 != null) + { + XElement xElement6 = xElement5.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement6 != null) + { + Asset asset2 = new Asset(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + MessageAsset messageAsset2 = new MessageAsset(); + messageAsset2.FromXElement(xElement6, deserializationInfo); + asset2.?(messageAsset2); + base.QuotingCurrency = asset2; + } + } + ?(); + } + + public void SaveHistory(HistoryHolder historyHolderFromProvider) + { + try + { + Save(new HistoryInterval + { + Description = new HistoryDescription(base.Id, historyHolderFromProvider.RequestParameters.Aggregation), + Interval = historyHolderFromProvider.RequestParameters.Interval, + History = historyHolderFromProvider.History + }, wait: true); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + } + public sealed class HistoryDataSymbolProvider : IHistoryDataProvider + { + [CompilerGenerated] + private Action ??; + + private readonly Symbol ??; + + private readonly HistoryRequestParameters ??; + + private readonly Interval[] ??; + + private int ??; + + public bool AllDataAlreadyProvided => ?? >= ??.Length; + + public string ProgressValue => ((float)?? / (float)??.Length).ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + + public event Action ProgressChanged + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public HistoryDataSymbolProvider(Symbol realSymbolToImportHistory, HistoryRequestParameters historyRequestParameters) + { + ?? = realSymbolToImportHistory; + ?? = historyRequestParameters; + ?? = ??.Interval.Split(??.GetHistoryDownloadingStep(??.Aggregation)).ToArray(); + ?? = 0; + } + + public HistoryHolder GetHistory(CancellationToken cancellationToken) + { + Interval interval = ??[??]; + HistoryRequestParameters historyRequestParameters = new HistoryRequestParameters(??) + { + Interval = interval, + CancellationToken = cancellationToken + }; + if (?? == null) + { + return null; + } + HistoricalData history = ??.GetHistory(historyRequestParameters); + List list = new List(); + for (int i = 0; i < history.Count; i++) + { + list.Add(history[i, SeekOriginHistory.Begin]); + } + ??++; + ???.Invoke(ProgressValue); + return new HistoryHolder(list, historyRequestParameters); + } + } + public sealed class HistoryDataSymbolProviderRealtime : IHistoryDataProvider, IDisposable + { + private const int ?? = 10000; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private string ??; + + private DateTime ??; + + private DateTime ??; + + private readonly HistoricalData ??; + + private readonly HistoryRequestParameters ??; + + private readonly ManualResetEventSlim ??; + + public bool AllDataAlreadyProvided + { + get + { + if (!(?? >= ??.ToTime)) + { + return Core.Instance.TimeUtils.DateTimeUtcNow - ??.Symbol.QuoteDelay - TimeSpan.FromSeconds(10.0) > ??.ToTime; + } + return true; + } + } + + public string ProgressValue + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public event Action ProgressChanged + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public HistoryDataSymbolProviderRealtime(HistoryRequestParameters historyRequestParameters) + { + ?? = historyRequestParameters; + HistoryRequestParameters historyRequestParameters2 = new HistoryRequestParameters(??) + { + ToTime = default(DateTime) + }; + ?? = new ManualResetEventSlim(); + ?? = ??.Symbol.GetHistory(historyRequestParameters2); + ??.NewHistoryItem += ?; + } + + public void Dispose() + { + ??.Dispose(); + ??.NewHistoryItem -= ?; + ??.Dispose(); + } + + public HistoryHolder GetHistory(CancellationToken cancellationToken) + { + if (??.Symbol == null) + { + return null; + } + if (??.Symbol.State == BusinessObjectState.Fake) + { + return null; + } + TimeSpan timeout = ??.ToTime - Core.Instance.TimeUtils.DateTimeUtcNow + ??.Symbol.QuoteDelay + TimeSpan.FromSeconds(10.0); + ??.Wait(timeout, cancellationToken); + ??.Reset(); + if (??.Count == 0) + { + return null; + } + List list = new List(); + HistoryRequestParameters historyRequestParameters = new HistoryRequestParameters(??); + int i; + for (i = 0; i < 10000 && i < ??.Count; i++) + { + IHistoryItem historyItem = ??[i, SeekOriginHistory.Begin]; + ?? = historyItem.TimeLeft; + if (historyItem.TimeLeft >= ??.ToTime) + { + break; + } + if (historyItem.TimeLeft >= ??.FromTime) + { + list.Add(historyItem); + } + } + if (!list.Any()) + { + return null; + } + historyRequestParameters.FromTime = list.First().TimeLeft; + historyRequestParameters.ToTime = new DateTime(list.Last().TicksRight + 1, DateTimeKind.Utc); + ??.CutItems(i); + return new HistoryHolder(list, historyRequestParameters); + } + + private void ?(object P_0, HistoryEventArgs P_1) + { + ?? = P_1.HistoryItem.TimeLeft; + if (?? < ??.FromTime) + { + if (??.Count > 10000) + { + ??.CutItems(10000); + } + ProgressValue = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + ???.Invoke(ProgressValue); + return; + } + if (??.Count >= 10000) + { + ??.Set(); + return; + } + if (?? >= ??.ToTime) + { + ??.Set(); + return; + } + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(25, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(??.Count((IHistoryItem historyItem) => historyItem.TicksLeft > ??.FromTime.Ticks)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(10000); + ProgressValue = defaultInterpolatedStringHandler.ToStringAndClear(); + ???.Invoke(ProgressValue); + } + + [CompilerGenerated] + private bool ?(IHistoryItem P_0) + { + return P_0.TicksLeft > ??.FromTime.Ticks; + } + } + public interface IHistoryDataProvider + { + bool AllDataAlreadyProvided { get; } + + string ProgressValue { get; } + + event Action ProgressChanged; + + HistoryHolder GetHistory(CancellationToken changeToken); + } + public interface IHistoryDataReceiver + { + void SaveHistory(HistoryHolder historyFromProvider); + } + public sealed class ImportHistoryTask : IHistoryProcessingTask, IDisposable + { + [CompilerGenerated] + private sealed class ? + { + public CancellationToken ??; + + public ImportHistoryTask ??; + + internal void ?() + { + while (!??.??.AllDataAlreadyProvided) + { + try + { + if (??.IsCancellationRequested) + { + break; + } + HistoryHolder history = ??.??.GetHistory(??); + if (??.IsCancellationRequested || history == null) + { + break; + } + if (history.History.Any()) + { + ??.??.SaveHistory(history); + ??.?? += history.History.Count; + ??.???.Invoke(??.ProgressValue); + } + continue; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + ??.Stop(); + return; + } + } + ??.TaskState = HistoryTaskStateEnum.Completed; + ??.??.ProgressChanged -= ??.?; + (??.?? as IDisposable)?.Dispose(); + } + } + + [CompilerGenerated] + private Action ??; + + private HistoryTaskStateEnum ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private Action ??; + + private int ??; + + private string ??; + + private readonly IHistoryDataProvider ??; + + private readonly IHistoryDataReceiver ??; + + private CancellationTokenSource ??; + + public HistoryTaskStateEnum TaskState + { + get + { + return ??; + } + private set + { + if (?? != HistoryTaskStateEnum.Completed) + { + ?? = historyTaskStateEnum; + switch (??) + { + case HistoryTaskStateEnum.Active: + ?(); + break; + case HistoryTaskStateEnum.Stopped: + ??.Cancel(); + break; + case HistoryTaskStateEnum.Completed: + ?? = string.Empty; + break; + } + ???.Invoke(??); + } + } + } + + public string Description + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string ProgressValue + { + get + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(13, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(??); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + string text = defaultInterpolatedStringHandler.ToStringAndClear(); + if (string.IsNullOrEmpty(??)) + { + return text; + } + return text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ??; + } + } + + public event Action TaskStateChanged + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public event Action ProgressChanged + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public ImportHistoryTask(IHistoryDataProvider historyDataProvider, IHistoryDataReceiver historyDataReceiver) + { + ?? = historyDataProvider; + ?? = historyDataReceiver; + } + + public void Dispose() + { + if (?? != null) + { + ??.Cancel(); + ??.Dispose(); + ?? = null; + } + } + + public void Start() + { + TaskState = HistoryTaskStateEnum.Active; + } + + public void Stop() + { + TaskState = HistoryTaskStateEnum.Stopped; + } + + private void ?() + { + ?? = new CancellationTokenSource(); + CancellationToken ?? = ??.Token; + ??.ProgressChanged += ?; + ?? = 0; + ???.Invoke(ProgressValue); + Task.Factory.StartNew(delegate + { + while (!??.AllDataAlreadyProvided) + { + try + { + if (!??.IsCancellationRequested) + { + HistoryHolder history = ??.GetHistory(??); + if (!??.IsCancellationRequested && history != null) + { + if (history.History.Any()) + { + ??.SaveHistory(history); + ?? += history.History.Count; + ???.Invoke(ProgressValue); + } + continue; + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + Stop(); + return; + } + break; + } + TaskState = HistoryTaskStateEnum.Completed; + ??.ProgressChanged -= ?; + (?? as IDisposable)?.Dispose(); + }, ??); + } + + private void ?(string P_0) + { + ?? = P_0; + ???.Invoke(ProgressValue); + } + } + public interface IHistoryProcessingTask + { + HistoryTaskStateEnum TaskState { get; } + + string ProgressValue { get; } + + string Description { get; } + + event Action TaskStateChanged; + + event Action ProgressChanged; + + void Stop(); + } + public enum HistoryTaskStateEnum + { + [Description("Stopped")] + [EnumMember] + Stopped, + [Description("Active")] + [EnumMember] + Active, + [Description("Completed")] + [EnumMember] + Completed + } + public class BasicSyntheticPriceModifier : SyntheticPriceModifier + { + public override SyntheticPriceModifierType Type => SyntheticPriceModifierType.Basic; + + public override double CalculatePrice(double coefficient, double price) + { + return coefficient * price; + } + } + public class LnSyntheticPriceModifier : SyntheticPriceModifier + { + public override SyntheticPriceModifierType Type => SyntheticPriceModifierType.Ln; + + public override double CalculatePrice(double coefficient, double price) + { + return coefficient * Math.Log(price); + } + } + public abstract class SyntheticPriceModifier + { + public abstract SyntheticPriceModifierType Type { get; } + + public abstract double CalculatePrice(double coefficient, double price); + + public static SyntheticPriceModifier Create(SyntheticPriceModifierType type) + { + return type switch + { + SyntheticPriceModifierType.Undefined => new BasicSyntheticPriceModifier(), + SyntheticPriceModifierType.Basic => new BasicSyntheticPriceModifier(), + SyntheticPriceModifierType.Ln => new LnSyntheticPriceModifier(), + _ => throw new ArgumentOutOfRangeException(), + }; + } + } + public enum SyntheticPriceModifierType + { + Undefined, + [Description("Basic")] + Basic, + [Description("Ln")] + Ln + } +} +namespace ? +{ + internal sealed class ? : HistoricalData + { + private readonly Synthetic ??; + + public ?(HistoryRequestParameters P_0) + : base(P_0) + { + ?? = (Synthetic)P_0.Symbol; + } + + private protected override IList ?(HistoryRequestParameters P_0) + { + if (??.SyntheticState != SyntheticState.Initialized) + { + return new List(); + } + HistoryAggregation aggregationToDirectDownload = P_0.Aggregation.GetAggregationToDirectDownload(P_0.Symbol.HistoryMetadata); + HistoryRequestParameters historyRequestParameters = new HistoryRequestParameters(P_0) + { + Aggregation = aggregationToDirectDownload + }; + if (??.ForceUseTicksForHistory) + { + HistoryAggregation aggregation = historyRequestParameters.Aggregation; + if (!(aggregation is HistoryAggregationTickBars historyAggregationTickBars)) + { + if (aggregation is HistoryAggregationTime historyAggregationTime) + { + HistoryRequestParameters historyRequestParameters2 = historyRequestParameters; + historyRequestParameters2.Aggregation = new HistoryAggregationTick(historyAggregationTime.HistoryType switch + { + HistoryType.Ask => HistoryType.BidAsk, + HistoryType.Bid => HistoryType.BidAsk, + _ => historyAggregationTime.HistoryType, + }); + } + } + else + { + HistoryRequestParameters historyRequestParameters2 = historyRequestParameters; + historyRequestParameters2.Aggregation = new HistoryAggregationTick(historyAggregationTickBars.HistoryType switch + { + HistoryType.Ask => HistoryType.BidAsk, + HistoryType.Bid => HistoryType.BidAsk, + _ => historyAggregationTickBars.HistoryType, + }); + } + } + List list = new List(); + double[] array = new double[??.Items.Count]; + for (int i = 0; i < ??.Items.Count; i++) + { + array[i] = ??.Items[i].Coefficient; + HistoryRequestParameters historyRequestParameters3 = new HistoryRequestParameters(historyRequestParameters) + { + Symbol = ??.Items[i].Symbol + }; + if (??.Items[i].Coefficient < 0.0) + { + HistoryAggregation aggregation = historyRequestParameters3.Aggregation; + if (!(aggregation is HistoryAggregationTickBars { HistoryType: var historyType } historyAggregationTickBars2)) + { + if (aggregation is HistoryAggregationTime { HistoryType: var historyType2 } historyAggregationTime2) + { + HistoryType historyType3 = historyType2 switch + { + HistoryType.Ask => HistoryType.Bid, + HistoryType.Bid => HistoryType.Ask, + _ => historyAggregationTime2.HistoryType, + }; + historyRequestParameters.Aggregation = new HistoryAggregationTime(historyAggregationTime2.Period, historyType3); + } + } + else + { + HistoryType historyType4 = historyType switch + { + HistoryType.Ask => HistoryType.Bid, + HistoryType.Bid => HistoryType.Ask, + _ => historyAggregationTickBars2.HistoryType, + }; + historyRequestParameters.Aggregation = new HistoryAggregationTickBars(historyAggregationTickBars2.TicksCount, historyType4); + } + } + HistoricalData historicalData = new HistoricalData(historyRequestParameters3); + historicalData.Reload(); + if (historicalData.Count == 0) + { + return new List(); + } + list.Add(new ? + { + HistoricalData = historicalData, + SyntheticItem = ??.Items[i] + }); + } + List list2 = new List(); + ? ?2 = new ?(list, P_0.CancellationToken); + do + { + IHistoryItem[] array2 = new IHistoryItem[??.Items.Count]; + for (int j = 0; j < ?2.?.Count; j++) + { + array2[j] = ?2.?[j].HistoricalData[?2.?[j].Position, SeekOriginHistory.Begin]; + } + IHistoryItem historyItem = global::?.?.?(array, array2, ??.PriceModifier); + if (!(historyItem is HistoryItemBar historyItemBar)) + { + if (!(historyItem is HistoryItemTick historyItemTick)) + { + if (!(historyItem is HistoryItemLast historyItemLast)) + { + if (historyItem is HistoryItemMark historyItemMark) + { + historyItemMark.Price = base.Symbol.RoundPriceToTickSize(historyItemMark.Price); + } + } + else + { + historyItemLast.Price = base.Symbol.RoundPriceToTickSize(historyItemLast.Price); + } + } + else + { + historyItemTick.Bid = base.Symbol.RoundPriceToTickSize(historyItemTick.Bid); + historyItemTick.Ask = base.Symbol.RoundPriceToTickSize(historyItemTick.Ask); + } + } + else + { + historyItemBar.Open = base.Symbol.RoundPriceToTickSize(historyItemBar.Open); + historyItemBar.High = base.Symbol.RoundPriceToTickSize(historyItemBar.High); + historyItemBar.Low = base.Symbol.RoundPriceToTickSize(historyItemBar.Low); + historyItemBar.Close = base.Symbol.RoundPriceToTickSize(historyItemBar.Close); + } + list2.Add(historyItem); + } + while (?2.?(P_0.CancellationToken)); + list2.ProcessTickDirection(P_0.CancellationToken); + return ??.AggregateHistory(new HistoryHolder(list2, historyRequestParameters)); + } + } +} +namespace TradingPlatform.BusinessLayer +{ + public sealed class Synthetic : CustomSymbol, ICustomizable + { + [Serializable] + [CompilerGenerated] + private new sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func, IEnumerable, IEnumerable> ??; + + public static Func> ??; + + public static Func> ??; + + public static Func> ??; + + public static Func> ??; + + public static Func ??; + + public static Action ??; + + internal string ?(SyntheticItem P_0) + { + return P_0.Symbol.ConnectionId; + } + + internal bool ?(SyntheticItem P_0) + { + return P_0.Symbol == null; + } + + internal bool ?(SyntheticItem P_0) + { + return P_0.Symbol.State == BusinessObjectState.Fake; + } + + internal SyntheticItem ?(SyntheticItem P_0) + { + return new SyntheticItem(P_0); + } + + internal bool ?(SyntheticItem P_0) + { + return P_0.Symbol.GetAlowedOrderTypes(OrderTypeUsage.Order)?.FirstOrDefault((OrderType orderType) => orderType.Behavior == OrderTypeBehavior.Market) != null; + } + + internal bool ?(OrderType P_0) + { + return P_0.Behavior == OrderTypeBehavior.Market; + } + + internal TimeInForce[] ?(SyntheticItem P_0) + { + return P_0.Symbol.GetAlowedOrderTypes(OrderTypeUsage.Order).First((OrderType orderType) => orderType.Behavior == OrderTypeBehavior.Market).AllowedTifs; + } + + internal bool ?(OrderType P_0) + { + return P_0.Behavior == OrderTypeBehavior.Market; + } + + internal IEnumerable ?(IEnumerable P_0, IEnumerable P_1) + { + return P_0.Intersect(P_1); + } + + internal IEnumerable ?(SyntheticItem P_0) + { + return P_0.Symbol.HistoryMetadata.AllowedAggregations; + } + + internal IEnumerable ?(SyntheticItem P_0) + { + return P_0.Symbol.HistoryMetadata.AllowedPeriodsHistoryAggregationTime; + } + + internal IEnumerable ?(SyntheticItem P_0) + { + return P_0.Symbol.HistoryMetadata.AllowedHistoryTypesHistoryAggregationTime; + } + + internal IEnumerable ?(SyntheticItem P_0) + { + return P_0.Symbol.HistoryMetadata.AllowedHistoryTypesHistoryAggregationTick; + } + + internal Symbol ?(SyntheticItem P_0) + { + return P_0.Symbol; + } + + internal void ?(SyntheticItem P_0) + { + P_0.Symbol = Core.Instance.GetSymbol(P_0.Symbol.CreateInfo()); + } + } + + [CompilerGenerated] + private new sealed class ? + { + public PlaceOrderRequestParameters ??; + + public Func ??; + + internal double ?(SyntheticItem P_0) + { + return (double)((??.Side == Side.Buy) ? 1 : (-1)) * P_0.TradeRatio; + } + + internal bool ?(OrderType P_0) + { + return P_0.Behavior == ??.OrderType.Behavior; + } + } + + public const string SYNTHETIC_CONNECTION_ID = "CUSTOM_SYMBOL_CONNECTION"; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private ReadOnlyCollection ??; + + [CompilerGenerated] + private SyntheticState ??; + + [CompilerGenerated] + private SyntheticPriceModifier ??; + + [CompilerGenerated] + private bool ??; + + private List ??; + + private readonly object ??; + + private readonly ConnectionStateObserver ??; + + private bool ??; + + private bool ??; + + public override Connection Connection => Items?.FirstOrDefault()?.Symbol?.Connection; + + public override BusinessObjectState State + { + get + { + if (SyntheticState != SyntheticState.Initialized) + { + return BusinessObjectState.Fake; + } + return base.State; + } + protected internal set + { + base.State = value; + } + } + + public string[] LegsConnectionsIds => Items.Select((SyntheticItem P_0) => P_0.Symbol.ConnectionId).Distinct().ToArray(); + + public SyntheticPriceModifierType PriceModifierType + { + get + { + return PriceModifier?.Type ?? SyntheticPriceModifierType.Undefined; + } + set + { + SyntheticPriceModifier priceModifier = PriceModifier; + if (priceModifier == null || priceModifier.Type != value) + { + PriceModifier = SyntheticPriceModifier.Create(value); + } + } + } + + public ReadOnlyCollection Items + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = readOnlyCollection; + } + } + + public SyntheticState SyntheticState + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = syntheticState; + } + } + + public SyntheticPriceModifier PriceModifier + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = syntheticPriceModifier; + } + } + + public bool ForceUseTicksForHistory + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IList Settings + { + get + { + List list = new List + { + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), base.Name), + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), base.Id), + new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)PriceModifierType), + new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ForceUseTicksForHistory) + }; + if (base.Group != null) + { + list.Add(new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new List + { + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), base.Group.GroupName), + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), base.Group.Id) + })); + } + for (int i = 0; i < Items.Count; i++) + { + list.Add(new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Items[i].Settings)); + } + return list; + } + set + { + if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemString settingItemString) + { + base.Name = (string)settingItemString.Value; + } + if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemString settingItemString2) + { + base.Id = (string)settingItemString2.Value; + } + PriceModifierType = (SyntheticPriceModifierType)value.GetValueOrDefault((int)PriceModifierType, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemBoolean settingItemBoolean) + { + ForceUseTicksForHistory = (bool)settingItemBoolean.Value; + } + if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value is IEnumerable list) + { + string text = list.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value?.ToString(); + string text2 = list.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value?.ToString(); + if (!string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(text2)) + { + base.Group = new SymbolGroup(base.ConnectionId); + base.Group.?(new MessageSymbolGroup + { + GroupName = text, + Id = text2 + }); + } + } + List list2 = new List(); + for (int i = 0; i < value.Count; i++) + { + if (!(value[i].Name != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + list2.Add(new SyntheticItem + { + Settings = (value[i].Value as List) + }); + } + } + Items = new ReadOnlyCollection(list2); + } + } + + public event Action Reinitialized + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public Synthetic(string name, SyntheticPriceModifierType priceModifierType) + : base(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + ?? = new object(); + ?? = new List(); + ForceUseTicksForHistory = false; + PriceModifierType = priceModifierType; + Items = new ReadOnlyCollection(Array.Empty()); + SyntheticState = SyntheticState.NotInitialized; + base.Name = name; + Core.Instance.?(?); + ?? = new ConnectionStateObserver(this, ConnectionStateObserverPriority.High, ConnectionState.Connected, ConnectionState.Disconnected, ConnectionState.ConnectionLost); + } + + public Synthetic(string name, SyntheticPriceModifierType priceModifierType, IEnumerable items) + : this(name, priceModifierType) + { + Reinitialize(items); + } + + public Synthetic(string name, Synthetic origin) + : this(name, origin.PriceModifierType, origin.Items) + { + } + + public void Rename(string newName) + { + if (string.IsNullOrEmpty(newName)) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + base.Name = newName; + ???.Invoke(this); + base.?(); + } + + public void RenameGroup(string groupName) + { + if (string.IsNullOrEmpty(groupName)) + { + base.Group = null; + } + else + { + if (base.Group == null) + { + SymbolGroup symbolGroup = (base.Group = new SymbolGroup(base.ConnectionId)); + } + base.Group.?(new MessageSymbolGroup + { + GroupName = groupName, + Id = groupName, + SortIndex = 0 + }); + } + ???.Invoke(this); + base.?(); + } + + public void Reinitialize(IEnumerable newItems) + { + if (newItems == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + try + { + lock (??) + { + SyntheticState = SyntheticState.NotInitialized; + ?(); + base.?(); + MessageSymbol messageSymbol = new MessageSymbol(base.Id) + { + Name = base.Name, + SymbolType = SymbolType.Synthetic, + QuotingType = SymbolQuotingType.Undefined, + MinLot = 1.0, + LotStep = 1.0, + LotSize = 1.0, + VolumeType = SymbolVolumeType.Disable, + NettingType = NettingType.Undefined, + AllowCalculateRealtimeChange = true, + AllowCalculateRealtimeTicks = false, + AllowCalculateRealtimeTrades = false, + AllowCalculateRealtimeVolume = false + }; + ?(messageSymbol); + if (!newItems.Any() || newItems.Any((SyntheticItem P_0) => P_0.Symbol == null) || newItems.Any((SyntheticItem P_0) => P_0.Symbol.State == BusinessObjectState.Fake)) + { + return; + } + Items = new ReadOnlyCollection(newItems.Select((SyntheticItem P_0) => new SyntheticItem(P_0)).ToArray()); + StringBuilder stringBuilder = new StringBuilder(); + double num = double.MinValue; + double num2 = double.MaxValue; + bool flag = true; + bool flag2 = true; + TimeSpan timeSpan = TimeSpan.MaxValue; + double num3 = double.MaxValue; + foreach (SyntheticItem item in Items) + { + if (stringBuilder.Length < 100) + { + StringBuilder stringBuilder2 = stringBuilder; + StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(5, 2, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(item.Symbol.FormatQuantity(item.Coefficient)); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(item.Symbol.Name); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + stringBuilder2.Append(ref handler); + } + if (item.Symbol.MinLot > num) + { + num = item.Symbol.MinLot; + } + if (item.Symbol.MaxLot < num2) + { + num2 = item.Symbol.MaxLot; + } + if (item.Symbol.HistoryType != HistoryType.Last) + { + flag = false; + } + if (item.Symbol.HistoryType != HistoryType.Mark) + { + flag2 = false; + } + if (item.Symbol.TickSize < num3) + { + num3 = item.Symbol.TickSize; + } + if (item.Symbol.QuoteDelay < timeSpan) + { + timeSpan = item.Symbol.QuoteDelay; + } + } + if (PriceModifierType == SyntheticPriceModifierType.Ln) + { + num3 = 1E-05; + } + messageSymbol.Description = stringBuilder.ToString().TrimEnd('+', ' '); + messageSymbol.QuoteDelay = timeSpan; + messageSymbol.VariableTickList = new List + { + new VariableTick(num3) + }; + messageSymbol.MaxLot = Math.Floor(num2); + messageSymbol.HistoryType = (flag ? HistoryType.Last : (flag2 ? HistoryType.Mark : HistoryType.Bid)); + ?(messageSymbol); + bool flag3 = true; + flag3 = Items.All((SyntheticItem P_0) => P_0.Symbol.GetAlowedOrderTypes(OrderTypeUsage.Order)?.FirstOrDefault((OrderType orderType) => orderType.Behavior == OrderTypeBehavior.Market) != null); + if (((?)this).Rules[3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()] is ? ?) + { + ?.?(new MessageRule + { + Value = flag3 + }); + } + if (flag3) + { + TimeInForce[] source = Items.Select((SyntheticItem P_0) => P_0.Symbol.GetAlowedOrderTypes(OrderTypeUsage.Order).First((OrderType orderType) => orderType.Behavior == OrderTypeBehavior.Market).AllowedTifs).Cast>().Aggregate((IEnumerable P_0, IEnumerable P_1) => P_0.Intersect(P_1)) + .ToArray(); + if (!source.Any()) + { + source = new TimeInForce[1]; + } + ?? = new List + { + new MarketOrderType(source.ToArray()) + }; + } + else + { + ?? = new List + { + new MarketOrderType(default(TimeInForce)) + }; + } + historyMetadata = new HistoryMetadata + { + AllowedAggregations = Items.SelectMany((SyntheticItem P_0) => P_0.Symbol.HistoryMetadata.AllowedAggregations).Distinct().ToArray(), + AllowedPeriodsHistoryAggregationTime = Items.SelectMany((SyntheticItem P_0) => P_0.Symbol.HistoryMetadata.AllowedPeriodsHistoryAggregationTime).Distinct().ToArray(), + AllowedHistoryTypesHistoryAggregationTime = Items.SelectMany((SyntheticItem P_0) => P_0.Symbol.HistoryMetadata.AllowedHistoryTypesHistoryAggregationTime).Distinct().ToArray(), + AllowedHistoryTypesHistoryAggregationTick = Items.SelectMany((SyntheticItem P_0) => P_0.Symbol.HistoryMetadata.AllowedHistoryTypesHistoryAggregationTick).Distinct().ToArray() + }; + foreach (SyntheticItem item2 in Items) + { + item2.Symbol.NewQuote += ?; + item2.Symbol.NewLast += ?; + item2.Symbol.NewMark += ?; + item2.Symbol.NewLevel2 += ?; + item2.Symbol.NewDayBar += ?; + } + ?(); + SyntheticState = SyntheticState.Initialized; + ?? = true; + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + public override void Dispose() + { + ??.Dispose(); + ?(); + SyntheticState = SyntheticState.NotInitialized; + base.Dispose(); + } + + private new void ?() + { + try + { + foreach (SyntheticItem item in Items) + { + item.Symbol.NewQuote -= ?; + item.Symbol.NewLast -= ?; + item.Symbol.NewMark -= ?; + item.Symbol.NewLevel2 -= ?; + item.Symbol.NewDayBar -= ?; + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + protected internal override void SubscribeAction(SubscribeQuoteType type) + { + } + + protected internal override void UnSubscribeAction(SubscribeQuoteType type) + { + } + + private new void ?() + { + try + { + ReadOnlyCollection items = Items; + if (items != null && items.Count == 0) + { + return; + } + int count = Items.Count; + double[] array = new double[count]; + Level2Item[][] array2 = new Level2Item[count][]; + Level2Item[][] array3 = new Level2Item[count][]; + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + for (int i = 0; i < Items.Count; i++) + { + SyntheticItem syntheticItem = Items[i]; + SessionsContainer currentSessionsInfo = syntheticItem.Symbol.CurrentSessionsInfo; + if (currentSessionsInfo != null && !currentSessionsInfo.ContainsDate(dateTimeUtcNow)) + { + return; + } + array[i] = syntheticItem.Coefficient; + DepthOfMarketAggregatedCollections depthOfMarketAggregatedCollections = syntheticItem.Symbol.DepthOfMarket.GetDepthOfMarketAggregatedCollections(); + if (syntheticItem.Coefficient > 0.0) + { + array3[i] = new Level2Item[depthOfMarketAggregatedCollections.Bids.Length]; + for (int j = 0; j < depthOfMarketAggregatedCollections.Bids.Length; j++) + { + array3[i][j] = depthOfMarketAggregatedCollections.Bids[j]; + } + } + else + { + array3[i] = new Level2Item[depthOfMarketAggregatedCollections.Asks.Length]; + for (int k = 0; k < depthOfMarketAggregatedCollections.Asks.Length; k++) + { + array3[i][k] = depthOfMarketAggregatedCollections.Asks[k]; + } + } + if (syntheticItem.Coefficient > 0.0) + { + array2[i] = new Level2Item[depthOfMarketAggregatedCollections.Asks.Length]; + for (int l = 0; l < depthOfMarketAggregatedCollections.Asks.Length; l++) + { + array2[i][l] = depthOfMarketAggregatedCollections.Asks[l]; + } + } + else + { + array2[i] = new Level2Item[depthOfMarketAggregatedCollections.Bids.Length]; + for (int m = 0; m < depthOfMarketAggregatedCollections.Bids.Length; m++) + { + array2[i][m] = depthOfMarketAggregatedCollections.Bids[m]; + } + } + } + (Level2Quote[], DateTime) tuple = global::?.?.?(array, QuotePriceType.Bid, base.Id, array3, PriceModifier); + (Level2Quote[], DateTime) tuple2 = global::?.?.?(array, QuotePriceType.Ask, base.Id, array2, PriceModifier); + DOMQuote dOMQuote = new DOMQuote(base.Id, dateTimeUtcNow); + Level2Quote[] item = tuple.Item1; + foreach (Level2Quote level2Quote in item) + { + dOMQuote.Bids.Add(new Level2Quote(level2Quote.PriceType, level2Quote.SymbolId, level2Quote.Id, RoundPriceToTickSize(level2Quote.Price), level2Quote.Size, level2Quote.Time)); + } + item = tuple2.Item1; + foreach (Level2Quote level2Quote2 in item) + { + dOMQuote.Asks.Add(new Level2Quote(level2Quote2.PriceType, level2Quote2.SymbolId, level2Quote2.Id, RoundPriceToTickSize(level2Quote2.Price), level2Quote2.Size, level2Quote2.Time)); + } + ?(dOMQuote); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + private void ?() + { + ReadOnlyCollection items = Items; + if (items == null || items.Count != 0) + { + int count = Items.Count; + double[] array = new double[count]; + double[] array2 = new double[count]; + double[] array3 = new double[count]; + double[] array4 = new double[count]; + double[] array5 = new double[count]; + DateTime[] array6 = new DateTime[count]; + for (int i = 0; i < Items.Count; i++) + { + SyntheticItem syntheticItem = Items[i]; + array[i] = syntheticItem.Coefficient; + array2[i] = syntheticItem.Symbol.Open; + array3[i] = syntheticItem.Symbol.High; + array4[i] = syntheticItem.Symbol.Low; + array5[i] = syntheticItem.Symbol.PrevClose; + array6[i] = syntheticItem.Symbol.QuoteDateTime; + } + (double, double, double, double, DateTime) tuple = global::?.?.?(array, array2, array3, array4, array5, array6, PriceModifier); + DayBar dayBar = new DayBar(base.Name, tuple.Item5) + { + Open = tuple.Item1, + High = tuple.Item2, + Low = tuple.Item3, + PreviousClose = tuple.Item4 + }; + ?(dayBar); + } + } + + private void ?() + { + ReadOnlyCollection items = Items; + if (items == null || items.Count != 0) + { + int count = Items.Count; + double[] array = new double[count]; + double[] array2 = new double[count]; + double[] array3 = new double[count]; + double[] array4 = new double[count]; + double[] array5 = new double[count]; + double[] array6 = new double[count]; + double[] array7 = new double[count]; + double[] array8 = new double[count]; + double[] array9 = new double[count]; + double[] array10 = new double[count]; + double[] array11 = new double[count]; + double[] array12 = new double[count]; + double[] array13 = new double[count]; + DateTime[] array14 = new DateTime[count]; + for (int i = 0; i < Items.Count; i++) + { + SyntheticItem syntheticItem = Items[i]; + array[i] = syntheticItem.Coefficient; + array2[i] = syntheticItem.Symbol.Ask; + array3[i] = syntheticItem.Symbol.Bid; + array4[i] = syntheticItem.Symbol.AskSize; + array5[i] = syntheticItem.Symbol.BidSize; + array6[i] = syntheticItem.Symbol.Last; + array7[i] = syntheticItem.Symbol.LastSize; + array8[i] = syntheticItem.Symbol.Mark; + array9[i] = syntheticItem.Symbol.MarkSize; + array10[i] = syntheticItem.Symbol.Open; + array11[i] = syntheticItem.Symbol.High; + array12[i] = syntheticItem.Symbol.Low; + array13[i] = syntheticItem.Symbol.PrevClose; + array14[i] = syntheticItem.Symbol.QuoteDateTime; + } + (double, double, double, double, DateTime) tuple = global::?.?.?(array, array2, array3, array4, array5, array14, PriceModifier); + (double, double, DateTime) tuple2 = global::?.?.?(array, array6, array7, array14, PriceModifier); + (double, double, DateTime) tuple3 = global::?.?.?(array, array8, array9, array14, PriceModifier); + (double, double, double, double, DateTime) tuple4 = global::?.?.?(array, array10, array11, array12, array13, array14, PriceModifier); + DayBar obj = new DayBar(base.Name, tuple.Item5) + { + Bid = tuple.Item2, + BidSize = tuple.Item4 + }; + (obj.Ask, _, obj.AskSize, _, _) = tuple; + (obj.Last, obj.LastSize, _) = tuple2; + (obj.Mark, obj.MarkSize, _) = tuple3; + (obj.Open, obj.High, obj.Low, obj.PreviousClose, _) = tuple4; + ?(obj); + } + } + + private void ?() + { + if (SyntheticState == SyntheticState.Initialized) + { + if (??) + { + ?? = false; + ?(); + } + if (??) + { + ?? = false; + ?(); + } + } + } + + private void ?(Symbol P_0, Last P_1) + { + if (SyntheticState == SyntheticState.NotInitialized) + { + return; + } + int count = Items.Count; + double[] array = new double[count]; + double[] array2 = new double[count]; + double[] array3 = new double[count]; + DateTime[] array4 = new DateTime[count]; + for (int i = 0; i < Items.Count; i++) + { + SyntheticItem syntheticItem = Items[i]; + array[i] = syntheticItem.Coefficient; + array2[i] = syntheticItem.Symbol.Last; + array3[i] = syntheticItem.Symbol.LastSize; + array4[i] = syntheticItem.Symbol.LastDateTime; + SessionsContainer currentSessionsInfo = syntheticItem.Symbol.CurrentSessionsInfo; + if (currentSessionsInfo != null && !currentSessionsInfo.ContainsDate(array4[i])) + { + return; + } + } + (double, double, DateTime) tuple = global::?.?.?(array, array2, array3, array4, PriceModifier); + if (!tuple.Item1.IsNanOrDefault()) + { + tuple.Item1 = RoundPriceToTickSize(tuple.Item1); + Last last = new Last(base.Name, tuple.Item1, tuple.Item2, tuple.Item3) + { + AggressorFlag = AggressorFlag.NotSet + }; + ?(last); + } + } + + private void ?(Symbol P_0, Mark P_1) + { + if (SyntheticState == SyntheticState.NotInitialized) + { + return; + } + int count = Items.Count; + double[] array = new double[count]; + double[] array2 = new double[count]; + double[] array3 = new double[count]; + DateTime[] array4 = new DateTime[count]; + for (int i = 0; i < Items.Count; i++) + { + SyntheticItem syntheticItem = Items[i]; + array[i] = syntheticItem.Coefficient; + array2[i] = syntheticItem.Symbol.Mark; + array3[i] = syntheticItem.Symbol.MarkSize; + array4[i] = syntheticItem.Symbol.LastDateTime; + SessionsContainer currentSessionsInfo = syntheticItem.Symbol.CurrentSessionsInfo; + if (currentSessionsInfo != null && !currentSessionsInfo.ContainsDate(array4[i])) + { + return; + } + } + (double, double, DateTime) tuple = global::?.?.?(array, array2, array3, array4, PriceModifier); + if (tuple.Item1 != 0.0) + { + tuple.Item1 = RoundPriceToTickSize(tuple.Item1); + Mark mark = new Mark(base.Name, tuple.Item3, tuple.Item1, tuple.Item2); + ?(mark); + } + } + + private void ?(Symbol P_0, Quote P_1) + { + if (SyntheticState == SyntheticState.NotInitialized) + { + return; + } + int count = Items.Count; + double[] array = new double[count]; + double[] array2 = new double[count]; + double[] array3 = new double[count]; + double[] array4 = new double[count]; + double[] array5 = new double[count]; + DateTime[] array6 = new DateTime[count]; + for (int i = 0; i < Items.Count; i++) + { + SyntheticItem syntheticItem = Items[i]; + array[i] = syntheticItem.Coefficient; + array2[i] = syntheticItem.Symbol.Ask; + array3[i] = syntheticItem.Symbol.Bid; + array4[i] = syntheticItem.Symbol.AskSize; + array5[i] = syntheticItem.Symbol.BidSize; + array6[i] = syntheticItem.Symbol.QuoteDateTime; + SessionsContainer currentSessionsInfo = syntheticItem.Symbol.CurrentSessionsInfo; + if (currentSessionsInfo != null && !currentSessionsInfo.ContainsDate(array6[i])) + { + return; + } + } + (double, double, double, double, DateTime) tuple = global::?.?.?(array, array2, array3, array4, array5, array6, PriceModifier); + if (!tuple.Item2.IsNanOrDefault() || !tuple.Item1.IsNanOrDefault()) + { + tuple.Item2 = RoundPriceToTickSize(tuple.Item2); + tuple.Item1 = RoundPriceToTickSize(tuple.Item1); + Quote quote = new Quote(base.Name, tuple.Item2, tuple.Item4, tuple.Item1, tuple.Item3, tuple.Item5); + ?(quote); + } + } + + private void ?(Symbol P_0, Level2Quote P_1, DOMQuote P_2) + { + ?? = true; + } + + private void ?(Symbol P_0, DayBar P_1) + { + ?? = true; + } + + private protected override HistoricalData ?(HistoryRequestParameters P_0) + { + return new ?(P_0); + } + + public override List GetAlowedOrderTypes(OrderTypeUsage? usage) + { + return ??; + } + + public override bool IsTradingAllowed(Account account) + { + foreach (Symbol item in Items.Select((SyntheticItem P_0) => P_0.Symbol)) + { + Account account2 = item.Connection?.BusinessObjects?.Accounts?.FirstOrDefault(); + if (account2 == null) + { + return false; + } + if (!item.IsTradingAllowed(account2)) + { + return false; + } + } + return true; + } + + internal override TradingOperationResult ?(PlaceOrderRequestParameters P_0) + { + if (P_0 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (P_0.OrderTypeId != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + return TradingOperationResult.CreateError(P_0.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + List list = Items.OrderByDescending((SyntheticItem syntheticItem2) => (double)((P_0.Side == Side.Buy) ? 1 : (-1)) * syntheticItem2.TradeRatio).ToList(); + for (int num = 0; num < list.Count; num++) + { + SyntheticItem syntheticItem = list[num]; + Symbol symbol = syntheticItem.Symbol; + PlaceOrderRequestParameters placeOrderRequestParameters = new PlaceOrderRequestParameters(P_0) + { + Symbol = symbol, + Account = ((LegsConnectionsIds.Length > 1) ? symbol.Connection.BusinessObjects.Accounts[0] : P_0.Account) + }; + OrderType orderType = syntheticItem.Symbol.GetAlowedOrderTypes(OrderTypeUsage.Order).FirstOrDefault((OrderType orderType2) => orderType2.Behavior == P_0.OrderType.Behavior); + if (orderType == null) + { + return TradingOperationResult.CreateError(P_0.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + placeOrderRequestParameters.OrderTypeId = orderType.Id; + placeOrderRequestParameters.Quantity = (double)Math.Abs((decimal)placeOrderRequestParameters.Quantity * (decimal)syntheticItem.TradeRatio); + if ((P_0.Side == Side.Buy && syntheticItem.TradeRatio > 0.0) || (P_0.Side == Side.Sell && syntheticItem.TradeRatio < 0.0)) + { + placeOrderRequestParameters.Side = Side.Buy; + } + else + { + placeOrderRequestParameters.Side = Side.Sell; + } + if (!string.IsNullOrEmpty(syntheticItem.TradeComment)) + { + placeOrderRequestParameters.Comment = syntheticItem.TradeComment; + } + TradingOperationResult tradingOperationResult = syntheticItem.Symbol.?(placeOrderRequestParameters); + if (tradingOperationResult.Status == TradingOperationResultStatus.Failure) + { + return tradingOperationResult; + } + } + return TradingOperationResult.CreateSuccess(P_0.RequestId); + } + + public override Account GetDefaultAccount(Account currentValue = null) + { + if (LegsConnectionsIds.Length != 1) + { + return null; + } + if (currentValue?.ConnectionId == Items[0].Symbol.ConnectionId) + { + return currentValue; + } + return Core.Instance.Connections[Items[0].Symbol.ConnectionId]?.BusinessObjects?.Accounts?.FirstOrDefault(); + } + + public override string FormatQuantity(double quantity, bool inLots = true, bool abbreviate = false) + { + int valuePrecision = CoreMath.GetValuePrecision((decimal)quantity); + return quantity.Format(valuePrecision, abbreviate); + } + + public override ConnectionDependency GetConnectionStateDependency() + { + return new ConnectionDependency + { + Behavior = ConnectionDependencyBehavior.PartialDependency, + DependentConnectionsIds = LegsConnectionsIds + }; + } + + public override void OnConnectionStateChanged(Connection connection, ConnectionStateChangedEventArgs e) + { + List list = Items.ToList(); + list.ForEach(delegate(SyntheticItem P_0) + { + P_0.Symbol = Core.Instance.GetSymbol(P_0.Symbol.CreateInfo()); + }); + Reinitialize(list); + } + } + public enum SyntheticState + { + NotInitialized, + Initialized + } +} +namespace ? +{ + internal static class ? + { + internal class ? + { + private readonly List ??; + + private int ??; + + private double ??; + + private bool HasNextLevel => ?? < ??.Count - 1; + + public double PriceOnCurrentLevel + { + get + { + if (?? >= ??.Count) + { + return 0.0; + } + return ??[??].Price; + } + } + + public double SizeOnCurrentLevel + { + get + { + if (?? >= ??.Count) + { + return 0.0; + } + return ??[??].Size - ??; + } + } + + public ?(Level2Item[] P_0) + { + ?? = new List(P_0); + } + + public bool ?(double P_0) + { + double num = P_0; + do + { + if (SizeOnCurrentLevel > num) + { + ?? += num; + num = 0.0; + continue; + } + num -= SizeOnCurrentLevel; + if (HasNextLevel) + { + ??++; + ?? = 0.0; + continue; + } + return false; + } + while (num > 0.0); + return true; + } + } + + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal double ?(? P_0) + { + return P_0.SizeOnCurrentLevel; + } + } + + public static (double ask, double bid, double askSize, double BidSize, DateTime QuoteDateTime) ?(double[] P_0, double[] P_1, double[] P_2, double[] P_3, double[] P_4, DateTime[] P_5, SyntheticPriceModifier P_6) + { + if (P_0 == null || P_0.Length == 0) + { + return (ask: double.NaN, bid: double.NaN, askSize: double.NaN, BidSize: double.NaN, QuoteDateTime: DateTime.MinValue); + } + double num = 0.0; + double num2 = 0.0; + double num3 = P_3[0]; + double num4 = P_4[0]; + DateTime dateTime = P_5[0]; + for (int i = 0; i < P_0.Length; i++) + { + if (P_1[i].IsNanOrDefault() && P_2[i].IsNanOrDefault()) + { + return (ask: double.NaN, bid: double.NaN, askSize: double.NaN, BidSize: double.NaN, QuoteDateTime: DateTime.MinValue); + } + num += P_6.CalculatePrice(P_0[i], (P_0[i] > 0.0) ? P_1[i] : P_2[i]); + num2 += P_6.CalculatePrice(P_0[i], (P_0[i] > 0.0) ? P_2[i] : P_1[i]); + if (P_0[i] > 0.0) + { + if (P_3[i] < num3) + { + num3 = P_3[i]; + } + if (P_4[i] < num4) + { + num4 = P_4[i]; + } + } + else + { + if (P_3[i] < num4) + { + num4 = P_3[i]; + } + if (P_4[i] < num3) + { + num3 = P_4[i]; + } + } + if (P_5[i] > dateTime) + { + dateTime = P_5[i]; + } + } + return (ask: num, bid: num2, askSize: num3, BidSize: num4, QuoteDateTime: dateTime); + } + + public static (double last, double lastSize, DateTime LastDateTime) ?(double[] P_0, double[] P_1, double[] P_2, DateTime[] P_3, SyntheticPriceModifier P_4) + { + if (P_0 == null || P_0.Length == 0) + { + return (last: double.NaN, lastSize: double.NaN, LastDateTime: DateTime.MinValue); + } + double num = 0.0; + double num2 = P_2[0]; + DateTime dateTime = P_3[0]; + for (int i = 0; i < P_0.Length; i++) + { + if (P_1[i].IsNanOrDefault()) + { + return (last: double.NaN, lastSize: double.NaN, LastDateTime: DateTime.MinValue); + } + num += P_4.CalculatePrice(P_0[i], P_1[i]); + if (P_2[i] < num2) + { + num2 = P_2[i]; + } + if (P_3[i] > dateTime) + { + dateTime = P_3[i]; + } + } + return (last: num, lastSize: num2, LastDateTime: dateTime); + } + + public static (double mark, double markSize, DateTime markDateTime) ?(double[] P_0, double[] P_1, double[] P_2, DateTime[] P_3, SyntheticPriceModifier P_4) + { + if (P_0 == null || P_0.Length == 0) + { + return (mark: double.NaN, markSize: double.NaN, markDateTime: DateTime.MinValue); + } + double num = 0.0; + double num2 = P_2[0]; + DateTime dateTime = P_3[0]; + for (int i = 0; i < P_0.Length; i++) + { + if (P_1[i].IsNanOrDefault()) + { + return (mark: double.NaN, markSize: double.NaN, markDateTime: DateTime.MinValue); + } + num += P_4.CalculatePrice(P_0[i], P_1[i]); + if (P_2[i] < num2) + { + num2 = P_2[i]; + } + if (P_3[i] > dateTime) + { + dateTime = P_3[i]; + } + } + return (mark: num, markSize: num2, markDateTime: dateTime); + } + + public static (Level2Quote[] quotes, DateTime Time) ?(double[] P_0, QuotePriceType P_1, string P_2, Level2Item[][] P_3, SyntheticPriceModifier P_4) + { + try + { + if (P_3 == null) + { + return (quotes: null, Time: DateTime.MinValue); + } + ?[] array = new ?[P_0.Length]; + for (int i = 0; i < array.Length; i++) + { + array[i] = new ?(P_3[i]); + } + List list = new List(); + bool flag = false; + do + { + double num = 0.0; + for (int j = 0; j < P_0.Length; j++) + { + num += P_4.CalculatePrice(P_0[j], array[j].PriceOnCurrentLevel); + } + double num2 = array.Min((? ?2) => ?2.SizeOnCurrentLevel); + list.Add(new Level2Quote(P_1, P_2, P_1.ToString() + list.Count, num, num2, Core.Instance.TimeUtils.DateTimeUtcNow)); + ?[] array2 = array; + for (int num3 = 0; num3 < array2.Length; num3++) + { + if (!array2[num3].?(num2)) + { + flag = true; + break; + } + } + } + while (!flag); + return (quotes: list.ToArray(), Time: DateTime.MinValue); + } + catch + { + return (quotes: null, Time: DateTime.MinValue); + } + } + + public static (double open, double high, double low, double close, DateTime QuoteDateTime) ?(double[] P_0, double[] P_1, double[] P_2, double[] P_3, double[] P_4, DateTime[] P_5, SyntheticPriceModifier P_6) + { + if (P_0 == null || P_0.Length == 0) + { + return (open: 0.0, high: 0.0, low: 0.0, close: 0.0, QuoteDateTime: DateTime.MinValue); + } + double num = 0.0; + double num2 = 0.0; + double num3 = 0.0; + double num4 = 0.0; + DateTime dateTime = P_5[0]; + for (int i = 0; i < P_0.Length; i++) + { + num += P_6.CalculatePrice(P_0[i], P_1[i]); + num2 += P_6.CalculatePrice(P_0[i], P_2[i]); + num3 += P_6.CalculatePrice(P_0[i], P_3[i]); + num4 += P_6.CalculatePrice(P_0[i], P_4[i]); + if (P_5[i] > dateTime) + { + dateTime = P_5[i]; + } + } + return (open: num, high: num2, low: num3, close: num4, QuoteDateTime: dateTime); + } + + public static IHistoryItem ?(double[] P_0, IHistoryItem[] P_1, SyntheticPriceModifier P_2) + { + if (P_1 == null) + { + return null; + } + if (P_1.Length == 0) + { + return null; + } + IHistoryItem historyItem = P_1[0]; + if (!(historyItem is HistoryItemBar)) + { + if (!(historyItem is HistoryItemTick)) + { + if (historyItem is HistoryItemLast) + { + double num = 0.0; + double volume = 0.0; + long num2 = long.MinValue; + for (int i = 0; i < P_0.Length; i++) + { + HistoryItemLast historyItemLast = (HistoryItemLast)P_1[i]; + num += P_2.CalculatePrice(P_0[i], historyItemLast.Price); + if (historyItemLast.TicksLeft > num2) + { + num2 = historyItemLast.TicksLeft; + } + } + return new HistoryItemLast + { + Price = num, + Volume = volume, + TicksLeft = num2 + }; + } + return null; + } + double num3 = 0.0; + double num4 = 0.0; + double bidSize = 0.0; + double askSize = 0.0; + long num5 = long.MinValue; + for (int j = 0; j < P_0.Length; j++) + { + HistoryItemTick historyItemTick = (HistoryItemTick)P_1[j]; + num3 += P_2.CalculatePrice(P_0[j], (P_0[j] > 0.0) ? historyItemTick.Bid : historyItemTick.Ask); + num4 += P_2.CalculatePrice(P_0[j], (P_0[j] > 0.0) ? historyItemTick.Ask : historyItemTick.Bid); + if (historyItemTick.TicksLeft > num5) + { + num5 = historyItemTick.TicksLeft; + } + } + return new HistoryItemTick + { + Bid = num3, + Ask = num4, + AskSize = askSize, + BidSize = bidSize, + TicksLeft = num5 + }; + } + double num6 = 0.0; + double num7 = 0.0; + double num8 = 0.0; + double num9 = 0.0; + double volume2 = 0.0; + int num10 = 0; + long num11 = long.MinValue; + long ticksRight = long.MinValue; + for (int k = 0; k < P_0.Length; k++) + { + HistoryItemBar historyItemBar = (HistoryItemBar)P_1[k]; + num6 += P_2.CalculatePrice(P_0[k], historyItemBar.Open); + num8 += P_2.CalculatePrice(P_0[k], historyItemBar.High); + num9 += P_2.CalculatePrice(P_0[k], historyItemBar.Low); + num7 += P_2.CalculatePrice(P_0[k], historyItemBar.Close); + if (historyItemBar.TicksLeft > num11) + { + num11 = historyItemBar.TicksLeft; + ticksRight = historyItemBar.TicksRight; + } + } + double[] source = new double[4] { num6, num8, num9, num7 }; + return new HistoryItemBar + { + Open = num6, + High = source.Max(), + Low = source.Min(), + Close = num7, + Volume = volume2, + Ticks = num10, + TicksLeft = num11, + TicksRight = ticksRight + }; + } + } + internal class ? + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Predicate ??; + + internal bool ?(ISyntheticSynhroniserItem P_0) + { + return P_0.Position == -1; + } + } + + public List ?; + + private bool ?; + + public ?(List P_0, CancellationToken P_1) + { + ? = P_0; + ? = P_0.Count > 0 && P_0[0].HistoricalData?.Aggregation is HistoryAggregationTime { Period: var period } && period.BasePeriod >= BasePeriod.Day; + while (?(P_1) && ?.Exists((ISyntheticSynhroniserItem syntheticSynhroniserItem) => syntheticSynhroniserItem.Position == -1)) + { + } + } + + public bool ?(CancellationToken P_0) + { + foreach (ISyntheticSynhroniserItem item in ?) + { + if (P_0.IsCancellationRequested) + { + return false; + } + long nextPositionTime = item.NextPositionTime; + if (nextPositionTime < 0) + { + continue; + } + foreach (ISyntheticSynhroniserItem item2 in ?) + { + if (P_0.IsCancellationRequested) + { + return false; + } + while (true) + { + nextPositionTime = item.NextPositionTime; + if (nextPositionTime < 0 || ? || (item2.SyntheticItem?.Symbol.CurrentSessionsInfo?.ContainsDate(nextPositionTime) ?? true)) + { + break; + } + if (P_0.IsCancellationRequested) + { + return false; + } + item.Move(); + } + } + } + long num = long.MaxValue; + for (int i = 0; i < ?.Count; i++) + { + if (P_0.IsCancellationRequested) + { + return false; + } + long nextPositionTime2 = ?[i].NextPositionTime; + if (nextPositionTime2 > 0 && nextPositionTime2 < num) + { + num = nextPositionTime2; + } + } + if (num == long.MaxValue) + { + return false; + } + bool result = false; + foreach (ISyntheticSynhroniserItem item3 in ?) + { + if (P_0.IsCancellationRequested) + { + return false; + } + if (item3.NextPositionTime == num) + { + item3.Move(); + result = true; + } + } + return result; + } + } +} +namespace TradingPlatform.BusinessLayer +{ + public interface ISyntheticSynhroniserItem + { + SyntheticItem SyntheticItem { get; set; } + + HistoricalData HistoricalData { get; set; } + + int Position { get; } + + long NextPositionTime { get; } + + void Move(); + } +} +namespace ? +{ + internal class ? : ISyntheticSynhroniserItem + { + [CompilerGenerated] + private SyntheticItem ??; + + [CompilerGenerated] + private HistoricalData ??; + + [CompilerGenerated] + private int ??; + + public SyntheticItem SyntheticItem + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public HistoricalData HistoricalData + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int Position + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public long NextPositionTime + { + get + { + if (Position < HistoricalData.Count - 1) + { + return HistoricalData[Position + 1, SeekOriginHistory.Begin].TicksLeft; + } + return -1L; + } + } + + public ?() + { + Position = -1; + } + + public void Move() + { + Position++; + } + } +} +namespace TradingPlatform.BusinessLayer +{ + public sealed class SyntheticItem : ICloneable, ICustomizable + { + [CompilerGenerated] + private Symbol ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private string ??; + + public Symbol Symbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double Coefficient + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double TradeRatio + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string TradeComment + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IList Settings + { + get + { + return new List + { + new SettingItemSymbol(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Symbol), + new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Coefficient), + new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TradeRatio) + }; + } + set + { + if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemSymbol settingItemSymbol) + { + Symbol = settingItemSymbol.Value as Symbol; + } + if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemDouble settingItemDouble) + { + Coefficient = (double)settingItemDouble.Value; + } + if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemDouble settingItemDouble2) + { + TradeRatio = (double)settingItemDouble2.Value; + } + } + } + + public SyntheticItem() + { + Coefficient = 1.0; + TradeRatio = 1.0; + TradeComment = null; + } + + public SyntheticItem(SyntheticItem syntheticItem) + { + Symbol = syntheticItem.Symbol; + Coefficient = syntheticItem.Coefficient; + TradeRatio = syntheticItem.TradeRatio; + TradeComment = syntheticItem.TradeComment; + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(1, 2); + defaultInterpolatedStringHandler.AppendFormatted(Coefficient); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Symbol?.Name); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public object Clone() + { + return new SyntheticItem(this); + } + } + public sealed class DeliveredAsset : TradingObject, IMessageBuilder + { + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private Action ??; + + public double Quantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public string Status + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public DateTime CreationTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + /// + /// Will be triggered on each invocation + /// + public event Action Updated + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + internal DeliveredAsset(string P_0) + : base(P_0) + { + } + + internal void ?(MessageOpenDeliveredAsset P_0) + { + base.Id = P_0.Id; + if (ConnectionCache != null && ConnectionCache.SymbolsCache.?(P_0.SymbolId, out var symbol)) + { + base.Symbol = symbol; + } + if (ConnectionCache != null && ConnectionCache.AccountsCache.?(P_0.AccountId, out var account)) + { + base.Account = account; + } + Quantity = P_0.Quantity; + Status = P_0.Status; + CreationTime = P_0.CreationTime; + ProcessAdditionalItems(P_0.AdditionalInfoItems); + ???.Invoke(this); + } + + public MessageOpenDeliveredAsset BuildMessage() + { + return new MessageOpenDeliveredAsset + { + Id = base.Id, + AccountId = base.Account?.Id, + SymbolId = base.Symbol?.Id, + Quantity = Quantity, + Status = Status, + CreationTime = CreationTime + }; + } + } + /// + /// Contains all information which belong to the given exchange + /// + [Published] + public sealed class Exchange : BusinessObject, IComparable, IMessageBuilder + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private int ??; + + private string ??; + + /// + /// Gets Exchange Id + /// + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Gets Exchange name + /// + public string ExchangeName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Used for the Exchanges comparing + /// + public int SortIndex + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + internal SessionsContainer CurrentSessionsInfo + { + get + { + if (string.IsNullOrEmpty(??)) + { + return null; + } + ConnectionCache.TradingSessions.TryGetValue(??, out var value); + return value; + } + } + + public ExchangeComplexIdentifier ComplexId => new ExchangeComplexIdentifier(base.ConnectionId, Id); + + internal Exchange(string P_0) + : base(P_0) + { + } + + internal void ?(MessageExchange P_0) + { + Id = P_0.Id; + ExchangeName = P_0.ExchangeName; + SortIndex = P_0.SortIndex; + ?? = P_0.SessionsContainerId; + } + + private MessageExchange ?() + { + return new MessageExchange + { + Id = Id, + ExchangeName = ExchangeName, + SortIndex = SortIndex, + SessionsContainerId = ?? + }; + } + + MessageExchange IMessageBuilder.BuildMessage() + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(); + } + + /// + /// Compares Exchnges in order by next - SortIndex, Exchange name, Connection Id, Exchange Id. + /// + /// + /// + [NotPublished] + public int CompareTo(object obj) + { + if (!(obj is Exchange exchange)) + { + return 1; + } + int num = SortIndex.CompareTo(exchange.SortIndex); + if (num != 0) + { + return num; + } + num = ExchangeName.CompareTo(exchange.ExchangeName); + if (num != 0) + { + return num; + } + num = base.ConnectionId.CompareTo(exchange.ConnectionId); + if (num != 0) + { + return num; + } + return Id.CompareTo(exchange.Id); + } + + public override string ToString() + { + return ExchangeName ?? Id.ToString() ?? base.ToString(); + } + } + /// + /// Provides possibility to group and sort symbols for each connection + /// + [Published] + [DataContract(Name = "InstrumentGroup", Namespace = "TradingPlatform")] + public class SymbolGroup : BusinessObject + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private int ??; + + /// + /// Gets group Id + /// + [DataMember(Name = "GroupId")] + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Gets group name + /// + [DataMember(Name = "GroupName")] + public string GroupName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Gets sort index for comparing process + /// + [DataMember(Name = "SortIndex")] + public int SortIndex + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + internal SymbolGroup(string P_0) + : base(P_0) + { + } + + internal void ?(MessageSymbolGroup P_0) + { + Id = P_0.Id; + GroupName = P_0.GroupName; + SortIndex = P_0.SortIndex; + } + } + public sealed class NewsArticle : BusinessObject + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal bool ?(Symbol P_0) + { + return P_0 != null; + } + } + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private IEnumerable ??; + + private string[] ??; + + private bool ??; + + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public DateTime CreationDate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + public string Title + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public string SourceLink + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public string Category + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public IEnumerable Symbols + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = enumerable; + } + } + + public bool NeedToLoadSymbols + { + get + { + if (?? != null) + { + return ??.Any(); + } + return false; + } + } + + internal NewsArticle(string P_0) + : base(P_0) + { + Symbols = new Symbol[0]; + ?? = new string[0]; + } + + internal void ?(MessageNewsHeadline P_0) + { + Id = P_0.Id; + CreationDate = P_0.CreationDate; + Title = P_0.Title; + SourceLink = P_0.SourceLink; + Category = P_0.Category; + if (P_0.SymbolsIds != null && P_0.SymbolsIds.Any()) + { + ?? = P_0.SymbolsIds.ToArray(); + } + } + + public void LoadSymbols() + { + if (??) + { + return; + } + ?? = true; + if (!NeedToLoadSymbols) + { + return; + } + try + { + Symbols = (from P_0 in ?? + select Connection.?(new GetSymbolRequestParameters + { + SymbolId = P_0 + }) into P_0 + where P_0 != null + select P_0).ToArray(); + ?? = null; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + ?? = false; + } + } + + [CompilerGenerated] + private Symbol ?(string P_0) + { + return Connection.?(new GetSymbolRequestParameters + { + SymbolId = P_0 + }); + } + } + /// + /// Represents trading information about pending order + /// + [DataContract(Name = "Order", Namespace = "TradingPlatform")] + [Published] + public class Order : TradingObject, IMessageBuilder, IOrder, ITradingObject, IUniqueID, IEquatable + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private OrderStatus ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private TimeInForce ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private SlTpHolder[] ??; + + [CompilerGenerated] + private SlTpHolder[] ??; + + [CompilerGenerated] + private Action ??; + + /// + /// The ID of the order group. This group created when trades done by the MAM account. + /// + [DataMember(Name = "GroupId")] + public string GroupId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Gets Position Id. + /// + [DataMember(Name = "PositionId")] + public string PositionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Total quantity of the order + /// + [DataMember(Name = "TotalQuantity")] + public double TotalQuantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Filled quantity of the order + /// + [DataMember(Name = "FilledQuantity")] + public double FilledQuantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Remaining quantity of the order + /// + public double RemainingQuantity => TotalQuantity - FilledQuantity; + + /// + /// Orders Type Id. It is used for the orders type comparing. + /// + [DataMember(Name = "OrderTypeId")] + public string OrderTypeId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Gets OrderType + /// + public OrderType OrderType => ConnectionCache.OrderTypes.FirstOrDefault((OrderType P_0) => P_0.Id == OrderTypeId); + + /// + /// Gets order price value + /// + [DataMember(Name = "Price")] + public double Price + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets order trigger price value + /// + [DataMember(Name = "TriggerPrice")] + public double TriggerPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets order trailing offset value + /// + [DataMember(Name = "TrailOffset")] + public double TrailOffset + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets orders current status + /// + [DataMember(Name = "Status")] + public OrderStatus Status + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = orderStatus; + } + } + + /// + /// Gets open order original status + /// + [DataMember(Name = "OriginalStatus")] + public string OriginalStatus + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Gets order TIF(Time-In-Force) type + /// + [DataMember(Name = "Tif")] + public TimeInForce TimeInForce + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = timeInForce; + } + } + + /// + /// Gets orders expiration time + /// + [DataMember(Name = "ExpirationTime")] + public DateTime ExpirationTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + /// + /// Gets orders last update time + /// + public DateTime LastUpdateTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + public double AverageFillPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets StopLoss holder for given order + /// + public SlTpHolder StopLoss => StopLossItems.FirstOrDefault(); + + /// + /// Gets TakeProfit holder for given order + /// + public SlTpHolder TakeProfit => TakeProfitItems.FirstOrDefault(); + + public SlTpHolder[] StopLossItems + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = array; + } + } + + public SlTpHolder[] TakeProfitItems + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = array; + } + } + + /// + /// Will be triggered on each invocation + /// + public event Action Updated + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + /// + /// Creates Order instance + /// + /// + internal Order(string P_0) + : base(P_0) + { + StopLossItems = new SlTpHolder[0]; + TakeProfitItems = new SlTpHolder[0]; + } + + internal void ?(MessageOpenOrder P_0) + { + base.Id = P_0.OrderId; + GroupId = P_0.GroupId; + PositionId = P_0.PositionId; + LastUpdateTime = P_0.LastUpdateTime; + if (ConnectionCache != null && ConnectionCache.SymbolsCache.?(P_0.SymbolId, out var symbol)) + { + base.Symbol = symbol; + } + else if (!string.IsNullOrEmpty(P_0.SymbolId)) + { + base.Symbol = new Symbol(new BusinessObjectInfo + { + Id = P_0.SymbolId, + Name = P_0.SymbolId + }); + } + if (!string.IsNullOrEmpty(P_0.AccountId) && ConnectionCache != null && ConnectionCache.AccountsCache.?(P_0.AccountId, out var account)) + { + base.Account = account; + } + TotalQuantity = P_0.TotalQuantity; + FilledQuantity = P_0.FilledQuantity; + base.Side = P_0.Side; + OrderTypeId = P_0.OrderTypeId; + Price = P_0.Price; + TriggerPrice = P_0.TriggerPrice; + TrailOffset = P_0.TrailOffset; + TimeInForce = P_0.TimeInForce; + ExpirationTime = P_0.ExpirationTime; + Status = P_0.Status; + OriginalStatus = P_0.OriginalStatus; + AverageFillPrice = P_0.AverageFillPrice; + StopLossItems = P_0.StopLossItems.ToArray(); + TakeProfitItems = P_0.TakeProfitItems.ToArray(); + base.Comment = P_0.Comment; + ProcessAdditionalItems(P_0.AdditionalInfoItems); + ???.Invoke(this); + } + + public MessageOpenOrder BuildMessage() + { + MessageOpenOrder messageOpenOrder = new MessageOpenOrder(base.Symbol?.Id); + messageOpenOrder.OrderId = base.Id; + messageOpenOrder.GroupId = GroupId; + messageOpenOrder.PositionId = PositionId; + messageOpenOrder.LastUpdateTime = LastUpdateTime; + messageOpenOrder.AccountId = base.Account?.Id; + messageOpenOrder.TotalQuantity = TotalQuantity; + messageOpenOrder.FilledQuantity = FilledQuantity; + messageOpenOrder.Side = base.Side; + messageOpenOrder.OrderTypeId = OrderTypeId; + messageOpenOrder.Price = Price; + messageOpenOrder.TriggerPrice = TriggerPrice; + messageOpenOrder.TrailOffset = TrailOffset; + messageOpenOrder.TimeInForce = TimeInForce; + messageOpenOrder.ExpirationTime = ExpirationTime; + messageOpenOrder.Status = Status; + messageOpenOrder.OriginalStatus = OriginalStatus; + messageOpenOrder.Comment = base.Comment; + messageOpenOrder.AdditionalInfoItems = base.AdditionalInfo?.ToList(); + messageOpenOrder.StopLossItems.AddRange(StopLossItems); + messageOpenOrder.TakeProfitItems.AddRange(TakeProfitItems); + return messageOpenOrder; + } + + /// + /// Cancels pending order + /// + /// + public TradingOperationResult Cancel(string sendingSource = null) + { + return Core.Instance.CancelOrder(new CancelOrderRequestParameters + { + Order = this, + SendingSource = sendingSource + }); + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(46, 12); + defaultInterpolatedStringHandler.AppendFormatted(base.Id); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.Symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.Account); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderType?.Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(FilledQuantity); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(TotalQuantity); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(?()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Status); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(PositionId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(GroupId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.Comment); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + private string ?() + { + StringBuilder stringBuilder = new StringBuilder(); + if (!double.IsNaN(Price)) + { + StringBuilder stringBuilder2 = stringBuilder; + StringBuilder stringBuilder3 = stringBuilder2; + StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(5, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(base.Symbol?.FormatPrice(Price) ?? Price.FormatPriceWithMaxPrecision()); + stringBuilder3.Append(ref handler); + } + if (!double.IsNaN(TriggerPrice)) + { + StringBuilder stringBuilder2 = stringBuilder; + StringBuilder stringBuilder4 = stringBuilder2; + StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(8, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(base.Symbol?.FormatPrice(TriggerPrice) ?? TriggerPrice.FormatPriceWithMaxPrecision()); + stringBuilder4.Append(ref handler); + } + if (!double.IsNaN(TrailOffset)) + { + StringBuilder stringBuilder2 = stringBuilder; + StringBuilder stringBuilder5 = stringBuilder2; + StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(12, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(base.Symbol?.FormatOffset(TrailOffset, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? TrailOffset.FormatPriceWithMaxPrecision()); + stringBuilder5.Append(ref handler); + } + return stringBuilder.ToString(); + } + + public bool Equals(Order other) + { + if (other == null) + { + return false; + } + if (this == other) + { + return true; + } + if (base.ConnectionId == other.ConnectionId) + { + return base.Id == other.Id; + } + return false; + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + if (this == obj) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((Order)obj); + } + + public override int GetHashCode() + { + return HashCode.Combine(base.ConnectionId, base.Id); + } + + [CompilerGenerated] + private bool ?(OrderType P_0) + { + return P_0.Id == OrderTypeId; + } + } + /// + /// Represents an wrapper + /// + public class OrderHistory : Order, IMessageBuilder, IEquatable + { + public OrderHistory(string connectionId) + : base(connectionId) + { + } + + private MessageOrderHistory ?() + { + return new MessageOrderHistory(BuildMessage()); + } + + MessageOrderHistory IMessageBuilder.BuildMessage() + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(); + } + + public bool Equals(OrderHistory other) + { + if (other == null) + { + return false; + } + if (this == other) + { + return true; + } + if (base.ConnectionId == other.ConnectionId && base.Id == other.Id && base.UniqueId == other.UniqueId && object.Equals(base.Symbol, other.Symbol) && object.Equals(base.Account, other.Account) && object.Equals(base.OrderType, other.OrderType) && object.Equals(base.StopLoss, other.StopLoss) && object.Equals(base.TakeProfit, other.TakeProfit) && object.Equals(base.StopLossItems, other.StopLossItems) && object.Equals(base.TakeProfitItems, other.TakeProfitItems) && object.Equals(base.AdditionalInfo, other.AdditionalInfo) && base.Comment == other.Comment && base.Price == other.Price && base.TriggerPrice == other.TriggerPrice && base.TrailOffset == other.TrailOffset && base.AverageFillPrice == other.AverageFillPrice && base.TotalQuantity == other.TotalQuantity && base.FilledQuantity == other.FilledQuantity && base.RemainingQuantity == other.RemainingQuantity && base.Side == other.Side && State == other.State && base.Status == other.Status && base.ExpirationTime == other.ExpirationTime && base.GroupId == other.GroupId && base.OriginalStatus == other.OriginalStatus && base.PositionId == other.PositionId && base.LastUpdateTime == other.LastUpdateTime && base.OrderTypeId == other.OrderTypeId) + { + return base.TimeInForce == other.TimeInForce; + } + return false; + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + if (this == obj) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((OrderHistory)obj); + } + + public override int GetHashCode() + { + HashCode hashCode = default(HashCode); + hashCode.Add(base.ConnectionId); + hashCode.Add(base.Id); + hashCode.Add(base.UniqueId); + hashCode.Add(base.Symbol); + hashCode.Add(base.Account); + hashCode.Add(base.OrderType); + hashCode.Add(base.StopLoss); + hashCode.Add(base.TakeProfit); + hashCode.Add(base.StopLossItems); + hashCode.Add(base.TakeProfitItems); + hashCode.Add(base.AdditionalInfo); + hashCode.Add(base.Comment); + hashCode.Add(base.Price); + hashCode.Add(base.TriggerPrice); + hashCode.Add(base.TrailOffset); + hashCode.Add(base.AverageFillPrice); + hashCode.Add(base.TotalQuantity); + hashCode.Add(base.FilledQuantity); + hashCode.Add(base.RemainingQuantity); + hashCode.Add(base.Side); + hashCode.Add(State); + hashCode.Add(base.Status); + hashCode.Add(base.ExpirationTime); + hashCode.Add(base.GroupId); + hashCode.Add(base.OriginalStatus); + hashCode.Add(base.PositionId); + hashCode.Add(base.LastUpdateTime); + hashCode.Add(base.OrderTypeId); + hashCode.Add(base.TimeInForce); + return hashCode.ToHashCode(); + } + } + public class BasicBalanceCalculator : IBalanceCalculator, IDisposable + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + internal bool ?(SlTpHolder P_0) + { + return !double.IsNaN(P_0.QuantityPercentage); + } + + internal double ?(SlTpHolder P_0) + { + return P_0.Quantity; + } + } + + [CompilerGenerated] + private sealed class ? + { + public BasicBalanceCalculator ??; + + public SettingItem[] ??; + + public OrderRequestParameters ??; + + internal void ?() + { + ??.PopulateAction(??, ??); + } + } + + [CompilerGenerated] + private sealed class ? + { + public BasicBalanceCalculator ??; + + public OrderRequestParameters ??; + + public string ??; + + internal void ?() + { + try + { + ??.RequestParameters = ??; + ??.?? = ??; + ??.OnOrderSettingChanged(??); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + ??.?? = null; + } + } + } + + [CompilerGenerated] + private sealed class ? + { + public BasicBalanceCalculator ??; + + public Symbol ??; + + public double ??; + + internal double ?(SlTpHolder P_0) + { + return ??.?(??, P_0, P_0.QuantityPercentage / 100.0, ??); + } + + internal double ?(SlTpHolder P_0) + { + return ??.?(??, P_0, P_0.Quantity, ??); + } + } + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private double? ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private readonly bool ??; + + [CompilerGenerated] + private bool ??; + + protected OrderRequestParameters RequestParameters; + + private string ??; + + private Task ??; + + private Task ??; + + protected SettingItem QuantityItem; + + private SettingItem ??; + + private SettingItem ??; + + public bool DisplayQuantityInLots + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double? CurrentFillPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string QuantityDefiningSettingName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool AsyncBehavior + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + protected bool SkipChanges + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public BasicBalanceCalculator() + { + AsyncBehavior = false; + } + + public void Populate(SettingItem[] orderSettings, OrderRequestParameters requestParameters) + { + if (AsyncBehavior) + { + ?? = Task.Run(delegate + { + PopulateAction(orderSettings, requestParameters); + }); + } + else + { + PopulateAction(orderSettings, requestParameters); + } + } + + protected virtual void PopulateAction(SettingItem[] orderSettings, OrderRequestParameters requestParameters) + { + RequestParameters = requestParameters; + QuantityItem = orderSettings?.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + ?? = orderSettings?.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + ?? = orderSettings?.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + ?(); + Recalculate(); + } + + public void OnOrderSettingChanged(string settingName, OrderRequestParameters requestParameters) + { + ? CS$<>8__locals11 = new ?(); + CS$<>8__locals11.?? = this; + CS$<>8__locals11.?? = requestParameters; + CS$<>8__locals11.?? = settingName; + if (SkipChanges || ?? != null) + { + return; + } + if (AsyncBehavior) + { + ?? = Task.Run(delegate + { + try + { + CS$<>8__locals11.??.RequestParameters = CS$<>8__locals11.??; + CS$<>8__locals11.??.?? = CS$<>8__locals11.??; + CS$<>8__locals11.??.OnOrderSettingChanged(CS$<>8__locals11.??); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + CS$<>8__locals11.??.?? = null; + } + }); + } + else + { + CS$<>8__locals11.?(); + } + } + + protected virtual void OnOrderSettingChanged(string settingName) + { + if (!(settingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (!(settingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (settingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + QuantityDefiningSettingName = settingName; + OnRiskPercentChanged(); + } + else + { + Recalculate(); + } + } + else + { + QuantityDefiningSettingName = settingName; + OnRiskChanged(); + } + } + else + { + QuantityDefiningSettingName = settingName; + OnQuantityChanged(); + } + } + + public void OnTimerTick() + { + OrderRequestParameters requestParameters = RequestParameters; + if (requestParameters != null && requestParameters.OrderType?.Behavior == OrderTypeBehavior.Market && ?? == null) + { + Recalculate(); + } + } + + protected void Recalculate() + { + string text = ??; + try + { + ?? = QuantityDefiningSettingName ?? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + ?(); + RecalculateAction(??); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + ?? = text; + } + } + + protected virtual void RecalculateAction(string processingSettingName) + { + if (!(processingSettingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (!(processingSettingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (processingSettingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + OnRiskPercentChanged(); + } + } + else + { + OnRiskChanged(); + } + } + else + { + OnQuantityChanged(); + } + } + + public void Dispose() + { + if (AsyncBehavior) + { + Task.WhenAll(?? ?? Task.CompletedTask, ?? ?? Task.CompletedTask).ContinueWith(delegate + { + DisposeAction(); + }); + } + else + { + DisposeAction(); + } + } + + protected virtual void DisposeAction() + { + QuantityItem = null; + } + + protected virtual void OnQuantityChanged() + { + if (QuantityItem != null) + { + UpdateRisk(GetQuantity()); + UpdateRiskPercent(GetRisk()); + } + } + + protected virtual void OnRiskChanged() + { + if (?? != null) + { + double? risk = GetRisk(); + ?(risk); + UpdateRiskPercent(risk); + } + } + + protected virtual void OnRiskPercentChanged() + { + double? num = ?(); + double? availableBalance = GetAvailableBalance(); + if (num.HasValue && availableBalance.HasValue) + { + double value = availableBalance.Value * num.Value / 100.0; + ?(value, SettingItemValueChangingReason.Programmatically); + ?(value); + } + } + + protected void UpdateQuantity(double? quantity, SettingItemValueChangingReason reason) + { + if (quantity.HasValue) + { + QuantityItem.SetValueWithReason(CoreMath.FloorToIncrement(quantity.Value, RequestParameters.Symbol.LotStep), reason); + } + } + + private void ?(double? P_0) + { + Symbol ?? = RequestParameters?.Symbol; + List list = RequestParameters?.StopLossItems; + if (!P_0.HasValue || QuantityItem == null || !CurrentFillPrice.HasValue || list == null || list.Count == 0 || ?? == null) + { + return; + } + double ?? = CurrentFillPrice.Value; + double value; + if (list.Count == 1) + { + SlTpHolder slTpHolder = list[0]; + value = CoreMath.RoundToIncrement(P_0.Value / ?(??, slTpHolder, 1.0, ??), ??.LotStep); + } + else if (list.All((SlTpHolder slTpHolder3) => !double.IsNaN(slTpHolder3.QuantityPercentage))) + { + double num = list.Sum((SlTpHolder slTpHolder3) => ?(??, slTpHolder3, slTpHolder3.QuantityPercentage / 100.0, ??)); + value = CoreMath.RoundToIncrement(P_0.Value / num, ??.LotStep); + } + else + { + SlTpHolder[] array = list.Take(list.Count - 1).ToArray(); + SlTpHolder slTpHolder2 = list.Last(); + if (array.Length < 1) + { + return; + } + double num2 = array.Sum((SlTpHolder slTpHolder3) => ?(??, slTpHolder3, slTpHolder3.Quantity, ??)); + double num3 = P_0.Value - num2; + if (num3 <= 0.0) + { + value = ??.MinLot; + } + else + { + double num4 = CoreMath.RoundToIncrement(num3 / ?(??, slTpHolder2, 1.0, ??), ??.LotStep); + value = array.Sum((SlTpHolder slTpHolder3) => slTpHolder3.Quantity) + num4; + } + } + UpdateQuantity(value, SettingItemValueChangingReason.Programmatically); + } + + private void ?(double? P_0, SettingItemValueChangingReason P_1) + { + if (P_0.HasValue) + { + ??.SetValueWithReason(P_0.Value, P_1); + } + } + + protected void UpdateRisk(double? quantity) + { + Symbol symbol = RequestParameters?.Symbol; + List list = RequestParameters?.StopLossItems; + if (!quantity.HasValue || ?? == null || !CurrentFillPrice.HasValue || list == null || list.Count == 0 || symbol == null || !RequestParameters.TryCorrectBracketsQuantity(out var _)) + { + return; + } + double value = CurrentFillPrice.Value; + double num = 0.0; + foreach (SlTpHolder item in list) + { + double num2 = item.Quantity; + if (double.IsNaN(num2)) + { + num2 = quantity.Value; + } + num += ?(symbol, item, num2, value); + } + ??.SetValueWithReason(num, SettingItemValueChangingReason.Programmatically); + } + + protected void UpdateRiskPercent(double? risk) + { + double? availableBalance = GetAvailableBalance(); + if (risk.HasValue && ?? != null && availableBalance.HasValue && availableBalance != 0.0) + { + double num = risk.Value / availableBalance.Value * 100.0; + ??.SetValueWithReason(num, SettingItemValueChangingReason.Programmatically); + } + } + + protected virtual double? GetAvailableBalance() + { + return RequestParameters?.Account?.Balance; + } + + protected double? GetQuantity() + { + double? result = QuantityItem?.GetValue(); + if (!result.HasValue) + { + return null; + } + if (!DisplayQuantityInLots && RequestParameters?.Symbol != null) + { + return result.Value / RequestParameters.Symbol.LotSize; + } + return result; + } + + protected double? GetRisk() + { + return ???.GetValue(); + } + + private double? ?() + { + return ???.GetValue(); + } + + private void ?() + { + CurrentFillPrice = RequestParameters.OrderType?.GetFillPrice(RequestParameters); + } + + private double ?(Symbol P_0, SlTpHolder P_1, double P_2, double P_3) + { + double num = P_1.Price; + if (P_1.PriceMeasurement == PriceMeasurement.Offset) + { + num = RequestParameters.Symbol.CalculatePrice(P_3, (double)((RequestParameters.Side != Side.Buy) ? 1 : (-1)) * num); + } + double num2 = Math.Abs(P_0.CalculateValue(RequestParameters.Side, P_3, P_2)); + double num3 = Math.Abs(P_0.CalculateValue(RequestParameters.Side, num, P_2)); + return Math.Abs(num2 - num3); + } + + [CompilerGenerated] + private void ?(Task P_0) + { + DisposeAction(); + } + } + public abstract class CryptoBalanceCalculator : BasicBalanceCalculator + { + private SettingItemDoubleWithLink ??; + + private SettingItemSlider ??; + + protected override void PopulateAction(SettingItem[] orderSettings, OrderRequestParameters requestParameters) + { + RequestParameters = requestParameters; + if (?? != null) + { + ??.LinkAction = null; + } + ?? = orderSettings?.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) as SettingItemDoubleWithLink; + ?? = orderSettings?.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) as SettingItemSlider; + if (?? != null) + { + ??.LinkAction = OnLinkAction; + PopulateTotal(); + } + base.PopulateAction(orderSettings, requestParameters); + } + + protected override void OnOrderSettingChanged(string settingName) + { + if (!(settingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (!(settingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (settingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + base.QuantityDefiningSettingName = settingName; + OnPercentChanged(); + } + } + else + { + base.QuantityDefiningSettingName = settingName; + OnTotalChanged(); + } + } + else + { + OnSideChanged(); + } + base.OnOrderSettingChanged(settingName); + } + + protected override void RecalculateAction(string processingSettingName) + { + if (!(processingSettingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (processingSettingName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + OnPercentChanged(); + } + else + { + base.RecalculateAction(processingSettingName); + } + } + else + { + OnTotalChanged(); + } + } + + protected override void DisposeAction() + { + ?? = null; + ?? = null; + base.DisposeAction(); + } + + protected virtual double CalculateQuantity(double total, double fillPrice) + { + return (double)((decimal)total / (decimal)fillPrice); + } + + protected virtual double CalculateTotal(double quantity, double fillPrice) + { + return (double)((decimal)fillPrice * (decimal)quantity); + } + + protected virtual string GetTotalLinkText() + { + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); + } + + protected virtual ulong CalculateSliderStep() + { + return 0uL; + } + + protected override void OnQuantityChanged() + { + base.OnQuantityChanged(); + if (QuantityItem != null) + { + UpdateTotal(GetQuantity()); + UpdateSlider(); + } + } + + protected override void OnRiskChanged() + { + base.OnRiskChanged(); + if (QuantityItem != null) + { + UpdateTotal(GetQuantity()); + UpdateSlider(); + } + } + + protected override void OnRiskPercentChanged() + { + base.OnRiskPercentChanged(); + if (QuantityItem != null) + { + UpdateTotal(GetQuantity()); + UpdateSlider(); + } + } + + protected virtual void OnSideChanged() + { + } + + protected virtual void OnTotalChanged() + { + if (?? != null) + { + UpdateQuantity(GetTotal()); + UpdateSlider(); + UpdateRisk(GetQuantity()); + UpdateRiskPercent(GetRisk()); + } + } + + protected abstract void OnLinkAction(object obj); + + protected abstract void OnPercentChanged(); + + protected void UpdateQuantity(double? total) + { + if (total.HasValue && QuantityItem != null && base.CurrentFillPrice.HasValue) + { + double value = base.CurrentFillPrice.Value; + if (!value.IsNanOrDefault()) + { + double value2 = CalculateQuantity(total.Value, value); + UpdateQuantity(value2, SettingItemValueChangingReason.Programmatically); + } + } + } + + protected void UpdateTotal(double? quantity) + { + if (quantity.HasValue && ?? != null && base.CurrentFillPrice.HasValue) + { + double value = base.CurrentFillPrice.Value; + if (!double.IsNaN(value)) + { + UpdateTotal(CalculateTotal(quantity.Value, value), SettingItemValueChangingReason.Programmatically); + } + } + } + + protected void UpdateTotal(double? total, SettingItemValueChangingReason reason) + { + if (total.HasValue) + { + ??.SetValueWithReason(total, reason); + } + } + + protected void UpdateTotalLink() + { + if (?? != null) + { + ??.LinkText = GetTotalLinkText(); + } + } + + protected void UpdateSlider() + { + if (?? != null) + { + ulong num = CalculateSliderStep(); + ??.SetValueWithReason(num, SettingItemValueChangingReason.Programmatically); + } + } + + protected void PopulateTotal() + { + if (?? != null) + { + double num = 1.0; + int decimalPlaces = 0; + string dimension = string.Empty; + Asset totalAsset = GetTotalAsset(); + if (totalAsset != null) + { + num = totalAsset.MinimumChange; + decimalPlaces = totalAsset.Precision; + dimension = totalAsset.Name; + } + ??.Minimum = num; + ??.Maximum = double.MaxValue; + ??.Increment = num; + ??.DecimalPlaces = decimalPlaces; + ??.Dimension = dimension; + } + } + + protected double? GetTotal() + { + return ???.GetValue(); + } + + protected double? GetSliderPercent() + { + return (double?)???.GetValue() / 100.0; + } + + protected virtual Asset GetTotalAsset() + { + return RequestParameters?.Symbol?.QuotingCurrency; + } + } + public interface IBalanceCalculator : IDisposable + { + bool DisplayQuantityInLots { get; set; } + + double? CurrentFillPrice { get; set; } + + string QuantityDefiningSettingName { get; set; } + + void Populate(SettingItem[] orderSettings, OrderRequestParameters requestParameters); + + void OnOrderSettingChanged(string settingName, OrderRequestParameters requestParameters); + + void OnTimerTick(); + } + public abstract class MarginBasedBalanceCalculator : CryptoBalanceCalculator + { + private Symbol ??; + + private Account ??; + + private Asset ??; + + protected Symbol CurrentSymbol + { + get + { + return ??; + } + set + { + if (?? == value) + { + return; + } + ?? = null; + if (?? != null) + { + ??.Updated -= ?; + } + ?? = value; + if (?? != null) + { + ??.Updated += ?; + ?? = CurrentSymbol.Connection?.BusinessObjects.Assets.FirstOrDefault((Asset P_0) => P_0.Id == BalanceCurrency); + } + } + } + + protected Account CurrentAccount + { + get + { + return ??; + } + set + { + if (?? != value) + { + if (?? != null) + { + ??.Updated -= ?; + } + ?? = value; + if (?? != null) + { + ??.Updated += ?; + } + } + } + } + + protected virtual string BalanceCurrency => CurrentSymbol?.QuotingCurrency?.Id; + + protected override void PopulateAction(SettingItem[] orderSettings, OrderRequestParameters requestParameters) + { + base.PopulateAction(orderSettings, requestParameters); + CurrentSymbol = requestParameters.Symbol; + CurrentAccount = requestParameters.Account; + PopulateTotal(); + UpdateTotalLink(); + Recalculate(); + } + + protected override void DisposeAction() + { + base.DisposeAction(); + CurrentAccount = null; + } + + protected override string GetTotalLinkText() + { + double? availableBalance = GetAvailableBalance(); + if (!availableBalance.HasValue) + { + return base.GetTotalLinkText(); + } + return ???.FormatPriceWithCurrency(availableBalance.Value); + } + + protected override ulong CalculateSliderStep() + { + double? total = GetTotal(); + if (!total.HasValue) + { + return base.CalculateSliderStep(); + } + double? num = GetAvailableBalance(); + if (!num.HasValue) + { + return base.CalculateSliderStep(); + } + if (num == 0.0) + { + num = 1.0; + } + return (ulong)(total.Value * 100.0 * 100.0 / num).Value; + } + + protected override Asset GetTotalAsset() + { + return ??; + } + + protected abstract double? GetAvailableForOrder(); + + protected abstract int? GetLeverage(); + + protected override void OnLinkAction(object obj) + { + UpdateTotal(GetAvailableBalance(), SettingItemValueChangingReason.Manually); + } + + protected override void OnPercentChanged() + { + double? sliderPercent = GetSliderPercent(); + if (sliderPercent.HasValue) + { + double? availableBalance = GetAvailableBalance(); + if (availableBalance.HasValue) + { + double value = availableBalance.Value * sliderPercent.Value / 100.0; + UpdateQuantity(value); + UpdateTotal(GetQuantity()); + UpdateRisk(GetQuantity()); + UpdateRiskPercent(GetRisk()); + } + } + } + + private void ?(Symbol P_0) + { + try + { + base.SkipChanges = true; + UpdateTotalLink(); + Recalculate(); + } + finally + { + base.SkipChanges = false; + } + } + + private void ?(Account P_0) + { + try + { + base.SkipChanges = true; + UpdateTotalLink(); + Recalculate(); + } + finally + { + base.SkipChanges = false; + } + } + + protected override double? GetAvailableBalance() + { + double? availableForOrder = GetAvailableForOrder(); + if (!availableForOrder.HasValue) + { + return null; + } + int? leverage = GetLeverage(); + if (!leverage.HasValue) + { + return null; + } + return availableForOrder * (double?)leverage; + } + + [CompilerGenerated] + private bool ?(Asset P_0) + { + return P_0.Id == BalanceCurrency; + } + } + public class MultiAssetBalanceCalculator : CryptoBalanceCalculator + { + private CryptoAssetBalances ??; + + private CryptoAccount ??; + + protected CryptoAssetBalances CurrentBalance + { + get + { + return ??; + } + set + { + if (?? != value) + { + ?? = value; + UpdateTotalLink(); + Recalculate(); + } + } + } + + private CryptoAccount CurrentAccount + { + get + { + return ??; + } + set + { + if (?? == cryptoAccount) + { + ?(); + return; + } + if (?? != null) + { + ??.BalanceUpdated -= ?; + } + ?? = cryptoAccount; + if (?? != null) + { + ??.BalanceUpdated += ?; + } + ?(); + } + } + + protected override void PopulateAction(SettingItem[] orderSettings, OrderRequestParameters requestParameters) + { + base.PopulateAction(orderSettings, requestParameters); + CurrentAccount = requestParameters.Account as CryptoAccount; + } + + protected override void DisposeAction() + { + base.DisposeAction(); + CurrentAccount = null; + CurrentBalance = null; + } + + protected override string GetTotalLinkText() + { + if (CurrentBalance == null) + { + return base.GetTotalLinkText(); + } + return CurrentBalance.Asset.FormatPriceWithCurrency(GetAvailableBalance().GetValueOrDefault()); + } + + protected override ulong CalculateSliderStep() + { + if (RequestParameters == null || CurrentBalance == null) + { + return base.CalculateSliderStep(); + } + double? num = ((RequestParameters.Side != Side.Buy) ? GetQuantity() : GetTotal()); + if (!num.HasValue) + { + return base.CalculateSliderStep(); + } + double? num2 = GetAvailableBalance(); + if ((!num2.HasValue || num2.GetValueOrDefault() == 0.0) ? true : false) + { + num2 = 1.0; + } + return (ulong)(num.Value * 100.0 * 100.0 / num2).Value; + } + + protected override double? GetAvailableBalance() + { + return CurrentBalance?.AvailableBalance ?? 0.0; + } + + protected override void OnSideChanged() + { + ?(); + UpdateSlider(); + } + + protected override void OnLinkAction(object obj) + { + if (CurrentBalance != null && RequestParameters != null) + { + double valueOrDefault = GetAvailableBalance().GetValueOrDefault(); + if (RequestParameters.Side == Side.Buy) + { + UpdateTotal(valueOrDefault, SettingItemValueChangingReason.Manually); + } + else + { + UpdateQuantity(valueOrDefault, SettingItemValueChangingReason.Manually); + } + } + } + + protected override void OnPercentChanged() + { + double? sliderPercent = GetSliderPercent(); + if (sliderPercent.HasValue && CurrentBalance != null && RequestParameters != null) + { + double valueOrDefault = GetAvailableBalance().GetValueOrDefault(); + if (RequestParameters.Side == Side.Buy) + { + double value = valueOrDefault * sliderPercent.Value / 100.0; + UpdateQuantity(value); + UpdateTotal(value, SettingItemValueChangingReason.Programmatically); + UpdateRisk(GetQuantity()); + UpdateRiskPercent(GetRisk()); + } + else + { + double value2 = valueOrDefault * sliderPercent.Value / 100.0; + UpdateTotal(value2); + UpdateQuantity(value2, SettingItemValueChangingReason.Programmatically); + UpdateRisk(GetQuantity()); + UpdateRiskPercent(GetRisk()); + } + } + } + + private void ?(object P_0, CryptoAccountEventArgs P_1) + { + if (CurrentBalance != null && !(P_1.Balances.AssetId != CurrentBalance.AssetId)) + { + UpdateTotalLink(); + Recalculate(); + } + } + + private void ?() + { + try + { + CurrentBalance = ?(); + } + finally + { + UpdateTotalLink(); + Recalculate(); + } + } + + [CompilerGenerated] + private CryptoAssetBalances ?() + { + CryptoAccount currentAccount = CurrentAccount; + if (currentAccount == null || currentAccount.State != BusinessObjectState.Normal) + { + return null; + } + string text = ((RequestParameters.Side != Side.Buy) ? RequestParameters.Symbol?.Product?.Id : RequestParameters.Symbol?.QuotingCurrency?.Id); + if (string.IsNullOrEmpty(text)) + { + return null; + } + if (!CurrentAccount.TryGetAssetBalances(text, out var cryptoAssetBalances)) + { + return null; + } + return cryptoAssetBalances; + } + } + public class CustomOrderType : OrderType + { + private readonly string ??; + + private readonly OrderTypeBehavior ??; + + private readonly OrderType ??; + + public override string Id + { + get + { + if (!string.IsNullOrEmpty(??)) + { + return ??; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + } + + public override string Name + { + get + { + if (!string.IsNullOrEmpty(??)) + { + return ??; + } + return ???.Name ?? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + } + + public override string Abbreviation => ???.Abbreviation ?? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override OrderTypeBehavior Behavior => ???.Behavior ?? ??; + + public override string PriceItemId => ???.PriceItemId ?? base.PriceItemId; + + public CustomOrderType(string name, OrderTypeBehavior behavior, params TimeInForce[] allowedTifs) + : this(name, behavior, null, allowedTifs) + { + } + + public CustomOrderType(string name, OrderType baseOrderType) + : this(name, baseOrderType?.Behavior, baseOrderType, baseOrderType?.AllowedTifs ?? new TimeInForce[1]) + { + } + + public CustomOrderType(OrderType baseOrderType) + : this(baseOrderType?.Name, baseOrderType?.Behavior, baseOrderType, baseOrderType?.AllowedTifs ?? new TimeInForce[1]) + { + } + + private CustomOrderType(string P_0, OrderTypeBehavior? P_1, OrderType P_2, params TimeInForce[] allowedTifs) + : base(allowedTifs) + { + ?? = P_0; + ?? = P_1.GetValueOrDefault(); + ?? = P_2; + } + + public override IList GetOrderSettings(OrderRequestParameters parameters, FormatSettings formatSettings) + { + return ???.GetOrderSettings(parameters, formatSettings) ?? base.GetOrderSettings(parameters, formatSettings); + } + + public override IList GetDealTicketItems(OrderRequestParameters request) + { + return ???.GetDealTicketItems(request) ?? base.GetDealTicketItems(request); + } + + public override void SetDefaultPrices(SettingItem[] settings, OrderRequestParameters parameters) + { + if (?? != null) + { + ??.SetDefaultPrices(settings, parameters); + } + else + { + base.SetDefaultPrices(settings, parameters); + } + } + + public override double GetFillPrice(OrderRequestParameters parameters) + { + return ???.GetFillPrice(parameters) ?? double.NaN; + } + + protected override string GetPlaceConfirmMessage(PlaceOrderRequestParameters placeRequest, FormatSettings formatSettings) + { + return ???.GetConfirmMessage(placeRequest, formatSettings); + } + + protected override string GetModifyConfirmMessage(ModifyOrderRequestParameters modifyRequest, FormatSettings formatSettings) + { + return ???.GetConfirmMessage(modifyRequest, formatSettings); + } + + public override string GetCancelConfirmMessage(CancelOrderRequestParameters cancelRequest, FormatSettings formatSettings) + { + return ???.GetCancelConfirmMessage(cancelRequest, formatSettings); + } + + public override ValidateResult ValidateOrderRequestParameters(OrderRequestParameters parameters) + { + return ???.ValidateOrderRequestParameters(parameters) ?? base.ValidateOrderRequestParameters(parameters); + } + } + public enum OrderTypeBehavior + { + Unspecified, + Market, + Limit, + Stop, + TrailingStop, + StopLimit + } + [Flags] + public enum OrderTypeUsage + { + Order = 1, + CloseOrder = 2, + All = 3 + } + public class LimitIfTouchedOrderType : LimitOrderType + { + public override string Id => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override string Name => loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + + public override string Abbreviation => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override OrderTypeBehavior Behavior => OrderTypeBehavior.StopLimit; + + public LimitIfTouchedOrderType(params TimeInForce[] allowedTimeInForce) + : base(allowedTimeInForce) + { + } + + public override IList GetOrderSettings(OrderRequestParameters parameters, FormatSettings formatSettings) + { + IList orderSettings = base.GetOrderSettings(parameters, formatSettings); + double num = 0.0; + double num2 = 1E-05; + int decimalPlaces = 5; + Symbol symbol = parameters.Symbol; + bool enabled = true; + if (symbol != null) + { + if (parameters.Type == RequestType.PlaceOrder) + { + num = ((parameters.Side == Side.Buy) ? symbol.Ask : symbol.Bid); + num = CoreMath.ProcessNaN(num); + } + else if (parameters.Type == RequestType.ModifyOrder) + { + num = parameters.TriggerPrice; + enabled = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), parameters.Account, parameters.Symbol, this).Status == TradingOperationStatus.Allowed; + } + VariableTick variableTick = symbol.FindVariableTick(num); + if (variableTick != null) + { + num2 = variableTick.TickSize; + decimalPlaces = variableTick.Precision; + } + } + SettingItemDouble item = new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + SortIndex = 0, + Minimum = num2, + Maximum = 2147483647.0, + Increment = num2, + DecimalPlaces = decimalPlaces, + Enabled = enabled + }; + orderSettings.Add(item); + return orderSettings; + } + + protected override string GetPlaceConfirmMessage(PlaceOrderRequestParameters placeRequest, FormatSettings formatSettings) + { + string value = placeRequest.TimeInForce.Format(placeRequest.ExpirationTime); + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(38, 9); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatQuantity(placeRequest.Quantity, formatSettings.DisplayQuantityInLots)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatPrice(placeRequest.Price)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatPrice(placeRequest.TriggerPrice)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(placeRequest)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Account.GetCurrentName()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + protected override string GetModifyConfirmMessage(ModifyOrderRequestParameters modifyRequest, FormatSettings formatSettings) + { + string value = modifyRequest.TimeInForce.Format(modifyRequest.ExpirationTime); + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(54, 10); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.OrderId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatQuantity(modifyRequest.Quantity, formatSettings.DisplayQuantityInLots)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatPrice(modifyRequest.Price)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatPrice(modifyRequest.TriggerPrice)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(modifyRequest)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Account.GetCurrentName()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public override string GetCancelConfirmMessage(CancelOrderRequestParameters cancelRequest, FormatSettings formatSettings) + { + IOrder order = cancelRequest?.Order; + if (order == null) + { + return string.Empty; + } + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(54, 9); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Id); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Format(order.PositionId, order.GroupId)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.TimeInForce); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatQuantity(order.TotalQuantity, formatSettings.DisplayQuantityInLots)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatPrice(order.Price)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatPrice(order.TriggerPrice)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Account.GetCurrentName()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public override ValidateResult ValidateOrderRequestParameters(OrderRequestParameters parameters) + { + return base.ValidateOrderRequestParameters(parameters); + } + + public override IList GetDealTicketItems(OrderRequestParameters request) + { + IList dealTicketItems = base.GetDealTicketItems(request); + dealTicketItems.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Symbol.FormatPrice(request.TriggerPrice), 5550)); + return dealTicketItems; + } + } + public class LimitOrderType : OrderType + { + public override string Id => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override string Name => loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + + public override string Abbreviation => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override OrderTypeBehavior Behavior => OrderTypeBehavior.Limit; + + protected virtual string PriceText => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override string PriceItemId => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public LimitOrderType(params TimeInForce[] allowedTimeInForce) + : base(allowedTimeInForce) + { + base.Usage = OrderTypeUsage.All; + } + + public override IList GetOrderSettings(OrderRequestParameters parameters, FormatSettings formatSettings) + { + IList orderSettings = base.GetOrderSettings(parameters, formatSettings); + double num = 0.0; + double num2 = 1E-05; + int decimalPlaces = 5; + Symbol symbol = parameters.Symbol; + bool enabled = true; + if (symbol != null) + { + if (parameters.Type == RequestType.PlaceOrder) + { + num = ((parameters.Side == Side.Buy) ? symbol.Ask : symbol.Bid); + num = CoreMath.ProcessNaN(num); + } + else if (parameters.Type == RequestType.ModifyOrder) + { + num = parameters.Price; + if (double.IsNaN(num)) + { + num = parameters.TriggerPrice; + } + enabled = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), parameters.Account, parameters.Symbol, this).Status == TradingOperationStatus.Allowed; + } + VariableTick variableTick = symbol.FindVariableTick(num); + if (variableTick != null) + { + num2 = variableTick.TickSize; + decimalPlaces = variableTick.Precision; + } + } + SettingItemDouble item = new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num) + { + Text = loc._(PriceText, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + SortIndex = 0, + Minimum = num2, + Maximum = 2147483647.0, + Increment = num2, + DecimalPlaces = decimalPlaces, + Enabled = enabled + }; + orderSettings.Add(item); + return orderSettings; + } + + protected override string GetPlaceConfirmMessage(PlaceOrderRequestParameters placeRequest, FormatSettings formatSettings) + { + string value = placeRequest.TimeInForce.Format(placeRequest.ExpirationTime); + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(16, 8); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatQuantity(placeRequest.Quantity, formatSettings.DisplayQuantityInLots)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatPrice(placeRequest.Price)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(placeRequest)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Account.GetCurrentName()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + protected override string GetModifyConfirmMessage(ModifyOrderRequestParameters modifyRequest, FormatSettings formatSettings) + { + string value = modifyRequest.TimeInForce.Format(modifyRequest.ExpirationTime); + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(32, 9); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.OrderId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatQuantity(modifyRequest.Quantity, formatSettings.DisplayQuantityInLots)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatPrice(modifyRequest.Price)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(modifyRequest)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Account.GetCurrentName()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public override string GetCancelConfirmMessage(CancelOrderRequestParameters cancelRequest, FormatSettings formatSettings) + { + IOrder order = cancelRequest?.Order; + if (order == null) + { + return string.Empty; + } + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(31, 8); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Id); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + defaultInterpolatedStringHandler.AppendFormatted(order.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Format(order.PositionId, order.GroupId)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.TimeInForce); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatQuantity(order.TotalQuantity, formatSettings.DisplayQuantityInLots)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatPrice(order.Price)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Account.GetCurrentName()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public override ValidateResult ValidateOrderRequestParameters(OrderRequestParameters parameters) + { + ValidateResult result = base.ValidateOrderRequestParameters(parameters); + if (result.State == ValidateState.NotValid) + { + return result; + } + double price = parameters.Price; + if (parameters.Side == Side.Buy) + { + SlTpHolder stopLoss = parameters.StopLoss; + if (stopLoss != null && stopLoss.PriceMeasurement == PriceMeasurement.Absolute && stopLoss.Price >= price) + { + return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + } + SlTpHolder takeProfit = parameters.TakeProfit; + if (takeProfit != null && takeProfit.PriceMeasurement == PriceMeasurement.Absolute && takeProfit.Price <= price) + { + return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + } + } + if (parameters.Side == Side.Sell) + { + SlTpHolder stopLoss2 = parameters.StopLoss; + if (stopLoss2 != null && stopLoss2.PriceMeasurement == PriceMeasurement.Absolute && stopLoss2.Price <= price) + { + return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + } + SlTpHolder takeProfit2 = parameters.TakeProfit; + if (takeProfit2 != null && takeProfit2.PriceMeasurement == PriceMeasurement.Absolute && takeProfit2.Price >= price) + { + return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + } + } + return ValidateResult.Valid; + } + + public override IList GetDealTicketItems(OrderRequestParameters request) + { + IList dealTicketItems = base.GetDealTicketItems(request); + dealTicketItems.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Symbol.FormatPrice(request.Price), 5500)); + return dealTicketItems; + } + + public override double GetFillPrice(OrderRequestParameters parameters) + { + SettingItem itemByPath = parameters.AdditionalParameters.GetItemByPath(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (itemByPath != null) + { + return (double)itemByPath.Value; + } + return parameters.Price; + } + + public override void SetDefaultPrices(SettingItem[] settings, OrderRequestParameters parameters) + { + if (parameters.Symbol != null) + { + double num = ((parameters.Side == Side.Buy) ? parameters.Symbol.Ask : parameters.Symbol.Bid); + if (!double.IsNaN(num)) + { + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num); + } + } + } + } + public class MarketIfTouchedOrderType : StopOrderType + { + public override string Id => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override string Name => loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + + public override string Abbreviation => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public MarketIfTouchedOrderType(params TimeInForce[] allowedTimeInForce) + : base(allowedTimeInForce) + { + base.Usage = OrderTypeUsage.All; + } + } + public class MarketOrderType : OrderType + { + public override string Id => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override string Name => loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + + public override string Abbreviation => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override OrderTypeBehavior Behavior => OrderTypeBehavior.Market; + + public MarketOrderType(params TimeInForce[] allowedTimeInForce) + : base(allowedTimeInForce) + { + } + + protected override string GetPlaceConfirmMessage(PlaceOrderRequestParameters placeRequest, FormatSettings formatSettings) + { + string value = placeRequest.TimeInForce.Format(placeRequest.ExpirationTime); + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(6, 6); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatQuantity(placeRequest.Quantity, formatSettings.DisplayQuantityInLots)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(placeRequest)); + return defaultInterpolatedStringHandler.ToStringAndClear() + ((placeRequest.Account != null) ? (3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + placeRequest.Account.GetCurrentName()) : string.Empty); + } + + protected override string GetModifyConfirmMessage(ModifyOrderRequestParameters modifyRequest, FormatSettings formatSettings) + { + string value = modifyRequest.TimeInForce.Format(modifyRequest.ExpirationTime); + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(27, 8); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.OrderId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatQuantity(modifyRequest.Quantity, formatSettings.DisplayQuantityInLots)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(modifyRequest)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Account.GetCurrentName()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public override string GetCancelConfirmMessage(CancelOrderRequestParameters cancelRequest, FormatSettings formatSettings) + { + IOrder order = cancelRequest?.Order; + if (order == null) + { + return string.Empty; + } + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(27, 7); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Id); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + defaultInterpolatedStringHandler.AppendFormatted(order.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Format(order.PositionId, order.GroupId)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.TimeInForce); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatQuantity(order.TotalQuantity, formatSettings.DisplayQuantityInLots)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Account.GetCurrentName()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public override ValidateResult ValidateOrderRequestParameters(OrderRequestParameters parameters) + { + ValidateResult result = base.ValidateOrderRequestParameters(parameters); + if (result.State == ValidateState.NotValid) + { + return result; + } + if (parameters.Side == Side.Buy) + { + double ask = parameters.Symbol.Ask; + SlTpHolder stopLoss = parameters.StopLoss; + if (stopLoss != null && stopLoss.PriceMeasurement == PriceMeasurement.Absolute && stopLoss.Price >= ask) + { + return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + } + SlTpHolder takeProfit = parameters.TakeProfit; + if (takeProfit != null && takeProfit.PriceMeasurement == PriceMeasurement.Absolute && takeProfit.Price <= ask) + { + return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + } + } + if (parameters.Side == Side.Sell) + { + double bid = parameters.Symbol.Bid; + SlTpHolder stopLoss2 = parameters.StopLoss; + if (stopLoss2 != null && stopLoss2.PriceMeasurement == PriceMeasurement.Absolute && stopLoss2.Price <= bid) + { + return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + } + SlTpHolder takeProfit2 = parameters.TakeProfit; + if (takeProfit2 != null && takeProfit2.PriceMeasurement == PriceMeasurement.Absolute && takeProfit2.Price >= bid) + { + return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + } + } + return ValidateResult.Valid; + } + + public override double GetFillPrice(OrderRequestParameters parameters) + { + double result = double.NaN; + if (parameters.Symbol != null) + { + result = ((parameters.Side != Side.Buy) ? parameters.Symbol.Bid : parameters.Symbol.Ask); + } + return result; + } + } + public abstract class OrderType : BusinessObject, IComparable, ?, IEquatable + { + [CompilerGenerated] + private static class ? + { + public static Func ??; + } + + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func> ??; + + internal IEnumerable ?(OrderType P_0) + { + return P_0.AllowedTifs; + } + } + + [CompilerGenerated] + private sealed class ? + { + public TimeInForce? ??; + + internal bool ?(SelectItem P_0) + { + if (??.HasValue) + { + return P_0.Value.Equals((int)??.Value); + } + return true; + } + } + + [CompilerGenerated] + private sealed class ? + { + public OrderRequestParameters ??; + + internal bool ?(SelectItem P_0) + { + return (int)(object)P_0.Value == (int)??.Side; + } + } + + public const string Market = "Market"; + + public const string Limit = "Limit"; + + public const string Stop = "Stop"; + + public const string TrailingStop = "Tr.stop"; + + public const string StopLimit = "StopLimit"; + + public const string MarketIfTouched = "MarketIfTouched"; + + public const string LimitIfTouched = "LimitIfTouched"; + + public const string Custom = "Custom"; + + public const string TIME_IF_FORCE = "Time in force"; + + public const string EXPIRATION = "Expiration"; + + public const string SIDE = "Side"; + + public const string QUANTITY = "Quantity"; + + public const string PRICE = "Price"; + + public const string TRIGGER_PRICE = "TriggerPrice"; + + public const string TRAIL_OFFSET = "TrailOffset"; + + public const string COMMENT = "Comment"; + + public const string TOTAL = "Total"; + + public const string BALANCE_PERCENT = "Balance percent"; + + public const string RISK = "Risk"; + + public const string RISK_PERCENT = "Risk percent"; + + public const string REDUCE_ONLY = "Reduce-Only"; + + public const string POST_ONLY = "Post-Only"; + + public const string PARENT_ORDER_ID = "Parent Order ID"; + + public const int BALANCE_PERCENT_STEPS_COUNT_MULTIPLIER = 100; + + [CompilerGenerated] + private readonly OrderTypeUsage ??; + + [CompilerGenerated] + private readonly TimeInForce[] ??; + + [CompilerGenerated] + private readonly PriceMeasurement ??; + + [CompilerGenerated] + private readonly BalanceCalculatorFactory ??; + + private readonly ? ??; + + public abstract string Id { get; } + + public virtual string Name => Id; + + public abstract string Abbreviation { get; } + + public virtual OrderTypeBehavior Behavior => OrderTypeBehavior.Unspecified; + + public OrderTypeUsage Usage + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public TimeInForce[] AllowedTifs + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public PriceMeasurement SLTPPriceMeasurement + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public BalanceCalculatorFactory BalanceCalculatorFactory + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public virtual string PriceItemId => null; + + int ?.PriorityIndex => 30; + + ? ?.Rules => ??; + + protected OrderType(params TimeInForce[] allowedTimeInForce) + : base(string.Empty) + { + if (allowedTimeInForce.Length == 0) + { + allowedTimeInForce = Enum.GetValues(typeof(TimeInForce)).Cast().ToArray(); + } + AllowedTifs = allowedTimeInForce; + Usage = OrderTypeUsage.Order; + SLTPPriceMeasurement = PriceMeasurement.Absolute; + ?? = new ?(); + Core.Instance.RulesManager.Defaults.ForEach(delegate(Rule P_0) + { + ??.?(P_0.Name, P_0); + }); + } + + public virtual IList GetOrderSettings(OrderRequestParameters parameters, FormatSettings formatSettings) + { + List list = new List(); + ?(list, parameters, -100, (parameters.Type == RequestType.ModifyOrder) ? new TimeInForce?(parameters.TimeInForce) : ((TimeInForce?)null)); + ?((ICollection)list, parameters, -90, (DateTime?)null); + ?(list, parameters, -80, (parameters.Type == RequestType.ModifyOrder) ? VisibilityMode.Hidden : VisibilityMode.Visible); + ?(list, parameters, formatSettings.DisplayQuantityInLots, -70, (parameters.Type == RequestType.ModifyOrder) ? new double?(parameters.Quantity) : ((double?)null)); + if (BalanceCalculatorFactory != null) + { + if (BalanceCalculatorFactory(parameters.Symbol, parameters.Account) is CryptoBalanceCalculator) + { + ?(list, -60); + ?(list, -50); + } + ?(list, parameters.Symbol?.QuotingCurrency, -40); + ?(list, -30); + } + return list; + } + + public abstract double GetFillPrice(OrderRequestParameters parameters); + + public virtual void SetDefaultPrices(SettingItem[] settings, OrderRequestParameters parameters) + { + } + + public virtual string GetConfirmMessage(OrderRequestParameters parameters, FormatSettings formatSettings) + { + string text = string.Empty; + if (!(parameters is PlaceOrderRequestParameters placeRequest)) + { + if (parameters is ModifyOrderRequestParameters modifyRequest) + { + text = GetModifyConfirmMessage(modifyRequest, formatSettings); + } + } + else + { + text = GetPlaceConfirmMessage(placeRequest, formatSettings); + } + string additionalPartConfirmMessage = GetAdditionalPartConfirmMessage(parameters, formatSettings); + if (string.IsNullOrEmpty(additionalPartConfirmMessage)) + { + return text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + return text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + additionalPartConfirmMessage + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + + protected abstract string GetPlaceConfirmMessage(PlaceOrderRequestParameters placeRequest, FormatSettings formatSettings); + + protected abstract string GetModifyConfirmMessage(ModifyOrderRequestParameters modifyRequest, FormatSettings formatSettings); + + protected virtual string GetAdditionalPartConfirmMessage(OrderRequestParameters parameters, FormatSettings formatSettings) + { + return null; + } + + public abstract string GetCancelConfirmMessage(CancelOrderRequestParameters cancelRequest, FormatSettings formatSettings); + + public virtual ValidateResult ValidateOrderRequestParameters(OrderRequestParameters parameters) + { + if (!AllowedTifs.Contains(parameters.TimeInForce)) + { + return ValidateResult.NotValid(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (parameters.StopLossItems != null) + { + foreach (SlTpHolder stopLossItem in parameters.StopLossItems) + { + if (stopLossItem.PriceMeasurement != PriceMeasurement.Absolute && stopLossItem.PriceMeasurement != SLTPPriceMeasurement) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(120, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(SLTPPriceMeasurement); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(stopLossItem.PriceMeasurement); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return ValidateResult.NotValid(defaultInterpolatedStringHandler.ToStringAndClear()); + } + } + } + if (parameters.TakeProfitItems != null) + { + foreach (SlTpHolder takeProfitItem in parameters.TakeProfitItems) + { + if (takeProfitItem.PriceMeasurement != PriceMeasurement.Absolute && takeProfitItem.PriceMeasurement != SLTPPriceMeasurement) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(120, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(SLTPPriceMeasurement); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(takeProfitItem.PriceMeasurement); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return ValidateResult.NotValid(defaultInterpolatedStringHandler.ToStringAndClear()); + } + } + } + return ValidateResult.Valid; + } + + public virtual IList GetDealTicketItems(OrderRequestParameters request) + { + List list = new List(); + list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Symbol.Connection?.Name)); + list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Symbol.Name, 1000)); + string text = Core.Instance.CustomAccountPropertiesProvider.GetProperty(request.Account, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) as string; + list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), string.IsNullOrEmpty(text) ? request.Account.Name : (request.Account.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()), 2000)); + list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Symbol.FormatQuantity(request.Quantity), 3000)); + if (request.Type == RequestType.ModifyOrder && request is ModifyOrderRequestParameters modifyOrderRequestParameters) + { + list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), modifyOrderRequestParameters.OrderId, 3500)); + } + list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Side.ToString(), 4000)); + list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Format(request.PositionId, request.GroupId), 5000)); + list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.TimeInForce.Format(request.ExpirationTime), 6000)); + if (request.StopLossItems != null && request.StopLossItems.Count > 1) + { + for (int i = 0; i < request.StopLossItems.Count; i++) + { + string key; + if (!request.StopLoss.IsTrailing) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(12, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(i + 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + key = defaultInterpolatedStringHandler.ToStringAndClear(); + } + else + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(16, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(i + 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + key = defaultInterpolatedStringHandler.ToStringAndClear(); + } + list.Add(new DealTicketItem(key, request.StopLossItems[i].Format(request.Symbol), 6500 + i)); + } + } + else if (request.StopLoss != null) + { + list.Add(new DealTicketItem(request.StopLoss.IsTrailing ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.StopLoss.Format(request.Symbol), 6500)); + } + if (request.TakeProfitItems != null && request.TakeProfitItems.Count > 1) + { + for (int j = 0; j < request.TakeProfitItems.Count; j++) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(j + 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + list.Add(new DealTicketItem(defaultInterpolatedStringHandler.ToStringAndClear(), request.TakeProfitItems[j].Format(request.Symbol), 6510 + j)); + } + } + else if (request.TakeProfit != null) + { + list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.TakeProfit.Format(request.Symbol), 6510)); + } + list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Core.Instance.TimeUtils.DateTimeUtcNow.ToString(), 7000)); + if (!string.IsNullOrEmpty(request.Comment)) + { + list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Comment, 8000)); + } + if (!string.IsNullOrEmpty(request.SendingSource)) + { + list.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.SendingSource, 9000)); + } + return list; + } + + private void ?(ICollection P_0, OrderRequestParameters P_1, int P_2, TimeInForce? P_3 = null) + { + List obj = P_1?.OrderType?.AllowedTifs?.ToList() ?? P_1?.Symbol?.GetAlowedOrderTypes(OrderTypeUsage.Order)?.SelectMany((OrderType orderType) => orderType.AllowedTifs).Distinct().ToList(); + obj?.Sort(new TimeInForceComparer()); + List list = obj?.Select(?).ToList(); + if (list != null && list.Any()) + { + SelectItem value = list.FirstOrDefault((SelectItem selectItem) => !P_3.HasValue || selectItem.Value.Equals((int)P_3.Value)); + P_0.Add(new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value, list, P_2) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + }); + } + } + + private void ?(ICollection P_0, OrderRequestParameters P_1, int P_2, DateTime? P_3 = null) + { + TimeInForce[] array = P_1?.OrderType?.AllowedTifs; + if (array != null && (array.Contains(TimeInForce.GTD) || array.Contains(TimeInForce.GTT))) + { + DateTime minDate = Core.Instance.TimeUtils.DateTimeUtcNow.ToSelectedTimeZone(); + DateTime value = P_3 ?? minDate.AddDays(1.0); + P_0.Add(new SettingItemDateTime(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value, P_2) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + MinDate = minDate, + MaxDate = (P_1.Symbol?.ExpirationDate ?? DateTime.MaxValue), + Relation = new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ?(TimeInForce.GTD), ?(TimeInForce.GTT)) + }); + } + } + + private void ?(ICollection P_0, OrderRequestParameters P_1, int P_2, VisibilityMode P_3 = VisibilityMode.Visible) + { + List list = new List + { + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1) + }; + SelectItem value = list.First(); + if (P_1 != null && P_1.Type == RequestType.ModifyOrder) + { + value = list.FirstOrDefault((SelectItem selectItem) => (int)(object)selectItem.Value == (int)P_1.Side); + } + P_0.Add(new SettingItemRadioLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value, list, P_2) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + VisibilityMode = P_3 + }); + } + + private void ?(ICollection P_0, OrderRequestParameters P_1, bool P_2, int P_3, double? P_4 = null) + { + double num = 0.0; + double maximum = 0.0; + double num2 = 1.0; + int decimalPlaces = 1; + double value = 1.0; + string dimension = null; + if (P_1 != null && P_1.Symbol?.State == BusinessObjectState.Normal) + { + double num3 = (P_2 ? 1.0 : P_1.Symbol.LotSize); + num = P_1.Symbol.MinLot * num3; + maximum = P_1.Symbol.MaxLot * num3; + num2 = (P_2 ? P_1.Symbol.LotStep : P_1.Symbol.NotionalValueStep); + decimalPlaces = CoreMath.GetValuePrecision((decimal)num2); + value = (P_4 * num3) ?? num; + dimension = P_1.Symbol.Product?.Name; + } + if (P_2) + { + dimension = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + P_0.Add(new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value, P_3) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + Minimum = num, + Maximum = maximum, + Increment = num2, + DecimalPlaces = decimalPlaces, + UseTradingNumeric = true, + Dimension = dimension + }); + } + + private void ?(ICollection P_0, int P_1) + { + double num = 1.0; + int decimalPlaces = 0; + double maximum = double.MaxValue; + string empty = string.Empty; + P_0.Add(new SettingItemDoubleWithLink(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num, null, P_1) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + Minimum = num, + Maximum = maximum, + Increment = num, + DecimalPlaces = decimalPlaces, + UseTradingNumeric = true, + Dimension = empty + }); + } + + private void ?(ICollection P_0, int P_1) + { + P_0.Add(new SettingItemSlider(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0uL, P_1) + { + StepsCount = 10000uL + }); + } + + private void ?(ICollection P_0, Asset P_1, int P_2) + { + P_0.Add(new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0.01, P_2) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + Minimum = 0.01, + Maximum = double.MaxValue, + Increment = 0.01, + DecimalPlaces = 2, + UseTradingNumeric = true, + Dimension = P_1?.Name + }); + } + + private void ?(ICollection P_0, int P_1) + { + P_0.Add(new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0.1, P_1) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + Minimum = 0.1, + Maximum = double.MaxValue, + Increment = 0.1, + DecimalPlaces = 1, + UseTradingNumeric = true, + Dimension = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }); + } + + private static SelectItem ?(TimeInForce P_0) + { + return new SelectItem(P_0.GetDescription(), (int)P_0); + } + + public int CompareTo(object obj) + { + return Id.CompareTo((obj as OrderType).Id); + } + + public static string GetSLTPComfirmMessage(OrderRequestParameters requestParameters) + { + string text = string.Empty; + try + { + bool flag = requestParameters.StopLossItems.Count > 1 || requestParameters.TakeProfitItems.Count > 1; + if (requestParameters.StopLoss != null) + { + for (int i = 0; i < requestParameters.StopLossItems.Count; i++) + { + SlTpHolder slTpHolder = requestParameters.StopLossItems[i]; + string text2 = slTpHolder.Format(requestParameters.Symbol); + string value = (flag ? (i + 1).ToString() : string.Empty); + string value2 = (flag ? (3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + requestParameters.Symbol.FormatQuantity(slTpHolder.Quantity)) : string.Empty); + if (slTpHolder.IsTrailing) + { + text = text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + text2; + } + else + { + string text3 = text; + string text4; + if (slTpHolder.PriceMeasurement != PriceMeasurement.Absolute) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(12, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(text2); + defaultInterpolatedStringHandler.AppendFormatted(value2); + text4 = defaultInterpolatedStringHandler.ToStringAndClear(); + } + else + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(11, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(text2); + defaultInterpolatedStringHandler.AppendFormatted(value2); + text4 = defaultInterpolatedStringHandler.ToStringAndClear(); + } + text = text3 + text4; + } + if (i != requestParameters.StopLossItems.Count - 1) + { + text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + } + } + if (requestParameters.TakeProfit != null) + { + if (!string.IsNullOrEmpty(text)) + { + text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + for (int j = 0; j < requestParameters.TakeProfitItems.Count; j++) + { + SlTpHolder slTpHolder2 = requestParameters.TakeProfitItems[j]; + string value3 = slTpHolder2.Format(requestParameters.Symbol); + string value4 = (flag ? (j + 1).ToString() : string.Empty); + string value5 = (flag ? (3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + requestParameters.Symbol.FormatQuantity(slTpHolder2.Quantity)) : string.Empty); + string text5 = text; + string text6 = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + string text7; + if (slTpHolder2.PriceMeasurement != PriceMeasurement.Absolute) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(11, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value4); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value3); + defaultInterpolatedStringHandler.AppendFormatted(value5); + text7 = defaultInterpolatedStringHandler.ToStringAndClear(); + } + else + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(11, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value4); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value3); + defaultInterpolatedStringHandler.AppendFormatted(value5); + text7 = defaultInterpolatedStringHandler.ToStringAndClear(); + } + text = text5 + text6 + text7; + if (j != requestParameters.TakeProfitItems.Count - 1) + { + text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + return text; + } + + public string Format(string positionId = null, string groupId = null) + { + if (!string.IsNullOrEmpty(positionId)) + { + string value = Behavior switch + { + OrderTypeBehavior.Limit => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + OrderTypeBehavior.Stop => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + OrderTypeBehavior.TrailingStop => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + _ => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), + }; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(7, 3); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(positionId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + if (!string.IsNullOrEmpty(groupId)) + { + return Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + return Name; + } + + public static string Format(IOrder order) + { + if (order is LocalOrder) + { + return order.OrderType.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + return Format(order.OrderTypeId, order.ConnectionId, order.PositionId, order.GroupId); + } + + public static string Format(string orderTypeId, string connectionId = null, string positionId = null, string groupId = null) + { + return Core.Instance.GetOrderType(orderTypeId, connectionId)?.Format(positionId, groupId) ?? orderTypeId; + } + + public bool Equals(OrderType other) + { + if (other == null) + { + return false; + } + if (this == other) + { + return true; + } + if (Id == other.Id) + { + return base.ConnectionId == other.ConnectionId; + } + return false; + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + if (this == obj) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((OrderType)obj); + } + + public override int GetHashCode() + { + return HashCode.Combine(Id, base.ConnectionId); + } + + [CompilerGenerated] + private void ?(Rule P_0) + { + ??.?(P_0.Name, P_0); + } + } + public delegate IBalanceCalculator BalanceCalculatorFactory(Symbol symbol, Account account); +} +namespace ? +{ + internal class ? : SettingItemRelation + { + [CompilerGenerated] + private new static class ? + { + public static SettingItemRelationDelegate ??; + } + + public ?(string P_0, params object[] relationValues) + : base(new Dictionary> { + { + P_0, + new List(relationValues) + } }, ?) + { + } + + private static bool ?(SettingItemRelationParameters P_0) + { + SettingItemRelation.CheckVisibilityRelation(P_0); + if (!SettingItemRelation.CheckValues(P_0.RelationValuesByParentItem, P_0.MultipleRelationCondition) || !(P_0.DependentItem is SettingItemDateTime settingItemDateTime)) + { + return false; + } + TimeInForce value = P_0.ChangedItem.GetValue(); + settingItemDateTime.Format = ((value != TimeInForce.GTD) ? DatePickerFormat.DateTime : DatePickerFormat.Date); + return true; + } + } +} +namespace TradingPlatform.BusinessLayer +{ + public class StopLimitOrderType : LimitOrderType + { + public override string Id => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override string Name => loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + + public override string Abbreviation => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override OrderTypeBehavior Behavior => OrderTypeBehavior.StopLimit; + + public StopLimitOrderType(params TimeInForce[] allowedTimeInForce) + : base(allowedTimeInForce) + { + } + + public override IList GetOrderSettings(OrderRequestParameters parameters, FormatSettings formatSettings) + { + IList orderSettings = base.GetOrderSettings(parameters, formatSettings); + double price = 0.0; + double num = 0.0; + double minimum = 1E-05; + double increment = 1E-05; + int decimalPlaces = 5; + Symbol symbol = parameters.Symbol; + bool enabled = true; + if (symbol != null) + { + if (parameters.Type == RequestType.PlaceOrder) + { + num = ((parameters.Side == Side.Buy) ? symbol.Ask : symbol.Bid); + num = CoreMath.ProcessNaN(num); + price = symbol.CalculatePrice(num, (parameters.Side != Side.Buy) ? 1 : (-1)); + } + else if (parameters.Type == RequestType.ModifyOrder) + { + price = parameters.Price; + num = parameters.TriggerPrice; + enabled = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), parameters.Account, parameters.Symbol, this).Status == TradingOperationStatus.Allowed; + } + VariableTick variableTick = symbol.FindVariableTick(price); + if (variableTick != null) + { + minimum = variableTick.TickSize; + } + variableTick = symbol.FindVariableTick(num); + if (variableTick != null) + { + increment = variableTick.TickSize; + decimalPlaces = variableTick.Precision; + } + } + SettingItemDouble item = new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + SortIndex = 0, + Minimum = minimum, + Maximum = 2147483647.0, + Increment = increment, + DecimalPlaces = decimalPlaces, + Enabled = enabled + }; + orderSettings.Add(item); + return orderSettings; + } + + protected override string GetPlaceConfirmMessage(PlaceOrderRequestParameters placeRequest, FormatSettings formatSettings) + { + string value = placeRequest.TimeInForce.Format(placeRequest.ExpirationTime); + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(38, 9); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatQuantity(placeRequest.Quantity, formatSettings.DisplayQuantityInLots)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatPrice(placeRequest.Price)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatPrice(placeRequest.TriggerPrice)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(placeRequest)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Account.GetCurrentName()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + protected override string GetModifyConfirmMessage(ModifyOrderRequestParameters modifyRequest, FormatSettings formatSettings) + { + string value = modifyRequest.TimeInForce.Format(modifyRequest.ExpirationTime); + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(54, 10); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.OrderId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatQuantity(modifyRequest.Quantity, formatSettings.DisplayQuantityInLots)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatPrice(modifyRequest.Price)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatPrice(modifyRequest.TriggerPrice)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(modifyRequest)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Account.GetCurrentName()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public override string GetCancelConfirmMessage(CancelOrderRequestParameters cancelRequest, FormatSettings formatSettings) + { + IOrder order = cancelRequest?.Order; + if (order == null) + { + return string.Empty; + } + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(54, 9); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Id); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Format(order.PositionId, order.GroupId)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.TimeInForce); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatQuantity(order.TotalQuantity, formatSettings.DisplayQuantityInLots)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatPrice(order.Price)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatPrice(order.TriggerPrice)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(cancelRequest.Order.Account.GetCurrentName()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public override IList GetDealTicketItems(OrderRequestParameters request) + { + IList dealTicketItems = base.GetDealTicketItems(request); + dealTicketItems.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Symbol.FormatPrice(request.TriggerPrice), 5550)); + return dealTicketItems; + } + + public override void SetDefaultPrices(SettingItem[] settings, OrderRequestParameters parameters) + { + if (parameters.Symbol != null) + { + double num = ((parameters.Side == Side.Buy) ? parameters.Symbol.Ask : parameters.Symbol.Bid); + if (!double.IsNaN(num)) + { + double num2 = parameters.Symbol.CalculatePrice(num, (parameters.Side != Side.Buy) ? 1 : (-1)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num2); + } + } + } + } + public class StopOrderType : OrderType + { + public override string Id => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override string Name => loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + + public override string Abbreviation => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override OrderTypeBehavior Behavior => OrderTypeBehavior.Stop; + + public override string PriceItemId => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public StopOrderType(params TimeInForce[] allowedTimeInForce) + : base(allowedTimeInForce) + { + base.Usage = OrderTypeUsage.All; + } + + public override IList GetOrderSettings(OrderRequestParameters parameters, FormatSettings formatSettings) + { + IList orderSettings = base.GetOrderSettings(parameters, formatSettings); + double num = 0.0; + double num2 = 1E-05; + int decimalPlaces = 5; + Symbol symbol = parameters.Symbol; + bool enabled = true; + if (symbol != null) + { + if (parameters.Type == RequestType.PlaceOrder) + { + num = ((parameters.Side == Side.Buy) ? symbol.Bid : symbol.Ask); + num = CoreMath.ProcessNaN(num); + } + else if (parameters.Type == RequestType.ModifyOrder) + { + num = parameters.TriggerPrice; + if (double.IsNaN(num)) + { + num = parameters.Price; + } + enabled = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), parameters.Account, parameters.Symbol, this).Status == TradingOperationStatus.Allowed; + } + VariableTick obj = symbol.FindVariableTick(num) ?? symbol.VariableTickList.FirstOrDefault(); + num2 = obj.TickSize; + decimalPlaces = obj.Precision; + } + SettingItemDouble item = new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + SortIndex = 0, + Minimum = num2, + Maximum = 2147483647.0, + Increment = num2, + DecimalPlaces = decimalPlaces, + Enabled = enabled + }; + orderSettings.Add(item); + return orderSettings; + } + + protected override string GetPlaceConfirmMessage(PlaceOrderRequestParameters placeRequest, FormatSettings formatSettings) + { + string value = placeRequest.TimeInForce.Format(placeRequest.ExpirationTime); + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(15, 8); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatQuantity(placeRequest.Quantity, formatSettings.DisplayQuantityInLots)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatPrice(placeRequest.TriggerPrice)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(placeRequest)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Account.GetCurrentName()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + protected override string GetModifyConfirmMessage(ModifyOrderRequestParameters modifyRequest, FormatSettings formatSettings) + { + string value = modifyRequest.TimeInForce.Format(modifyRequest.ExpirationTime); + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(31, 9); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.OrderId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatQuantity(modifyRequest.Quantity, formatSettings.DisplayQuantityInLots)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatPrice(modifyRequest.TriggerPrice)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(modifyRequest)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Account.GetCurrentName()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public override string GetCancelConfirmMessage(CancelOrderRequestParameters cancelRequest, FormatSettings formatSettings) + { + IOrder order = cancelRequest?.Order; + if (order == null) + { + return string.Empty; + } + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(31, 8); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Id); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + defaultInterpolatedStringHandler.AppendFormatted(order.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Format(order.PositionId, order.GroupId)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.TimeInForce); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatQuantity(order.TotalQuantity, formatSettings.DisplayQuantityInLots)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatPrice(order.TriggerPrice)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(cancelRequest.Order.Account.GetCurrentName()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public override ValidateResult ValidateOrderRequestParameters(OrderRequestParameters parameters) + { + ValidateResult result = base.ValidateOrderRequestParameters(parameters); + if (result.State == ValidateState.NotValid) + { + return result; + } + double triggerPrice = parameters.TriggerPrice; + if (parameters.Side == Side.Buy) + { + SlTpHolder stopLoss = parameters.StopLoss; + if (stopLoss != null && stopLoss.PriceMeasurement == PriceMeasurement.Absolute && stopLoss.Price >= triggerPrice) + { + return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + } + SlTpHolder takeProfit = parameters.TakeProfit; + if (takeProfit != null && takeProfit.PriceMeasurement == PriceMeasurement.Absolute && takeProfit.Price <= triggerPrice) + { + return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + } + } + if (parameters.Side == Side.Sell) + { + SlTpHolder stopLoss2 = parameters.StopLoss; + if (stopLoss2 != null && stopLoss2.PriceMeasurement == PriceMeasurement.Absolute && stopLoss2.Price <= triggerPrice) + { + return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + } + SlTpHolder takeProfit2 = parameters.TakeProfit; + if (takeProfit2 != null && takeProfit2.PriceMeasurement == PriceMeasurement.Absolute && takeProfit2.Price >= triggerPrice) + { + return ValidateResult.NotValid(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + } + } + return ValidateResult.Valid; + } + + public override IList GetDealTicketItems(OrderRequestParameters request) + { + IList dealTicketItems = base.GetDealTicketItems(request); + dealTicketItems.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Symbol.FormatPrice(request.TriggerPrice), 5500)); + return dealTicketItems; + } + + public override double GetFillPrice(OrderRequestParameters parameters) + { + SettingItem itemByPath = parameters.AdditionalParameters.GetItemByPath(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (itemByPath != null) + { + return (double)itemByPath.Value; + } + return parameters.TriggerPrice; + } + + public override void SetDefaultPrices(SettingItem[] settings, OrderRequestParameters parameters) + { + if (parameters.Symbol != null) + { + double num = ((parameters.Side == Side.Buy) ? parameters.Symbol.Bid : parameters.Symbol.Ask); + if (!double.IsNaN(num)) + { + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num); + } + } + } + } + public class TrailingStopOrderType : OrderType + { + public override string Id => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override string Name => loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + + public override string Abbreviation => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override OrderTypeBehavior Behavior => OrderTypeBehavior.TrailingStop; + + public TrailingStopOrderType(params TimeInForce[] allowedTimeInForce) + : base(allowedTimeInForce) + { + base.Usage = OrderTypeUsage.All; + base.SLTPPriceMeasurement = PriceMeasurement.Offset; + } + + public override IList GetOrderSettings(OrderRequestParameters parameters, FormatSettings formatSettings) + { + IList orderSettings = base.GetOrderSettings(parameters, formatSettings); + int value = 1; + if (parameters.Type == RequestType.ModifyOrder) + { + value = (int)parameters.TrailOffset; + } + orderSettings.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + Minimum = 1 + }); + return orderSettings; + } + + protected override string GetPlaceConfirmMessage(PlaceOrderRequestParameters placeRequest, FormatSettings formatSettings) + { + string value = placeRequest.TimeInForce.Format(placeRequest.ExpirationTime); + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(15, 8); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatQuantity(placeRequest.Quantity, formatSettings.DisplayQuantityInLots)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Symbol.FormatOffset(placeRequest.TrailOffset, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(placeRequest)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(placeRequest.Account.GetCurrentName()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + protected override string GetModifyConfirmMessage(ModifyOrderRequestParameters modifyRequest, FormatSettings formatSettings) + { + string value = modifyRequest.TimeInForce.Format(modifyRequest.ExpirationTime); + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(31, 9); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.OrderId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatQuantity(modifyRequest.Quantity, formatSettings.DisplayQuantityInLots)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Symbol.FormatOffset(modifyRequest.TrailOffset, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderType.GetSLTPComfirmMessage(modifyRequest)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(modifyRequest.Account.GetCurrentName()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public override string GetCancelConfirmMessage(CancelOrderRequestParameters cancelRequest, FormatSettings formatSettings) + { + IOrder order = cancelRequest?.Order; + if (order == null) + { + return string.Empty; + } + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(33, 9); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Id); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + defaultInterpolatedStringHandler.AppendFormatted(order.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Format(order.PositionId, order.GroupId)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.TimeInForce); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatQuantity(order.TotalQuantity, formatSettings.DisplayQuantityInLots)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatPrice(order.TriggerPrice)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Symbol.FormatOffset(order.TrailOffset, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(order.Account.GetCurrentName()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public override IList GetDealTicketItems(OrderRequestParameters request) + { + IList dealTicketItems = base.GetDealTicketItems(request); + dealTicketItems.Add(new DealTicketItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), request.Symbol.FormatOffset(request.TrailOffset, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), 5500)); + return dealTicketItems; + } + + public override double GetFillPrice(OrderRequestParameters parameters) + { + double result = double.NaN; + SettingItem itemByPath = parameters.AdditionalParameters.GetItemByPath(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + int num = ((itemByPath == null) ? ((int)parameters.TrailOffset) : ((int)itemByPath.Value)); + if (parameters.Symbol != null) + { + result = ((parameters.Side != Side.Buy) ? parameters.Symbol.CalculatePrice(parameters.Symbol.Bid, -num) : parameters.Symbol.CalculatePrice(parameters.Symbol.Ask, num)); + } + return result; + } + } + /// + /// Represents trading information about related position + /// + [DataContract(Name = "Position", Namespace = "TradingPlatform")] + [Published] + public class Position : TradingObject, IMessageBuilder + { + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private DateTime ??; + + private PnLItem ??; + + private PnLItem ??; + + private PnLItem ??; + + private PnLItem ??; + + [CompilerGenerated] + private double ??; + + /// + /// Gets position quantity value + /// + [DataMember(Name = "Quantity")] + public double Quantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets position open order price + /// + [DataMember(Name = "OpenPrice")] + public double OpenPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets position openning time + /// + [DataMember(Name = "OpenTime")] + public DateTime OpenTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + /// + /// Gets Profit/loss (without swaps or commissions) all calculated based on the current broker's price. For open position it shows the profit/loss you would make if you close the position at the current price. If position closed, this parameter show profit/loss what trader have after closing this position. + /// + public PnLItem GrossPnL + { + get + { + return ??; + } + internal set + { + ?? = pnLItem; + } + } + + /// + /// Gets Profit/loss calculated based on the current broker's price. For open position it shows the profit/loss you would make if you close the position at the current price. If position closed, this parameter show profit/loss what trader have after closing this position. + /// + public PnLItem NetPnL + { + get + { + return ??; + } + internal set + { + ?? = pnLItem; + } + } + + /// + /// Gets fee amount for the position. + /// + public PnLItem Fee + { + get + { + return ??; + } + internal set + { + ?? = pnLItem; + } + } + + /// + /// Gets PnL swaps + /// + public PnLItem Swaps + { + get + { + return ??; + } + internal set + { + ?? = pnLItem; + } + } + + /// + /// The market price obtainable from your broker. + /// + public double CurrentPrice => ((base.Side != Side.Buy) ? base.Symbol?.Ask : base.Symbol?.Bid) ?? double.NaN; + + public double LiquidationPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets StopLoss order which belongs to the position + /// + public Order StopLoss => ConnectionCache.Orders.FirstOrDefault((Order P_0) => P_0.PositionId == base.Id && (P_0.OrderType.Behavior == OrderTypeBehavior.Stop || P_0.OrderType.Behavior == OrderTypeBehavior.TrailingStop) && P_0.OrderType.Usage.HasFlag(OrderTypeUsage.CloseOrder)); + + /// + /// Gets TakeProfit order which belongs to the position + /// + public Order TakeProfit => ConnectionCache.Orders.FirstOrDefault((Order P_0) => P_0.PositionId == base.Id && P_0.OrderType.Behavior == OrderTypeBehavior.Limit && P_0.OrderType.Usage.HasFlag(OrderTypeUsage.CloseOrder)); + + /// + /// Returns ticks amount between open and current price. + /// + public double GrossPnLTicks + { + get + { + if (base.Symbol == null || OpenPrice.IsNanOrDefault() || CurrentPrice.IsNanOrDefault()) + { + return 0.0; + } + if (base.Side == Side.Buy) + { + return base.Symbol.CalculateTicks(OpenPrice, CurrentPrice); + } + return base.Symbol.CalculateTicks(CurrentPrice, OpenPrice); + } + } + + /// + /// Will be triggered on each and invocation + /// + public event Action Updated + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + internal Position(string P_0) + : base(P_0) + { + LiquidationPrice = double.NaN; + } + + /// + /// Closes position if quantity is not specified else - uses partial closing operation. + /// + /// + /// + public virtual TradingOperationResult Close(double closeQuantity = -1.0) + { + return Core.Instance.ClosePosition(new ClosePositionRequestParameters + { + Position = this, + CloseQuantity = ((closeQuantity != -1.0) ? closeQuantity : Quantity) + }); + } + + public void ForceRecalculatePnl() + { + PnL pnL = Connection.?(new PnLRequestParameters + { + Symbol = base.Symbol, + Account = base.Account, + OpenPrice = OpenPrice, + ClosePrice = CurrentPrice, + Side = base.Side, + Quantity = Quantity, + PositionId = base.Id + }); + if (pnL != null) + { + ?(pnL); + } + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(18, 6); + defaultInterpolatedStringHandler.AppendFormatted(base.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Quantity); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.Symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.Symbol.FormatPrice(OpenPrice)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.Account); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.Id); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + internal virtual void ?(MessageOpenPosition P_0) + { + base.Id = P_0.PositionId; + if (ConnectionCache != null && ConnectionCache.SymbolsCache.?(P_0.SymbolId, out var symbol)) + { + base.Symbol = symbol; + } + if (ConnectionCache != null && ConnectionCache.AccountsCache.?(P_0.AccountId, out var account)) + { + base.Account = account; + } + OpenPrice = P_0.OpenPrice; + OpenTime = P_0.OpenTime; + Quantity = P_0.Quantity; + base.Side = P_0.Side; + base.Comment = P_0.Comment; + LiquidationPrice = P_0.LiquidationPrice; + ProcessAdditionalItems(P_0.AdditionalInfoItems); + ???.Invoke(this); + } + + public MessageOpenPosition BuildMessage() + { + return new MessageOpenPosition(base.Symbol?.Id) + { + PositionId = base.Id, + AccountId = base.Account?.Id, + OpenPrice = OpenPrice, + OpenTime = OpenTime, + Quantity = Quantity, + Side = base.Side, + Comment = base.Comment, + LiquidationPrice = LiquidationPrice, + AdditionalInfoItems = base.AdditionalInfo?.ToList() + }; + } + + internal void ?(PnL P_0) + { + if ((0u | (?(ref ??, P_0.GrossPnL) ? 1u : 0u) | (?(ref ??, P_0.NetPnL) ? 1u : 0u) | (?(ref ??, P_0.Fee) ? 1u : 0u) | (?(ref ??, P_0.Swaps) ? 1u : 0u)) != 0) + { + ???.Invoke(this); + } + } + + private bool ?(ref PnLItem P_0, PnLItem P_1) + { + if (P_1 != null) + { + PnLItem obj = P_0; + if (obj == null || !obj.Equals(P_1)) + { + P_0 = P_1; + P_0.ConnectionId = base.ConnectionId; + return true; + } + } + return false; + } + + [CompilerGenerated] + private bool ?(Order P_0) + { + if (P_0.PositionId == base.Id && (P_0.OrderType.Behavior == OrderTypeBehavior.Stop || P_0.OrderType.Behavior == OrderTypeBehavior.TrailingStop)) + { + return P_0.OrderType.Usage.HasFlag(OrderTypeUsage.CloseOrder); + } + return false; + } + + [CompilerGenerated] + private bool ?(Order P_0) + { + if (P_0.PositionId == base.Id && P_0.OrderType.Behavior == OrderTypeBehavior.Limit) + { + return P_0.OrderType.Usage.HasFlag(OrderTypeUsage.CloseOrder); + } + return false; + } + } + /// + /// Represents a report grid which can hold system reports based on s and s content. + /// + public class Report + { + /// + /// Columns collection + /// + public List Columns; + + /// + /// Rows collection + /// + public List Rows; + + internal string ?; + + /// + /// Initializes report grid + /// + public Report() + { + Columns = new List(); + Rows = new List(); + } + + /// + /// Adds coloring column to the report + /// + public void AddColumn(string header, ComparingType valueType, ColouringModes coloringModes) + { + Columns.Add(new ReportColumn(header, valueType, coloringModes)); + } + + /// + /// Adds default(non-colored) column to the report + /// + public void AddColumn(string header, ComparingType valueType) + { + AddColumn(header, valueType, ColouringModes.None); + } + } + /// + /// Exposes report cell decoration + /// + public class ReportCell + { + /// + /// Cell label + /// + public string Label; + + /// + /// Cell value + /// + public object Value; + + public IFormattingDescription formattingDescription; + + internal ReportCell(string P_0, object P_1, IFormattingDescription P_2 = null) + { + Label = P_0; + Value = P_1; + formattingDescription = P_2; + } + } + /// + /// Exposes report column decoration + /// + public class ReportColumn + { + [CompilerGenerated] + private Color ?; + + [CompilerGenerated] + private Color ?; + + /// + /// Header of the column + /// + public string Header; + + public ColouringModes ColoringModes; + + /// + /// Column value type + /// + public ComparingType ValueType; + + public Color UpForeColor + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = color; + } + } + + public Color DownForeColor + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = color; + } + } + + internal ReportColumn(string P_0, ComparingType P_1, ColouringModes P_2) + { + Header = P_0; + ValueType = P_1; + ColoringModes = P_2; + if (P_2 == ColouringModes.Signed) + { + UpForeColor = Color.FromArgb(55, 219, 186); + DownForeColor = Color.FromArgb(235, 96, 47); + } + } + } + /// + /// Exposes report row decoration + /// + public class ReportRow + { + /// + /// A collection of cells + /// + public List Cells; + + /// + /// Initializes cells in the row + /// + public ReportRow() + { + Cells = new List(); + } + + /// + /// Adds cells to the row by label and value + /// + public void AddCell(string label, object value, IFormattingDescription formattingDescription = null) + { + Cells.Add(new ReportCell(label, value, formattingDescription)); + } + + /// + /// Adds cells to the row by value only + /// + public void AddCell(object value, IFormattingDescription formattingDescription = null) + { + if (value == null) + { + AddCell(string.Empty, string.Empty, formattingDescription); + return; + } + string label = ((!(value is double d)) ? value.ToString() : (double.IsNaN(d) ? string.Empty : d.ToString())); + AddCell(label, value, formattingDescription); + } + } + /// + /// Defines report request parameters from which can be used in + /// + public class ReportType : BusinessObject, IComparable, ICustomizable + { + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private string ??; + + private IList ??; + + /// + /// Gets report Id + /// + public int Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets report Name + /// + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// report settings + /// + public IList Settings + { + get + { + return ??; + } + set + { + ?? = new List(); + foreach (SettingItem item in value) + { + ??.Add(item.GetCopy()); + } + } + } + + internal ReportType(string P_0) + : base(P_0) + { + ?? = new List(); + } + + internal void ?(MessageReportType P_0) + { + Id = P_0.Id; + Name = P_0.Name; + if (?? == null) + { + ?? = new List(); + } + foreach (SettingItem parameter in P_0.Parameters) + { + ??.Add(parameter); + } + } + + internal ReportType ?() + { + return new ReportType(base.ConnectionId) + { + Id = Id, + Name = Name, + Settings = Settings + }; + } + + public int CompareTo(object obj) + { + return 0; + } + } +} +namespace ? +{ + internal interface ? + { + int PriorityIndex { get; } + + ? Rules { get; } + } +} +namespace TradingPlatform.BusinessLayer +{ + public abstract class Rule + { + public const string ALLOW_TRADING = "Allow trading"; + + public const string ALLOW_SCREENER = "Allow screener"; + + public const string ALLOW_CONTAINS_SCREENER_CONDITIONS = "Allow 'contains' screener conditions"; + + public const string ALLOW_NEWS = "Allow news"; + + public const string ALLOW_SL = "Allow SL"; + + public const string ALLOW_TP = "Allow TP"; + + public const string ALLOW_SL_TRAILING = "Allow SL Trailing"; + + public const string ALLOW_TP_TRAILING = "Allow TP Trailing"; + + public const string ALLOW_MULTI_SL_TP = "ALLOW_MULTI_SL_TP"; + + public const string ALLOW_MODIFY_ORDER = "Allow modify order"; + + public const string ALLOW_MODIFY_ORDER_TYPE = "Allow modify order type"; + + public const string ALLOW_MODIFY_AMOUNT = "Allow modify amount"; + + public const string ALLOW_MODIFY_PRICE = "Allow modify price"; + + public const string ALLOW_MODIFY_TIF = "Allow modify tif"; + + public const string ALLOW_CHANGE_TO_MARKET = "Allow change to market"; + + public const string ALLOW_REVERSE_POSITION = "Allow reverse position"; + + public const string ALLOW_REDUCE_ONLY = "Allow reduce-only"; + + public const string ALLOW_EXPORT = "Allow export"; + + public const string ALLOW_LINK_OCO = "Allow Link OCO"; + + public const string ALLOW_NEW_OCO = "Allow New OCO"; + + public const string ALLOW_GROUP_ORDERS = "Allow group orders"; + + public const string ALLOW_PARTIAL_CLOSE_POSITION = "Allow partial close position"; + + public const string DEFAULT_SHOW_STRIKES_COUNT = "DEFAULT_SHOW_STRIKES_COUNT"; + + public const string LEVEL2_IS_AGGREGATED = "LEVEL2_IS_AGGREGATED"; + + public const string LEVEL2_HAS_IMPLIED_SIZE = "LEVEL2_HAS_IMPLIED_SIZE"; + + public const string PLACE_ORDER_TRADING_OPERATION_HAS_ORDER_ID = "PLACE_ORDER_TRADING_OPERATION_HAS_ORDER_ID"; + + public const string ALLOW_VOLUME_ANALYSIS_FROM_TICK_HISTORY = "ALLOW_VOLUME_ANALYSIS_FROM_TICK_HISTORY"; + + [CompilerGenerated] + private string ?; + + internal string Name + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = text; + } + } + + protected Rule(string name) + { + Name = name; + } + + internal virtual void ?(MessageRule P_0) + { + Name = P_0.Name; + } + + internal static Rule ?(MessageRule P_0) + { + object value = P_0.Value; + if (!(value is string text)) + { + if (!(value is int num)) + { + if (value is bool flag) + { + return new ?(P_0.Name, flag); + } + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + return new ?(P_0.Name, num); + } + return new ?(P_0.Name, text); + } + } +} +namespace ? +{ + internal sealed class ? : Rule + { + [CompilerGenerated] + private ? ??; + + internal ? Value + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = val; + } + } + + internal ?(string P_0, ? P_1) + : base(P_0) + { + Value = P_1; + } + + internal override void ?(MessageRule P_0) + { + if (!(P_0.Value is ? value)) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + typeof(?).Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + base.?(P_0); + Value = value; + } + } +} +namespace TradingPlatform.BusinessLayer +{ + /// + /// Represents a permisions checking tool which use next priority order , , and + /// + public sealed class RulesManager + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal bool ?(FieldInfo P_0) + { + if (P_0.IsLiteral) + { + return !P_0.IsInitOnly; + } + return false; + } + + internal bool ?(FieldInfo P_0) + { + return P_0.FieldType == typeof(string); + } + + internal string ?(FieldInfo P_0) + { + return P_0.GetValue(null) as string; + } + + internal Symbol ?(SyntheticItem P_0) + { + return P_0.Symbol; + } + } + + [Serializable] + [CompilerGenerated] + private sealed class ? where ? : Rule + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + internal bool ?(? P_0) + { + return P_0 != null; + } + + internal int ?(? P_0) + { + return P_0.PriorityIndex; + } + } + + internal static HashSet ?; + + internal const int ? = 0; + + internal const int ? = 10; + + internal const int ? = 20; + + internal const int ? = 30; + + internal List Defaults => new List + { + new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), + new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), + new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), + new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), + new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), + new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), + new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), + new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), + new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), + new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), + new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true), + new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), true) + }; + + static RulesManager() + { + ? = new HashSet(from P_0 in typeof(CoreLicenceKeys).GetFields(BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy) + where P_0.IsLiteral && !P_0.IsInitOnly + where P_0.FieldType == typeof(string) + select P_0.GetValue(null) as string); + } + + public AllowedResult IsAllowed(string ruleName, string connectionId) + { + ?(ruleName); + return ?(ruleName, ?(connectionId)); + } + + public AllowedResult IsAllowed(string ruleName, Account account) + { + ?(ruleName, account); + return ?(ruleName, ?(account.ConnectionId), account); + } + + public AllowedResult IsAllowed(string ruleName, Symbol symbol) + { + ?(ruleName, symbol); + if (ruleName != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() || !(symbol is Synthetic synthetic)) + { + return ?(ruleName, ?(symbol.ConnectionId), symbol); + } + ?[] rulesContainers = synthetic.LegsConnectionsIds.Select(?).Cast().Concat(synthetic.Items.Select((SyntheticItem P_0) => P_0.Symbol)) + .ToArray(); + return ?(ruleName, rulesContainers); + } + + public AllowedResult IsAllowed(string ruleName, Account account, Symbol symbol) + { + ?(ruleName, account, symbol); + return ?(ruleName, ?(account.ConnectionId), account, symbol); + } + + public AllowedResult IsAllowed(string ruleName, Account account, Symbol symbol, OrderType orderType) + { + ?(ruleName, account, symbol, orderType); + return ?(ruleName, ?(account.ConnectionId), account, symbol, orderType); + } + + public int GetIntValue(string ruleName, string connectionId) + { + ?(ruleName); + return ?(ruleName, ?(connectionId)); + } + + public int GetIntValue(string ruleName, Account account) + { + ?(ruleName, account); + return ?(ruleName, ?(account.ConnectionId), account); + } + + public int GetIntValue(string ruleName, Account account, Symbol symbol) + { + ?(ruleName, account, symbol); + return ?(ruleName, ?(account.ConnectionId), account, symbol); + } + + public int GetIntValue(string ruleName, Account account, Symbol symbol, OrderType orderType) + { + ?(ruleName, account, symbol, orderType); + return ?(ruleName, ?(account.ConnectionId), account, symbol, orderType); + } + + public string GetStringValue(string ruleName, string connectionId) + { + ?(ruleName); + return ?(ruleName, ?(connectionId)); + } + + public string GetStringValue(string ruleName, Account account) + { + ?(ruleName, account); + return ?(ruleName, ?(account.ConnectionId), account); + } + + public string GetStringValue(string ruleName, Account account, Symbol symbol) + { + ?(ruleName, account, symbol); + return ?(ruleName, ?(account.ConnectionId), account, symbol); + } + + public string GetStringValue(string ruleName, Account account, Symbol symbol, OrderType orderType) + { + ?(ruleName, account, symbol, orderType); + return ?(ruleName, ?(account.ConnectionId), account, symbol, orderType); + } + + private AllowedResult ?(string P_0, params ?[] rulesContainers) + { + IEnumerable> enumerable = ?>(P_0, rulesContainers); + if (enumerable.Count() == 0) + { + return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + foreach (? item in enumerable) + { + if (!item.Value) + { + return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + } + return AllowedResult.GetAllowedResult(); + } + + private int ?(string P_0, params ?[] rulesContainers) + { + return ?>(P_0, rulesContainers).LastOrDefault()?.Value ?? (-1); + } + + private string ?(string P_0, params ?[] rulesContainers) + { + return ?>(P_0, rulesContainers).LastOrDefault()?.Value ?? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); + } + + private IEnumerable ?(string P_0, params ?[] rulesContainers) where ? : Rule + { + IOrderedEnumerable orderedEnumerable = from ? in rulesContainers + where ? != null + orderby ?.PriorityIndex + select ?; + foreach (? item in orderedEnumerable) + { + if (item.Rules != null && item.Rules.?(P_0, out var rule) && rule is ? val) + { + yield return val; + } + } + } + + private ? ?(string P_0) + { + return Core.Instance.Connections[P_0]?.??; + } + + private void ?(string P_0) + { + if (string.IsNullOrEmpty(P_0)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + } + + private void ?(string P_0, Account P_1) + { + ?(P_0); + if (P_1 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + } + + private void ?(string P_0, Symbol P_1) + { + ?(P_0); + if (P_1 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + } + + private void ?(string P_0, Account P_1, Symbol P_2) + { + ?(P_0, P_1); + if (P_2 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + if (P_2.SymbolType == SymbolType.Synthetic || !(P_1.ConnectionId != P_2.ConnectionId)) + { + return; + } + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + + private void ?(string P_0, Account P_1, Symbol P_2, OrderType P_3) + { + ?(P_0, P_1, P_2); + if (P_3 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + if (P_2.SymbolType == SymbolType.Synthetic || !(P_1.ConnectionId != P_3.ConnectionId)) + { + return; + } + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + } + [ProtoContract] + public class HolidayInfo : IXElementSerialization + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private DateTime ??; + + [ProtoMember(1)] + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(2)] + public DateTime Date + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public HolidayInfo() + { + } + + internal HolidayInfo(HolidayInfo P_0) + { + Name = P_0.Name; + Date = P_0.Date; + } + + public override string ToString() + { + return Core.Instance.TimeUtils.GetFormatedDate(Core.Instance.TimeUtils.ConvertFromSelectedTimeZoneToUTC(Date)) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Name; + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Date)); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + Name = xElement.Value; + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + Date = xElement2.ToDateTime(toUTC: true); + } + } + } + [ProtoContract] + public class Session : ISession, IXElementSerialization + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private TimeSpan ??; + + [CompilerGenerated] + private TimeSpan ??; + + [CompilerGenerated] + private SessionType ??; + + [CompilerGenerated] + private bool ??; + + [ProtoMember(1)] + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + [ProtoMember(2)] + public TimeSpan OpenTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = timeSpan; + } + } + + [ProtoMember(3)] + public TimeSpan CloseTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = timeSpan; + } + } + + [ProtoMember(4)] + public SessionType Type + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = sessionType; + } + } + + [ProtoMember(5)] + public bool IsPrimary + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Session(string name, TimeSpan openTime, TimeSpan closeTime, SessionType type = SessionType.Main, bool isPrimary = false) + : this() + { + Name = name; + OpenTime = openTime; + CloseTime = closeTime; + Type = type; + IsPrimary = isPrimary; + } + + public Session(Session session) + : this(session.Name, session.OpenTime, session.CloseTime, session.Type, session.IsPrimary) + { + } + + internal Session() + { + Type = SessionType.Main; + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OpenTime)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OpenTime)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)Type)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsPrimary)); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + Name = xElement.Value; + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + OpenTime = xElement2.ToTimeSpan(); + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + CloseTime = xElement3.ToTimeSpan(); + } + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + Type = (SessionType)xElement4.ToInt(); + } + XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement5 != null) + { + IsPrimary = xElement5.ToBool(); + } + } + } + public class SessionsContainer : BusinessObject, ISessionsContainer, IMessageBuilder + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func> ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + internal IEnumerable ?(SessionsSet P_0) + { + return P_0.Sessions; + } + + internal HolidayInfo ?(HolidayInfo P_0) + { + return new HolidayInfo(P_0); + } + + internal SessionsSet ?(SessionsSet P_0) + { + return new SessionsSet(P_0); + } + + internal HolidayInfo ?(HolidayInfo P_0) + { + return new HolidayInfo(P_0); + } + + internal SessionsSet ?(SessionsSet P_0) + { + return new SessionsSet(P_0); + } + } + + [CompilerGenerated] + private sealed class ? + { + public DateTime ??; + + public DayOfWeek ??; + + public Func ??; + + public Func ??; + + internal bool ?(HolidayInfo P_0) + { + return P_0.Date.Date == ??.Date; + } + + internal bool ?(SessionsSet P_0) + { + return P_0.CertainDates?.Any((DateTime dateTime) => dateTime.Date == ??.Date) ?? false; + } + + internal bool ?(DateTime P_0) + { + return P_0.Date == ??.Date; + } + + internal bool ?(SessionsSet P_0) + { + return P_0.Days?.Any((DayOfWeek dayOfWeek) => dayOfWeek == ??) ?? false; + } + + internal bool ?(DayOfWeek P_0) + { + return P_0 == ??; + } + } + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private HolidayInfo[] ??; + + [CompilerGenerated] + private SessionsSet[] ??; + + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public string Description + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public HolidayInfo[] Holidays + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = array; + } + } + + public SessionsSet[] SessionsSets + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = array; + } + } + + public ISession[] ActiveSessions => SessionsSets?.SelectMany((SessionsSet P_0) => P_0.Sessions).Cast().ToArray(); + + public TimeZoneInfo TimeZone => null; + + internal SessionsContainer(string P_0) + : base(P_0) + { + } + + public void UpdateByMessage(MessageSessionsContainer message) + { + Id = message.Id; + Name = message.Name; + Description = message.Description; + Holidays = message.Holidays?.Select((HolidayInfo P_0) => new HolidayInfo(P_0)).ToArray(); + SessionsSets = message.SessionsSets?.Select((SessionsSet P_0) => new SessionsSet(P_0)).ToArray(); + } + + public ISession[] GetSessionsForDate(DateTime dateTime) + { + if (Holidays?.FirstOrDefault((HolidayInfo P_0) => P_0.Date.Date == dateTime.Date) != null) + { + return Array.Empty(); + } + DayOfWeek ?? = dateTime.DayOfWeek; + return (SessionsSets.FirstOrDefault((SessionsSet P_0) => P_0.CertainDates?.Any((DateTime dateTime2) => dateTime2.Date == dateTime.Date) ?? false) ?? SessionsSets.FirstOrDefault((SessionsSet P_0) => P_0.Days?.Any((DayOfWeek dayOfWeek) => dayOfWeek == ??) ?? false))?.Sessions.Cast().ToArray() ?? Array.Empty(); + } + + public MessageSessionsContainer BuildMessage() + { + return new MessageSessionsContainer + { + Id = Id, + Name = Name, + Description = Description, + Holidays = Holidays?.Select((HolidayInfo P_0) => new HolidayInfo(P_0)).ToArray(), + SessionsSets = SessionsSets?.Select((SessionsSet P_0) => new SessionsSet(P_0)).ToArray() + }; + } + } + [ProtoContract] + public class SessionsSet : IXElementSerialization + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func ??; + + internal Session ?(Session P_0) + { + return new Session(P_0); + } + + internal DayOfWeek ?(XElement P_0) + { + return (DayOfWeek)P_0.ToInt(); + } + + internal DateTime ?(XElement P_0) + { + return P_0.ToDateTime(toUTC: true); + } + } + + [CompilerGenerated] + private Session[] ??; + + [CompilerGenerated] + private DayOfWeek[] ??; + + [CompilerGenerated] + private DateTime[] ??; + + [ProtoMember(1)] + public Session[] Sessions + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(2)] + public DayOfWeek[] Days + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(3)] + public DateTime[] CertainDates + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SessionsSet() + { + } + + internal SessionsSet(SessionsSet P_0) + { + Sessions = P_0.Sessions.Select((Session session) => new Session(session)).ToArray(); + Days = P_0.Days?.Clone() as DayOfWeek[]; + CertainDates = P_0.CertainDates?.ToArray(); + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + Session[] sessions = Sessions; + foreach (Session session in sessions) + { + xElement2.Add(session.ToXElement()); + } + xElement.Add(xElement2); + XElement xElement3 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + DayOfWeek[] days = Days; + foreach (DayOfWeek dayOfWeek in days) + { + xElement3.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)dayOfWeek)); + } + xElement.Add(xElement3); + if (CertainDates != null) + { + XElement xElement4 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + DateTime[] certainDates = CertainDates; + foreach (DateTime dateTime in certainDates) + { + xElement4.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), dateTime)); + } + xElement.Add(xElement4); + } + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + List list = new List(); + foreach (XElement item in xElement.Elements()) + { + Session session = new Session(); + session.FromXElement(item, deserializationInfo); + list.Add(session); + } + Sessions = list.ToArray(); + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + Days = (from P_0 in xElement2.Elements() + select (DayOfWeek)P_0.ToInt()).ToArray(); + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + CertainDates = (from P_0 in xElement3.Elements() + select P_0.ToDateTime(toUTC: true)).ToArray(); + } + } + } + /// + /// Represent access to symbol information and properties. + /// + [Published] + public class Symbol : BusinessObject, IComparable, ?, IMessageBuilder, IMessageBuilder, IEquatable, IConnectionStateDependent + { + [CompilerGenerated] + private static class ? + { + public static Func ??; + } + + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + internal double ?(double P_0, double P_1) + { + return P_0; + } + + internal long ?(long P_0, long P_1) + { + return P_0; + } + + internal DateTime ?(DateTime P_0, DateTime P_1) + { + return P_0; + } + + internal long ?(long P_0, long P_1) + { + if (P_0 < 0) + { + return P_1; + } + return P_0; + } + + internal DateTime ?(DateTime P_0, DateTime P_1) + { + if (!(P_0 != default(DateTime))) + { + return P_1; + } + return P_0; + } + + internal string ?(Exchange P_0) + { + return P_0.Id; + } + } + + [CompilerGenerated] + private sealed class ? + { + public MessageSymbolInfo ??; + + internal bool ?(OptionSerie P_0) + { + return P_0.Id == ??.OptionSerieId; + } + } + + [CompilerGenerated] + private sealed class ? + { + public OrderTypeUsage? ??; + + internal bool ?(OrderType P_0) + { + return P_0.Usage.HasFlag(??); + } + } + + public const string SPOT_SYMBOL_ID = "spotSymbolId"; + + public const string TRADING_SYMBOL_ID = "TradingSymbol"; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private SymbolType ??; + + [CompilerGenerated] + private Asset ??; + + [CompilerGenerated] + private Asset ??; + + private Exchange ??; + + private string ??; + + [CompilerGenerated] + private TimeSpan ??; + + [CompilerGenerated] + private AdditionalInfoCollection ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private NettingType ??; + + [CompilerGenerated] + private SymbolGroup ??; + + [CompilerGenerated] + private SymbolQuotingType ??; + + [CompilerGenerated] + private double ??; + + private List ??; + + private double? ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private OptionCodingStyle ??; + + [CompilerGenerated] + private OptionType ??; + + [CompilerGenerated] + private OptionSerie ??; + + [CompilerGenerated] + private string ??; + + private Symbol ??; + + private string ??; + + [CompilerGenerated] + private AvailableDerivatives ??; + + [CompilerGenerated] + private AvailableDerivatives ??; + + private List ??; + + [CompilerGenerated] + private FutureContractType? ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private long ??; + + [CompilerGenerated] + private long ??; + + [CompilerGenerated] + private DepthOfMarket ??; + + private double ??; + + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + private readonly object ??; + + private TickDirection ??; + + private TickDirection ??; + + private TickDirection ??; + + [CompilerGenerated] + private HistoryType ??; + + protected HistoryMetadata historyMetadata; + + [CompilerGenerated] + private SymbolVolumeType ??; + + protected VolumeAnalysisMetadata volumeAnalysisMetadata; + + private QuoteHandler ??; + + private Level2Handler ??; + + private LastHandler ??; + + private MarkHandler ??; + + [CompilerGenerated] + private DayBarHandler ??; + + [CompilerGenerated] + private SymbolUpdateHandler ??; + + private readonly ? ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private DeltaCalculationType ??; + + [CompilerGenerated] + private double ??; + + private string ??; + + private const double ?? = 1.0 / 32.0; + + private const double ?? = 1.0 / 64.0; + + private const double ?? = 1.0 / 128.0; + + private const double ?? = 1.0 / 256.0; + + /// + /// Gets symbol Id + /// + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected set + { + ?? = value; + } + } + + public SymbolComplexIdentifier ComplexId => new SymbolComplexIdentifier(base.ConnectionId, ExchangeId, Id); + + /// + /// Gets symbol name + /// + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected set + { + ?? = value; + } + } + + /// + /// Gets symbol description + /// + public string Description + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Gets symbol type + /// + public SymbolType SymbolType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = symbolType; + } + } + + /// + /// Gets symbol base Asset + /// + public Asset Product + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected set + { + ?? = value; + } + } + + /// + /// Gets symbol counter Asset + /// + public Asset QuotingCurrency + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected set + { + ?? = value; + } + } + + /// + /// Gets Exchange of current symbol + /// + public Exchange Exchange + { + get + { + return ??; + } + protected set + { + ?? = value; + ExchangeId = Exchange?.Id; + } + } + + /// + /// Gets Exchange id of current symbol + /// + public string ExchangeId + { + get + { + return Exchange?.Id ?? ??; + } + private set + { + ?? = text; + } + } + + /// + /// Returns delay with which quote come in platform. + /// + public TimeSpan QuoteDelay + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = timeSpan; + } + } + + /// + /// Gets symbol additional info + /// + [NotPublished] + public AdditionalInfoCollection AdditionalInfo + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = additionalInfoCollection; + } + } + + /// + /// The highest trade allowed + /// + public double MaxLot + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// The lowest trade allowed + /// + public double MinLot + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets symbol NettingType + /// + public NettingType NettingType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = nettingType; + } + } + + /// + /// Gets SymbolGroup + /// + public SymbolGroup Group + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected set + { + ?? = value; + } + } + + /// + /// Gets current SymbolQuotingType + /// + public SymbolQuotingType QuotingType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = symbolQuotingType; + } + } + + /// + /// Amount of base asset for one lot. + /// + public double LotSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Stores list of symbol ticksizes + /// + public List VariableTickList + { + get + { + return ??; + } + private set + { + ?? = list; + List list2 = ??; + if (list2 != null && list2.Count == 1) + { + ?? = ??[0].TickSize; + } + else + { + ?? = null; + } + } + } + + /// + /// Step of the lot changes + /// + public double LotStep + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Step of the notional value changes + /// + public double NotionalValueStep + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets derivative expiration date + /// + public DateTime ExpirationDate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + /// + /// Gets derivative last trading date + /// + public DateTime LastTradingDate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + /// + /// Gets derivative maturity date + /// + public DateTime MaturityDate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + /// + /// Gets derivative strike price + /// + [NotPublished] + public double StrikePrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets derivative option style + /// + [NotPublished] + public OptionCodingStyle OptionStyle + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = optionCodingStyle; + } + } + + /// + /// Gets derivative option type + /// + [NotPublished] + public OptionType OptionType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = optionType; + } + } + + /// + /// Gets derivative option serie + /// + [NotPublished] + public OptionSerie OptionSerie + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = optionSerie; + } + } + + /// + /// Gets derivative underlier name + /// + public string Root + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Gets derivative underlier symbol + /// + public Symbol Underlier + { + get + { + return ??; + } + private set + { + ?? = symbol; + UnderlierId = Underlier?.Id; + } + } + + /// + /// Gets derivative underlier symbol id + /// + public string UnderlierId + { + get + { + return Underlier?.Id ?? ??; + } + private set + { + ?? = text; + } + } + + public AvailableDerivatives AvailableFutures + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = availableDerivatives; + } + } + + public AvailableDerivatives AvailableOptions + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = availableDerivatives; + } + } + + public Exchange[] AvailableOptionsExchanges => ??.ToArray(); + + public FutureContractType? FutureContractType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = futureContractType; + } + } + + /// + /// Gets Ask price + /// + public double Ask + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets Ask size + /// + public double AskSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets Bid price + /// + public double Bid + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets Bid size + /// + public double BidSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets quote time + /// + public DateTime QuoteDateTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + /// + /// Gets last price + /// + public double Last + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets last size + /// + public double LastSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets last time + /// + public DateTime LastDateTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + /// + /// Gets mark price + /// + public double Mark + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets mark size + /// + public double MarkSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets open price + /// + public double Open + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets previous close price + /// + public double PrevClose + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets high price + /// + public double High + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets low price + /// + public double Low + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets volume value + /// + public double Volume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets quote asset volume value + /// + public double QuoteAssetVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets PrevSettlement value + /// + [NotPublished] + public double PrevSettlement + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets ticks amount + /// + public long Ticks + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets trades amount + /// + public long Trades + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets Level2 data + /// + public DepthOfMarket DepthOfMarket + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = depthOfMarket; + } + } + + /// + /// Gets spread value between Bid and Ask + /// + public double Spread + { + get + { + if (double.IsNaN(Bid) || double.IsNaN(Ask)) + { + return double.NaN; + } + return CalculateTicks(Bid, Ask); + } + } + + /// + /// Gets percentage value + /// + public double SpreadPercentage + { + get + { + if (double.IsNaN(Bid) || double.IsNaN(Ask)) + { + return double.NaN; + } + decimal num = (decimal)Ask; + decimal num2 = (decimal)Bid; + decimal num3 = (num + num2) / 2m; + if (num3 == 0m) + { + return double.NaN; + } + return (double)((num - num2) / num3 * 100m); + } + } + + /// + /// Gets change value between Bid/Last and Close price + /// + public double Change + { + get + { + if (AllowCalculateRealtimeChange) + { + return CurrentPrice - ClosePrice; + } + return ??; + } + } + + /// + /// Gets percentage value + /// + public double ChangePercentage + { + get + { + if (AllowCalculateRealtimeChange) + { + double change = Change; + double closePrice = ClosePrice; + if (double.IsNaN(change) || double.IsNaN(closePrice) || closePrice == 0.0) + { + return double.NaN; + } + return (double)((decimal)change / Math.Abs((decimal)closePrice) * 100m); + } + return ??; + } + } + + private double CurrentPrice => HistoryType switch + { + HistoryType.Ask => Ask, + HistoryType.Last => Last, + HistoryType.Midpoint => (Bid + Ask) / 2.0, + HistoryType.Mark => Mark, + _ => Bid, + }; + + private double ClosePrice + { + get + { + if (!double.IsNaN(PrevSettlement) && PrevSettlement != 0.0) + { + return PrevSettlement; + } + return PrevClose; + } + } + + public double OpenInterest + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public double FundingRate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public DateTime FundingTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + public double TopPriceLimit + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public double BottomPriceLimit + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public double AverageTradedPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public double TotalBuyQuantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public double TotalSellQuantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public double IV + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public double Delta + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public double Vega + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public double Gamma + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public double Theta + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public double Rho + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + internal bool HasAnySubscription => QuotesSubscribed | Level2Subscribed | LastsSubscribed | MarkSubscribed; + + /// + /// Default history type + /// + public HistoryType HistoryType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = historyType; + } + } + + /// + /// List of all available history types + /// + [NotPublished] + public virtual HistoryMetadata HistoryMetadata + { + get + { + HistoryMetadata historyMetaData = historyMetadata; + if (historyMetaData == null) + { + Connection connection = Connection; + if (connection == null) + { + return null; + } + historyMetaData = connection.HistoryMetaData; + } + return historyMetaData; + } + } + + /// + /// Gets SymbolVolumeType + /// + public SymbolVolumeType VolumeType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = symbolVolumeType; + } + } + + /// + /// List of all available history types + /// + [NotPublished] + public virtual VolumeAnalysisMetadata VolumeAnalysisMetadata + { + get + { + VolumeAnalysisMetadata obj = volumeAnalysisMetadata; + if (obj == null) + { + Connection connection = Connection; + if (connection == null) + { + return null; + } + obj = connection.VolumeAnalysisMetadata; + } + return obj; + } + } + + internal bool QuotesSubscribed => ?? != null; + + internal bool Level2Subscribed => ?? != null; + + internal bool LastsSubscribed => ?? != null; + + internal bool MarkSubscribed => ?? != null; + + int ?.PriorityIndex => 20; + + ? ?.Rules => ??; + + /// + /// Gets real time calculation setting + /// + [NotPublished] + public bool AllowCalculateRealtimeTicks + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = flag; + } + } + + /// + /// Gets real time calculation setting + /// + [NotPublished] + public bool AllowCalculateRealtimeTrades + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = flag; + } + } + + /// + /// Gets real time calculation setting + /// + [NotPublished] + public bool AllowCalculateRealtimeVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = flag; + } + } + + /// + /// Gets real time calculation setting + /// + [NotPublished] + public bool AllowCalculateRealtimeChange + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = flag; + } + } + + [NotPublished] + public bool AllowAbbreviatePriceByTickSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DeltaCalculationType DeltaCalculationType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = deltaCalculationType; + } + } + + public double MinVolumeAnalysisTickSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public SessionsContainer CurrentSessionsInfo + { + get + { + if (string.IsNullOrEmpty(??)) + { + return Exchange?.CurrentSessionsInfo; + } + if (ConnectionCache?.TradingSessions == null) + { + return null; + } + ConnectionCache.TradingSessions.TryGetValue(??, out var value); + return value; + } + } + + internal int TotalSubscriptionsCount => (LastsSubscribed ? 1 : 0) + (MarkSubscribed ? 1 : 0) + (QuotesSubscribed ? 1 : 0) + (Level2Subscribed ? 1 : 0); + + /// + /// Gets cached tick size if it available, else tries to obtain with Last, Bid, Ask, first element of list otherwise - + /// + public double TickSize + { + get + { + if (??.HasValue) + { + return ??.Value; + } + if (!double.IsNaN(Last)) + { + return GetTickSize(Last); + } + if (!double.IsNaN(Bid)) + { + return GetTickSize(Bid); + } + if (!double.IsNaN(Ask)) + { + return GetTickSize(Ask); + } + return VariableTickList?.FirstOrDefault()?.TickSize ?? double.NaN; + } + } + + /// + /// Will be triggered when new Level1 quote is comming + /// + public event QuoteHandler NewQuote + { + add + { + ?(ref ??, value, SubscribeQuoteType.Quote); + } + remove + { + ?(ref ??, value, SubscribeQuoteType.Quote); + } + } + + /// + /// Will be triggered when new Level2 quote is comming + /// + public event Level2Handler NewLevel2 + { + add + { + ?(ref ??, value, SubscribeQuoteType.Level2); + } + remove + { + ?(ref ??, value, SubscribeQuoteType.Level2); + } + } + + /// + /// Will be triggered when new trade quote is comming + /// + public event LastHandler NewLast + { + add + { + ?(ref ??, value, SubscribeQuoteType.Last); + } + remove + { + ?(ref ??, value, SubscribeQuoteType.Last); + } + } + + public event MarkHandler NewMark + { + add + { + ?(ref ??, value, SubscribeQuoteType.Mark); + } + remove + { + ?(ref ??, value, SubscribeQuoteType.Mark); + } + } + + /// + /// Will be triggered when new correctional quote is comming from the vendor. + /// + public event DayBarHandler NewDayBar + { + [CompilerGenerated] + add + { + DayBarHandler dayBarHandler = ??; + DayBarHandler dayBarHandler2; + do + { + dayBarHandler2 = dayBarHandler; + DayBarHandler value2 = (DayBarHandler)Delegate.Combine(dayBarHandler2, value); + dayBarHandler = Interlocked.CompareExchange(ref ??, value2, dayBarHandler2); + } + while ((object)dayBarHandler != dayBarHandler2); + } + [CompilerGenerated] + remove + { + DayBarHandler dayBarHandler = ??; + DayBarHandler dayBarHandler2; + do + { + dayBarHandler2 = dayBarHandler; + DayBarHandler value2 = (DayBarHandler)Delegate.Remove(dayBarHandler2, value); + dayBarHandler = Interlocked.CompareExchange(ref ??, value2, dayBarHandler2); + } + while ((object)dayBarHandler != dayBarHandler2); + } + } + + /// + /// Will be triggered when symbol updated. + /// + public event SymbolUpdateHandler Updated + { + [CompilerGenerated] + add + { + SymbolUpdateHandler symbolUpdateHandler = ??; + SymbolUpdateHandler symbolUpdateHandler2; + do + { + symbolUpdateHandler2 = symbolUpdateHandler; + SymbolUpdateHandler value2 = (SymbolUpdateHandler)Delegate.Combine(symbolUpdateHandler2, value); + symbolUpdateHandler = Interlocked.CompareExchange(ref ??, value2, symbolUpdateHandler2); + } + while ((object)symbolUpdateHandler != symbolUpdateHandler2); + } + [CompilerGenerated] + remove + { + SymbolUpdateHandler symbolUpdateHandler = ??; + SymbolUpdateHandler symbolUpdateHandler2; + do + { + symbolUpdateHandler2 = symbolUpdateHandler; + SymbolUpdateHandler value2 = (SymbolUpdateHandler)Delegate.Remove(symbolUpdateHandler2, value); + symbolUpdateHandler = Interlocked.CompareExchange(ref ??, value2, symbolUpdateHandler2); + } + while ((object)symbolUpdateHandler != symbolUpdateHandler2); + } + } + + private void ?(ref ? P_0, ? P_1, SubscribeQuoteType P_2) where ? : Delegate + { + lock (??) + { + if (P_0 == null) + { + SubscribeAction(P_2); + } + P_0 = (?)Delegate.Combine(P_0, P_1); + } + } + + private void ?(ref ? P_0, ? P_1, SubscribeQuoteType P_2) where ? : Delegate + { + lock (??) + { + bool flag = P_0 != null; + P_0 = (?)Delegate.Remove(P_0, P_1); + if (P_0 == null && flag) + { + UnSubscribeAction(P_2); + } + } + } + + protected internal Symbol() + { + } + + [NotPublished] + protected internal Symbol(string connectionId) + : base(connectionId) + { + ?? = new object(); + ?(); + ?? = new ?(); + Core.Instance.RulesManager.Defaults.ForEach(delegate(Rule P_0) + { + ??.?(P_0.Name, P_0); + }); + } + + private protected void ?() + { + NettingType = NettingType.Undefined; + Ask = double.NaN; + AskSize = double.NaN; + Bid = double.NaN; + BidSize = double.NaN; + Last = double.NaN; + LastSize = double.NaN; + Mark = double.NaN; + MarkSize = double.NaN; + Open = double.NaN; + PrevClose = double.NaN; + High = double.NaN; + Low = double.NaN; + Volume = double.NaN; + QuoteAssetVolume = double.NaN; + PrevSettlement = double.NaN; + ?? = double.NaN; + ?? = double.NaN; + OpenInterest = double.NaN; + FundingRate = double.NaN; + TopPriceLimit = double.NaN; + BottomPriceLimit = double.NaN; + TotalBuyQuantity = double.NaN; + TotalSellQuantity = double.NaN; + IV = double.NaN; + Delta = double.NaN; + Vega = double.NaN; + Gamma = double.NaN; + Theta = double.NaN; + Rho = double.NaN; + Ticks = 0L; + Trades = 0L; + DepthOfMarket = new DepthOfMarket(this); + AllowCalculateRealtimeTicks = true; + AllowCalculateRealtimeTrades = true; + AllowCalculateRealtimeVolume = true; + AllowCalculateRealtimeChange = true; + DeltaCalculationType = DeltaCalculationType.AggressorFlag; + MinVolumeAnalysisTickSize = double.NaN; + AvailableFutures = AvailableDerivatives.None; + AvailableOptions = AvailableDerivatives.None; + MinLot = 1.0; + MaxLot = 2147483647.0; + LotStep = 1.0; + LotSize = 1.0; + NotionalValueStep = 1.0; + ?? = new List(); + } + + [NotPublished] + protected internal Symbol(BusinessObjectInfo objectInfo) + : this(objectInfo.ConnectionId) + { + Id = objectInfo.Id; + Name = objectInfo.Name; + State = BusinessObjectState.Fake; + if (objectInfo is SymbolInfo symbolInfo) + { + ExchangeId = symbolInfo.ExchangeId; + SymbolType = symbolInfo.SymbolType; + FutureContractType = symbolInfo.FutureContractType; + UnderlierId = symbolInfo.UnderlierId; + Root = symbolInfo.Root; + ExpirationDate = symbolInfo.ExpirationDate; + } + } + + internal void ?(MessageSymbolInfo P_0) + { + if (string.IsNullOrEmpty(Id)) + { + Id = P_0.Id; + } + Name = P_0.Name; + Description = P_0.Description; + SymbolType = P_0.SymbolType; + AvailableFutures = P_0.AvailableFutures; + AvailableOptions = P_0.AvailableOptions; + Root = P_0.Root; + LotStep = P_0.LotStep; + MinLot = P_0.MinLot; + MaxLot = P_0.MaxLot; + HistoryType = P_0.HistoryType; + VariableTickList = P_0.VariableTickList; + StrikePrice = P_0.StrikePrice; + OptionType = P_0.OptionType; + ExpirationDate = P_0.ExpirationDate; + LastTradingDate = P_0.LastTradingDate; + FutureContractType = P_0.FutureContractType; + if (ConnectionCache != null && !string.IsNullOrEmpty(P_0.ExchangeId)) + { + if (ConnectionCache.ExchangesCache.?(P_0.ExchangeId, out var exchange)) + { + Exchange = exchange; + } + else + { + ExchangeId = P_0.ExchangeId; + } + if (P_0.AvailableOptionsExchanges != null) + { + string[] availableOptionsExchanges = P_0.AvailableOptionsExchanges; + foreach (string text in availableOptionsExchanges) + { + if (ConnectionCache.ExchangesCache.?(text, out var item)) + { + ??.Add(item); + } + } + } + } + if (string.IsNullOrEmpty(P_0.UnderlierId)) + { + return; + } + if (ConnectionCache != null && ConnectionCache.SymbolsCache.?(P_0.UnderlierId, out var underlier)) + { + Underlier = underlier; + } + else + { + UnderlierId = P_0.UnderlierId; + } + if (P_0.OptionSerieId != null && Underlier != null) + { + OptionSerie = Connection.?(new GetOptionSeriesRequestParameters(Underlier))?.FirstOrDefault((OptionSerie optionSerie) => optionSerie.Id == P_0.OptionSerieId); + } + } + + internal void ?(MessageSymbol P_0) + { + ?((MessageSymbolInfo)P_0); + if (ConnectionCache != null) + { + if (P_0.ProductAssetId != null && ConnectionCache.??.TryGetValue(P_0.ProductAssetId, out var value)) + { + Product = value; + } + if (P_0.QuotingCurrencyAssetID != null && ConnectionCache.??.TryGetValue(P_0.QuotingCurrencyAssetID, out var value2)) + { + QuotingCurrency = value2; + } + if (!string.IsNullOrEmpty(P_0.GroupId) && ConnectionCache.SymbolGroupsCache.TryGetValue(P_0.GroupId, out var value3)) + { + Group = value3; + } + } + QuoteDelay = P_0.QuoteDelay; + MaturityDate = P_0.MaturityDate; + QuotingType = P_0.QuotingType; + LotSize = P_0.LotSize; + NotionalValueStep = P_0.NotionalValueStep; + NettingType = P_0.NettingType; + if (P_0.SymbolAdditionalInfo != null) + { + if (AdditionalInfo == null) + { + AdditionalInfoCollection additionalInfoCollection = (AdditionalInfo = new AdditionalInfoCollection()); + } + foreach (AdditionalInfoItem item in P_0.SymbolAdditionalInfo) + { + AdditionalInfo.?(item); + } + } + historyMetadata = P_0.HistoryMetadata; + volumeAnalysisMetadata = P_0.VolumeAnalysisMetadata; + VolumeType = P_0.VolumeType; + AllowCalculateRealtimeTicks = P_0.AllowCalculateRealtimeTicks; + AllowCalculateRealtimeTrades = P_0.AllowCalculateRealtimeTrades; + AllowCalculateRealtimeVolume = P_0.AllowCalculateRealtimeVolume; + AllowCalculateRealtimeChange = P_0.AllowCalculateRealtimeChange; + AllowAbbreviatePriceByTickSize = P_0.AllowAbbreviatePriceByTickSize; + DeltaCalculationType = P_0.DeltaCalculationType; + MinVolumeAnalysisTickSize = P_0.MinVolumeAnalysisTickSize; + ?? = P_0.SessionsContainerId; + ?(); + } + + protected internal virtual void SubscribeAction(SubscribeQuoteType type) + { + if (State == BusinessObjectState.Fake) + { + return; + } + if (Core.Instance.SymbolsMapping.TryGetQuotesSymbol(this, out var quotesSymbol) && quotesSymbol != this) + { + switch (type) + { + case SubscribeQuoteType.Quote: + quotesSymbol.NewQuote += ?; + break; + case SubscribeQuoteType.Level2: + { + DOMQuote dOMQuote = ((IMessageBuilder)quotesSymbol.DepthOfMarket).BuildMessage(); + dOMQuote.SymbolId = Id; + ?(dOMQuote); + quotesSymbol.NewLevel2 += ?; + break; + } + case SubscribeQuoteType.Last: + quotesSymbol.NewLast += ?; + break; + case SubscribeQuoteType.Mark: + quotesSymbol.NewMark += ?; + break; + } + bool flag = ((type == SubscribeQuoteType.Quote || (uint)(type - 2) <= 1u) ? true : false); + if (flag && (quotesSymbol.?? == null || !quotesSymbol.??.GetInvocationList().Contains(new DayBarHandler(?)))) + { + quotesSymbol.NewDayBar += ?; + DayBar dayBar = ((IMessageBuilder)quotesSymbol).BuildMessage(); + dayBar.SymbolId = Id; + ?((MessageQuote)dayBar); + } + } + else + { + Core.Instance.Connections[base.ConnectionId]?.?(this, type); + } + } + + protected internal virtual void UnSubscribeAction(SubscribeQuoteType type) + { + if (State == BusinessObjectState.Fake) + { + return; + } + if (Core.Instance.SymbolsMapping.TryGetQuotesSymbol(this, out var quotesSymbol) && quotesSymbol != this) + { + switch (type) + { + case SubscribeQuoteType.Quote: + quotesSymbol.NewQuote -= ?; + break; + case SubscribeQuoteType.Level2: + quotesSymbol.NewLevel2 -= ?; + break; + case SubscribeQuoteType.Last: + quotesSymbol.NewLast -= ?; + break; + case SubscribeQuoteType.Mark: + quotesSymbol.NewMark -= ?; + break; + } + QuoteHandler quoteHandler = quotesSymbol.??; + if (quoteHandler == null || !quoteHandler.GetInvocationList().Contains(new QuoteHandler(?))) + { + LastHandler lastHandler = quotesSymbol.??; + if (lastHandler == null || !lastHandler.GetInvocationList().Contains(new LastHandler(?))) + { + MarkHandler markHandler = quotesSymbol.??; + if (markHandler == null || !markHandler.GetInvocationList().Contains(new MarkHandler(?))) + { + quotesSymbol.NewDayBar -= ?; + ?((MessageQuote)new DayBar(Id, Core.Instance.TimeUtils.DateTimeUtcNow)); + } + } + } + } + else + { + Core.Instance.Connections[base.ConnectionId]?.?(this, type); + } + if (type == SubscribeQuoteType.Level2) + { + DepthOfMarket.?(); + } + } + + private void ?(Symbol P_0, Quote P_1) + { + ?((MessageQuote)P_1); + } + + private void ?(Symbol P_0, Level2Quote P_1, DOMQuote P_2) + { + ?(P_2); + ?(P_1); + } + + private void ?(Symbol P_0, Last P_1) + { + ?((MessageQuote)P_1); + } + + private void ?(Symbol P_0, Mark P_1) + { + ?((MessageQuote)P_1); + } + + private void ?(Symbol P_0, DayBar P_1) + { + ?((MessageQuote)P_1); + } + + internal void ?(Action P_0) + { + lock (??) + { + P_0(); + } + } + + internal void ?(MessageQuote P_0) + { + if (P_0 == null) + { + return; + } + if (!(P_0 is Quote quote)) + { + if (!(P_0 is Level2Quote level2Quote)) + { + if (!(P_0 is DOMQuote dOMQuote)) + { + if (!(P_0 is Last last)) + { + if (!(P_0 is Mark mark)) + { + if (!(P_0 is DayBar dayBar)) + { + return; + } + Func func; + Func func2; + Func func3; + if (dayBar.FullRefresh) + { + func = (double result, double num) => result; + func2 = (long result, long num) => result; + func3 = (DateTime result, DateTime dateTime) => result; + } + else + { + func = CoreMath.ProcessNaN; + func2 = (long num, long num2) => (num < 0) ? num2 : num; + func3 = (DateTime dateTime, DateTime dateTime2) => (!(dateTime != default(DateTime))) ? dateTime2 : dateTime; + } + Open = func(dayBar.Open, Open); + High = func(dayBar.High, High); + Low = func(dayBar.Low, Low); + PrevClose = func(dayBar.PreviousClose, PrevClose); + Volume = func(dayBar.Volume, Volume); + QuoteAssetVolume = func(dayBar.QuoteAssetVolume, QuoteAssetVolume); + PrevSettlement = func(dayBar.PrevSettlementPrice, PrevSettlement); + Ticks = func2(dayBar.Ticks, Ticks); + Trades = func2(dayBar.Trades, Trades); + Bid = func(dayBar.Bid, Bid); + BidSize = func(dayBar.BidSize, BidSize); + Ask = func(dayBar.Ask, Ask); + AskSize = func(dayBar.AskSize, AskSize); + Last = func(dayBar.Last, Last); + LastSize = func(dayBar.LastSize, LastSize); + Mark = func(dayBar.Mark, Mark); + MarkSize = func(dayBar.MarkSize, MarkSize); + if (!AllowCalculateRealtimeChange) + { + ?? = func(dayBar.Change, ??); + ?? = func(dayBar.ChangePercentage, ??); + } + OpenInterest = func(dayBar.OpenInterest, OpenInterest); + FundingRate = func(dayBar.FundingRate, FundingRate); + FundingTime = func3(dayBar.FundingTime, FundingTime); + TopPriceLimit = func(dayBar.TopPriceLimit, TopPriceLimit); + BottomPriceLimit = func(dayBar.BottomPriceLimit, BottomPriceLimit); + AverageTradedPrice = func(dayBar.AverageTradedPrice, AverageTradedPrice); + TotalBuyQuantity = dayBar.TotalBuyQuantity; + TotalSellQuantity = dayBar.TotalSellQuantity; + IV = dayBar.IV; + Delta = dayBar.Delta; + Vega = dayBar.Vega; + Gamma = dayBar.Gamma; + Theta = dayBar.Theta; + Rho = dayBar.Rho; + ?(dayBar); + } + else + { + Mark = mark.Price; + MarkSize = CoreMath.ProcessNaN(mark.Size, MarkSize); + ?(mark); + } + return; + } + if (HistoryMetadata != null && !HistoryMetadata.ServerSideTickDirectionAvailable) + { + last.TickDirection = DetermineTickDirection(Last, last.Price, ??); + } + ?? = last.TickDirection; + Last = last.Price; + LastSize = last.Size; + LastDateTime = last.Time; + if (AllowCalculateRealtimeVolume) + { + Volume += last.Size; + if (!double.IsNaN(last.QuoteAssetVolume)) + { + QuoteAssetVolume += last.QuoteAssetVolume; + } + } + if (AllowCalculateRealtimeTrades) + { + Trades++; + } + if (!double.IsNaN(last.OpenInterest)) + { + OpenInterest = last.OpenInterest; + } + ?(last); + } + else + { + DepthOfMarket.?(dOMQuote); + ?(null, dOMQuote); + } + } + else + { + DepthOfMarket.?(level2Quote); + ?(level2Quote, null); + } + } + else + { + quote.BidTickDirection = DetermineTickDirection(Bid, quote.Bid, ??); + quote.AskTickDirection = DetermineTickDirection(Ask, quote.Ask, ??); + ?? = quote.BidTickDirection; + ?? = quote.AskTickDirection; + if (!double.IsNaN(quote.Bid)) + { + Bid = quote.Bid; + } + if (!double.IsNaN(quote.BidSize)) + { + BidSize = quote.BidSize; + } + if (!double.IsNaN(quote.Ask)) + { + Ask = quote.Ask; + } + if (!double.IsNaN(quote.AskSize)) + { + AskSize = quote.AskSize; + } + QuoteDateTime = quote.Time; + if (AllowCalculateRealtimeTicks) + { + Ticks++; + } + ?(quote); + } + } + + private void ?(Quote P_0) + { + ???.Invoke(this, P_0); + } + + private void ?(Level2Quote P_0, DOMQuote P_1) + { + ???.Invoke(this, P_0, P_1); + } + + private void ?(Last P_0) + { + ???.Invoke(this, P_0); + } + + private void ?(Mark P_0) + { + ???.Invoke(this, P_0); + } + + private void ?(DayBar P_0) + { + ???.Invoke(this, P_0); + } + + /// + /// Gets historical data according to period and other parameters + /// + /// + /// + /// + /// + public HistoricalData GetHistory(Period period, DateTime fromTime, DateTime toTime = default(DateTime)) + { + return GetHistory(period, HistoryType, fromTime, toTime); + } + + /// + /// Gets historical data according to period and other parameters + /// + /// + /// + /// + /// + /// + public HistoricalData GetHistory(Period period, HistoryType historyType, DateTime fromTime, DateTime toTime = default(DateTime)) + { + HistoryAggregation aggregation = ((period.BasePeriod != BasePeriod.Tick) ? new HistoryAggregationTime(period, historyType) : ((period.PeriodMultiplier != 1) ? ((HistoryAggregation)new HistoryAggregationTickBars(period.PeriodMultiplier, historyType)) : ((HistoryAggregation)new HistoryAggregationTick(historyType)))); + HistoryRequestParameters historyRequestParameters = new HistoryRequestParameters + { + Symbol = this, + Aggregation = aggregation, + FromTime = fromTime, + ToTime = toTime + }; + return GetHistory(historyRequestParameters); + } + + /// + /// Gets historical data according to aggregation and other parameters + /// + /// + /// + /// + /// + /// + public HistoricalData GetHistory(HistoryAggregation aggregation, DateTime fromTime, DateTime toTime = default(DateTime)) + { + return GetHistory(new HistoryRequestParameters + { + Symbol = this, + Aggregation = aggregation, + FromTime = fromTime, + ToTime = toTime + }); + } + + /// + /// Gets historical data according to given history request + /// + /// + /// + public HistoricalData GetHistory(HistoryRequestParameters historyRequestParameters) + { + if (historyRequestParameters == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + historyRequestParameters.Symbol = this; + HistoricalData historicalData = ?(historyRequestParameters); + historicalData.Reload(); + return historicalData; + } + + private protected virtual HistoricalData ?(HistoryRequestParameters P_0) + { + return new HistoricalData(P_0); + } + + /// + /// Gets historical ticks data according to given parameters + /// + /// + /// + /// + /// + public HistoricalData GetTickHistory(HistoryType historyType, DateTime fromTime, DateTime toTime = default(DateTime)) + { + return GetHistory(new HistoryRequestParameters + { + Symbol = this, + Aggregation = new HistoryAggregationTick(historyType), + FromTime = fromTime, + ToTime = toTime + }); + } + + /// + /// Returns rounded to price + /// + public double RoundPriceToTickSize(double price, double tickSize = double.NaN) + { + if (double.IsNaN(price) || (VariableTickList == null && tickSize.IsNanOrDefault())) + { + return 0.0; + } + if (tickSize.IsNanOrDefault()) + { + VariableTick variableTick = FindVariableTick(price); + if (variableTick == null) + { + return price; + } + tickSize = variableTick.TickSize; + } + return CoreMath.RoundToIncrement(price, tickSize); + } + + /// + /// Calculates new price which equal to given price shifted by a number of given ticks + /// + /// + /// + /// + public double CalculatePrice(double price, double ticks) + { + decimal num = (decimal)price; + decimal num2 = (decimal)ticks; + return (double)(num + num2 * (decimal)GetTickSize(price)); + } + + /// + /// Calculates ticks between two prices + /// + /// + /// + /// + public double CalculateTicks(double price1, double price2) + { + if (double.IsNaN(price1) || double.IsNaN(price2)) + { + return double.NaN; + } + decimal num = (decimal)price1; + decimal num2 = (decimal)price2; + decimal num3 = (decimal)GetTickSize(price1); + decimal num4 = default(decimal); + if (num3 != 0m) + { + num4 = (num2 - num) / num3; + } + return (double)num4; + } + + /// + /// Gets cached symbol tick size or retrives it from the list + /// + /// + /// + public double GetTickSize(double price) + { + if (??.HasValue) + { + return ??.Value; + } + return FindVariableTick(price)?.TickSize ?? double.NaN; + } + + /// + /// Gets symbol tick cost retrived from the list by price + /// + /// + /// + public double GetTickCost(double price) + { + return FindVariableTick(price)?.TickCost ?? double.NaN; + } + + /// + /// Returns VariableTick if it can be retrived from list by price or null + /// + /// + /// + public VariableTick FindVariableTick(double price) + { + List variableTickList = VariableTickList; + if (variableTickList == null) + { + if (Underlier != null) + { + variableTickList = Underlier.VariableTickList; + } + if (variableTickList == null) + { + return null; + } + } + for (int num = variableTickList.Count - 1; num >= 0; num--) + { + VariableTick variableTick = variableTickList[num]; + if (variableTick.CheckPrice(price)) + { + return variableTick; + } + } + return null; + } + + private protected void ?() + { + ???.Invoke(this); + } + + [NotPublished] + public override string ToString() + { + return Name; + } + + [NotPublished] + public override BusinessObjectInfo CreateInfo() + { + return new SymbolInfo + { + ConnectionId = base.ConnectionId, + Id = Id, + Name = Name, + ExchangeId = ExchangeId, + SymbolType = SymbolType, + FutureContractType = FutureContractType, + UnderlierId = UnderlierId, + Root = Root, + ExpirationDate = ExpirationDate + }; + } + + public override bool Equals(object obj) + { + return Equals(obj as Symbol); + } + + public bool Equals(Symbol other) + { + if (other != null && base.ConnectionId == other.ConnectionId) + { + return Id == other.Id; + } + return false; + } + + public override int GetHashCode() + { + return (-1919740922 * -1521134295 + EqualityComparer.Default.GetHashCode(base.ConnectionId)) * -1521134295 + EqualityComparer.Default.GetHashCode(Id); + } + + /// + /// Formats price value to the appropriative string with a counting on tick precision. + /// + /// + /// + public string FormatPrice(double price) + { + VariableTick variableTick = FindVariableTick(price); + return FormatPrice(price, variableTick); + } + + /// + /// Formats price value to the appropriative string with a counting on tick precision. + /// + /// + /// + /// + public string FormatPrice(double price, VariableTick variableTick) + { + double num = Math.Abs(price); + if (AllowAbbreviatePriceByTickSize && GlobalSettings.AbbreviateCryptoPrices && price != 0.0 && num < 1.0 && variableTick != null) + { + int num2 = -(int)Math.Floor(Math.Log10(num)) - 1; + if (num2 < 0) + { + num2 *= -1; + } + if (num2 == 0) + { + if (variableTick != null) + { + return price.Format(variableTick.Precision); + } + return price.Format(); + } + string value = string.Empty; + if (price < 0.0) + { + value = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(2, 2); + defaultInterpolatedStringHandler.AppendFormatted(value); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(num2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + return defaultInterpolatedStringHandler.ToStringAndClear() + (num / variableTick.TickSize).ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo.InvariantCulture); + } + if (variableTick != null && (variableTick.TickSize == 1.0 / 32.0 || variableTick.TickSize == 1.0 / 64.0 || variableTick.TickSize == 1.0 / 128.0 || variableTick.TickSize == 1.0 / 256.0)) + { + return ?(price, variableTick); + } + if (variableTick != null) + { + return price.Format(variableTick.Precision); + } + return price.Format(); + } + + /// + /// Formats price value to the appropriative string with a counting on max tick precision. + /// + /// + /// + public string FormatPriceWithMaxPrecision(double price) + { + VariableTick variableTick = FindVariableTick(price); + if (variableTick != null && (variableTick.TickSize == 1.0 / 32.0 || variableTick.TickSize == 1.0 / 64.0 || variableTick.TickSize == 1.0 / 128.0 || variableTick.TickSize == 1.0 / 256.0)) + { + return ?(price, variableTick); + } + if (variableTick != null) + { + return price.FormatPriceWithMaxPrecision(variableTick.Precision); + } + return price.FormatPriceWithMaxPrecision(); + } + + private static string ?(double P_0, VariableTick P_1) + { + double num = Math.Abs(P_0 - (double)(long)P_0); + string value = ((P_1.TickSize == 1.0 / 32.0) ? ((double)(decimal)(num / P_1.TickSize)).ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) : ((P_1.TickSize == 1.0 / 64.0) ? ((double)(decimal)(num / P_1.TickSize / 2.0 * 10.0)).ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) : ((P_1.TickSize != 1.0 / 128.0) ? ((double)(decimal)(long)(num / P_1.TickSize / 8.0 * 10.0)).ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) : ((double)(decimal)(long)(num / P_1.TickSize / 4.0 * 10.0)).ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())))); + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(1, 3); + defaultInterpolatedStringHandler.AppendFormatted((P_0 < 0.0) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + defaultInterpolatedStringHandler.AppendFormatted((long)Math.Abs(P_0)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public virtual string FormatQuantity(double quantity, bool inLots = true, bool abbreviate = false) + { + if (inLots) + { + int valuePrecision = CoreMath.GetValuePrecision((decimal)LotStep); + return quantity.Format(valuePrecision, abbreviate); + } + return (quantity * LotSize).Format(CoreMath.GetValuePrecision((decimal)NotionalValueStep), abbreviate); + } + + /// + /// Returns string with formatted ticks value + /// + /// + /// + /// + public string FormatOffset(double offset, string dimension = "ticks") + { + return offset.FormatPriceWithMaxPrecision(0) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + dimension; + } + + [NotPublished] + public string FormatQuoteAssetVolume(double volume) + { + return volume.Format(); + } + + /// + /// Comparing by value + /// + [NotPublished] + public int CompareTo(Symbol symbol) + { + return Name.CompareTo(symbol.Name); + } + + private MessageSymbol ?() + { + return new MessageSymbol(Id) + { + GroupId = Group?.Id, + Name = Name, + Description = Description, + SymbolType = SymbolType, + ProductAssetId = Product?.Id, + QuotingCurrencyAssetID = QuotingCurrency?.Id, + ExchangeId = ExchangeId, + QuoteDelay = QuoteDelay, + QuotingType = QuotingType, + LotSize = LotSize, + VariableTickList = VariableTickList, + LotStep = LotStep, + NotionalValueStep = NotionalValueStep, + MaxLot = MaxLot, + MinLot = MinLot, + SymbolAdditionalInfo = AdditionalInfo?.Items.ToList(), + NettingType = NettingType, + Root = Root, + OptionType = OptionType, + StrikePrice = StrikePrice, + ExpirationDate = ExpirationDate, + HistoryType = HistoryType, + VolumeType = VolumeType, + LastTradingDate = LastTradingDate, + AllowCalculateRealtimeTicks = AllowCalculateRealtimeTicks, + AllowCalculateRealtimeTrades = AllowCalculateRealtimeTrades, + AllowCalculateRealtimeVolume = AllowCalculateRealtimeVolume, + AllowCalculateRealtimeChange = AllowCalculateRealtimeChange, + AllowAbbreviatePriceByTickSize = AllowAbbreviatePriceByTickSize, + DeltaCalculationType = DeltaCalculationType, + MinVolumeAnalysisTickSize = MinVolumeAnalysisTickSize, + AvailableFutures = AvailableFutures, + AvailableOptions = AvailableOptions, + AvailableOptionsExchanges = (AvailableOptionsExchanges.Any() ? AvailableOptionsExchanges.Select((Exchange P_0) => P_0.Id).ToArray() : null), + UnderlierId = Underlier?.Id, + MaturityDate = MaturityDate, + OptionSerieId = OptionSerie?.Id, + SessionsContainerId = ??, + HistoryMetadata = ((historyMetadata == null) ? null : new HistoryMetadata(historyMetadata)), + FutureContractType = FutureContractType + }; + } + + MessageSymbol IMessageBuilder.BuildMessage() + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(); + } + + private DayBar ?() + { + return new DayBar(Id, Core.Instance.TimeUtils.DateTimeUtcNow) + { + Ask = Ask, + AskSize = AskSize, + AverageTradedPrice = AverageTradedPrice, + TotalBuyQuantity = TotalBuyQuantity, + TotalSellQuantity = TotalSellQuantity, + Bid = Bid, + BidSize = BidSize, + BottomPriceLimit = BottomPriceLimit, + Change = Change, + ChangePercentage = ChangePercentage, + High = High, + Last = Last, + LastSize = LastSize, + Mark = Mark, + Low = Low, + Open = Open, + OpenInterest = OpenInterest, + FundingRate = FundingRate, + FundingTime = FundingTime, + PreviousClose = PrevClose, + PrevSettlementPrice = PrevSettlement, + Ticks = Ticks, + TopPriceLimit = TopPriceLimit, + Trades = Trades, + Volume = Volume, + QuoteAssetVolume = QuoteAssetVolume, + IV = IV, + Delta = Delta, + Vega = Vega, + Gamma = Gamma, + Theta = Theta, + Rho = Rho + }; + } + + DayBar IMessageBuilder.BuildMessage() + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(); + } + + /// + /// Gets symbol orders types list which are allowed. + /// + /// + /// + [NotPublished] + public virtual List GetAlowedOrderTypes(OrderTypeUsage? usage) + { + if (State == BusinessObjectState.Fake) + { + return new List(); + } + string connectionId = base.ConnectionId; + Connection connection = Core.Instance.Connections[connectionId]; + if (connection == null || connection.BusinessObjects.OrderTypes == null) + { + return null; + } + if (!usage.HasValue) + { + return connection.BusinessObjects.OrderTypes.ToList(); + } + return connection.BusinessObjects.OrderTypes.Where((OrderType P_0) => P_0.Usage.HasFlag(usage)).ToList(); + } + + public virtual bool IsTradingAllowed(Account account) + { + return TradingOperations.IsAllowed(TradingOperation.PlaceOrder, new TradingOperationParameters + { + Symbol = this, + Account = account + }).Status != TradingOperationStatus.NotAllowed; + } + + internal virtual TradingOperationResult ?(PlaceOrderRequestParameters P_0) + { + if (P_0 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return Connection.?(P_0); + } + + /// + /// An symbol has possibility to obtain the default account + /// + [NotPublished] + public virtual Account GetDefaultAccount(Account currentValue = null) + { + if (currentValue?.ConnectionId == base.ConnectionId) + { + return currentValue; + } + return Connection?.BusinessObjects?.Accounts?.FirstOrDefault(); + } + + public MarginInfo GetMarginInfo(OrderRequestParameters orderRequestParameters) + { + return Connection?.?(orderRequestParameters); + } + + public virtual ConnectionDependency GetConnectionStateDependency() + { + ConnectionDependency connectionDependency = new ConnectionDependency(); + connectionDependency.Behavior = ConnectionDependencyBehavior.PartialDependency; + connectionDependency.DependentConnectionsIds = new string[1] { base.ConnectionId }; + return connectionDependency; + } + + public virtual void OnConnectionStateChanged(Connection connection, ConnectionStateChangedEventArgs e) + { + } + + public static TickDirection DetermineTickDirection(double previousPrice, double currentPrice, TickDirection prevItemTickDirection) + { + if (double.IsNaN(previousPrice)) + { + return TickDirection.NotSet; + } + if (double.IsNaN(currentPrice)) + { + return TickDirection.NotSet; + } + if (currentPrice > previousPrice) + { + return TickDirection.Up; + } + if (currentPrice < previousPrice) + { + return TickDirection.Down; + } + return prevItemTickDirection; + } + + [NotPublished] + public static AggressorFlag ConvertTickDirection(TickDirection tickDirection) + { + return tickDirection switch + { + TickDirection.None => AggressorFlag.None, + TickDirection.Up => AggressorFlag.Buy, + TickDirection.Down => AggressorFlag.Sell, + _ => AggressorFlag.NotSet, + }; + } + + [CompilerGenerated] + private void ?(Rule P_0) + { + ??.?(P_0.Name, P_0); + } + } + public delegate void QuoteHandler(Symbol symbol, Quote quote); + public delegate void Level2Handler(Symbol symbol, Level2Quote level2, DOMQuote dom); + public delegate void LastHandler(Symbol symbol, Last last); + public delegate void MarkHandler(Symbol symbol, Mark mark); + public delegate void DayBarHandler(Symbol symbol, DayBar dayBar); + public delegate void SymbolUpdateHandler(Symbol symbol); + public struct VWAP + { + [CompilerGenerated] + private double ?; + + [CompilerGenerated] + private Side ?; + + public double Price + { + [CompilerGenerated] + readonly get + { + return ?; + } + [CompilerGenerated] + internal set + { + ? = num; + } + } + + public Side Side + { + [CompilerGenerated] + readonly get + { + return ?; + } + [CompilerGenerated] + internal set + { + ? = side; + } + } + } + /// + /// Represents information about trade. + /// + [Published] + public class Trade : TradingObject, IMessageBuilder + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private PnLItem ??; + + [CompilerGenerated] + private PnLItem ??; + + [CompilerGenerated] + private PnLItem ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private PositionImpactType ??; + + [CompilerGenerated] + private Action ??; + + /// + /// Gets the unique identifier of the order initiating the trade. + /// + public string OrderId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Gets a unique identifier of the position, which is related to this trade. + /// + public string PositionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Get the price where trade was executed + /// + public double Price + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Get the trade quantity + /// + public double Quantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Get the date and time when trade was executed + /// + public DateTime DateTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + /// + /// Get the trade Gross P&L + /// + public PnLItem GrossPnl + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = pnLItem; + } + } + + /// + /// Get the trade Net P&L + /// + public PnLItem NetPnl + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = pnLItem; + } + } + + /// + /// Get the fee value that was charged for this trade + /// + public PnLItem Fee + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = pnLItem; + } + } + + /// + /// Get the trade order type + /// + public string OrderTypeId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + public PositionImpactType PositionImpactType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = positionImpactType; + } + } + + /// + /// Will be triggered on trade updating + /// + public event Action Updated + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public Trade(string connectionId) + : base(connectionId) + { + } + + internal void ?(MessageTrade P_0) + { + base.Id = P_0.TradeId; + if (ConnectionCache != null && ConnectionCache.SymbolsCache.?(P_0.SymbolId, out var symbol)) + { + base.Symbol = symbol; + } + else if (!string.IsNullOrEmpty(P_0.SymbolId)) + { + base.Symbol = new Symbol(new BusinessObjectInfo + { + Id = P_0.SymbolId, + Name = P_0.SymbolId + }); + } + if (ConnectionCache != null && ConnectionCache.AccountsCache.?(P_0.AccountId, out var account)) + { + base.Account = account; + } + else if (!string.IsNullOrEmpty(P_0.AccountId)) + { + base.Account = new Account(new BusinessObjectInfo + { + Id = P_0.AccountId, + Name = P_0.AccountId + }); + } + OrderId = P_0.OrderId; + PositionId = P_0.PositionId; + Price = P_0.Price; + Quantity = P_0.Quantity; + base.Side = P_0.Side; + base.Comment = P_0.Comment; + DateTime = P_0.DateTime; + OrderTypeId = P_0.OrderTypeId; + PositionImpactType = P_0.PositionImpactType; + GrossPnl = P_0.GrossPnl; + if (GrossPnl != null) + { + GrossPnl.ConnectionId = base.ConnectionId; + } + NetPnl = P_0.NetPnl; + if (NetPnl != null) + { + NetPnl.ConnectionId = base.ConnectionId; + } + Fee = P_0.Fee; + if (Fee != null) + { + Fee.ConnectionId = base.ConnectionId; + } + ???.Invoke(); + } + + public MessageTrade BuildMessage() + { + return new MessageTrade + { + TradeId = base.Id, + SymbolId = base.Symbol?.Id, + AccountId = base.Account?.Id, + OrderId = OrderId, + PositionId = PositionId, + Price = Price, + Quantity = Quantity, + Side = base.Side, + Comment = base.Comment, + DateTime = DateTime, + OrderTypeId = OrderTypeId, + PositionImpactType = PositionImpactType, + GrossPnl = GrossPnl, + NetPnl = NetPnl, + Fee = Fee + }; + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(50, 7); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.Symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.Account); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Quantity); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Price); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.Comment); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + public sealed class TradingSignal : BusinessObject, IMessageBuilder + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private Side ??; + + [CompilerGenerated] + private OrderTypeBehavior ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public string Ticker + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public string Root + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public string VendorName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public Side Side + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = side; + } + } + + public OrderTypeBehavior OrderTypeBehavior + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = orderTypeBehavior; + } + } + + public double EntryPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public double TargetPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public double StopPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public double Confidence + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public double Profitability + { + get + { + if (Side != Side.Buy) + { + return 1.0 - TargetPrice / EntryPrice; + } + return TargetPrice / EntryPrice - 1.0; + } + } + + public DateTime Published + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + public DateTime Updated + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + public DateTime ExpiresAt + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + public string Duration + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public string Status + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public string Description + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public string Details + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public string Source + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + internal TradingSignal(string P_0) + : base(P_0) + { + } + + internal void ?(MessageTradingSignal P_0) + { + Id = P_0.Id; + Ticker = P_0.Ticker; + Root = P_0.Root; + VendorName = P_0.VendorName; + Side = P_0.Side; + OrderTypeBehavior = P_0.OrderTypeBehavior; + EntryPrice = P_0.EntryPrice; + TargetPrice = P_0.TargetPrice; + StopPrice = P_0.StopPrice; + Confidence = P_0.Confidence; + Published = P_0.Published; + Updated = P_0.Updated; + ExpiresAt = P_0.ExpiresAt; + Duration = P_0.Duration; + Status = P_0.Status; + Description = P_0.Description; + Details = P_0.Details; + Source = P_0.Source; + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(5, 4); + defaultInterpolatedStringHandler.AppendFormatted(Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderTypeBehavior); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Ticker ?? Root); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + defaultInterpolatedStringHandler.AppendFormatted(Description); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + private MessageTradingSignal ?() + { + return new MessageTradingSignal(Id) + { + Ticker = Ticker, + Root = Root, + VendorName = VendorName, + Side = Side, + OrderTypeBehavior = OrderTypeBehavior, + EntryPrice = EntryPrice, + TargetPrice = TargetPrice, + StopPrice = StopPrice, + Confidence = Confidence, + Published = Published, + Updated = Updated, + ExpiresAt = ExpiresAt, + Duration = Duration, + Status = Status, + Description = Description, + Details = Details, + Source = Source + }; + } + + MessageTradingSignal IMessageBuilder.BuildMessage() + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(); + } + + public string Format() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(18, 7); + defaultInterpolatedStringHandler.AppendFormatted(Confidence, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Status); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Ticker ?? Root); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(EntryPrice); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(TargetPrice); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(StopPrice); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Updated, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } +} +namespace ? +{ + [Serializable] + [DataContract] + internal class ? : BusinessObjectInfo + { + [CompilerGenerated] + private bool ??; + + [DataMember(Name = "IsCrypto")] + public bool IsCrypto + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = flag; + } + } + + protected override bool NeedToEncryptInfo => true; + + public override XElement ToXElement() + { + XElement xElement = base.ToXElement(); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsCrypto)); + return xElement; + } + + public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + base.FromXElement(element, deserializationInfo); + IsCrypto = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToBool() ?? false; + } + } +} +namespace TradingPlatform.BusinessLayer +{ + [Serializable] + [DataContract] + public class BusinessObjectInfo : IXElementSerialization, IEquatable + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [DataMember(Name = "Id")] + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + [DataMember(Name = "ConnectionId")] + public string ConnectionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + [DataMember(Name = "Name")] + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + protected virtual bool NeedToEncryptInfo => false; + + public static BusinessObjectInfo Empty => new BusinessObjectInfo + { + Id = string.Empty, + ConnectionId = string.Empty, + Name = string.Empty + }; + + public virtual XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), NeedToEncryptInfo ? Encryptor.?(Id) : Id)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ConnectionId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), NeedToEncryptInfo ? Encryptor.?(Name) : Name)); + return xElement; + } + + public virtual void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + string value = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; + if (NeedToEncryptInfo) + { + string text = Encryptor.?(value); + if (text != null) + { + Id = text; + goto IL_0038; + } + } + Id = value; + goto IL_0038; + IL_0038: + ConnectionId = ConnectionsManager.??.?(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value); + string value2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; + if (NeedToEncryptInfo) + { + string text2 = Encryptor.?(value2); + if (text2 != null) + { + Name = text2; + return; + } + } + Name = value2; + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(6, 3); + defaultInterpolatedStringHandler.AppendFormatted(ConnectionId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Id); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public bool Equals(BusinessObjectInfo other) + { + if ((object)other == null) + { + return false; + } + if ((object)this == other) + { + return true; + } + if (Id == other.Id && ConnectionId == other.ConnectionId) + { + return Name == other.Name; + } + return false; + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + if (this == obj) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((BusinessObjectInfo)obj); + } + + public override int GetHashCode() + { + return HashCode.Combine(Id, ConnectionId, Name); + } + + public static bool operator ==(BusinessObjectInfo left, BusinessObjectInfo right) + { + return object.Equals(left, right); + } + + public static bool operator !=(BusinessObjectInfo left, BusinessObjectInfo right) + { + return !object.Equals(left, right); + } + } + public class CryptoAccountEventArgs : EventArgs + { + [CompilerGenerated] + private readonly AccountBalanceEventReason ?; + + [CompilerGenerated] + private readonly CryptoAssetBalances ?; + + public AccountBalanceEventReason Reason + { + [CompilerGenerated] + get + { + return ?; + } + } + + public CryptoAssetBalances Balances + { + [CompilerGenerated] + get + { + return ?; + } + } + + public CryptoAccountEventArgs(AccountBalanceEventReason reason, CryptoAssetBalances balances) + { + ? = reason; + ? = balances; + } + } + public sealed class CustomAccountPropertiesProvider : ICustomizable + { + public const string CUSTOM_NAME = "CustomName"; + + public const string LOCKED = "Locked"; + + [CompilerGenerated] + private Action ??; + + private readonly ConcurrentDictionary> ??; + + public IList Settings + { + get + { + List list = new List(); + foreach (KeyValuePair> item2 in ??) + { + List list2 = new List + { + new SettingItemAccount(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), item2.Key) + }; + foreach (KeyValuePair item3 in item2.Value) + { + list2.Add(?(item3.Key, item3.Value)); + } + SettingItemGroup item = new SettingItemGroup(string.Empty, list2); + list.Add(item); + } + return list; + } + set + { + foreach (SettingItem item in value) + { + if (!(item is SettingItemGroup settingItemGroup)) + { + continue; + } + Account account = null; + Dictionary dictionary = new Dictionary(); + foreach (SettingItem item2 in settingItemGroup.Value as IList) + { + if (item2.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + account = item2.Value as Account; + } + else + { + dictionary[item2.Name] = item2.Value; + } + } + if (account != null) + { + ??[account] = dictionary; + } + } + } + } + + public event Action ParametersChanged + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public CustomAccountPropertiesProvider() + { + ?? = new ConcurrentDictionary>(); + } + + public void SetProperty(Account account, string name, object value) + { + if (??.ContainsKey(account)) + { + ??[account][name] = value; + } + else + { + ??[account] = new Dictionary { { name, value } }; + } + ???.Invoke(); + } + + public object GetProperty(Account account, string name) + { + if (account == null) + { + return null; + } + if (??.TryGetValue(account, out var value) && value.TryGetValue(name, out var value2)) + { + return value2; + } + return null; + } + + private SettingItem ?(string P_0, object P_1) + { + if (!(P_1 is int)) + { + if (!(P_1 is double)) + { + if (!(P_1 is string)) + { + if (P_1 is bool) + { + return new SettingItemBoolean(P_0, (bool)P_1); + } + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return new SettingItemString(P_0, (string)P_1); + } + return new SettingItemDouble(P_0, (double)P_1); + } + return new SettingItemInteger(P_0, (int)P_1); + } + } + public class DealTicket + { + [CompilerGenerated] + private readonly string ?; + + [CompilerGenerated] + private readonly string ?; + + [CompilerGenerated] + private readonly DealTicketType ?; + + [CompilerGenerated] + private readonly DateTime ?; + + [CompilerGenerated] + private readonly Action ?; + + public string Header + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + init + { + ? = value; + } + } + + public string Description + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + init + { + ? = value; + } + } + + public DealTicketType Type + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + init + { + ? = value; + } + } + + public DateTime CreationTime + { + [CompilerGenerated] + get + { + return ?; + } + } + + public Action CustomAction + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + init + { + ? = value; + } + } + + internal DealTicket(string P_0, string P_1, DealTicketType P_2) + : this() + { + Header = P_0; + Description = P_1; + Type = P_2; + } + + protected DealTicket() + { + ? = Core.Instance.TimeUtils.DateTimeUtcNow; + } + } + public sealed class DealticketConnection : DealTicket, IConnectionBindedObject, ILoggable + { + private readonly string ??; + + string IConnectionBindedObject.ConnectionId => ??; + + public string Event => base.Header; + + public string Message => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + base.Description + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public DealticketConnection(string connectionId, MessageDealTicket message) + { + ?? = connectionId; + base.Header = message.Header; + base.Description = message.Description; + base.Type = message.DealTicketType; + } + } + [DataContract] + public sealed class DealTicketItem + { + [CompilerGenerated] + private string ?; + + private readonly object ?; + + [CompilerGenerated] + private readonly int ?; + + [DataMember(Name = "key")] + public string Key + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = text; + } + } + + [DataMember(Name = "value")] + public string FormattedValue => ??.ToString(); + + public int SortIndex + { + [CompilerGenerated] + get + { + return ?; + } + } + + public DealTicketItem(string key, object value, int sortIndex = 0) + { + Key = key; + ? = value; + ? = sortIndex; + } + } + public readonly struct ExchangeComplexIdentifier : IEquatable + { + [CompilerGenerated] + private readonly string ?; + + [CompilerGenerated] + private readonly string ?; + + public string ConnectionId + { + [CompilerGenerated] + get + { + return ?; + } + } + + public string ExchangeId + { + [CompilerGenerated] + get + { + return ?; + } + } + + public ExchangeComplexIdentifier(string connectionId, string exchangeId) + { + ? = connectionId; + ? = exchangeId; + } + + public bool Equals(ExchangeComplexIdentifier other) + { + if (ConnectionId == other.ConnectionId) + { + return ExchangeId == other.ExchangeId; + } + return false; + } + + public override bool Equals(object obj) + { + if (obj is ExchangeComplexIdentifier other) + { + return Equals(other); + } + return false; + } + + public override int GetHashCode() + { + return (ConnectionId.GetHashCode() * 397) ^ ExchangeId.GetHashCode(); + } + + public static bool operator ==(ExchangeComplexIdentifier left, ExchangeComplexIdentifier right) + { + return left.Equals(right); + } + + public static bool operator !=(ExchangeComplexIdentifier left, ExchangeComplexIdentifier right) + { + return !left.Equals(right); + } + } + /// + /// The symbols list manager. + /// + public sealed class SymbolsListManager : ICustomizable + { + [CompilerGenerated] + private static class ? + { + public static Func ??; + } + + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func ??; + + internal bool ?(FtpListItem P_0) + { + return P_0.Type == FtpObjectType.Directory; + } + + internal bool ?(FtpListItem P_0) + { + return P_0.Type == FtpObjectType.File; + } + + internal bool ?(FtpListItem P_0) + { + return Path.GetExtension(P_0.Name) == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + } + + private readonly Dictionary ??; + + private readonly Dictionary ??; + + /// + /// Gets the count. + /// + public int Count => ??.Count + ??.Count; + + /// + /// Gets or Sets the settings. + /// + public IList Settings + { + get + { + List list = new List(); + foreach (KeyValuePair item in ??) + { + list.Add(new SettingItemGroup(item.Key, item.Value.Settings)); + } + return list; + } + set + { + foreach (SettingItem item in value) + { + if (item.Value is IList settings) + { + if (??.TryGetValue(item.Name, out var value2)) + { + value2.Settings = settings; + continue; + } + value2 = new SymbolList + { + Settings = settings + }; + ??.Add(item.Name, value2); + } + } + } + } + + internal SymbolList[] Items => ??.Values.Concat(??.Values).ToArray(); + + internal SymbolsListManager() + { + ?? = new Dictionary(); + ?? = new Dictionary(); + } + + internal void ?() + { + } + + internal void ?(string P_0, IEnumerable P_1) + { + ??.Add(P_0, new SymbolList(P_0, P_1)); + } + + internal void ?(string P_0, IList P_1) + { + ??[P_0].Symbols = P_1; + } + + internal void ?(string P_0) + { + ??.Remove(P_0); + } + + internal void ?(string P_0, string P_1) + { + if (!??.TryGetValue(P_0, out var value)) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0); + } + ??.Remove(P_0); + value.?(P_1); + ??.Add(P_1, value); + } + + [Conditional("quantower_in_licences")] + private void ?() + { + Task.Factory.StartNew(delegate + { + try + { + using FtpClient ftpClient = new FtpClient(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + ftpClient.Connect(); + foreach (FtpListItem item in from P_0 in ftpClient.GetListing(Path.Combine(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + where P_0.Type == FtpObjectType.Directory + select P_0) + { + FtpListItem[] array = (from P_0 in ftpClient.GetListing(item.FullName) + where P_0.Type == FtpObjectType.File + where Path.GetExtension(P_0.Name) == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + select P_0).ToArray(); + foreach (FtpListItem ftpListItem in array) + { + using MemoryStream memoryStream = new MemoryStream(); + ftpClient.DownloadStream(memoryStream, ftpListItem.FullName, 0L, null, 0L); + memoryStream.Position = 0L; + double version; + List list = Serializer.DeserializeXML(memoryStream, out version, SettingItem.DesserrializationFabric).OfType().ToList(); + if (list != null && list.Any()) + { + SymbolList symbolList = new SymbolList(list, false) + { + Group = item.Name + }; + string key = Path.Combine(item.Name, symbolList.Name); + ??[key] = symbolList; + } + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + }); + } + + [CompilerGenerated] + private void ?() + { + try + { + using FtpClient ftpClient = new FtpClient(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + ftpClient.Connect(); + foreach (FtpListItem item in from P_0 in ftpClient.GetListing(Path.Combine(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + where P_0.Type == FtpObjectType.Directory + select P_0) + { + FtpListItem[] array = (from P_0 in ftpClient.GetListing(item.FullName) + where P_0.Type == FtpObjectType.File + where Path.GetExtension(P_0.Name) == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + select P_0).ToArray(); + foreach (FtpListItem ftpListItem in array) + { + using MemoryStream memoryStream = new MemoryStream(); + ftpClient.DownloadStream(memoryStream, ftpListItem.FullName, 0L, null, 0L); + memoryStream.Position = 0L; + double version; + List list = Serializer.DeserializeXML(memoryStream, out version, SettingItem.DesserrializationFabric).OfType().ToList(); + if (list != null && list.Any()) + { + SymbolList symbolList = new SymbolList(list, false) + { + Group = item.Name + }; + string key = Path.Combine(item.Name, symbolList.Name); + ??[key] = symbolList; + } + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + } + /// + /// Represent access to level2 data. + /// + [Published] + public class DepthOfMarket : IMessageBuilder + { + [CompilerGenerated] + private ? ?; + + [CompilerGenerated] + private ? ?; + + private Dictionary ?; + + private readonly Symbol ?; + + private readonly object ?; + + /// + /// Gets Level2 Asks list + /// + internal ? Asks + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = ?; + } + } + + /// + /// Gets Level2 Bids list + /// + internal ? Bids + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = ?; + } + } + + internal DepthOfMarket(Symbol P_0) + { + ? = P_0; + bool flag = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ?.ConnectionId).Status == TradingOperationStatus.Allowed; + Asks = new ?(QuotePriceType.Ask, flag); + Bids = new ?(QuotePriceType.Bid, flag); + ? = new object(); + ? = new Dictionary(); + } + + internal void ?(Level2Quote P_0) + { + lock (?) + { + if (P_0.PriceType == QuotePriceType.Ask) + { + Asks.?(P_0); + } + else + { + Bids.?(P_0); + } + ? = new Dictionary(); + } + } + + internal void ?(DOMQuote P_0) + { + lock (?) + { + Asks.?(P_0.Asks); + Bids.?(P_0.Bids); + ? = new Dictionary(); + } + } + + internal void ?() + { + lock (?) + { + Asks.?(); + Bids.?(); + ?.Clear(); + } + } + + /// + /// Gets current Level2 data + /// + /// Parameters of DepthOfMarket + /// + public DepthOfMarketAggregatedCollections GetDepthOfMarketAggregatedCollections(GetDepthOfMarketParameters parameters = null) + { + if (parameters == null) + { + parameters = new GetDepthOfMarketParameters(); + } + lock (?) + { + int hashCode = parameters.GetHashCode(); + if (!?.TryGetValue(hashCode, out var value)) + { + value = new DepthOfMarketAggregatedCollections + { + Asks = Asks.?(parameters.GetLevel2ItemsParameters), + Bids = Bids.?(parameters.GetLevel2ItemsParameters) + }; + if (parameters.CalculateImbalancePercent) + { + ?(value.Asks, value.Bids); + } + ?[hashCode] = value; + } + return value; + } + } + + /// + /// Gets current Level2 data + /// + /// Parameters of request for Leve2Item collection + /// + public DepthOfMarketAggregatedCollections GetDepthOfMarketAggregatedCollections(GetLevel2ItemsParameters parameters) + { + return GetDepthOfMarketAggregatedCollections(new GetDepthOfMarketParameters + { + GetLevel2ItemsParameters = parameters + }); + } + + private static void ?(Level2Item[] P_0, Level2Item[] P_1) + { + int num = Math.Min(P_1.Length, P_0.Length); + for (int i = 0; i < num; i++) + { + Level2Item level2Item = P_0[i]; + Level2Item level2Item2 = P_1[i]; + double cumulative = level2Item.Cumulative; + double cumulative2 = level2Item2.Cumulative; + if (cumulative >= 0.0 && cumulative2 >= 0.0) + { + level2Item.ImbalancePercent = Math.Round(level2Item.Cumulative / (level2Item.Cumulative + level2Item2.Cumulative) * 100.0, 2); + level2Item2.ImbalancePercent = 100.0 - level2Item.ImbalancePercent; + } + } + } + + private DOMQuote ?() + { + return new DOMQuote(?.Id, Core.Instance.TimeUtils.DateTimeUtcNow) + { + Asks = Asks.Items.Values.ToList(), + Bids = Bids.Items.Values.ToList() + }; + } + + DOMQuote IMessageBuilder.BuildMessage() + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(); + } + } + /// + /// Leve2 data. Contains Bids and Ask collections + /// + [Published] + public class DepthOfMarketAggregatedCollections + { + [CompilerGenerated] + private Level2Item[] ?; + + [CompilerGenerated] + private Level2Item[] ?; + + public Level2Item[] Asks + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + internal set + { + ? = array; + } + } + + public Level2Item[] Bids + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + internal set + { + ? = array; + } + } + } + /// + /// Represent parameters of DepthOfMarket + /// + [Published] + public class GetDepthOfMarketParameters + { + [CompilerGenerated] + private GetLevel2ItemsParameters ?; + + [CompilerGenerated] + private bool ?; + + public GetLevel2ItemsParameters GetLevel2ItemsParameters + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + public bool CalculateImbalancePercent + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + public GetDepthOfMarketParameters() + { + GetLevel2ItemsParameters = new GetLevel2ItemsParameters(); + } + + public static bool operator ==(GetDepthOfMarketParameters p1, GetDepthOfMarketParameters p2) + { + if ((object)p1 == null || (object)p2 == null) + { + if ((object)p1 == null) + { + return (object)p2 == null; + } + return false; + } + return p1.Equals(p2); + } + + public static bool operator !=(GetDepthOfMarketParameters p1, GetDepthOfMarketParameters p2) + { + if ((object)p1 == null || (object)p2 == null) + { + if ((object)p1 == null) + { + return (object)p2 != null; + } + return true; + } + return !p1.Equals(p2); + } + + public override bool Equals(object obj) + { + if (!(obj is GetDepthOfMarketParameters getDepthOfMarketParameters)) + { + return false; + } + if (GetLevel2ItemsParameters != getDepthOfMarketParameters.GetLevel2ItemsParameters) + { + return false; + } + if (CalculateImbalancePercent != getDepthOfMarketParameters.CalculateImbalancePercent) + { + return false; + } + return true; + } + + public override int GetHashCode() + { + return GetLevel2ItemsParameters.GetHashCode() ^ CalculateImbalancePercent.GetHashCode(); + } + } + /// + /// Represent parameters of request for Leve2Item collection + /// + [Published] + public class GetLevel2ItemsParameters + { + [CompilerGenerated] + private AggregateMethod ?; + + [CompilerGenerated] + private ImplicitOrderBookType ?; + + [CompilerGenerated] + private int ?; + + [CompilerGenerated] + private double ?; + + [CompilerGenerated] + private bool ?; + + [CompilerGenerated] + private bool ?; + + /// + /// Aggregation method + /// + public AggregateMethod AggregateMethod + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + public ImplicitOrderBookType ImplicitOrderBookType + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + /// + /// Required amount of level2 + /// + public int LevelsCount + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + /// + /// Use custom tick size + /// + public double CustomTickSize + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + /// + /// Calculate cumulative size + /// + public bool CalculateCumulative + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + public bool GetMBOItems + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + public static bool operator ==(GetLevel2ItemsParameters p1, GetLevel2ItemsParameters p2) + { + if ((object)p1 == null || (object)p2 == null) + { + if ((object)p1 == null) + { + return (object)p2 == null; + } + return false; + } + return p1.Equals(p2); + } + + public static bool operator !=(GetLevel2ItemsParameters p1, GetLevel2ItemsParameters p2) + { + if ((object)p1 == null || (object)p2 == null) + { + if ((object)p1 == null) + { + return (object)p2 != null; + } + return true; + } + return !p1.Equals(p2); + } + + public override bool Equals(object obj) + { + if (!(obj is GetLevel2ItemsParameters getLevel2ItemsParameters)) + { + return false; + } + if (AggregateMethod != getLevel2ItemsParameters.AggregateMethod) + { + return false; + } + if (LevelsCount != getLevel2ItemsParameters.LevelsCount) + { + return false; + } + if (CustomTickSize != getLevel2ItemsParameters.CustomTickSize) + { + return false; + } + if (CalculateCumulative != getLevel2ItemsParameters.CalculateCumulative) + { + return false; + } + if (ImplicitOrderBookType != getLevel2ItemsParameters.ImplicitOrderBookType) + { + return false; + } + if (GetMBOItems != getLevel2ItemsParameters.GetMBOItems) + { + return false; + } + return true; + } + + public override int GetHashCode() + { + return (int)((uint)AggregateMethod ^ (uint)LevelsCount ^ (uint)CustomTickSize.GetHashCode() ^ (uint)CalculateCumulative.GetHashCode() ^ (uint)ImplicitOrderBookType.GetHashCode()) ^ GetMBOItems.GetHashCode(); + } + } +} +namespace ? +{ + internal sealed class ? + { + [CompilerGenerated] + private static class ? + { + public static Func ??; + } + + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + internal string ?(Level2Quote P_0) + { + return P_0.Id; + } + + internal Level2Quote ?(Level2Quote P_0) + { + return P_0; + } + + internal double ?(Level2Quote P_0) + { + return P_0.ImpliedSize; + } + + internal double ?(Level2Quote P_0) + { + return P_0.Size - P_0.ImpliedSize; + } + + internal double ?(Level2Quote P_0) + { + return P_0.Size; + } + + internal double ?(Level2Quote P_0) + { + return P_0.Price; + } + + internal Level2Item ?(Level2Item P_0) + { + return P_0; + } + + internal Level2Item ?(Level2Item P_0) + { + return P_0; + } + } + + [CompilerGenerated] + private sealed class ? + { + public ? ??; + + public GetLevel2ItemsParameters ??; + + public Func ??; + + public Func ??; + + public Func ??; + + internal double ?(Level2Quote P_0) + { + return (double)??.?((decimal)P_0.Price, (decimal)??.CustomTickSize); + } + + internal Level2Item ?(IGrouping P_0) + { + Level2Quote level2Quote = P_0.First(); + if (P_0.Count() == 1) + { + double num = ??(level2Quote); + return new Level2Item(P_0.Key, num, level2Quote.Time, level2Quote.Broker, level2Quote.Priority, level2Quote.NumberOrders, (!??.GetMBOItems) ? new Level2Item[0] : new Level2Item[1] + { + new Level2Item(P_0.Key, num, level2Quote.Time, level2Quote.Broker, level2Quote.Priority, 1) + { + Id = level2Quote.Id + } + }); + } + return new Level2Item(P_0.Key, P_0.Sum((Level2Quote arg) => ??(arg)), level2Quote.Time, string.Empty, 0L, P_0.Count(), ??.GetMBOItems ? P_0.Select((Level2Quote level2Quote2) => new Level2Item(level2Quote2.Price, ??(level2Quote2), level2Quote2.Time, level2Quote2.Broker, level2Quote2.Priority, 1) + { + Id = level2Quote2.Id + }).OrderBy(?.?.??.?, ??.?).ToArray() : new Level2Item[0]); + } + + internal double ?(Level2Quote P_0) + { + return ??(P_0); + } + + internal Level2Item ?(Level2Quote P_0) + { + return new Level2Item(P_0.Price, ??(P_0), P_0.Time, P_0.Broker, P_0.Priority, 1) + { + Id = P_0.Id + }; + } + + internal Level2Item ?(Level2Quote P_0) + { + return new Level2Item(P_0.Price, ??(P_0), P_0.Time, P_0.Broker, P_0.Priority, P_0.NumberOrders); + } + } + + [CompilerGenerated] + private sealed class ? + { + public double ??; + + internal Level2Item ?(Level2Item P_0) + { + ?? += P_0.Size; + P_0.Cumulative = ??; + return P_0; + } + } + + [CompilerGenerated] + private Dictionary ?; + + private readonly object ?; + + private readonly QuotePriceType ?; + + private readonly ? ?; + + private readonly Func ?; + + private Dictionary ?; + + private readonly bool ?; + + internal Dictionary Items + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = dictionary; + } + } + + internal ?(QuotePriceType P_0, bool P_1) + { + ? = P_0; + ? = P_1; + ? = new ?(? == QuotePriceType.Bid); + ? = ?; + Items = new Dictionary(); + ? = new Dictionary(); + ? = new object(); + } + + internal void ?() + { + lock (?) + { + Items.Clear(); + ?.Clear(); + } + } + + internal Level2Item[] ?(GetLevel2ItemsParameters P_0 = null) + { + if (P_0 == null) + { + P_0 = new GetLevel2ItemsParameters(); + } + lock (?) + { + int hashCode = P_0.GetHashCode(); + if (!?.TryGetValue(hashCode, out var value)) + { + value = ?(P_0); + ?[hashCode] = value; + } + return value; + } + } + + internal void ?(Level2Quote P_0) + { + lock (?) + { + if (P_0.Closed) + { + Items.Remove(P_0.Id); + } + else + { + Items[P_0.Id] = P_0; + } + ? = new Dictionary(); + } + } + + internal void ?(IEnumerable P_0) + { + lock (?) + { + Items = P_0.ToDictionary((Level2Quote level2Quote) => level2Quote.Id, (Level2Quote result) => result); + ? = new Dictionary(); + } + } + + private Level2Item[] ?(GetLevel2ItemsParameters P_0) + { + Dictionary.ValueCollection values = Items.Values; + bool flag = P_0.CustomTickSize > 0.0 && !P_0.CustomTickSize.IsNanOrDefault(); + _ = P_0.AggregateMethod; + if (?) + { + } + Func ?? = P_0.ImplicitOrderBookType switch + { + ImplicitOrderBookType.Implied => (Level2Quote level2Quote) => level2Quote.ImpliedSize, + ImplicitOrderBookType.Outright => (Level2Quote level2Quote) => level2Quote.Size - level2Quote.ImpliedSize, + _ => (Level2Quote level2Quote) => level2Quote.Size, + }; + IEnumerable source = (P_0.AggregateMethod switch + { + AggregateMethod.ByPriceLVL => (flag ? (from level2Quote in values + group level2Quote by (double)?((decimal)level2Quote.Price, (decimal)P_0.CustomTickSize)) : (from level2Quote in values + group level2Quote by level2Quote.Price)).Select(delegate(IGrouping grouping) + { + Level2Quote level2Quote = grouping.First(); + if (grouping.Count() == 1) + { + double num = ??(level2Quote); + return new Level2Item(grouping.Key, num, level2Quote.Time, level2Quote.Broker, level2Quote.Priority, level2Quote.NumberOrders, (!P_0.GetMBOItems) ? new Level2Item[0] : new Level2Item[1] + { + new Level2Item(grouping.Key, num, level2Quote.Time, level2Quote.Broker, level2Quote.Priority, 1) + { + Id = level2Quote.Id + } + }); + } + return new Level2Item(grouping.Key, grouping.Sum((Level2Quote arg) => ??(arg)), level2Quote.Time, string.Empty, 0L, grouping.Count(), P_0.GetMBOItems ? grouping.Select((Level2Quote level2Quote2) => new Level2Item(level2Quote2.Price, ??(level2Quote2), level2Quote2.Time, level2Quote2.Broker, level2Quote2.Priority, 1) + { + Id = level2Quote2.Id + }).OrderBy(?.?.??.?, ?).ToArray() : new Level2Item[0]); + }), + _ => values.Select((Level2Quote level2Quote) => new Level2Item(level2Quote.Price, ??(level2Quote), level2Quote.Time, level2Quote.Broker, level2Quote.Priority, level2Quote.NumberOrders)), + }).OrderBy((Level2Item result) => result, ?); + if (P_0.LevelsCount > 0) + { + source = source.Take(P_0.LevelsCount); + } + if (P_0.CalculateCumulative) + { + double ?? = 0.0; + source = source.Select(delegate(Level2Item level2Item) + { + ?? += level2Item.Size; + level2Item.Cumulative = ??; + return level2Item; + }); + } + return source.ToArray(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static decimal ?(decimal P_0, decimal P_1) + { + return P_0 - P_0 % P_1; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static decimal ?(decimal P_0, decimal P_1) + { + decimal num = ?(P_0, P_1); + if (num == P_0) + { + return P_0; + } + return num + P_1; + } + } +} +namespace TradingPlatform.BusinessLayer +{ + /// + /// Aggregation method + /// + [Published] + public enum AggregateMethod + { + ByPriceLVL, + ByMMIDAndPrice, + None + } + public enum ImplicitOrderBookType + { + Combined, + Implied, + Outright + } + /// + /// Represent access to level2 item. + /// + [Published] + public class Level2Item + { + [CompilerGenerated] + private string ?; + + [CompilerGenerated] + private double ?; + + [CompilerGenerated] + private double ?; + + [CompilerGenerated] + private double ?; + + [CompilerGenerated] + private double ?; + + [CompilerGenerated] + private DateTime ?; + + [CompilerGenerated] + private string ?; + + [CompilerGenerated] + private long ?; + + [CompilerGenerated] + private int ?; + + [CompilerGenerated] + private Level2Item[] ?; + + public string Id + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + internal set + { + ? = text; + } + } + + /// + /// Cumulative size + /// + public double Cumulative + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + internal set + { + ? = num; + } + } + + /// + /// Imbalance Percent + /// + public double ImbalancePercent + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + internal set + { + ? = num; + } + } + + /// + /// Price + /// + public double Price + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = num; + } + } + + /// + /// Size + /// + public double Size + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = num; + } + } + + /// + /// Time + /// + public DateTime QuoteTime + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = dateTime; + } + } + + /// + /// MMID + /// + public string MMID + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = text; + } + } + + public long Priority + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = num; + } + } + + /// + /// Number orders + /// + public int NumberOrders + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = num; + } + } + + public Level2Item[] DetailedLevels + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + private Level2Item() + { + Cumulative = double.NaN; + ImbalancePercent = double.NaN; + } + + internal Level2Item(double P_0, double P_1, DateTime P_2, string P_3, long P_4, int P_5) + : this() + { + Price = P_0; + Size = P_1; + QuoteTime = P_2; + MMID = P_3; + Priority = P_4; + NumberOrders = P_5; + } + + internal Level2Item(double P_0, double P_1, DateTime P_2, string P_3, long P_4, int P_5, Level2Item[] P_6) + : this(P_0, P_1, P_2, P_3, P_4, P_5) + { + DetailedLevels = P_6; + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + defaultInterpolatedStringHandler.AppendFormatted(Price); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + defaultInterpolatedStringHandler.AppendFormatted(Size); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } +} +namespace ? +{ + internal class ? : IComparer + { + private readonly bool ?; + + public ?(bool P_0) + { + ? = P_0; + } + + public int Compare(Level2Item x, Level2Item y) + { + double price = x.Price; + double size = x.Size; + long ticks = x.QuoteTime.Ticks; + double price2 = y.Price; + double size2 = y.Size; + long ticks2 = y.QuoteTime.Ticks; + double num = price - price2; + if (num <= -1E-12) + { + if (!?) + { + return -1; + } + return 1; + } + if (num >= 1E-12) + { + if (!?) + { + return 1; + } + return -1; + } + if (ticks > ticks2) + { + return 1; + } + if (ticks < ticks2) + { + return -1; + } + if (size > size2) + { + return -1; + } + if (size < size2) + { + return 1; + } + return string.CompareOrdinal(x.MMID, y.MMID); + } + } +} +namespace TradingPlatform.BusinessLayer +{ + [DataContract(Name = "OptionSerie", Namespace = "TradingPlatform")] + public sealed class OptionSerie : BusinessObject, IMessageBuilder, IComparable + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private Exchange ??; + + [CompilerGenerated] + private OptionSerieType ??; + + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public DateTime ExpirationDate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public string UnderlierId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public Exchange Exchange + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = exchange; + } + } + + public OptionSerieType SerieType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = optionSerieType; + } + } + + public string VisualName + { + get + { + string text = ExpirationDate.ToShortDateString(); + if (string.IsNullOrEmpty(Name)) + { + return text; + } + return Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + text; + } + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(2, 3); + defaultInterpolatedStringHandler.AppendFormatted(UnderlierId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(ExpirationDate.ToShortDateString()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + internal OptionSerie(string P_0) + : base(P_0) + { + } + + internal void ?(MessageOptionSerie P_0) + { + Id = P_0.Id; + ExpirationDate = P_0.ExpirationDate; + Name = P_0.Name; + UnderlierId = P_0.UnderlierId; + SerieType = P_0.SerieType; + if (!string.IsNullOrEmpty(P_0.ExchangeId) && ConnectionCache != null && ConnectionCache.ExchangesCache.?(P_0.ExchangeId, out var exchange)) + { + Exchange = exchange; + } + } + + private MessageOptionSerie ?() + { + return new MessageOptionSerie + { + Id = Id, + ExpirationDate = ExpirationDate, + Name = Name, + UnderlierId = UnderlierId + }; + } + + MessageOptionSerie IMessageBuilder.BuildMessage() + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(); + } + + public override bool Equals(object obj) + { + if (obj is OptionSerie optionSerie && base.ConnectionId == optionSerie.ConnectionId && Id == optionSerie.Id) + { + return UnderlierId == optionSerie.UnderlierId; + } + return false; + } + + public override int GetHashCode() + { + return ((-1159877490 * -1521134295 + ExpirationDate.GetHashCode()) * -1521134295 + EqualityComparer.Default.GetHashCode(Id)) * -1521134295 + EqualityComparer.Default.GetHashCode(UnderlierId); + } + + public int CompareTo(object obj) + { + return CompareTo(obj); + } + } + [ProtoContract] + public class PnL + { + [CompilerGenerated] + private PnLItem ?; + + [CompilerGenerated] + private PnLItem ?; + + [CompilerGenerated] + private PnLItem ?; + + [CompilerGenerated] + private PnLItem ?; + + [ProtoMember(1)] + public PnLItem GrossPnL + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + [ProtoMember(2)] + public PnLItem NetPnL + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + [ProtoMember(3)] + public PnLItem Fee + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + [ProtoMember(4)] + public PnLItem Swaps + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + } + [DataContract(Name = "PnLItem", Namespace = "TradingPlatform")] + [ProtoContract] + public class PnLItem : BusinessObject + { + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private double ??; + + private Asset ??; + + [DataMember(Name = "Value")] + [ProtoMember(1)] + public double Value + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "AssetID")] + [ProtoMember(2)] + public string AssetID + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "ValuePercent")] + [ProtoMember(3)] + public double ValuePercent + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Asset Asset => ?? ?? (?? = Core.Instance.Assets.FirstOrDefault((Asset P_0) => P_0.ConnectionId == base.ConnectionId && P_0.Id == AssetID)); + + public PnLItem() + : base(string.Empty) + { + ValuePercent = double.NaN; + } + + public override bool Equals(object obj) + { + if (!(obj is PnLItem pnLItem)) + { + return false; + } + if (Value != pnLItem.Value) + { + return false; + } + if (AssetID != pnLItem.AssetID) + { + return false; + } + return true; + } + + public override int GetHashCode() + { + return (13 * 7 + Value.GetHashCode()) * 7 + AssetID.GetHashCode(); + } + + public string Format() + { + string text = FormatPercent(); + if (text == null) + { + return FormatValue(); + } + return FormatValue() + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); + } + + public string FormatValue() + { + return Asset?.FormatPriceWithCurrency(Value) ?? Value.Format(); + } + + public string FormatPercent() + { + if (!double.IsNaN(ValuePercent)) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(0, 1); + defaultInterpolatedStringHandler.AppendFormatted(ValuePercent, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + return null; + } + + public override string ToString() + { + return Format(); + } + + [CompilerGenerated] + private bool ?(Asset P_0) + { + if (P_0.ConnectionId == base.ConnectionId) + { + return P_0.Id == AssetID; + } + return false; + } + } + [ProtoContract] + public sealed class SlTpHolder : ICloneable, IXElementSerialization, IEquatable, ICustomizable + { + [CompilerGenerated] + private CloseOrderType ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private PriceMeasurement ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private double ??; + + [ProtoMember(1)] + public CloseOrderType Type + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = closeOrderType; + } + } + + [ProtoMember(2)] + public double Price + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + [ProtoMember(3)] + public double Quantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(4)] + public PriceMeasurement PriceMeasurement + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = priceMeasurement; + } + } + + [ProtoMember(5)] + public bool IsTrailing + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = flag; + } + } + + [ProtoMember(6)] + public double QuantityPercentage + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IList Settings + { + get + { + return new List + { + new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)Type, new List + { + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1) + }), + new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Price), + new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Quantity), + new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)PriceMeasurement, new List + { + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1) + }), + new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsTrailing), + new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), QuantityPercentage) + }; + } + set + { + Type = (CloseOrderType)value.GetValueOrDefault((int)Type, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + Price = value.GetValueOrDefault(Price, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + Quantity = value.GetValueOrDefault(Quantity, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + PriceMeasurement = (PriceMeasurement)value.GetValueOrDefault((int)PriceMeasurement, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + IsTrailing = value.GetValueOrDefault(IsTrailing, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + QuantityPercentage = value.GetValueOrDefault(QuantityPercentage, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + [NotPublished] + public SlTpHolder(IList settings) + { + Settings = settings; + } + + internal SlTpHolder() + { + } + + public static SlTpHolder CreateSL(double price, PriceMeasurement priceMeasurement = PriceMeasurement.Absolute, bool isTrailing = false, double quantity = double.NaN, double quantityPercentage = double.NaN) + { + return new SlTpHolder + { + Type = CloseOrderType.StopLoss, + Price = price, + Quantity = quantity, + PriceMeasurement = priceMeasurement, + IsTrailing = isTrailing, + QuantityPercentage = quantityPercentage + }; + } + + public static SlTpHolder CreateTP(double price, PriceMeasurement priceMeasurement = PriceMeasurement.Absolute, double quantity = double.NaN, double quantityPercentage = double.NaN) + { + return new SlTpHolder + { + Type = CloseOrderType.TakeProfit, + Price = price, + Quantity = quantity, + PriceMeasurement = priceMeasurement, + IsTrailing = false, + QuantityPercentage = quantityPercentage + }; + } + + public string Format(Symbol symbol) + { + if (symbol == null) + { + return Price.ToString(); + } + if (PriceMeasurement == PriceMeasurement.Absolute) + { + return symbol.FormatPrice(Price); + } + return symbol.FormatOffset(Price, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + + public object Clone() + { + if (Type == CloseOrderType.StopLoss) + { + return CreateSL(Price, PriceMeasurement, IsTrailing, Quantity, QuantityPercentage); + } + return CreateTP(Price, PriceMeasurement, Quantity, QuantityPercentage); + } + + public XElement ToXElement() + { + XElement xElement = new XElement(GetType().Name); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)Type).ToString())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Price)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Quantity)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)PriceMeasurement).ToString())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsTrailing)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), QuantityPercentage)); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + Type = (CloseOrderType)xElement.ToInt(); + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + Price = xElement2.ToDouble(); + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + PriceMeasurement = (PriceMeasurement)xElement3.ToInt(); + } + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + IsTrailing = xElement4.ToBool(); + } + XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement5 != null) + { + Quantity = xElement5.ToDouble(); + } + XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement6 != null) + { + QuantityPercentage = xElement6.ToDouble(); + } + if (Quantity == 0.0) + { + Quantity = double.NaN; + } + } + + public bool Equals(SlTpHolder other) + { + if (other == null) + { + return false; + } + if (this == other) + { + return true; + } + if (Type == other.Type && Price.Equals(other.Price) && Quantity.Equals(other.Quantity) && QuantityPercentage.Equals(other.QuantityPercentage) && PriceMeasurement == other.PriceMeasurement) + { + return IsTrailing == other.IsTrailing; + } + return false; + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + if (this == obj) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((SlTpHolder)obj); + } + + public override int GetHashCode() + { + return (int)(((uint)((((((((int)Type * 397) ^ Price.GetHashCode()) * 397) ^ Quantity.GetHashCode()) * 397) ^ QuantityPercentage.GetHashCode()) * 397) ^ (uint)PriceMeasurement) * 397) ^ IsTrailing.GetHashCode(); + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(9, 4); + defaultInterpolatedStringHandler.AppendFormatted(Type); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(PriceMeasurement); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Price); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + object value; + if (!double.IsNaN(QuantityPercentage)) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler2 = new DefaultInterpolatedStringHandler(0, 1); + defaultInterpolatedStringHandler2.AppendFormatted(QuantityPercentage, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + value = defaultInterpolatedStringHandler2.ToStringAndClear(); + } + else + { + value = $"{Quantity}"; + } + defaultInterpolatedStringHandler.AppendFormatted((string?)value); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + public readonly struct SymbolComplexIdentifier : IEquatable + { + [CompilerGenerated] + private readonly string ?; + + private readonly ExchangeComplexIdentifier ?; + + public string ConnectionId => ?.ConnectionId; + + public string ExchangeId => ?.ExchangeId; + + public string SymbolId + { + [CompilerGenerated] + get + { + return ?; + } + } + + public SymbolComplexIdentifier(string connectionId, string exchangeId, string symbolId) + { + ? = new ExchangeComplexIdentifier(connectionId, exchangeId); + ? = symbolId; + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(4, 3); + defaultInterpolatedStringHandler.AppendFormatted(SymbolId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + defaultInterpolatedStringHandler.AppendFormatted(ExchangeId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + defaultInterpolatedStringHandler.AppendFormatted(ConnectionId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public bool Equals(SymbolComplexIdentifier other) + { + if (?.Equals(other.?)) + { + return SymbolId == other.SymbolId; + } + return false; + } + + public override bool Equals(object obj) + { + if (obj is SymbolComplexIdentifier other) + { + return Equals(other); + } + return false; + } + + public override int GetHashCode() + { + return (?.GetHashCode() * 397) ^ SymbolId.GetHashCode(); + } + + public static bool operator ==(SymbolComplexIdentifier left, SymbolComplexIdentifier right) + { + return left.Equals(right); + } + + public static bool operator !=(SymbolComplexIdentifier left, SymbolComplexIdentifier right) + { + return !left.Equals(right); + } + } + [Serializable] + [DataContract] + public class SymbolInfo : BusinessObjectInfo, IEquatable + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private SymbolType ??; + + [CompilerGenerated] + private FutureContractType? ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private DateTime ??; + + [DataMember(Name = "exchangeId")] + public string ExchangeId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + [DataMember(Name = "symbolType")] + public SymbolType SymbolType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = symbolType; + } + } + + [DataMember(Name = "futuresContractType")] + public FutureContractType? FutureContractType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = futureContractType; + } + } + + [DataMember(Name = "underlierId")] + public string UnderlierId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + [DataMember(Name = "root")] + public string Root + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + [DataMember(Name = "expirationTime")] + public DateTime ExpirationDate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = dateTime; + } + } + + public new static SymbolInfo Empty => new SymbolInfo + { + Id = string.Empty, + ConnectionId = string.Empty, + Name = string.Empty, + ExchangeId = string.Empty, + SymbolType = SymbolType.Unknown, + FutureContractType = null, + UnderlierId = string.Empty, + Root = string.Empty, + ExpirationDate = default(DateTime) + }; + + public override XElement ToXElement() + { + XElement xElement = base.ToXElement(); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExchangeId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SymbolType.ToString())); + if (FutureContractType.HasValue) + { + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), FutureContractType.ToString())); + } + if (!string.IsNullOrEmpty(UnderlierId)) + { + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), UnderlierId)); + } + if (!string.IsNullOrEmpty(Root)) + { + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Root)); + } + if (ExpirationDate != default(DateTime)) + { + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExpirationDate)); + } + return xElement; + } + + public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + base.FromXElement(element, deserializationInfo); + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + ExchangeId = xElement.Value; + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null && Enum.TryParse(xElement2.Value, out var result)) + { + FutureContractType = result; + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null && Enum.TryParse(xElement3.Value, out var result2)) + { + SymbolType = result2; + } + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + UnderlierId = xElement4.Value; + } + XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement5 != null) + { + Root = xElement5.Value; + } + XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement6 != null) + { + ExpirationDate = xElement6.ToDateTime(); + } + } + + public bool Equals(SymbolInfo other) + { + if ((object)other == null) + { + return false; + } + if ((object)this == other) + { + return true; + } + if (Equals((BusinessObjectInfo)other) && ExchangeId == other.ExchangeId && SymbolType == other.SymbolType && FutureContractType == other.FutureContractType && UnderlierId == other.UnderlierId && Root == other.Root) + { + return ExpirationDate.Equals(other.ExpirationDate); + } + return false; + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + if (this == obj) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((SymbolInfo)obj); + } + + public override int GetHashCode() + { + return HashCode.Combine(base.GetHashCode(), ExchangeId, (int)SymbolType, FutureContractType, UnderlierId, Root, ExpirationDate); + } + + public static bool operator ==(SymbolInfo left, SymbolInfo right) + { + return object.Equals(left, right); + } + + public static bool operator !=(SymbolInfo left, SymbolInfo right) + { + return !object.Equals(left, right); + } + } + [DataContract(Name = "TradingObject")] + public abstract class TradingObject : BusinessObject, ITradingObject + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private Account ??; + + [CompilerGenerated] + private Symbol ??; + + [CompilerGenerated] + private Side ??; + + [CompilerGenerated] + private string ??; + + private readonly Lazy ??; + + [DataMember(Name = "ID")] + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected set + { + ?? = value; + } + } + + [DataMember(Name = "Account")] + public Account Account + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected set + { + ?? = value; + } + } + + [DataMember(Name = "Instrument")] + public Symbol Symbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected set + { + ?? = value; + } + } + + [DataMember(Name = "Side")] + public Side Side + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected set + { + ?? = value; + } + } + + [DataMember(Name = "Comment")] + public string Comment + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected set + { + ?? = value; + } + } + + public AdditionalInfoCollection AdditionalInfo + { + get + { + if (!??.IsValueCreated) + { + return null; + } + return ??.Value; + } + } + + protected TradingObject(string connectionId) + : base(connectionId) + { + ?? = new Lazy(); + } + + protected void ProcessAdditionalItems(List items) + { + if (items == null) + { + return; + } + foreach (AdditionalInfoItem item in items) + { + ??.Value.?(item); + } + } + } + public class TradingSignalEventArgs : EntityLifecycleEventArgs + { + [CompilerGenerated] + private readonly TradingSignal ??; + + public TradingSignal TradingSignal + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + } + [DataContract(Name = "VariableTick", Namespace = "TradingPlatform")] + [ProtoContract] + public class VariableTick : IXElementSerialization + { + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private int ??; + + [DataMember] + [ProtoMember(1)] + public double LeftBorder + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + [DataMember] + [ProtoMember(2)] + public bool IncludeLeftBorder + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = flag; + } + } + + [DataMember] + [ProtoMember(3)] + public double TickSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + [DataMember] + [ProtoMember(4)] + public double TickCost + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + [DataMember] + [ProtoMember(5)] + public double RightBorder + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + [DataMember] + [ProtoMember(6)] + public int Precision + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// ???????? ?? ????????? + /// + public bool CheckPrice(double price) + { + if ((!(price > LeftBorder) || !(price < RightBorder)) && (price != LeftBorder || !IncludeLeftBorder)) + { + if (price == RightBorder) + { + return !IncludeLeftBorder; + } + return false; + } + return true; + } + + public VariableTick(double lowLimit, double highLimit, bool allowLimit, double tickSize, double tickCost, int? precision = null) + { + LeftBorder = lowLimit; + RightBorder = highLimit; + IncludeLeftBorder = allowLimit; + TickSize = (double)(decimal)tickSize; + TickCost = tickCost; + Precision = ((!precision.HasValue) ? CoreMath.GetValuePrecision((decimal)TickSize) : precision.Value); + } + + public VariableTick(double tickSize, double tickCost = 1.0, int? precision = null) + : this(double.NegativeInfinity, double.PositiveInfinity, allowLimit: true, tickSize, tickCost, precision) + { + } + + internal VariableTick() + { + } + + public override string ToString() + { + return LeftBorder + ((IncludeLeftBorder && LeftBorder != double.NegativeInfinity) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ((!IncludeLeftBorder && RightBorder != double.PositiveInfinity) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + RightBorder; + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LeftBorder.ToString(CultureInfo.InvariantCulture))); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), RightBorder.ToString(CultureInfo.InvariantCulture))); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IncludeLeftBorder)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TickSize)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TickCost)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Precision)); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + LeftBorder = xElement.ToDouble(); + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + RightBorder = xElement2.ToDouble(); + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + IncludeLeftBorder = xElement3.ToBool(); + } + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + TickSize = xElement4.ToDouble(); + } + XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement5 != null) + { + TickCost = xElement5.ToDouble(); + } + XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement6 != null) + { + Precision = xElement6.ToInt(); + } + } + } + /// + /// Represents information about connection and provides an access to the current trading information(Symbols, Orders, Position, Accounts etc.). + /// + [Published] + public sealed class Connection : ICustomizable, IComparable + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func> ??; + + public static Func> ??; + + public static Func ??; + + public static Func, Symbol> ??; + + public static Func ??; + + public static Func, Symbol> ??; + + internal SettingItem ?(SettingItem P_0) + { + return P_0.GetCopy(); + } + + internal int ?(Symbol P_0) + { + return P_0.TotalSubscriptionsCount; + } + + internal long ?(Period P_0) + { + return P_0.Ticks; + } + + internal bool ?(Connection P_0) + { + if (P_0.State != ConnectionState.Connected) + { + return P_0.State == ConnectionState.Connecting; + } + return true; + } + + internal bool ?(Connection P_0) + { + return P_0.Type == ConnectionType.General; + } + + internal bool ?(Connection P_0) + { + return Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), P_0.Id).Status != TradingOperationStatus.Allowed; + } + + internal bool ?(SettingItem P_0) + { + return P_0 is SettingItemOAuth; + } + + internal string ?(PlaceOrderRequestParameters P_0) + { + return P_0.Symbol.ConnectionId; + } + + internal DateTime ?(OptionSerie P_0) + { + return P_0.ExpirationDate; + } + + internal DateTime ?(UserTradesInterval P_0) + { + return P_0.Interval.From; + } + + internal IEnumerable ?(UserTradesInterval P_0) + { + return P_0.Trades; + } + + internal IEnumerable ?(UserTradesInterval P_0) + { + return P_0.Trades; + } + + internal Symbol ?(Order P_0) + { + return P_0.Symbol; + } + + internal Symbol ?(IGrouping P_0) + { + return P_0.Key; + } + + internal Symbol ?(Position P_0) + { + return P_0.Symbol; + } + + internal Symbol ?(IGrouping P_0) + { + return P_0.Key; + } + } + + [CompilerGenerated] + private sealed class ? + { + public GetStrikesRequestParameters ??; + + internal bool ?(Symbol P_0) + { + if (P_0.OptionSerie != null) + { + return P_0.OptionSerie.Id == ??.SerieId; + } + return false; + } + } + + [CompilerGenerated] + private sealed class ? + { + public IList ??; + + public IList ??; + + public string[] ??; + + public SearchSymbolsRequestParameters ??; + + internal bool ?(Symbol P_0) + { + return ??.Contains(P_0.ExchangeId); + } + + internal bool ?(Symbol P_0) + { + return ??.Contains(P_0.SymbolType); + } + + internal bool ?(Symbol P_0) + { + return Connection.?(??, P_0, ??.GetSynonyms); + } + } + + [CompilerGenerated] + private sealed class ? + { + public TradesHistoryRequestParameters ??; + + internal bool ?(MessageTrade P_0) + { + if (!string.IsNullOrEmpty(??.SymbolId)) + { + return P_0.SymbolId == ??.SymbolId; + } + return true; + } + } + + [CompilerGenerated] + private sealed class ? + { + public CancellationToken ??; + + public AccountTradesLoadingCallback ??; + + public Connection ??; + + public TradesHistoryRequestParameters ??; + + public CancellationTokenSource ??; + } + + [CompilerGenerated] + private sealed class ? + { + public Interval ??; + + public TradesHistoryRequestParameters ??; + + public List ??; + + public ? ??; + + internal void ?(IList P_0, bool P_1) + { + try + { + if (??.??.IsCancellationRequested) + { + return; + } + if (P_0 == null) + { + if (P_1) + { + ??.??.InvokeSafely(new List(), P_1); + } + return; + } + P_0 = ??.??.?(??, P_0).Trades.ToList(); + ??.AddRange(P_0); + List list = ??.??.?(P_0, ??.??).ToList(); + ??.??.InvokeSafely(list, P_1); + if (P_1 && string.IsNullOrEmpty(??.??.SymbolId) && !??.??.??.UsersTradesCacheMetadata.AllowSingleSymbolLoading) + { + ??.??.???.Save(new UserTradesInterval + { + Interval = ??, + Trades = ?? + }); + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + if (P_1) + { + ??.??.Dispose(); + } + } + } + } + + [CompilerGenerated] + private sealed class ? + { + public TradesHistoryRequestParameters ??; + + internal bool ?(MessageTrade P_0) + { + return ??.Interval.Contains(P_0.DateTime); + } + } + + [CompilerGenerated] + private sealed class ? + { + public Connection ??; + + public CancellationToken ??; + + internal void ?(string P_0) + { + ??.ConnectingProgress = P_0; + } + + internal bool ?(Connection P_0) + { + return P_0 != ??; + } + } + + [CompilerGenerated] + private sealed class ? + { + public DateTime ??; + + public ? ??; + + internal void ?() + { + try + { + ??.??.GetTrades(new TradesHistoryRequestParameters + { + From = ??.AddDays(-2.0), + To = ??, + CancellationToken = ??.?? + }); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + } + + [CompilerGenerated] + private sealed class ? + { + public Connection ??; + + public SubscribeQuotesParameters ??; + + internal void ?() + { + ??.??.SubscribeSymbol(??); + } + } + + [CompilerGenerated] + private sealed class ? + { + public Connection ??; + + public SubscribeQuotesParameters ??; + + internal void ?() + { + ??.??.UnSubscribeSymbol(??); + } + } + + internal const string ?? = "Test"; + + internal ? ??; + + private string ??; + + [CompilerGenerated] + private ConnectionType ??; + + [CompilerGenerated] + private EventHandler ??; + + [CompilerGenerated] + private EventHandler ??; + + [CompilerGenerated] + private TimeSpan? ??; + + [CompilerGenerated] + private TimeSpan? ??; + + private DateTime ??; + + [CompilerGenerated] + private ConnectionResult ??; + + [CompilerGenerated] + private ? ??; + + [CompilerGenerated] + private VolumeAnalysisStorage ??; + + private UsersTradesStorage ??; + + private Vendor ??; + + private CancellationTokenSource ??; + + [CompilerGenerated] + private readonly ConnectionInfo ??; + + [CompilerGenerated] + private EventHandler ??; + + [CompilerGenerated] + private EventHandler ??; + + [CompilerGenerated] + private Limiter ??; + + private readonly ActionBufferedProcessor ??; + + /// + /// Provides access to all business objects which are belong to this connection + /// + public IBusinessObjectsProvider BusinessObjects => ??; + + /// + /// Gets connection Id + /// + public string Id + { + get + { + return Info.ConnectionId; + } + private set + { + Info.ConnectionId = connectionId; + } + } + + /// + /// Gets connection Name + /// + public string Name + { + get + { + return Info.Name; + } + set + { + Info.Name = value; + } + } + + /// + /// Gets connection's vendor name + /// + public string VendorName => Info.VendorName; + + /// + /// Contains list of connection settings. Will be reused on each population time. + /// + public IList Settings + { + get + { + return Info.Settings; + } + set + { + Info.Settings = value; + } + } + + /// + /// Gets connection's state (Connected/Connecting/Fail etc.) + /// + public ConnectionState State + { + get + { + return Info.ConnectionState; + } + private set + { + if (Info.ConnectionState != connectionState) + { + ConnectionState connectionState2 = Info.ConnectionState; + Info.ConnectionState = connectionState; + ?? = ((connectionState == ConnectionState.Connected) ? Core.Instance.TimeUtils.DateTimeUtcNow : default(DateTime)); + ?(connectionState2); + } + } + } + + public string ConnectingProgress + { + get + { + return ??; + } + private set + { + if (!(?? == text)) + { + ?? = text; + ???.Invoke(this, new ConnectionConnectingProgressChangedEventArgs(ConnectingProgress)); + } + } + } + + /// + /// Defines connection type + /// + public ConnectionType Type + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Represents connection ping time + /// + public TimeSpan? PingTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = timeSpan; + } + } + + public TimeSpan? RoundTripTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = timeSpan; + } + } + + /// + /// Messages count that one is waited to process + /// + public int MessagesQueueDepth => ???.QueueDepth ?? 0; + + public TimeSpan Uptime + { + get + { + if (!(?? == default(DateTime))) + { + return Core.Instance.TimeUtils.DateTimeUtcNow - ??; + } + return TimeSpan.Zero; + } + } + + /// + /// Gets a matched available metadata info with the vendor's side + /// + public HistoryMetadata HistoryMetaData => ??.HistoryMetadata?.Copy; + + public TradesHistoryMetadata TradesHistoryMetadata + { + get + { + if (??.UsersTradesCacheMetadata != null) + { + return new TradesHistoryMetadata(??.UsersTradesCacheMetadata); + } + return null; + } + } + + public VolumeAnalysisMetadata VolumeAnalysisMetadata => ??.VolumeAnalysisMetadata?.Copy; + + public IEnumerable NewsFeedSettings => ???.NewsFeedSettings?.Select((SettingItem P_0) => P_0.GetCopy()); + + public ConnectionResult LastConnectionResult + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = connectionResult; + } + } + + internal ? HistoryLoadingManager + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = ?; + } + } + + internal VolumeAnalysisStorage VolumeAnalysisStorage + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = volumeAnalysisStorage; + } + } + + internal bool Connected => State == ConnectionState.Connected; + + public ConnectionInfo Info + { + [CompilerGenerated] + get + { + return ??; + } + } + + public int TotalSubscriptionsCount => BusinessObjects.Symbols.Sum((Symbol P_0) => P_0.TotalSubscriptionsCount); + + public DateTime ServerTime => ???.ServerTime ?? Core.Instance.TimeUtils.DateTimeUtcNow; + + [NotPublished] + public Limiter Limitation + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = limiter; + } + } + + /// + /// Will be triggered when changed. + /// + public event EventHandler StateChanged + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + /// + /// Will be triggered when changed. + /// + public event EventHandler ConnectingProgressChanged + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + public event EventHandler NewRequest + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + public event EventHandler NewPerformedRequest + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + internal Connection(ConnectionInfo P_0) + { + ?? = P_0; + Type = ConnectionType.General; + if (string.IsNullOrEmpty(P_0.ConnectionId)) + { + Id = Guid.NewGuid().ToString(); + } + State = ConnectionState.Disconnected; + ?? = new ActionBufferedProcessor(); + } + + /// + /// Establishes a connection to a specified vendor + /// + /// + public ConnectionResult Connect() + { + LastConnectionResult = new ConnectionResult(); + IProgress progress = new Progress(delegate(string P_0) + { + ConnectingProgress = P_0; + }); + if (State == ConnectionState.Connected) + { + return LastConnectionResult; + } + if (State == ConnectionState.Connecting) + { + LastConnectionResult.State = ConnectionState.Connecting; + LastConnectionResult.Message = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + return LastConnectionResult; + } + if (State == ConnectionState.Disconnecting) + { + LastConnectionResult.State = ConnectionState.Connecting; + LastConnectionResult.Message = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + return LastConnectionResult; + } + ?? = new CancellationTokenSource(); + CancellationToken ?? = ??.Token; + ?? = (Info.SyncMsgProcessing ? new ?(Id) : new ?(Id)); + progress.Report(null); + State = ConnectionState.Connecting; + ??.?(); + VendorInfo vendorInfo = Core.Instance.Vendors[VendorName]; + ?? = vendorInfo.?(); + ??.NewMessage += ?; + try + { + ??.ThrowIfCancellationRequested(); + vendorInfo.?(); + Core.Instance.Loggers.Log(Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + ?(??); + LastConnectionResult = ??.Connect(new ConnectRequestParameters + { + ConnectionSettings = Settings, + BrowserFactory = Core.Instance.BrowserFactory, + ConnectionId = Id, + CancellationToken = ??, + ConnectingProgress = progress + }); + if (LastConnectionResult.UpdatedSettings != null) + { + Settings = LastConnectionResult.UpdatedSettings; + } + ??.ThrowIfCancellationRequested(); + if (LastConnectionResult.State == ConnectionState.Fail) + { + State = ConnectionState.Disconnecting; + ?(); + State = ConnectionState.Disconnected; + Core.Instance.Loggers.Log(Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + LastConnectionResult.Message); + return LastConnectionResult; + } + ??.ThrowIfCancellationRequested(); + progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + IList sessions = ??.GetSessions(??); + if (sessions != null) + { + foreach (MessageSessionsContainer item in sessions) + { + ?(item); + } + } + ??.ThrowIfCancellationRequested(); + progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + IList exchanges = ??.GetExchanges(??); + if (exchanges != null) + { + foreach (MessageExchange item2 in exchanges) + { + ?(item2); + } + } + ??.ThrowIfCancellationRequested(); + progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + IList symbolGroups = ??.GetSymbolGroups(??); + if (symbolGroups != null) + { + foreach (MessageSymbolGroup item3 in symbolGroups) + { + ?(item3); + } + } + ??.ThrowIfCancellationRequested(); + ??.HistoryMetadata = ??.GetHistoryMetadata(??); + ??.HistoryMetadata.AllowedPeriodsHistoryAggregationTime = ??.HistoryMetadata.AllowedPeriodsHistoryAggregationTime.OrderByDescending((Period P_0) => P_0.Ticks).ToArray(); + ??.VolumeAnalysisMetadata = ??.GetVolumeAnalysisMetadata(); + ??.NewsFeedSettings = ??.GetNewsProviderSettings(??); + ??.UsersTradesCacheMetadata = ??.GetTradesMetadata(); + ??.LimitationMetadata = ??.GetLimitationMetadata(); + if (??.LimitationMetadata?.Limits != null) + { + Limitation = new Limiter(??.LimitationMetadata); + } + ??.ThrowIfCancellationRequested(); + progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + foreach (OrderType allowedOrderType in ??.GetAllowedOrderTypes(??)) + { + allowedOrderType.ConnectionId = Id; + ??.OrderTypesCache.?(allowedOrderType.Id, allowedOrderType); + } + ??.ThrowIfCancellationRequested(); + progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + foreach (MessageAsset asset in ??.GetAssets(??)) + { + ?(asset); + } + progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + ?(??.GetSymbolTypes(??)); + ??.ThrowIfCancellationRequested(); + progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + foreach (MessageAccount account in ??.GetAccounts(??)) + { + ?(account); + } + ??.ThrowIfCancellationRequested(); + foreach (MessageCryptoAssetBalances cryptoAssetBalance in ??.GetCryptoAssetBalances(??)) + { + ?(cryptoAssetBalance); + } + ??.ThrowIfCancellationRequested(); + progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + foreach (MessageOptionSerie item4 in ??.GetAllOptionSeries(??)) + { + ?(item4); + } + ??.ThrowIfCancellationRequested(); + progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + foreach (MessageSymbol symbol in ??.GetSymbols(??)) + { + ?(symbol); + } + ??.ThrowIfCancellationRequested(); + progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + foreach (MessageRule rule in ??.GetRules(??)) + { + ?(rule); + } + ??.ThrowIfCancellationRequested(); + progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + foreach (MessageOpenPosition position in ??.GetPositions(??)) + { + ?(position); + } + ??.ThrowIfCancellationRequested(); + progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + foreach (MessageClosedPosition closedPosition in ??.GetClosedPositions(??)) + { + ?(closedPosition); + } + ??.ThrowIfCancellationRequested(); + progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + foreach (MessageReportType reportsMetaDatum in ??.GetReportsMetaData(??)) + { + ?(reportsMetaDatum); + } + ??.ThrowIfCancellationRequested(); + progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + foreach (MessageOpenOrder pendingOrder in ??.GetPendingOrders(??)) + { + ?(pendingOrder); + } + ??.ThrowIfCancellationRequested(); + progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + foreach (MessageAccountOperation accountOperation in ??.GetAccountOperations(??)) + { + ?(accountOperation); + } + ??.ThrowIfCancellationRequested(); + progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + foreach (MessageTradingSignal tradingSignal in ??.GetTradingSignals(??)) + { + ?(tradingSignal); + } + ??.ThrowIfCancellationRequested(); + progress.Report(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + ??.WaitAllMessagesProcess(??); + progress.Report(null); + ??.ThrowIfCancellationRequested(); + ??.OnConnected(??); + ??.ThrowIfCancellationRequested(); + ? ? = new ? + { + AllowLocalStorage = ??.HistoryMetadata.UseHistoryLocalCache, + DegreeOfParallelism = ??.HistoryMetadata.DegreeOfParallelism, + LoadHistoryDelegate = ? + }; + if (?.AllowLocalStorage) + { + ?.LocalStorageConnectionString = Path.Combine(Const.HISTORY_PATH, (Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + Id + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()).EncodeFilePathPart(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + HistoryLoadingManager = ?.?(?); + if (?.AllowLocalStorage) + { + VolumeAnalysisStorage = VolumeAnalysisStorage.Create(Path.Combine(Const.VOLUME_ANALYSIS_PATH, (Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + Id + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()).EncodeFilePathPart(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + } + if (??.UsersTradesCacheMetadata.AllowLocalStorage) + { + ?? = UsersTradesStorage.Create(Path.Combine(Const.USER_TRADES_CACHE_PATH, (Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + Id + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()).EncodeFilePathPart(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), Id); + if (??.UsersTradesCacheMetadata.LoadTradesFromCurrentTradingDate) + { + DateTime ?? = Core.Instance.TimeUtils.DateTimeUtcNow; + Task.Factory.StartNew(delegate + { + try + { + GetTrades(new TradesHistoryRequestParameters + { + From = ??.AddDays(-2.0), + To = ??, + CancellationToken = ?? + }); + } + catch (Exception ex3) + { + Core.Instance.Loggers.Log(ex3); + } + }, ??); + } + } + ??.?? = true; + ???.Start(); + State = ConnectionState.Connected; + } + catch (OperationCanceledException) + { + LastConnectionResult.State = ConnectionState.Fail; + LastConnectionResult.Message = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + LastConnectionResult.Cancelled = true; + State = ConnectionState.Disconnecting; + ?(); + State = ConnectionState.Disconnected; + } + catch (Exception exception) + { + LastConnectionResult.State = ConnectionState.Fail; + LastConnectionResult.Message = exception.GetFullMessageRecursive(); + State = ConnectionState.Fail; + Core.Instance.Loggers.Log(LastConnectionResult.Message, LoggingLevel.Verbose); + ?(); + State = ConnectionState.Disconnected; + } + finally + { + vendorInfo.?(); + } + ConnectionResult lastConnectionResult = LastConnectionResult; + if (lastConnectionResult != null && lastConnectionResult.State == ConnectionState.Connected) + { + Core.Instance.Loggers.Log(Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + else + { + Core.Instance.Loggers.Log(Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + LastConnectionResult?.Message); + } + if (Type == ConnectionType.General && State == ConnectionState.Connected && Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), Id).Status != TradingOperationStatus.Allowed) + { + try + { + if ((Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())) == null) + { + Connection[] array = (from P_0 in Core.Instance.Connections.All + where P_0 != this + where P_0.State == ConnectionState.Connected || P_0.State == ConnectionState.Connecting + where P_0.Type == ConnectionType.General + where Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), P_0.Id).Status != TradingOperationStatus.Allowed + select P_0).ToArray(); + if (array.Any()) + { + Connection[] array2 = array; + foreach (Connection connection in array2) + { + if (connection.LastConnectionResult != null) + { + connection.LastConnectionResult.State = ConnectionState.Fail; + connection.LastConnectionResult.Message = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + connection.Disconnect(); + } + MessageDealTicket messageDealTicket = new MessageDealTicket(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + ?(messageDealTicket); + } + } + } + catch (Exception ex2) + { + Core.Instance.Loggers.Log(ex2); + } + } + return LastConnectionResult; + } + + private void ?(CancellationToken P_0) + { + IList settings = Settings; + if (!(settings.GetItemByPath(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemGroup { Value: IList value }) || !(value.FirstOrDefault((SettingItem settingItem) => settingItem is SettingItemOAuth) is SettingItemOAuth settingItemOAuth)) + { + return; + } + OidcClientOptions copy = settingItemOAuth.OidcOptions.GetCopy(); + if (copy == null) + { + throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (settingItemOAuth.UpdateIdentityAuthorityUrl != null) + { + copy.Authority = settingItemOAuth.UpdateIdentityAuthorityUrl(settings, P_0); + } + if (string.IsNullOrEmpty(copy.Authority) && copy.ProviderInformation == null) + { + return; + } + int value2 = 55650; + try + { + value2 = TcpIpHelper.GetRandomUnusedPort; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + copy.Browser = new ?(settingItemOAuth.AllowOpenNewWindow, value2) + { + ?? = Core.Instance.OAuthBrowserCreator + }; + if (string.IsNullOrEmpty(copy.RedirectUri)) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(17, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value2); + string postLogoutRedirectUri = (copy.RedirectUri = defaultInterpolatedStringHandler.ToStringAndClear()); + copy.PostLogoutRedirectUri = postLogoutRedirectUri; + } + OidcClient oidcClient = new OidcClient(copy); + LoginRequest loginRequest = new LoginRequest + { + BrowserDisplayMode = DisplayMode.Visible, + BrowserTimeout = 300, + BackChannelExtraParameters = settingItemOAuth.BackChannelExtraParameters + }; + OAuthResult oAuthResult = settingItemOAuth.Value as OAuthResult; + Result result = null; + if (oAuthResult != null && !string.IsNullOrEmpty(oAuthResult.RefreshToken) && oAuthResult.UseSavedTokens) + { + RefreshTokenResult refreshTokenResult = null; + if (VendorName.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + UriBuilder uriBuilder = new UriBuilder(copy.ProviderInformation.TokenEndpoint); + NameValueCollection nameValueCollection = HttpUtility.ParseQueryString(string.Empty); + nameValueCollection.Add(new NameValueCollection + { + { + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + copy.ClientId + }, + { + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + copy.ClientSecret + }, + { + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + oAuthResult.RefreshToken + }, + { + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + } + }); + uriBuilder.Query = nameValueCollection.ToString(); + using HttpClient httpClient = new HttpClient(); + TokenResponse result2 = ProtocolResponse.FromHttpResponseAsync(httpClient.Send(new HttpRequestMessage(HttpMethod.Get, uriBuilder.Uri), P_0)).Result; + if (result2 != null && !result2.IsError) + { + refreshTokenResult = new RefreshTokenResult(); + try + { + Type? typeFromHandle = typeof(RefreshTokenResult); + typeFromHandle.GetProperty(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.SetValue(refreshTokenResult, result2.AccessToken); + typeFromHandle.GetProperty(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.SetValue(refreshTokenResult, result2.RefreshToken); + typeFromHandle.GetProperty(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.SetValue(refreshTokenResult, result2.ExpiresIn); + } + catch (Exception ex2) + { + Core.Instance.Loggers.Log(ex2, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + } + else + { + refreshTokenResult = oidcClient.RefreshTokenAsync(oAuthResult.RefreshToken, null, null, P_0).Result; + } + result = refreshTokenResult; + oAuthResult.RequestRefreshResult = refreshTokenResult; + } + else if (VendorName.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + result = new LoginResult(); + BrowserOptions options = new BrowserOptions(new RequestUrl(copy.ProviderInformation.AuthorizeEndpoint).CreateAuthorizeUrl(copy.ClientId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), redirectUri: copy.RedirectUri, scope: copy.Scope), copy.RedirectUri) + { + Timeout = TimeSpan.FromSeconds(loginRequest.BrowserTimeout), + DisplayMode = loginRequest.BrowserDisplayMode + }; + BrowserResult result3 = copy.Browser.InvokeAsync(options, P_0).Result; + if (result3.IsError) + { + throw new Exception(result3.Error); + } + NameValueCollection nameValueCollection2 = HttpUtility.ParseQueryString(result3.Response); + if (!nameValueCollection2.AllKeys.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + using HttpClient httpClient2 = new HttpClient(); + new TokenClient(httpClient2, new TokenClientOptions + { + Address = copy.ProviderInformation.TokenEndpoint, + ClientId = copy.ClientId, + ClientSecret = copy.ClientSecret + }); + string value3 = nameValueCollection2[3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()]; + UriBuilder uriBuilder2 = new UriBuilder(copy.ProviderInformation.TokenEndpoint); + NameValueCollection nameValueCollection3 = HttpUtility.ParseQueryString(string.Empty); + nameValueCollection3.Add(new NameValueCollection + { + { + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + copy.ClientId + }, + { + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + copy.ClientSecret + }, + { + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + copy.RedirectUri + }, + { + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }, + { + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + value3 + } + }); + uriBuilder2.Query = nameValueCollection3.ToString(); + TokenResponse result4 = ProtocolResponse.FromHttpResponseAsync(httpClient2.Send(new HttpRequestMessage(HttpMethod.Get, uriBuilder2.Uri), P_0)).Result; + if (result4.IsError) + { + result.Error = result4.Error; + } + oAuthResult.TokenResponce = result4; + } + else + { + if (oAuthResult != null && !string.IsNullOrEmpty(oAuthResult.IdentityToken)) + { + LogoutRequest request = new LogoutRequest + { + IdTokenHint = oAuthResult.IdentityToken + }; + oidcClient.LogoutAsync(request, P_0).Wait(P_0); + Task.Delay(700, P_0).Wait(P_0); + } + result = (oAuthResult.RequestTokenResult = oidcClient.LoginAsync(loginRequest, P_0).Result); + } + Settings = new List + { + new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new List { settingItemOAuth }) + }; + if (!result.IsError) + { + return; + } + if (result.Error == BrowserResultType.UserCancel.ToString()) + { + throw new OperationCanceledException(); + } + throw new Exception(result.Error); + } + + /// + /// Closes a connection. + /// + public void Disconnect() + { + if (State == ConnectionState.Connecting) + { + ??.Cancel(); + } + else if (State == ConnectionState.Connected) + { + ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + State = ConnectionState.Disconnecting; + Core.Instance.Loggers.Log(Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + ?(); + State = ConnectionState.Disconnected; + Core.Instance.Loggers.Log(Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + private void ?() + { + ???.Stop(); + if (?? != null) + { + try + { + ??.Disconnect(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); + } + ??.NewMessage -= ?; + ?? = null; + } + ???.Stop(); + if (HistoryLoadingManager != null) + { + HistoryLoadingManager.Dispose(); + HistoryLoadingManager = null; + } + if (VolumeAnalysisStorage != null) + { + VolumeAnalysisStorage.Dispose(); + VolumeAnalysisStorage = null; + } + if (?? != null) + { + ??.Dispose(); + ?? = null; + } + if (Limitation != null) + { + Limitation.Dispose(); + Limitation = null; + } + } + + internal void ?() + { + if (?? == null || State != ConnectionState.Connected) + { + return; + } + PingResult pingResult; + try + { + pingResult = ??.Ping(); + if (State != ConnectionState.Connected) + { + return; + } + } + catch (Exception ex) + { + pingResult = new PingResult + { + State = PingEnum.Disconnected + }; + Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); + } + if (pingResult != null && pingResult.State == PingEnum.Connected) + { + PingTime = pingResult.PingTime; + RoundTripTime = pingResult.RoundTripTime; + } + else + { + ?(); + State = (pingResult.StopReconnecting ? ConnectionState.Disconnected : ConnectionState.ConnectionLost); + Core.Instance.Loggers.Log(Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + (pingResult.StopReconnecting ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : string.Empty)); + } + } + + public void SendCustomRequest(RequestParameters parameters) + { + try + { + if (!Connected) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + return; + } + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(parameters.CancellationToken, ??.Token); + parameters.CancellationToken = cancellationTokenSource.Token; + ?(parameters); + ??.SendCustomRequest(parameters); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); + } + finally + { + ?(parameters, (object)null); + } + } + + internal void ?(Symbol P_0, SubscribeQuoteType P_1) + { + if (?? != null) + { + SubscribeQuotesParameters ?? = new SubscribeQuotesParameters(P_0.Id, P_1); + ??.Push(delegate + { + ??.SubscribeSymbol(??); + }); + } + } + + internal void ?(Symbol P_0, SubscribeQuoteType P_1) + { + if (?? != null) + { + SubscribeQuotesParameters ?? = new SubscribeQuotesParameters(P_0.Id, P_1); + ??.Push(delegate + { + ??.UnSubscribeSymbol(??); + }); + } + } + + internal TradingOperationResult ?(PlaceOrderRequestParameters P_0) + { + TradingOperationResult tradingOperationResult = null; + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); + PlaceOrderRequestParameters placeOrderRequestParameters = new PlaceOrderRequestParameters(P_0) + { + CancellationToken = cancellationTokenSource.Token + }; + try + { + if (!Connected) + { + long requestId = placeOrderRequestParameters.RequestId; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(State); + tradingOperationResult = TradingOperationResult.CreateError(requestId, defaultInterpolatedStringHandler.ToStringAndClear()); + return tradingOperationResult; + } + AllowedResult allowedResult = TradingOperations.IsAllowed(TradingOperation.PlaceOrder, new TradingOperationParameters + { + Account = placeOrderRequestParameters.Account, + Symbol = placeOrderRequestParameters.Symbol + }); + if (allowedResult.Status == TradingOperationStatus.NotAllowed) + { + tradingOperationResult = TradingOperationResult.CreateError(placeOrderRequestParameters.RequestId, allowedResult.Reason); + return tradingOperationResult; + } + if (placeOrderRequestParameters.OrderType == null) + { + tradingOperationResult = TradingOperationResult.CreateError(placeOrderRequestParameters.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return tradingOperationResult; + } + if (placeOrderRequestParameters.TimeInForce == TimeInForce.Default) + { + placeOrderRequestParameters.TimeInForce = placeOrderRequestParameters.OrderType.AllowedTifs.FirstOrDefault(); + } + ?((RequestParameters)placeOrderRequestParameters); + Core.Instance.Loggers.Log(placeOrderRequestParameters, LoggingLevel.Trading, Name); + tradingOperationResult = ??.PlaceOrder(placeOrderRequestParameters); + } + catch (Exception ex) + { + tradingOperationResult = TradingOperationResult.CreateError(placeOrderRequestParameters.RequestId, ex.Message); + } + finally + { + Core.Instance.Loggers.Log(tradingOperationResult, LoggingLevel.Trading, Name); + ?(placeOrderRequestParameters, tradingOperationResult); + } + return tradingOperationResult; + } + + internal TradingOperationResult ?(PlaceMultiOrderOrderRequestParameters P_0) + { + TradingOperationResult tradingOperationResult = null; + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); + PlaceMultiOrderOrderRequestParameters placeMultiOrderOrderRequestParameters = new PlaceMultiOrderOrderRequestParameters(P_0) + { + CancellationToken = cancellationTokenSource.Token + }; + try + { + if (!Connected) + { + long requestId = placeMultiOrderOrderRequestParameters.RequestId; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(State); + tradingOperationResult = TradingOperationResult.CreateError(requestId, defaultInterpolatedStringHandler.ToStringAndClear()); + return tradingOperationResult; + } + if (placeMultiOrderOrderRequestParameters.OrderParameters == null || !placeMultiOrderOrderRequestParameters.OrderParameters.Any()) + { + tradingOperationResult = TradingOperationResult.CreateError(placeMultiOrderOrderRequestParameters.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return tradingOperationResult; + } + if (placeMultiOrderOrderRequestParameters.OrderParameters.Select((PlaceOrderRequestParameters placeOrderRequestParameters2) => placeOrderRequestParameters2.Symbol.ConnectionId).Distinct().Count() > 1) + { + tradingOperationResult = TradingOperationResult.CreateError(placeMultiOrderOrderRequestParameters.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return tradingOperationResult; + } + if (placeMultiOrderOrderRequestParameters.GroupOrderType == GroupOrderType.OCO && Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id).Status != TradingOperationStatus.Allowed) + { + tradingOperationResult = TradingOperationResult.CreateError(placeMultiOrderOrderRequestParameters.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return tradingOperationResult; + } + PlaceOrderRequestParameters[] orderParameters = placeMultiOrderOrderRequestParameters.OrderParameters; + foreach (PlaceOrderRequestParameters placeOrderRequestParameters in orderParameters) + { + AllowedResult allowedResult = TradingOperations.IsAllowed(TradingOperation.PlaceOrder, new TradingOperationParameters + { + Account = placeOrderRequestParameters.Account, + Symbol = placeOrderRequestParameters.Symbol + }); + if (allowedResult.Status == TradingOperationStatus.NotAllowed) + { + tradingOperationResult = TradingOperationResult.CreateError(placeMultiOrderOrderRequestParameters.RequestId, allowedResult.Reason); + return tradingOperationResult; + } + } + ?((RequestParameters)placeMultiOrderOrderRequestParameters); + Core.Instance.Loggers.Log(placeMultiOrderOrderRequestParameters, LoggingLevel.Trading, Name); + tradingOperationResult = ??.PlaceMultiOrder(placeMultiOrderOrderRequestParameters); + } + catch (Exception ex) + { + tradingOperationResult = TradingOperationResult.CreateError(placeMultiOrderOrderRequestParameters.RequestId, ex.Message); + } + finally + { + Core.Instance.Loggers.Log(tradingOperationResult, LoggingLevel.Trading, Name); + ?(placeMultiOrderOrderRequestParameters, tradingOperationResult); + } + return tradingOperationResult; + } + + internal TradingOperationResult ?(ModifyOrderRequestParameters P_0) + { + TradingOperationResult tradingOperationResult = null; + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); + ModifyOrderRequestParameters modifyOrderRequestParameters = new ModifyOrderRequestParameters(P_0) + { + CancellationToken = cancellationTokenSource.Token + }; + try + { + if (!Connected) + { + long requestId = modifyOrderRequestParameters.RequestId; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(State); + tradingOperationResult = TradingOperationResult.CreateError(requestId, defaultInterpolatedStringHandler.ToStringAndClear()); + return tradingOperationResult; + } + AllowedResult allowedResult = TradingOperations.IsAllowed(TradingOperation.ModifyOrder, new TradingOperationParameters + { + Account = modifyOrderRequestParameters.Account, + Symbol = modifyOrderRequestParameters.Symbol + }); + if (allowedResult.Status == TradingOperationStatus.NotAllowed) + { + tradingOperationResult = TradingOperationResult.CreateError(modifyOrderRequestParameters.RequestId, allowedResult.Reason); + return tradingOperationResult; + } + if (modifyOrderRequestParameters.TimeInForce == TimeInForce.Default) + { + modifyOrderRequestParameters.TimeInForce = modifyOrderRequestParameters.OrderType.AllowedTifs.FirstOrDefault(); + } + ?((RequestParameters)modifyOrderRequestParameters); + Core.Instance.Loggers.Log(modifyOrderRequestParameters, LoggingLevel.Trading, Name); + tradingOperationResult = ??.ModifyOrder(modifyOrderRequestParameters); + } + catch (Exception ex) + { + tradingOperationResult = TradingOperationResult.CreateError(modifyOrderRequestParameters.RequestId, ex.Message); + } + finally + { + Core.Instance.Loggers.Log(tradingOperationResult, LoggingLevel.Trading, Name); + ?(modifyOrderRequestParameters, tradingOperationResult); + } + return tradingOperationResult; + } + + internal TradingOperationResult ?(ClosePositionRequestParameters P_0) + { + TradingOperationResult tradingOperationResult = null; + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); + ClosePositionRequestParameters closePositionRequestParameters = new ClosePositionRequestParameters(P_0) + { + CancellationToken = cancellationTokenSource.Token + }; + try + { + if (!Connected) + { + long requestId = closePositionRequestParameters.RequestId; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(State); + tradingOperationResult = TradingOperationResult.CreateError(requestId, defaultInterpolatedStringHandler.ToStringAndClear()); + return tradingOperationResult; + } + AllowedResult allowedResult = TradingOperations.IsAllowed(TradingOperation.ClosePosition, new TradingOperationParameters + { + Position = closePositionRequestParameters.Position + }); + if (allowedResult.Status == TradingOperationStatus.NotAllowed) + { + tradingOperationResult = TradingOperationResult.CreateError(closePositionRequestParameters.RequestId, allowedResult.Reason); + return tradingOperationResult; + } + ?((RequestParameters)closePositionRequestParameters); + Core.Instance.Loggers.Log(closePositionRequestParameters, LoggingLevel.Trading, Name); + tradingOperationResult = ??.ClosePosition(closePositionRequestParameters); + } + catch (Exception ex) + { + tradingOperationResult = TradingOperationResult.CreateError(closePositionRequestParameters.RequestId, ex.Message); + } + finally + { + Core.Instance.Loggers.Log(tradingOperationResult, LoggingLevel.Trading, Name); + ?(closePositionRequestParameters, tradingOperationResult); + } + return tradingOperationResult; + } + + internal TradingOperationResult ?(CancelOrderRequestParameters P_0) + { + TradingOperationResult tradingOperationResult = null; + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); + CancelOrderRequestParameters cancelOrderRequestParameters = new CancelOrderRequestParameters(P_0) + { + CancellationToken = cancellationTokenSource.Token + }; + try + { + if (!Connected) + { + long requestId = cancelOrderRequestParameters.RequestId; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(State); + tradingOperationResult = TradingOperationResult.CreateError(requestId, defaultInterpolatedStringHandler.ToStringAndClear()); + return tradingOperationResult; + } + AllowedResult allowedResult = TradingOperations.IsAllowed(TradingOperation.CancelOrder, new TradingOperationParameters + { + Order = cancelOrderRequestParameters.Order + }); + if (allowedResult.Status == TradingOperationStatus.NotAllowed) + { + tradingOperationResult = TradingOperationResult.CreateError(cancelOrderRequestParameters.RequestId, allowedResult.Reason); + return tradingOperationResult; + } + ?((RequestParameters)cancelOrderRequestParameters); + Core.Instance.Loggers.Log(cancelOrderRequestParameters, LoggingLevel.Trading, Name); + tradingOperationResult = ??.CancelOrder(cancelOrderRequestParameters); + return tradingOperationResult; + } + catch (Exception ex) + { + tradingOperationResult = TradingOperationResult.CreateError(P_0.RequestId, ex.Message); + return tradingOperationResult; + } + finally + { + Core.Instance.Loggers.Log(tradingOperationResult, LoggingLevel.Trading, Name); + ?(cancelOrderRequestParameters, tradingOperationResult); + } + } + + internal MarginInfo ?(OrderRequestParameters P_0) + { + MarginInfo result = null; + if (!Connected) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + return result; + } + try + { + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); + P_0.CancellationToken = cancellationTokenSource.Token; + result = ??.GetMarginInfo(P_0); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); + } + return result; + } + + internal Symbol ?(GetSymbolRequestParameters P_0, NonFixedListDownload P_1 = NonFixedListDownload.Download) + { + if (!Connected) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + return null; + } + return ?(P_0, P_1); + } + + internal Symbol ?(GetSymbolRequestParameters P_0, NonFixedListDownload P_1 = NonFixedListDownload.Download) + { + Symbol symbol = null; + if (string.IsNullOrEmpty(P_0.SymbolId)) + { + return symbol; + } + if (??.SymbolsCache.?(P_0.SymbolId, out symbol)) + { + return symbol; + } + if (!??.AllowNonFixedList || P_1 == NonFixedListDownload.IgnoreDownload) + { + return symbol; + } + ? ? = ??.GetSymbolRequestCache.?(P_0); + if (? != null && ?.Finished) + { + return ?.Result; + } + try + { + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); + GetSymbolRequestParameters getSymbolRequestParameters = new GetSymbolRequestParameters(P_0) + { + CancellationToken = cancellationTokenSource.Token + }; + MessageSymbol nonFixedSymbol = ??.GetNonFixedSymbol(getSymbolRequestParameters); + if (nonFixedSymbol == null) + { + return symbol; + } + ??.Push(nonFixedSymbol); + CancellationTokenSource cancellationTokenSource2 = new CancellationTokenSource(TimeSpan.FromSeconds(15.0)); + using CancellationTokenSource cancellationTokenSource3 = CancellationTokenSource.CreateLinkedTokenSource(getSymbolRequestParameters.CancellationToken, cancellationTokenSource2.Token); + while (!cancellationTokenSource3.IsCancellationRequested) + { + if (??.SymbolsCache.?(nonFixedSymbol.Id, out symbol)) + { + return symbol; + } + Thread.Sleep(100); + } + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.SymbolId, LoggingLevel.Verbose); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); + } + finally + { + if (!P_0.CancellationToken.IsCancellationRequested) + { + ??.GetSymbolRequestCache.?(P_0, symbol); + } + } + return symbol; + } + + internal IList ?(SearchSymbolsRequestParameters P_0) + { + List list = new List(); + if (!Connected) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + return null; + } + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); + SearchSymbolsRequestParameters searchSymbolsRequestParameters = new SearchSymbolsRequestParameters(P_0) + { + CancellationToken = cancellationTokenSource.Token + }; + searchSymbolsRequestParameters.SymbolTypes = searchSymbolsRequestParameters.SymbolTypes.Intersect(BusinessObjects.SymbolTypes).ToList(); + if (string.IsNullOrEmpty(searchSymbolsRequestParameters.FilterName) || !??.AllowNonFixedList) + { + return ?(searchSymbolsRequestParameters); + } + ?> ? = ??.SearchSymbolsRequestCache.?(searchSymbolsRequestParameters); + if (? != null && ?.Finished) + { + return new List(?.Result); + } + try + { + IList list2 = ??.SearchSymbols(new SearchSymbolsRequestParameters(searchSymbolsRequestParameters)); + if (list2 == null || list2.Count == 0) + { + return list; + } + foreach (MessageSymbolInfo item in list2) + { + if (item != null) + { + list.Add(??.?(item)); + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); + } + finally + { + if (!searchSymbolsRequestParameters.CancellationToken.IsCancellationRequested) + { + ??.SearchSymbolsRequestCache.?(searchSymbolsRequestParameters, new List(list)); + } + } + return list; + } + + internal IList ?(GetFutureContractsRequestParameters P_0) + { + IList list = new List(); + if (!Connected) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + return null; + } + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); + GetFutureContractsRequestParameters getFutureContractsRequestParameters = new GetFutureContractsRequestParameters(P_0) + { + CancellationToken = cancellationTokenSource.Token + }; + if (!??.AllowNonFixedList) + { + return ?(getFutureContractsRequestParameters, false); + } + ?> ? = ??.GetFutureContractsRequestCache.?(getFutureContractsRequestParameters); + if (? != null && ?.Finished) + { + return new List(?.Result); + } + try + { + IList futureContracts = ??.GetFutureContracts(new GetFutureContractsRequestParameters(getFutureContractsRequestParameters)); + if (futureContracts == null || futureContracts.Count == 0) + { + return list; + } + foreach (MessageSymbolInfo item in futureContracts) + { + if (item != null) + { + list.Add(??.?(item)); + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); + } + finally + { + if (!getFutureContractsRequestParameters.CancellationToken.IsCancellationRequested) + { + ??.GetFutureContractsRequestCache.?(getFutureContractsRequestParameters, new List(list)); + } + } + return list; + } + + internal IList ?(GetOptionSeriesRequestParameters P_0) + { + List list = new List(); + if (!Connected) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + return list; + } + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); + GetOptionSeriesRequestParameters getOptionSeriesRequestParameters = new GetOptionSeriesRequestParameters(P_0) + { + CancellationToken = cancellationTokenSource.Token + }; + if (!??.AllowNonFixedList) + { + return ?(getOptionSeriesRequestParameters); + } + ?> ? = ??.GetOptionSeriesRequestCache.?(getOptionSeriesRequestParameters); + if (? != null && ?.Finished) + { + return new List(?.Result); + } + try + { + IList optionSeries = ??.GetOptionSeries(new GetOptionSeriesRequestParameters(getOptionSeriesRequestParameters)); + if (optionSeries == null) + { + return list; + } + foreach (MessageOptionSerie item in optionSeries) + { + if (item != null) + { + list.Add(??.?(item)); + } + } + list = list.OrderBy((OptionSerie optionSerie) => optionSerie.ExpirationDate).ToList(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); + } + finally + { + if (!getOptionSeriesRequestParameters.CancellationToken.IsCancellationRequested) + { + ??.GetOptionSeriesRequestCache.?(getOptionSeriesRequestParameters, new List(list)); + } + } + return list; + } + + internal IList ?(GetStrikesRequestParameters P_0) + { + List list = new List(); + if (!Connected) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + return null; + } + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); + GetStrikesRequestParameters getStrikesRequestParameters = new GetStrikesRequestParameters(P_0) + { + CancellationToken = cancellationTokenSource.Token + }; + if (!??.AllowNonFixedList) + { + return ??.Symbols.Where((Symbol symbol) => symbol.OptionSerie != null && symbol.OptionSerie.Id == P_0.SerieId).ToList(); + } + ?> ? = ??.GetStrikesRequestCache.?(getStrikesRequestParameters); + if (? != null && ?.Finished) + { + return new List(?.Result); + } + try + { + IList strikes = ??.GetStrikes(new GetStrikesRequestParameters(getStrikesRequestParameters)); + if (strikes == null) + { + return list; + } + foreach (MessageSymbolInfo item in strikes) + { + if (item != null) + { + list.Add(??.?(item)); + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); + } + finally + { + if (!getStrikesRequestParameters.CancellationToken.IsCancellationRequested) + { + ??.GetStrikesRequestCache.?(getStrikesRequestParameters, new List(list)); + } + } + return list; + } + + private IList ?(SearchSymbolsRequestParameters P_0) + { + IEnumerable source = ??.Symbols; + IList ?? = P_0.ExchangeIds; + if (?? != null && ??.Any()) + { + source = source.Where((Symbol symbol) => ??.Contains(symbol.ExchangeId)); + } + IList ?? = P_0.SymbolTypes; + if (?? != null && ??.Any()) + { + source = source.Where((Symbol symbol) => ??.Contains(symbol.SymbolType)); + } + string filterName = P_0.FilterName; + if (string.IsNullOrEmpty(filterName)) + { + return source.ToList(); + } + string[] ?? = filterName.Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries); + return source.Where((Symbol symbol) => ?(??, symbol, P_0.GetSynonyms)).ToList(); + } + + private IList ?(GetFutureContractsRequestParameters P_0, bool P_1 = false) + { + List list = new List(); + ICollection collection; + if (!P_1) + { + ICollection symbols = ??.Symbols; + collection = symbols; + } + else + { + collection = ??.SymbolsInfoCache.Values; + } + foreach (Symbol item in collection) + { + if (item.SymbolType != SymbolType.Futures && item.SymbolType != SymbolType.Forward) + { + continue; + } + if (!string.IsNullOrEmpty(P_0.UnderlierId)) + { + if (item.Underlier != null && item.Underlier.Id == P_0.UnderlierId) + { + list.Add(item); + } + } + else if (item.Root == P_0.Root) + { + list.Add(item); + } + } + return list; + } + + private IList ?(GetOptionSeriesRequestParameters P_0) + { + if (??.OptionSeriesCache.?(P_0.UnderlierId, out var result)) + { + return result; + } + return new List(); + } + + private static bool ?(string[] P_0, Symbol P_1, Func P_2) + { + bool result = true; + foreach (string text in P_0) + { + bool num = P_1.Name.Contains(text, StringComparison.InvariantCultureIgnoreCase); + bool flag = !string.IsNullOrEmpty(P_1.Description) && P_1.Description.Contains(text, StringComparison.InvariantCultureIgnoreCase); + bool flag2 = text.Length > 2 && P_1.Name.Contains(text.Insert(3, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), StringComparison.InvariantCultureIgnoreCase); + bool flag3 = text.Length > 3 && text[3] == '/' && P_1.Name.Contains(text.Remove(3, 1), StringComparison.InvariantCultureIgnoreCase); + bool flag4 = false; + bool flag5 = false; + bool flag6 = false; + if (P_2 != null) + { + string text2 = P_2(text); + if (!string.IsNullOrEmpty(text2)) + { + flag4 = P_1.Name.Contains(text2, StringComparison.InvariantCultureIgnoreCase); + flag5 = text2.Length > 2 && P_1.Name.Contains(text2.Insert(3, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), StringComparison.InvariantCultureIgnoreCase); + flag6 = text2.Length > 3 && text2[3] == '/' && P_1.Name.Contains(text2.Remove(3, 1), StringComparison.InvariantCultureIgnoreCase); + } + } + if (!num && !flag && !flag2 && !flag3 && !flag4 && !flag5 && !flag6) + { + result = false; + break; + } + } + return result; + } + + internal Order ?(string P_0) + { + if (State != ConnectionState.Connected) + { + return null; + } + if (?? == null) + { + return null; + } + if (??.OrdersCache.?(P_0, out var result)) + { + return result; + } + return null; + } + + internal PnL ?(PnLRequestParameters P_0) + { + if (!Connected) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + return null; + } + try + { + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); + PnL pnL = ??.CalculatePnL(new PnLRequestParameters(P_0) + { + CancellationToken = cancellationTokenSource.Token + }); + if (pnL == null) + { + return pnL; + } + if (pnL.GrossPnL != null) + { + pnL.GrossPnL.ConnectionId = Id; + } + if (pnL.NetPnL != null) + { + pnL.NetPnL.ConnectionId = Id; + } + if (pnL.Fee != null) + { + pnL.Fee.ConnectionId = Id; + } + return pnL; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); + } + return null; + } + + internal Position ?(string P_0) + { + if (State != ConnectionState.Connected) + { + return null; + } + if (?? == null) + { + return null; + } + if (??.PositionsCache.?(P_0, out var result)) + { + return result; + } + return null; + } + + private IList ?(HistoryRequestParameters P_0) + { + IList list = new List(); + if (!Connected) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + return list; + } + try + { + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(20, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.Aggregation); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.FromTime); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.ToTime); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.LoadingHistory, Name); + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + list = ??.LoadHistory(new HistoryRequestParameters(P_0) + { + CancellationToken = cancellationTokenSource.Token + }); + stopwatch.Stop(); + bool flag = list != null; + LoggerManager loggers2 = Core.Instance.Loggers; + defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(54, 6); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.Aggregation); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.FromTime); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.ToTime); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(flag ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(list?.Count ?? 0); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(stopwatch.Elapsed.TotalSeconds, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers2.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.LoadingHistory, Name); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); + } + return list; + } + + [Obfuscation(Exclude = true)] + internal VolumeAnalysisInterval LoadVolumeAnalysis(VolumeAnalysisByPeriodRequestParameters requestParameters) + { + if (!Connected) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + return null; + } + try + { + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(requestParameters.CancellationToken, ??.Token); + VolumeAnalysisByPeriodRequestParameters volumeAnalysisByPeriodRequestParameters = new VolumeAnalysisByPeriodRequestParameters(requestParameters) + { + CancellationToken = cancellationTokenSource.Token + }; + VendorVolumeAnalysisByPeriodResponse vendorVolumeAnalysisByPeriodResponse = ??.LoadVolumeAnalysis(volumeAnalysisByPeriodRequestParameters); + if (vendorVolumeAnalysisByPeriodResponse == null) + { + return null; + } + return new VolumeAnalysisInterval + { + Interval = vendorVolumeAnalysisByPeriodResponse.ActualDataInterval, + Description = volumeAnalysisByPeriodRequestParameters.ToDescription(), + VolumeAnalysis = vendorVolumeAnalysisByPeriodResponse.Data + }; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); + } + return null; + } + + public IEnumerable GetNews(GetNewsRequestParameters requestParameters) + { + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(requestParameters.CancellationToken, ??.Token); + IEnumerable news = ??.GetNews(new GetNewsRequestParameters(requestParameters) + { + CancellationToken = cancellationTokenSource.Token + }); + if (news == null) + { + return Array.Empty(); + } + if (!news.Any()) + { + return Array.Empty(); + } + List list = new List(); + foreach (MessageNewsHeadline item in news) + { + if (item != null) + { + if (requestParameters.CancellationToken.IsCancellationRequested) + { + break; + } + NewsArticle newsArticle = new NewsArticle(Id); + newsArticle.?(item); + list.Add(newsArticle); + } + } + return list.ToArray(); + } + + public string GetNewsArticleContent(GetNewsArticleContentRequestParameters requestParameters) + { + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(requestParameters.CancellationToken, ??.Token); + return ??.GetNewsArticleContent(new GetNewsArticleContentRequestParameters(requestParameters) + { + CancellationToken = cancellationTokenSource.Token + }); + } + + public void SubscribeNewsUpdates(SubscribeNewsRequestParameters subscribeNewsRequestParameters, Action updateAction) + { + if (updateAction == null) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + int hashCode = updateAction.GetHashCode(); + if (!??.NewsSubscribersCache.TryGetValue(hashCode, out var value)) + { + value = new HashSet>(); + ??.NewsSubscribersCache[hashCode] = value; + } + int count = value.Count; + value.Add(updateAction); + if (value.Count > count) + { + using (CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(subscribeNewsRequestParameters.CancellationToken, ??.Token)) + { + subscribeNewsRequestParameters.SubscribeId = hashCode.ToString(); + subscribeNewsRequestParameters.CancellationToken = cancellationTokenSource.Token; + ??.SubscribeNewsUpdates(subscribeNewsRequestParameters); + } + } + } + + public void UnsubscribeNewsUpdates(SubscribeNewsRequestParameters subscribeNewsRequestParameters, Action updateAction) + { + if (updateAction == null) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + int hashCode = updateAction.GetHashCode(); + if (!??.NewsSubscribersCache.TryGetValue(hashCode, out var value)) + { + return; + } + int count = value.Count; + value.Remove(updateAction); + if (value.Count > count) + { + using (CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(subscribeNewsRequestParameters.CancellationToken, ??.Token)) + { + subscribeNewsRequestParameters.SubscribeId = hashCode.ToString(); + subscribeNewsRequestParameters.CancellationToken = cancellationTokenSource.Token; + ??.UnsubscribeNewsUpdates(subscribeNewsRequestParameters); + } + } + } + + [Obsolete("Use Core.Instance.GetTrades() instead")] + public IList GetTrades(TradesHistoryRequestParameters parameters) + { + parameters.Progress?.Report(0f); + if (parameters.To > Core.Instance.TimeUtils.DateTimeUtcNow) + { + parameters.To = Core.Instance.TimeUtils.DateTimeUtcNow; + } + if (parameters.ForceReload && !TradesHistoryMetadata.AllowReloadFromServer) + { + parameters.ForceReload = false; + } + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(parameters.CancellationToken, ??.Token); + CancellationToken token = cancellationTokenSource.Token; + List> list2; + IList list = ?(parameters, out list2); + foreach (Interval item in list2) + { + if (token.IsCancellationRequested) + { + break; + } + TradesHistoryRequestParameters tradesHistoryRequestParameters = new TradesHistoryRequestParameters + { + From = item.From, + To = item.To, + SymbolId = parameters.SymbolId, + ForceReload = parameters.ForceReload, + CancellationToken = token, + Progress = parameters.Progress + }; + IList list3 = null; + try + { + list3 = ??.GetTrades(tradesHistoryRequestParameters); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + if (token.IsCancellationRequested) + { + break; + } + if (list3 != null) + { + UserTradesInterval userTradesInterval = ?(tradesHistoryRequestParameters, list3); + list.Add(userTradesInterval); + if (string.IsNullOrEmpty(parameters.SymbolId) || !??.UsersTradesCacheMetadata.AllowSingleSymbolLoading) + { + ???.Save(userTradesInterval); + } + } + } + if (token.IsCancellationRequested) + { + return Array.Empty(); + } + MessageTrade[] array = (from P_0 in list.OrderBy((UserTradesInterval P_0) => P_0.Interval.From).SelectMany((UserTradesInterval P_0) => P_0.Trades) + where string.IsNullOrEmpty(parameters.SymbolId) || P_0.SymbolId == parameters.SymbolId + select P_0).ToArray(); + if (!array.Any()) + { + return Array.Empty(); + } + return ?(array, token); + } + + internal void ?(TradesHistoryRequestParameters P_0, AccountTradesLoadingCallback P_1) + { + if (P_0 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (P_1 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + P_0.Progress?.Report(0f); + if (P_0.To > Core.Instance.TimeUtils.DateTimeUtcNow) + { + P_0.To = Core.Instance.TimeUtils.DateTimeUtcNow; + } + CancellationTokenSource ?? = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); + CancellationToken ?? = ??.Token; + List> list; + IList source = ?(P_0, out list); + P_1.InvokeSafely(?(source.SelectMany((UserTradesInterval userTradesInterval) => userTradesInterval.Trades).ToList(), ??), !list.Any()); + foreach (Interval ?? in list) + { + if (??.IsCancellationRequested) + { + break; + } + TradesHistoryRequestParameters ?? = new TradesHistoryRequestParameters + { + From = ??.From, + To = ??.To, + SymbolId = P_0.SymbolId, + ForceReload = P_0.ForceReload, + CancellationToken = ??, + Progress = P_0.Progress + }; + List ?? = new List(); + ??.GetTrades(??, delegate(IList list2, bool flag) + { + try + { + if (!??.IsCancellationRequested) + { + if (list2 == null) + { + if (flag) + { + P_1.InvokeSafely(new List(), flag); + } + } + else + { + list2 = ?(??, list2).Trades.ToList(); + ??.AddRange(list2); + List list3 = ?(list2, ??).ToList(); + P_1.InvokeSafely(list3, flag); + if (flag && string.IsNullOrEmpty(P_0.SymbolId) && !??.UsersTradesCacheMetadata.AllowSingleSymbolLoading) + { + ???.Save(new UserTradesInterval + { + Interval = ??, + Trades = ?? + }); + } + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + if (flag) + { + ??.Dispose(); + } + } + }); + } + } + + private IList ?(TradesHistoryRequestParameters P_0, out List> P_1) + { + List list = new List(); + P_1 = new List>(); + if (!P_0.ForceReload && ?? != null) + { + IList collection = ??.Load(P_0.Interval, out P_1); + list.AddRange(collection); + } + else + { + P_1.Add(P_0.Interval); + } + if (!(?? == default(DateTime)) && !P_0.ForceReload) + { + UsersTradesStorage usersTradesStorage = ??; + if (usersTradesStorage != null && usersTradesStorage.IsRealtimeCollectingAllowed) + { + for (int i = 0; i < P_1.Count; i++) + { + Interval interval = P_1[i]; + if (!(interval.To <= ??)) + { + if (interval.From >= ??) + { + P_1.RemoveAt(i--); + } + else + { + P_1[i] = new Interval(interval.From, ??); + } + } + } + return list; + } + } + return list; + } + + private UserTradesInterval ?(TradesHistoryRequestParameters P_0, IList P_1) + { + List trades = P_1.Where((MessageTrade messageTrade) => P_0.Interval.Contains(messageTrade.DateTime)).ToList(); + return new UserTradesInterval + { + Trades = trades, + Interval = new Interval(P_0.From, P_0.To) + }; + } + + private Trade[] ?(IList P_0, CancellationToken P_1) + { + List list = new List(); + foreach (MessageTrade item in P_0) + { + if (item != null) + { + if (P_1.IsCancellationRequested) + { + break; + } + ?(new GetSymbolRequestParameters + { + SymbolId = item.SymbolId, + CancellationToken = P_1 + }); + Trade trade = new Trade(Id); + trade.?(item); + list.Add(trade); + } + } + return list.ToArray(); + } + + public IList GetOrdersHistory(OrdersHistoryRequestParameters parameters) + { + parameters.Progress?.Report(0f); + if (parameters.To > Core.Instance.TimeUtils.DateTimeUtcNow) + { + parameters.To = Core.Instance.TimeUtils.DateTimeUtcNow; + } + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(parameters.CancellationToken, ??.Token); + parameters.CancellationToken = cancellationTokenSource.Token; + IList list = null; + try + { + list = ??.GetOrdersHistory(parameters); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + if (parameters.CancellationToken.IsCancellationRequested) + { + return Array.Empty(); + } + if (list == null) + { + return Array.Empty(); + } + if (!list.Any()) + { + return Array.Empty(); + } + List list2 = new List(); + foreach (MessageOrderHistory item in list) + { + if (item != null) + { + if (parameters.CancellationToken.IsCancellationRequested) + { + break; + } + ?(new GetSymbolRequestParameters + { + SymbolId = item.SymbolId, + CancellationToken = parameters.CancellationToken + }); + OrderHistory orderHistory = new OrderHistory(Id); + orderHistory.?(item); + list2.Add(orderHistory); + } + } + return list2.ToArray(); + } + + internal Report ?(ReportRequestParameters P_0) + { + using CancellationTokenSource cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(P_0.CancellationToken, ??.Token); + ReportRequestParameters reportRequestParameters = new ReportRequestParameters(P_0) + { + CancellationToken = cancellationTokenSource.Token + }; + Report report = ??.GenerateReport(reportRequestParameters); + foreach (ReportRow row in report.Rows) + { + foreach (ReportCell cell in row.Cells) + { + if (cell.formattingDescription != null) + { + cell.formattingDescription.ConnectionId = Id; + } + } + } + return report; + } + + private void ?(object P_0, VendorEventArgs P_1) + { + ?(P_1.Message); + } + + private void ?(Message P_0) + { + if (P_0 != null) + { + ??.Push(P_0); + } + } + + private void ?(ConnectionState P_0) + { + try + { + ???.Invoke(this, new ConnectionStateChangedEventArgs(P_0, State, LastConnectionResult.Clone() as ConnectionResult)); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + private void ?(RequestParameters P_0) + { + RequestEventArgs e = new RequestEventArgs(P_0); + ???.InvokeSafely(this, e); + Core.Instance.?(this, e); + } + + private void ?(RequestParameters P_0, object P_1) + { + ???.InvokeSafely(this, new PerformedRequestEventArgs(P_0, P_1)); + Core.Instance.?(P_0, P_1); + } + + private void ?(string P_0) + { + try + { + int num = ??.Orders.Length; + int num2 = ??.Positions.Length; + if (num <= 0 && num2 <= 0) + { + return; + } + string value = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler; + if (num > 0) + { + defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(19, 2); + defaultInterpolatedStringHandler.AppendFormatted(num); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(string.Join(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (from order in ??.Orders + group order by order.Symbol into grouping + select grouping.Key).ToList())); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + value = defaultInterpolatedStringHandler.ToStringAndClear(); + } + string value2 = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + if (num2 > 0) + { + defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(15, 2); + defaultInterpolatedStringHandler.AppendFormatted(num2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(string.Join(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (from position in ??.Positions + group position by position.Symbol into grouping + select grouping.Key).ToList())); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + value2 = defaultInterpolatedStringHandler.ToStringAndClear(); + } + LoggerManager loggers = Core.Instance.Loggers; + defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(13, 4); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Trading); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + [EditorBrowsable(EditorBrowsableState.Never)] + [Obfuscation(Exclude = true)] + private void SubscribeOnMessage(Action handler) + { + if (?? != null) + { + ??.?(handler); + } + } + + public int CompareTo(object obj) + { + if (obj is Connection connection) + { + return string.Compare(Name, connection.Name, StringComparison.Ordinal); + } + return 0; + } + + public override string ToString() + { + return Name; + } + } + public delegate void AccountTradesLoadingCallback(IList trades, bool isFinished); +} +namespace ? +{ + internal class ? : BufferedProcessor, ?, IBusinessObjectsProvider + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + internal bool ?(AdditionalInfoItem P_0) + { + return P_0.FormattingDescription != null; + } + + internal IFormattingDescription ?(AdditionalInfoItem P_0) + { + return P_0.FormattingDescription; + } + + internal bool ?(AdditionalInfoItem P_0) + { + return P_0.FormattingDescription != null; + } + + internal IFormattingDescription ?(AdditionalInfoItem P_0) + { + return P_0.FormattingDescription; + } + } + + [CompilerGenerated] + private sealed class ? + { + public ? ??; + + public Message ??; + + public INeedSymbolToPocess ??; + + internal void ?() + { + Symbol symbol = Core.Instance.Connections[??.??].?(new GetSymbolRequestParameters + { + SymbolId = ??.SymbolId + }); + if (symbol == null || symbol.Id != ??.SymbolId) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(50, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(??.GetType()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(??.SymbolId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Error); + } + else + { + ??.Push(??); + } + } + } + + [CompilerGenerated] + private sealed class ? + { + public MessageOptionSerie ??; + + internal bool ?(OptionSerie P_0) + { + return P_0.Id == ??.Id; + } + } + + private readonly string ??; + + [CompilerGenerated] + private HistoryMetadata ??; + + [CompilerGenerated] + private VolumeAnalysisMetadata ??; + + [CompilerGenerated] + private IEnumerable ??; + + [CompilerGenerated] + private TradesHistoryMetadata ??; + + [CompilerGenerated] + private LimitationMetadata ??; + + internal readonly Dictionary ??; + + [CompilerGenerated] + private readonly Dictionary ??; + + [CompilerGenerated] + private readonly ? ??; + + [CompilerGenerated] + private readonly ? ??; + + [CompilerGenerated] + private readonly ? ??; + + [CompilerGenerated] + private readonly ? ??; + + [CompilerGenerated] + private readonly ? ??; + + [CompilerGenerated] + private readonly ? ??; + + [CompilerGenerated] + private readonly ? ??; + + [CompilerGenerated] + private readonly ? ??; + + [CompilerGenerated] + private ? ??; + + [CompilerGenerated] + private readonly ? ??; + + [CompilerGenerated] + private readonly ? ??; + + [CompilerGenerated] + private readonly ?> ??; + + [CompilerGenerated] + private readonly Dictionary ??; + + [CompilerGenerated] + private readonly ? ??; + + [CompilerGenerated] + private readonly ? ??; + + [CompilerGenerated] + private readonly ConcurrentDictionary>> ??; + + [CompilerGenerated] + private readonly ? ??; + + [CompilerGenerated] + private SymbolType[] ??; + + internal bool ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private readonly ? ??; + + [CompilerGenerated] + private readonly ?> ??; + + [CompilerGenerated] + private readonly ?> ??; + + [CompilerGenerated] + private readonly ?> ??; + + [CompilerGenerated] + private readonly ?> ??; + + internal HistoryMetadata HistoryMetadata + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = historyMetadata; + } + } + + internal VolumeAnalysisMetadata VolumeAnalysisMetadata + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = volumeAnalysisMetadata; + } + } + + internal IEnumerable NewsFeedSettings + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = enumerable; + } + } + + internal TradesHistoryMetadata UsersTradesCacheMetadata + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = tradesHistoryMetadata; + } + } + + internal LimitationMetadata LimitationMetadata + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = limitationMetadata; + } + } + + internal Dictionary SymbolGroupsCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ? AccountsCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ? SymbolsCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ? SymbolsInfoCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ? OrdersCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ? PositionsCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ? ClosedPositionsCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ? CorporateActionCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ? ReportTypeCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ? OrderTypesCache + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = ?2; + } + } + + internal ? ExchangesCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ? RulesCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ?> OptionSeriesCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal Dictionary TradingSessions + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ? DeliveredAssetsCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ? AccountOperationsCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ConcurrentDictionary>> NewsSubscribersCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ? TradingSignalsCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + public Symbol[] Symbols => SymbolsCache.?(); + + public SymbolType[] SymbolTypes + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = array; + } + } + + public Account[] Accounts => AccountsCache.?(); + + public Asset[] Assets => ??.Values.ToArray(); + + public Exchange[] Exchanges => ExchangesCache.Values.ToArray(); + + public Order[] Orders => OrdersCache.?(); + + public OrderType[] OrderTypes => OrderTypesCache.?(); + + public Position[] Positions => PositionsCache.?(); + + public ClosedPosition[] ClosedPositions => ClosedPositionsCache.?(); + + public CorporateAction[] CorporateActions => CorporateActionCache.?(); + + public ReportType[] ReportTypes => ReportTypeCache.?(); + + public DeliveredAsset[] DeliveredAssets => DeliveredAssetsCache.?(); + + public AccountOperation[] AccountOperations => AccountOperationsCache.?(); + + public TradingSignal[] TradingSignals => TradingSignalsCache.?(); + + int ?.PriorityIndex => 0; + + ? ?.Rules => RulesCache; + + internal ? GetSymbolRequestCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ?> SearchSymbolsRequestCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ?> GetFutureContractsRequestCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ?> GetOptionSeriesRequestCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ?> GetStrikesRequestCache + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ?(string P_0) + { + ?? = P_0; + ?? = new ?(); + ?? = new ?(); + ?? = new ?(); + ?? = new Dictionary(); + ?? = new ?(); + ?? = new ?(); + ?? = new ?(); + ?? = new ?(); + ?? = new ?(); + OrderTypesCache = new ?(); + ?? = new ?(); + ?? = new ?>(); + ?? = new Dictionary(); + SymbolTypes = new SymbolType[0]; + ?? = new ?(); + ?? = new Dictionary(); + ?? = new ?(); + ?? = new ?(); + ?? = new ConcurrentDictionary>>(); + ?? = new ?(); + ?? = new ?(); + ?? = new ?>(); + ?? = new ?>(); + ?? = new ?>(); + ?? = new ?>(); + } + + internal void ?() + { + Core.Instance.RulesManager.Defaults.ForEach(delegate(Rule P_0) + { + RulesCache.?(P_0.Name, P_0); + }); + Start(); + } + + protected internal override void Clear() + { + List list = new List(); + list.AddRange(AccountsCache); + AccountsCache.?(); + list.AddRange(SymbolsCache); + SymbolsCache.?(); + SymbolsInfoCache.?(); + SymbolTypes = new SymbolType[0]; + OrdersCache.?(); + PositionsCache.?(); + ClosedPositionsCache.?(); + CorporateActionCache.?(); + ReportTypeCache.?(); + ??.Clear(); + OrderTypesCache.?(); + ExchangesCache.?(); + RulesCache.?(); + AccountOperationsCache.?(); + TradingSignalsCache.?(); + GetSymbolRequestCache.Dispose(); + SearchSymbolsRequestCache.Dispose(); + GetFutureContractsRequestCache.Dispose(); + GetOptionSeriesRequestCache.Dispose(); + GetStrikesRequestCache.Dispose(); + foreach (BusinessObject item in list) + { + item.State = BusinessObjectState.Fake; + } + base.Clear(); + } + + [Obfuscation(Exclude = true)] + protected override void Process(Message message) + { + if (message == null) + { + return; + } + try + { + INeedSymbolToPocess ?? = message as INeedSymbolToPocess; + if (?? != null && !string.IsNullOrEmpty(??.SymbolId) && !SymbolsCache.?(??.SymbolId)) + { + Task.Factory.StartNew(delegate + { + Symbol symbol = Core.Instance.Connections[??].?(new GetSymbolRequestParameters + { + SymbolId = ??.SymbolId + }); + if (symbol == null || symbol.Id != ??.SymbolId) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(50, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(message.GetType()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(??.SymbolId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Error); + } + else + { + Push(message); + } + }); + return; + } + switch (message.Type) + { + case MessageType.Account: + case MessageType.CryptoAccount: + ?(message as MessageAccount); + break; + case MessageType.Symbol: + ?(message as MessageSymbol); + break; + case MessageType.SymbolInfo: + ?(message as MessageSymbolInfo); + break; + case MessageType.Quote: + case MessageType.Level2: + case MessageType.Last: + case MessageType.DayBar: + case MessageType.DOM: + case MessageType.Mark: + ?(message as MessageQuote); + break; + case MessageType.Asset: + ?(message as MessageAsset); + break; + case MessageType.CryptoAssetBalances: + ?(message as MessageCryptoAssetBalances); + break; + case MessageType.OpenOrder: + ?(message as MessageOpenOrder); + break; + case MessageType.CloseOrder: + ?(message as MessageCloseOrder); + break; + case MessageType.OpenPosition: + ?(message as MessageOpenPosition); + break; + case MessageType.ClosedPosition: + ?(message as MessageClosedPosition); + break; + case MessageType.ClosePosition: + ?(message as MessageClosePosition); + break; + case MessageType.Trade: + ?(message as MessageTrade); + break; + case MessageType.CorporateAction: + ?(message as MessageCorporateAction); + break; + case MessageType.ReportMetadata: + ?(message as MessageReportType); + break; + case MessageType.Exchange: + ?(message as MessageExchange); + break; + case MessageType.SymbolTypes: + ?(message as MessageSymbolTypes); + break; + case MessageType.OrderHistory: + ?(message as MessageOrderHistory); + break; + case MessageType.Rule: + ?(message as MessageRule); + break; + case MessageType.DealTicket: + ?(message as MessageDealTicket); + break; + case MessageType.SymbolGroup: + ?(message as MessageSymbolGroup); + break; + case MessageType.OptionSerie: + ?(message as MessageOptionSerie); + break; + case MessageType.Session: + ?(message as MessageSessionsContainer); + break; + case MessageType.OpenDeliveredAsset: + ?(message as MessageOpenDeliveredAsset); + break; + case MessageType.CloseDeliveredAsset: + ?(message as MessageCloseDeliveredAsset); + break; + case MessageType.AccountOperation: + ?(message as MessageAccountOperation); + break; + case MessageType.NewsHeadline: + ?(message as MessageNewsHeadline); + break; + case MessageType.TradingSignal: + ?(message as MessageTradingSignal); + break; + case MessageType.RemoveTradingSignal: + ?(message as MessageRemoveTradingSignal); + break; + case MessageType.Custom: + ?(message as CustomMessage); + break; + } + } + finally + { + ???.Invoke(message); + } + } + + private void ?(MessageSymbolGroup P_0) + { + if (P_0 != null) + { + if (!SymbolGroupsCache.TryGetValue(P_0.Id, out var value)) + { + value = new SymbolGroup(??); + value.?(P_0); + SymbolGroupsCache.Add(value.Id, value); + } + else + { + value.?(P_0); + } + } + } + + private void ?(MessageSymbolTypes P_0) + { + if (P_0 != null) + { + SymbolTypes = P_0.SymbolTypes?.ToArray() ?? new SymbolType[0]; + } + } + + private void ?(MessageExchange P_0) + { + if (P_0 != null) + { + if (!ExchangesCache.?(P_0.Id, out var exchange)) + { + exchange = new Exchange(??); + exchange.?(P_0); + ExchangesCache[exchange.Id] = exchange; + } + else + { + exchange.?(P_0); + } + } + } + + private void ?(MessageAsset P_0) + { + if (P_0 != null) + { + if (!??.TryGetValue(P_0.Id, out var value)) + { + value = new Asset(??); + value.?(P_0); + ??[value.Id] = value; + } + else + { + value.?(P_0); + } + } + } + + private void ?(MessageAccount P_0) + { + if (P_0 == null) + { + return; + } + IEnumerable enumerable = (from additionalInfoItem in P_0.AccountAdditionalInfo?.Where((AdditionalInfoItem additionalInfoItem) => additionalInfoItem.FormattingDescription != null) + select additionalInfoItem.FormattingDescription); + if (enumerable != null) + { + foreach (IFormattingDescription item in enumerable) + { + item.ConnectionId = ??; + } + } + if (!AccountsCache.?(P_0.AccountId, out var account)) + { + account = ((!(P_0 is MessageCryptoAccount)) ? new Account(??) : new CryptoAccount(??)); + account.?(P_0); + AccountsCache.?(account.Id, account); + Core.Instance.?(account); + } + else + { + account.?(P_0); + } + } + + private void ?(MessageSymbol P_0) + { + if (P_0 == null) + { + return; + } + IEnumerable enumerable = (from additionalInfoItem in P_0.SymbolAdditionalInfo?.Where((AdditionalInfoItem additionalInfoItem) => additionalInfoItem.FormattingDescription != null) + select additionalInfoItem.FormattingDescription); + if (enumerable != null) + { + foreach (IFormattingDescription item in enumerable) + { + item.ConnectionId = ??; + } + } + Symbol symbol = SymbolsCache[P_0.Id]; + if (symbol == null) + { + lock (SymbolsInfoCache) + { + if (SymbolsInfoCache.?(P_0.Id, out symbol)) + { + SymbolsInfoCache.?(P_0.Id); + } + else + { + symbol = new Symbol(??); + } + } + symbol.?(P_0); + SymbolsCache.?(symbol.Id, symbol); + Core.Instance.?(symbol); + } + else + { + symbol.?(P_0); + } + } + + internal Symbol ?(MessageSymbolInfo P_0) + { + if (P_0 == null) + { + return null; + } + if (SymbolsCache.?(P_0.Id, out var symbol)) + { + return symbol; + } + lock (SymbolsInfoCache) + { + symbol = SymbolsInfoCache[P_0.Id]; + } + if (symbol == null) + { + symbol = new Symbol(??); + symbol.?(P_0); + try + { + lock (SymbolsInfoCache) + { + SymbolsInfoCache.?(symbol.Id, symbol); + } + } + catch (ArgumentException ex) + { + Core.Instance.Loggers.Log(ex); + } + } + else + { + symbol.?(P_0); + } + return symbol; + } + + private void ?(MessageQuote P_0) + { + if (P_0 != null) + { + SymbolsCache[P_0.SymbolId]?.?(P_0); + SymbolsInfoCache[P_0.SymbolId]?.?(P_0); + } + } + + private void ?(MessageOpenOrder P_0) + { + if (P_0 == null) + { + return; + } + if (string.IsNullOrEmpty(P_0.AccountId)) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.PositionId, LoggingLevel.Error); + return; + } + if (string.IsNullOrEmpty(P_0.SymbolId)) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.PositionId, LoggingLevel.Error); + return; + } + if (!OrdersCache.?(P_0.OrderId, out var order)) + { + order = new Order(??); + order.?(P_0); + OrdersCache.?(order.Id, order); + } + else + { + order.?(P_0); + } + Core.Instance.?(order); + } + + private void ?(MessageCloseOrder P_0) + { + if (P_0 != null && OrdersCache.?(P_0.OrderId, out var order)) + { + OrdersCache.?(order.Id); + order.State = BusinessObjectState.Fake; + Core.Instance.?(order); + } + } + + private void ?(MessageOpenPosition P_0) + { + if (P_0 == null) + { + return; + } + if (string.IsNullOrEmpty(P_0.AccountId)) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.PositionId, LoggingLevel.Error); + return; + } + if (string.IsNullOrEmpty(P_0.SymbolId)) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.PositionId, LoggingLevel.Error); + return; + } + if (!PositionsCache.?(P_0.PositionId, out var position)) + { + position = new Position(??); + position.?(P_0); + PositionsCache.?(position.Id, position); + } + else + { + position.?(P_0); + } + Core.Instance.?(position); + } + + private void ?(MessageClosedPosition P_0) + { + if (P_0 == null) + { + return; + } + if (string.IsNullOrEmpty(P_0.AccountId)) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.PositionId, LoggingLevel.Error); + return; + } + if (string.IsNullOrEmpty(P_0.SymbolId)) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.PositionId, LoggingLevel.Error); + return; + } + if (!ClosedPositionsCache.?(P_0.PositionId, out var closedPosition)) + { + closedPosition = new ClosedPosition(??); + closedPosition.?(P_0); + ClosedPositionsCache.?(closedPosition.Id, closedPosition); + } + else + { + closedPosition.?(P_0); + } + Core.Instance.?(closedPosition); + } + + private void ?(MessageClosePosition P_0) + { + if (P_0 != null) + { + ClosedPosition closedPosition; + if (PositionsCache.?(P_0.PositionId, out var position)) + { + PositionsCache.?(position.Id); + position.State = BusinessObjectState.Fake; + Core.Instance.?(position); + } + else if (ClosedPositionsCache.?(P_0.PositionId, out closedPosition)) + { + ClosedPositionsCache.?(closedPosition.Id); + closedPosition.State = BusinessObjectState.Fake; + Core.Instance.?(closedPosition); + } + } + } + + private void ?(MessageTrade P_0) + { + if (P_0 != null) + { + Trade trade = new Trade(??); + trade.?(P_0); + Core.Instance.?(trade); + } + } + + private void ?(MessageCorporateAction P_0) + { + if (P_0 != null) + { + if (!CorporateActionCache.?(P_0.CorporateActionId, out var corporateAction)) + { + corporateAction = new CorporateAction(??); + corporateAction.?(P_0); + CorporateActionCache.?(corporateAction.Id, corporateAction); + Core.Instance.?(corporateAction); + } + else + { + corporateAction.?(P_0); + } + } + } + + private void ?(MessageReportType P_0) + { + if (P_0 != null) + { + ReportType reportType = new ReportType(??); + reportType.?(P_0); + ReportTypeCache.?(P_0.Id, reportType); + } + } + + private void ?(MessageOrderHistory P_0) + { + if (P_0 != null) + { + OrderHistory orderHistory = new OrderHistory(??); + orderHistory.?(P_0); + Core.Instance.?(orderHistory); + } + } + + private void ?(MessageRule P_0) + { + if (P_0 == null) + { + return; + } + ? ?2 = null; + if (P_0.OrderTypeId != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) + { + if (OrderTypesCache.?(P_0.OrderTypeId, out var orderType)) + { + ?2 = orderType; + } + } + else if (P_0.SymbolId != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) + { + if (SymbolsCache.?(P_0.SymbolId, out var symbol)) + { + ?2 = symbol; + } + else if (SymbolsInfoCache.?(P_0.SymbolId, out symbol)) + { + ?2 = symbol; + } + } + else if (P_0.AccountId != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) + { + if (AccountsCache.?(P_0.AccountId, out var account)) + { + ?2 = account; + } + } + else + { + ?2 = this; + } + if (?2 != null) + { + if (?2.Rules.?(P_0.Name, out var rule)) + { + rule.?(P_0); + } + else if (P_0 is LicenceMessageRule || !RulesManager.?.Contains(P_0.Name)) + { + rule = Rule.?(P_0); + ?2.Rules.?(rule.Name, rule); + } + } + } + + private void ?(MessageDealTicket P_0) + { + if (P_0 != null) + { + DealticketConnection dealticketConnection = new DealticketConnection(??, P_0); + Core.Instance.Loggers.Log(dealticketConnection, LoggingLevel.Trading, Core.Instance.Connections[((IConnectionBindedObject)dealticketConnection)?.ConnectionId]?.Name); + Core.Instance.?(dealticketConnection); + } + } + + private void ?(MessageCryptoAssetBalances P_0) + { + if (P_0 == null) + { + return; + } + Account account; + if (string.IsNullOrEmpty(P_0.AccountId)) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Error); + } + else if (string.IsNullOrEmpty(P_0.AssetId)) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Error); + } + else if (AccountsCache.?(P_0.AccountId, out account)) + { + if (account is CryptoAccount cryptoAccount) + { + cryptoAccount.?(P_0); + return; + } + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(32, 3); + defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.AccountId); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Error); + } + else + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.AccountId, LoggingLevel.Error); + } + } + + internal OptionSerie ?(MessageOptionSerie P_0) + { + if (P_0 == null) + { + return null; + } + if (!OptionSeriesCache.?(P_0.UnderlierId, out var list)) + { + OptionSeriesCache.?(P_0.UnderlierId, list = new List()); + } + OptionSerie optionSerie = list.FirstOrDefault((OptionSerie optionSerie2) => optionSerie2.Id == P_0.Id); + if (optionSerie == null) + { + optionSerie = new OptionSerie(??); + list.Add(optionSerie); + } + optionSerie.?(P_0); + return optionSerie; + } + + private void ?(MessageSessionsContainer P_0) + { + if (P_0 != null) + { + if (!TradingSessions.TryGetValue(P_0.Id, out var value)) + { + value = new SessionsContainer(??); + value.UpdateByMessage(P_0); + TradingSessions.Add(value.Id, value); + } + else + { + value.UpdateByMessage(P_0); + } + } + } + + private void ?(MessageOpenDeliveredAsset P_0) + { + if (P_0 == null) + { + return; + } + if (string.IsNullOrEmpty(P_0.AccountId)) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.Id, LoggingLevel.Error); + return; + } + if (string.IsNullOrEmpty(P_0.SymbolId)) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.Id, LoggingLevel.Error); + return; + } + if (!DeliveredAssetsCache.?(P_0.Id, out var deliveredAsset)) + { + deliveredAsset = new DeliveredAsset(??); + deliveredAsset.?(P_0); + DeliveredAssetsCache.?(deliveredAsset.Id, deliveredAsset); + } + else + { + deliveredAsset.?(P_0); + } + Core.Instance.?(deliveredAsset); + } + + private void ?(MessageCloseDeliveredAsset P_0) + { + if (P_0 != null && DeliveredAssetsCache.?(P_0.Id, out var deliveredAsset)) + { + DeliveredAssetsCache.?(deliveredAsset.Id); + Core.Instance.?(deliveredAsset); + } + } + + private void ?(MessageAccountOperation P_0) + { + if (P_0 != null) + { + if (!AccountOperationsCache.?(P_0.Name, out var accountOperation)) + { + AccountOperationsCache.?(P_0.Name, accountOperation = new AccountOperation(??)); + } + accountOperation.?(P_0); + } + } + + private void ?(MessageNewsHeadline P_0) + { + if (P_0 == null || string.IsNullOrEmpty(P_0.SubscribeId) || !int.TryParse(P_0.SubscribeId, out var result) || !NewsSubscribersCache.TryGetValue(result, out var value)) + { + return; + } + foreach (Action item in value) + { + NewsArticle newsArticle = new NewsArticle(??); + newsArticle.?(P_0); + item(newsArticle); + } + } + + private void ?(MessageTradingSignal P_0) + { + if (P_0 != null) + { + if (!TradingSignalsCache.?(P_0.Id, out var tradingSignal)) + { + tradingSignal = new TradingSignal(??); + tradingSignal.?(P_0); + TradingSignalsCache.?(tradingSignal.Id, tradingSignal); + Core.Instance.?(tradingSignal, EntityLifecycle.Created); + } + else + { + tradingSignal.?(P_0); + Core.Instance.?(tradingSignal, EntityLifecycle.Changed); + } + } + } + + private void ?(MessageRemoveTradingSignal P_0) + { + if (P_0 != null && TradingSignalsCache.?(P_0.TradingSignalId, out var tradingSignal)) + { + Core.Instance.?(tradingSignal, EntityLifecycle.Removed); + } + } + + private void ?(CustomMessage P_0) + { + if (P_0 != null) + { + P_0.ConnectionId = ??; + Core.Instance.CustomMessageProcessor.?(P_0); + } + } + + [SpecialName] + [CompilerGenerated] + internal void ?(Action P_0) + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value = (Action)Delegate.Combine(action2, P_0); + action = Interlocked.CompareExchange(ref ??, value, action2); + } + while ((object)action != action2); + } + + [SpecialName] + [CompilerGenerated] + internal void ?(Action P_0) + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value = (Action)Delegate.Remove(action2, P_0); + action = Interlocked.CompareExchange(ref ??, value, action2); + } + while ((object)action != action2); + } + + [CompilerGenerated] + private void ?(Rule P_0) + { + RulesCache.?(P_0.Name, P_0); + } + } + internal sealed class ? : ? + { + internal ?(string P_0) + : base(P_0) + { + } + + public override void Push(Message subject) + { + Process(subject); + } + } +} +namespace TradingPlatform.BusinessLayer +{ + public class ConnectionConnectingProgressChangedEventArgs + { + [CompilerGenerated] + private string ?; + + public string Progress + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = text; + } + } + + internal ConnectionConnectingProgressChangedEventArgs(string P_0) + { + Progress = P_0; + } + } + public class ConnectionDependency + { + [CompilerGenerated] + private ConnectionDependencyBehavior ?; + + private string[] ?; + + public static ConnectionDependency NoDependency => new ConnectionDependency + { + Behavior = ConnectionDependencyBehavior.NoDependency + }; + + public static ConnectionDependency TotalDependency => new ConnectionDependency + { + Behavior = ConnectionDependencyBehavior.TotalDependency + }; + + public ConnectionDependencyBehavior Behavior + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + public string[] DependentConnectionsIds + { + get + { + return ?; + } + set + { + ? = value ?? new string[0]; + } + } + } + /// + /// Server connection status + /// + public enum ConnectionState + { + Connected, + Connecting, + Disconnected, + Disconnecting, + ConnectionLost, + Fail + } + /// + /// Specifies connection using type. + /// + public enum ConnectionType + { + General, + TradingSimulator, + HistoryPlayer, + Backtester, + Technical + } + /// + /// Specifies how connection was created: by default or by user + /// + public enum ConnectionCreationType + { + Default, + Custom, + Technical + } + public enum ConnectionDependencyBehavior + { + NoDependency, + PartialDependency, + TotalDependency + } + public enum ConnectionStateObserverPriority + { + Low = 10, + Normal = 20, + High = 30 + } + /// + /// Represents all needed parameters for the connection constructing process. + /// + [Published] + public sealed class ConnectionInfo : ICustomizable, IRenamable, IComparable, IComparable + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal SettingItem ?(SettingItem P_0) + { + return P_0.GetCopy(); + } + } + + internal const string ?? = "ConnectionId"; + + private const string ?? = "Name"; + + internal const string ?? = "Group"; + + private const string ?? = "VendorName"; + + private const string ?? = "IsFavourite"; + + private const string ?? = "ConnectionState"; + + private const string ?? = "CreationType"; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private ConnectionState ??; + + [CompilerGenerated] + private IList ??; + + [CompilerGenerated] + private IList ??; + + [CompilerGenerated] + private ConnectionCreationType ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private List ??; + + [CompilerGenerated] + private string ??; + + private VendorInfo ??; + + [CompilerGenerated] + private bool ??; + + /// + /// Gets a user friendly name of the connection + /// + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + /// + /// Gets connection group + /// + public string Group + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Gets vendor's name + /// + public string VendorName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Gets connection Id + /// + public string ConnectionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + /// + /// Favorites one will be displayed in Control center toolbar + /// + public bool IsFavourite + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets ConnectionState + /// + public ConnectionState ConnectionState + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = connectionState; + } + } + + /// + /// Gets vendor's settings + /// + public IList VendorSettings + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = list; + } + } + + internal IList ConnectionSettings + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = list; + } + } + + /// + /// Specifies how connection was created: by default or by user + /// + public ConnectionCreationType CreationType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = connectionCreationType; + } + } + + public string ConnectionLogoPath + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + public bool AllowCreateCustomConnections + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = flag; + } + } + + public List Links + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = list; + } + } + + public string Copyrights + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + public VendorInfo VendorInfo + { + get + { + return ??; + } + internal set + { + if (vendorInfo == null) + { + return; + } + ?? = vendorInfo; + List list = new List(??.ConnectionParameters); + if (ConnectionSettings != null) + { + list.MergeWith(ConnectionSettings.Select((SettingItem P_0) => P_0.GetCopy()).ToList()); + } + VendorSettings = list; + } + } + + /// + /// realization + /// + public IList Settings + { + get + { + int value = (int)((ConnectionState != ConnectionState.Connecting) ? ((ConnectionState == ConnectionState.Disconnecting) ? ConnectionState.Disconnected : ((ConnectionState != ConnectionState.ConnectionLost) ? ConnectionState : ConnectionState.Connected)) : ConnectionState.Connected); + List list = new List + { + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ConnectionId) + { + VisibilityMode = VisibilityMode.Hidden + }, + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name) + { + Text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }, + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Group) + { + VisibilityMode = VisibilityMode.Hidden + }, + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), VendorName) + { + VisibilityMode = VisibilityMode.Hidden + }, + new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsFavourite) + { + VisibilityMode = VisibilityMode.Hidden + }, + new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value) + { + VisibilityMode = VisibilityMode.Hidden + }, + new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)CreationType) + { + VisibilityMode = VisibilityMode.Hidden + } + }; + if (VendorSettings != null) + { + for (int i = 0; i < VendorSettings.Count; i++) + { + list.Add(VendorSettings[i].GetCopy()); + } + } + return list; + } + set + { + if (value == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + foreach (SettingItem item in value) + { + try + { + string name = item.Name; + if (name != null) + { + switch (name.Length) + { + case 12: + switch (name[1]) + { + case 'o': + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + ConnectionId = item.Value as string; + goto end_IL_0021; + case 'r': + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + CreationType = (ConnectionCreationType)(int)item.Value; + goto end_IL_0021; + } + break; + case 4: + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + Name = item.Value as string; + goto end_IL_0021; + case 10: + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + VendorName = item.Value as string; + ?(); + goto end_IL_0021; + case 5: + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + Group = item.Value as string; + goto end_IL_0021; + case 11: + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + IsFavourite = (bool)item.Value; + goto end_IL_0021; + case 15: + { + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + ConnectionState connectionState = (ConnectionState)(int)item.Value; + if (connectionState == ConnectionState.Disconnecting) + { + connectionState = ConnectionState.Disconnected; + } + ConnectionState = connectionState; + goto end_IL_0021; + } + } + } + VendorSettings?.UpdateItemValue(item.Name, item.Value); + end_IL_0021:; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + if (string.IsNullOrEmpty(ConnectionLogoPath) && CreationType == ConnectionCreationType.Custom) + { + ?(); + } + } + } + + public bool SyncMsgProcessing + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + string IRenamable.Name + { + get + { + return Name; + } + set + { + Core.Instance.Connections.RenameConnectionInfo(this, newName); + } + } + + /// + /// Creates connection info instance + /// + /// + internal ConnectionInfo(string P_0) + { + Name = P_0; + ConnectionState = ConnectionState.Disconnected; + ConnectionId = string.Empty; + } + + internal ConnectionInfo(string P_0, string P_1) + : this(P_0, P_1, P_1, ConnectionCreationType.Custom) + { + } + + /// + /// Creates connection info instance. + /// + /// + /// + /// + /// + internal ConnectionInfo(string P_0, string P_1, string P_2, ConnectionCreationType P_3 = ConnectionCreationType.Default) + : this(P_0) + { + Group = P_1 ?? P_2; + VendorName = P_2; + CreationType = P_3; + ConnectionId = ?(); + if (CreationType == ConnectionCreationType.Custom) + { + ?(); + ?(); + } + else if (CreationType == ConnectionCreationType.Technical) + { + ?(); + } + } + + private string ?() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 4); + defaultInterpolatedStringHandler.AppendFormatted(VendorName); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Group); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(CreationType); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted((CreationType == ConnectionCreationType.Default) ? Name : Guid.NewGuid().ToShortString()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + private void ?() + { + ConnectionInfo connectionInfo = Core.Instance.Connections.ConnectionsInfo.FirstOrDefault((ConnectionInfo P_0) => P_0.CreationType == ConnectionCreationType.Default && P_0.Group == Group); + if (connectionInfo != null) + { + ConnectionLogoPath = connectionInfo.ConnectionLogoPath; + } + } + + private void ?() + { + if (VendorInfo == null) + { + VendorInfo vendorInfo = Core.Instance.Vendors.Vendors.FirstOrDefault((VendorInfo P_0) => P_0.MetaData.VendorName == VendorName); + ConnectionInfo connectionInfo = vendorInfo?.DefaultConnections.FirstOrDefault((ConnectionInfo P_0) => P_0.Group == Group); + if (connectionInfo != null) + { + ConnectionSettings = connectionInfo.ConnectionSettings; + } + VendorInfo = vendorInfo; + } + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(26, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(VendorName); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(IsFavourite); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public override bool Equals(object obj) + { + if (obj is ConnectionInfo connectionInfo) + { + return ConnectionId == connectionInfo.ConnectionId; + } + return false; + } + + public override int GetHashCode() + { + return -463474436 + EqualityComparer.Default.GetHashCode(ConnectionId); + } + + private bool ?(string P_0, ref string P_1) + { + return true; + } + + bool IRenamable.IsNameAllowed(string P_0, ref string P_1) + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(P_0, ref P_1); + } + + public int CompareTo(object obj) + { + return CompareTo(obj as ConnectionInfo); + } + + public int CompareTo(ConnectionInfo other) + { + if (this == other) + { + return 0; + } + if (other == null) + { + return 1; + } + return string.Compare(ConnectionId, other.ConnectionId, StringComparison.Ordinal); + } + + [CompilerGenerated] + private bool ?(ConnectionInfo P_0) + { + if (P_0.CreationType == ConnectionCreationType.Default) + { + return P_0.Group == Group; + } + return false; + } + + [CompilerGenerated] + private bool ?(VendorInfo P_0) + { + return P_0.MetaData.VendorName == VendorName; + } + + [CompilerGenerated] + private bool ?(ConnectionInfo P_0) + { + return P_0.Group == Group; + } + } + public sealed class ConnectionInfoLink + { + [CompilerGenerated] + private string ?; + + [CompilerGenerated] + private string ?; + + public string Text + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + public string URL + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + } + public sealed class ConnectionsManager : ICustomizable, IDisposable + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func> ??; + + public static Func ??; + + internal bool ?(Connection P_0) + { + return P_0.Connected; + } + + internal IEnumerable ?(VendorInfo P_0) + { + return P_0.DefaultConnections; + } + + internal bool ?(ConnectionInfo P_0) + { + return P_0.AllowCreateCustomConnections; + } + } + + [CompilerGenerated] + private sealed class ? + { + public string ??; + + public string ??; + + internal bool ?(ConnectionInfo P_0) + { + if (P_0.CreationType == ConnectionCreationType.Default && P_0.VendorName == ??) + { + return P_0.Group == ??; + } + return false; + } + } + + [CompilerGenerated] + private sealed class ? + { + public ConnectionInfo ??; + + internal bool ?(ConnectionInfo P_0) + { + if (P_0.CreationType == ConnectionCreationType.Default && P_0.VendorName == ??.VendorName) + { + return P_0.Group == ??.Group; + } + return false; + } + } + + [CompilerGenerated] + private sealed class ? + { + public ? ??; + + public ConnectionsManager ??; + + internal void ?() + { + ??.?(??.Connection); + } + + internal Task ?(Task t) + { + return ??.CurrentTask = null; + } + } + + private const int ?? = 10000; + + private readonly ? ??; + + private readonly object ??; + + private readonly ? ??; + + private Timer ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private EventHandler ??; + + [CompilerGenerated] + private EventHandler ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + private bool ??; + + private readonly List ??; + + private readonly object ??; + + private readonly Dictionary ??; + + private int ??; + + internal static readonly ? ?? = new ?(); + + public Connection[] All => ??.Values.ToArray(); + + public Connection[] Connected => (from P_0 in ??.Values.ToList() + where P_0.Connected + select P_0).ToArray(); + + public ConnectionInfo[] ConnectionsInfo => ??.Values.ToArray(); + + public Connection this[string id] + { + get + { + if (string.IsNullOrEmpty(id)) + { + return null; + } + return ??[id]; + } + } + + public IList Settings + { + get + { + List list = new List(); + ConnectionInfo[] connectionsInfo = Core.Instance.Connections.ConnectionsInfo; + foreach (ConnectionInfo connectionInfo in connectionsInfo) + { + try + { + list.Add(new SettingItemGroup(connectionInfo.Name, connectionInfo.Settings)); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, connectionInfo.Name); + } + } + return list; + } + set + { + foreach (SettingItem item in value) + { + ??.?(item); + ConnectionInfo connectionInfo = new ConnectionInfo(item.Name) + { + Settings = (item.Value as IList) + }; + if (connectionInfo.VendorInfo != null) + { + AddConnectionInfo(connectionInfo); + } + } + } + } + + public event Action ConnectionAdded + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public event Action ConnectionRemoved + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public event EventHandler ConnectionStateChanged + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + public event EventHandler ConnectionConnectingProgressChanged + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + public event Action PingUpdated + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public event Action ConnectionInfoAdded + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public event Action ConnectionInfoRemoved + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public event Action ConnectionInfoRenamed + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public ConnectionsManager() + { + ?? = ?.?(); + ?? = new ?(); + ?? = new Dictionary(); + ?? = new object(); + ?? = new List(); + ?? = new object(); + } + + internal ConnectionsManager(List P_0) + : this() + { + foreach (Connection item in P_0) + { + ??.?(item.Id, item); + } + } + + public void Initialize() + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + foreach (ConnectionInfo item in Core.Instance.Vendors.Vendors.SelectMany((VendorInfo P_0) => P_0.DefaultConnections)) + { + ??[item.ConnectionId] = item; + } + ?(); + Core.Instance.?(?); + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + } + + public Connection CreateConnection(ConnectionInfo info) + { + lock (??) + { + if (??.?(info.ConnectionId, out var result)) + { + return result; + } + result = new Connection(info); + ??.?(result.Id, result); + ?(result); + return result; + } + } + + public void RemoveConnection(Connection connection) + { + if (connection == null) + { + return; + } + lock (??) + { + ??.Remove(connection.Id); + if (??.?(connection.Id)) + { + connection.Disconnect(); + ??.?(connection.Id); + ?(connection); + } + } + } + + public ConnectionInfo CreateCustomConnectionInfo(string name, string vendorName, string group = null) + { + if (name == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (vendorName == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (group == null) + { + group = vendorName; + } + List list = ConnectionsInfo.Where((ConnectionInfo P_0) => P_0.CreationType == ConnectionCreationType.Default && P_0.VendorName == vendorName && P_0.Group == group).ToList(); + if (list.Count == 0) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + vendorName + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + group); + } + if (!list.Any((ConnectionInfo P_0) => P_0.AllowCreateCustomConnections)) + { + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + vendorName + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + group); + } + return new ConnectionInfo(name, group, vendorName, ConnectionCreationType.Custom) + { + Links = list[0].Links + }; + } + + public ConnectionInfo CreateTechnicalConnectionInfo(string name, string vendorName, string id = null) + { + if (name == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (vendorName == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ConnectionInfo connectionInfo = new ConnectionInfo(name, vendorName, vendorName, ConnectionCreationType.Technical); + if (!string.IsNullOrEmpty(id)) + { + connectionInfo.ConnectionId = id; + } + return connectionInfo; + } + + public void AddConnectionInfo(ConnectionInfo connectionInfo) + { + if (connectionInfo == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (connectionInfo.CreationType == ConnectionCreationType.Technical) + { + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (??.?(connectionInfo.ConnectionId, out var connectionInfo2)) + { + connectionInfo2.Settings = connectionInfo.Settings; + return; + } + ??[connectionInfo.ConnectionId] = connectionInfo; + List list = ConnectionsInfo.Where((ConnectionInfo P_0) => P_0.CreationType == ConnectionCreationType.Default && P_0.VendorName == connectionInfo.VendorName && P_0.Group == connectionInfo.Group).ToList(); + if (list.Count > 0) + { + connectionInfo.Links = list[0].Links; + connectionInfo.Copyrights = list[0].Copyrights; + } + ??.InvokeSafely(connectionInfo); + } + + public void RemoveConnectionInfo(ConnectionInfo connectionInfo) + { + if (connectionInfo == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (??.?(connectionInfo.ConnectionId)) + { + ??.?(connectionInfo.ConnectionId); + if (??.?(connectionInfo.ConnectionId, out var connection)) + { + RemoveConnection(connection); + } + ??.InvokeSafely(connectionInfo); + } + } + + public void RenameConnectionInfo(ConnectionInfo connectionInfo, string newName) + { + if (connectionInfo == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (string.IsNullOrEmpty(newName)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (!(connectionInfo.Name == newName)) + { + connectionInfo.Name = newName; + ??.InvokeSafely(connectionInfo); + } + } + + private void ?(Connection P_0) + { + P_0.StateChanged += ?; + P_0.ConnectingProgressChanged += ?; + ??.InvokeSafely(P_0); + } + + private void ?(Connection P_0) + { + P_0.StateChanged -= ?; + P_0.ConnectingProgressChanged -= ?; + ??.InvokeSafely(P_0); + } + + private void ?(object P_0, ConnectionStateChangedEventArgs P_1) + { + if (!(P_0 is Connection connection)) + { + return; + } + lock (??) + { + if (P_1.NewState == ConnectionState.ConnectionLost && !??.ContainsKey(connection.Id)) + { + ??.Add(connection.Id, new ?(connection)); + } + } + List list = null; + lock (??) + { + list = new List(??); + } + foreach (ConnectionStateObserver item in list) + { + item.?(P_0, P_1); + } + ??.InvokeSafely(P_0, P_1); + } + + private void ?(object P_0, ConnectionConnectingProgressChangedEventArgs P_1) + { + if (P_0 is Connection) + { + ???.Invoke(P_0, P_1); + } + } + + public void Dispose() + { + ?(); + if (?? != null) + { + List list = new List(??.Values); + foreach (Connection item in list) + { + item.Disconnect(); + } + ??.?(); + list.Clear(); + } + Core.Instance.?(?); + } + + internal void ?(ConnectionStateObserver P_0) + { + lock (??) + { + ??.Add(P_0); + ??.Sort(); + } + } + + internal void ?(ConnectionStateObserver P_0) + { + lock (??) + { + ??.Remove(P_0); + } + } + + private void ?() + { + try + { + if (?? == null) + { + ?? = new Timer(?); + ??.Change(0, 10000); + } + } + catch + { + } + } + + private void ?() + { + try + { + if (?? != null) + { + ??.Change(-1, -1); + ??.Dispose(); + ?? = null; + } + } + catch (Exception) + { + } + } + + private void ?(object P_0) + { + if (??) + { + return; + } + try + { + ?? = true; + Connection[] all = All; + for (int i = 0; i < all.Length; i++) + { + all[i].?(); + } + ???.Invoke(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + ?? = false; + } + } + + private void ?() + { + if (?? < 10) + { + ??++; + return; + } + List list = new List(); + lock (??) + { + list.AddRange(??.Values); + } + foreach (? ?? in list) + { + if (??.CurrentTask != null || ??.Connection.State == ConnectionState.Connecting) + { + continue; + } + ??.ReconnectDelay -= 1.0; + if (??.ReconnectDelay <= 0.0) + { + ??.CurrentTask = Task.Run(delegate + { + ?(??.Connection); + }).ContinueWith((Task t) => ??.CurrentTask = null); + } + } + ?? = 0; + } + + private void ?(Connection P_0) + { + ? value; + lock (??) + { + if (!??.TryGetValue(P_0.Id, out value)) + { + return; + } + } + value.ReconnectAttempts++; + ConnectionResult connectionResult = P_0.Connect(); + if (P_0.State == ConnectionState.Connected || connectionResult.Cancelled) + { + lock (??) + { + ??.Remove(P_0.Id); + return; + } + } + if (connectionResult.State == ConnectionState.Fail) + { + value.ReconnectDelay = 5.0; + } + } + } + public class ConnectionStateChangedEventArgs : EventArgs + { + [CompilerGenerated] + private ConnectionState ?; + + [CompilerGenerated] + private ConnectionState ?; + + [CompilerGenerated] + private ConnectionResult ?; + + public ConnectionState PreviousState + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = connectionState; + } + } + + public ConnectionState NewState + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = connectionState; + } + } + + public ConnectionResult LastConnectionResult + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = connectionResult; + } + } + + internal ConnectionStateChangedEventArgs(ConnectionState P_0, ConnectionState P_1, ConnectionResult P_2) + { + PreviousState = P_0; + NewState = P_1; + LastConnectionResult = P_2; + } + } + public sealed class ConnectionStateObserver : IDisposable, IComparable + { + private IConnectionStateDependent ?; + + private readonly ConnectionStateObserverPriority ?; + + private readonly ConnectionState[] ?; + + public ConnectionStateObserver(IConnectionStateDependent dependencyObject, ConnectionStateObserverPriority priority = ConnectionStateObserverPriority.Normal, params ConnectionState[] monitoringStates) + { + ? = dependencyObject; + ? = priority; + ? = monitoringStates; + Core.Instance.Connections.?(this); + } + + internal void ?(object P_0, ConnectionStateChangedEventArgs P_1) + { + if (!?.Contains(P_1.NewState) || !(P_0 is Connection connection)) + { + return; + } + try + { + ConnectionDependency connectionDependency = ??.GetConnectionStateDependency(); + if ((connectionDependency == null || connectionDependency.Behavior != ConnectionDependencyBehavior.NoDependency) && ((connectionDependency != null && connectionDependency.Behavior == ConnectionDependencyBehavior.TotalDependency) || connectionDependency?.DependentConnectionsIds?.Contains(connection.Id) == true)) + { + ??.OnConnectionStateChanged(connection, P_1); + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + public void Dispose() + { + Core.Instance.Connections.?(this); + ? = null; + } + + public int CompareTo(ConnectionStateObserver other) + { + return -1 * ?.CompareTo(other.?); + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(4, 2); + defaultInterpolatedStringHandler.AppendFormatted(?); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + defaultInterpolatedStringHandler.AppendFormatted(?); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } +} +namespace ? +{ + internal class ? + { + [CompilerGenerated] + private int ?; + + [CompilerGenerated] + private double ?; + + [CompilerGenerated] + private Connection ?; + + [CompilerGenerated] + private Task ?; + + public int ReconnectAttempts + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = num; + } + } + + public double ReconnectDelay + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = num; + } + } + + public Connection Connection + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = connection; + } + } + + public Task CurrentTask + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = task; + } + } + + public ?(Connection P_0) + { + Connection = P_0; + } + } + internal class ? : IDisposable where ? : CachedRequestParameters + { + [CompilerGenerated] + private Dictionary> ?; + + private Dictionary> RequestsCache + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = dictionary; + } + } + + public ?() + { + RequestsCache = new Dictionary>(); + } + + public ? ?(? P_0) + { + int cacheKey = P_0.GetCacheKey(); + ? value; + lock (RequestsCache) + { + if (!RequestsCache.TryGetValue(cacheKey, out value)) + { + value = new ?(); + RequestsCache[cacheKey] = value; + } + else if (value.Finished) + { + return value; + } + } + Monitor.Enter(value); + if (value.Finished) + { + Monitor.Exit(value); + } + return value; + } + + public void ?(? P_0, ? P_1) + { + int cacheKey = P_0.GetCacheKey(); + ? value; + bool finished; + lock (RequestsCache) + { + if (!RequestsCache.TryGetValue(cacheKey, out value)) + { + value = (RequestsCache[cacheKey] = new ?(P_1)); + return; + } + finished = value.Finished; + value.Result = P_1; + value.Finished = true; + } + if (!finished) + { + try + { + Monitor.Exit(value); + } + catch + { + } + } + } + + public void Dispose() + { + RequestsCache.Clear(); + } + } + internal class ? + { + [CompilerGenerated] + private bool ?; + + [CompilerGenerated] + private ? ?; + + public bool Finished + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = flag; + } + } + + public ? Result + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = val; + } + } + + internal ?() + { + Result = default(?); + } + + internal ?(? P_0) + { + Result = P_0; + Finished = true; + } + } +} +namespace TradingPlatform.BusinessLayer +{ + /// + /// The main entry point in the API. Core keeps access to all business logic entities and their properties: + /// connections, accounts, symbols, positions, orders, etc. Some of them can be reached through using managers or directly via specified collections. + /// You can always access the Core object via static Core.Instance property. + /// + [Published] + public class Core : IDisposable, IBusinessObjectsProvider + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func> ??; + + public static Func> ??; + + public static Func> ??; + + public static Func> ??; + + public static Func> ??; + + public static Func> ??; + + public static Func> ??; + + public static Func> ??; + + public static Func> ??; + + public static Func> ??; + + public static Func> ??; + + public static Func> ??; + + public static Func> ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func> ??; + + public static Func ??; + + public static Func ??; + + internal IEnumerable ?(Connection P_0) + { + return P_0.BusinessObjects.Symbols; + } + + internal IEnumerable ?(Connection P_0) + { + return P_0.BusinessObjects.SymbolTypes; + } + + internal IEnumerable ?(Connection P_0) + { + return P_0.BusinessObjects.Accounts; + } + + internal IEnumerable ?(Connection P_0) + { + return P_0.BusinessObjects.Assets; + } + + internal IEnumerable ?(Connection P_0) + { + return P_0.BusinessObjects.Exchanges; + } + + internal IEnumerable ?(Connection P_0) + { + return P_0.BusinessObjects.Orders; + } + + internal IEnumerable ?(Connection P_0) + { + return P_0.BusinessObjects.OrderTypes; + } + + internal IEnumerable ?(Connection P_0) + { + return P_0.BusinessObjects.Positions; + } + + internal IEnumerable ?(Connection P_0) + { + return P_0.BusinessObjects.ClosedPositions; + } + + internal IEnumerable ?(Connection P_0) + { + return P_0.BusinessObjects.CorporateActions; + } + + internal IEnumerable ?(Connection P_0) + { + return P_0.BusinessObjects.ReportTypes; + } + + internal IEnumerable ?(Connection P_0) + { + return P_0.BusinessObjects.AccountOperations; + } + + internal IEnumerable ?(Connection P_0) + { + return P_0.BusinessObjects.TradingSignals; + } + + internal bool ?(Connection P_0) + { + return P_0.Connected; + } + + internal bool ?(Connection P_0) + { + return P_0.Connected; + } + + internal bool ?(Connection P_0) + { + return P_0.Connected; + } + + internal bool ?(Connection P_0) + { + return P_0.Connected; + } + + internal string ?(PlaceOrderRequestParameters P_0) + { + return P_0.ConnectionId; + } + + internal IEnumerable ?(Connection P_0) + { + return P_0.BusinessObjects.DeliveredAssets; + } + + internal bool ?(Connection P_0) + { + if (P_0 != null) + { + string vendorName = P_0.VendorName; + if (vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + return true; + } + } + return false; + } + + internal bool ?(Connection P_0) + { + if (P_0 != null) + { + string vendorName = P_0.VendorName; + if (vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + return true; + } + } + return false; + } + } + + [CompilerGenerated] + private sealed class ? + { + public BusinessObjectInfo ??; + + internal bool ?(Account P_0) + { + return P_0.Id == ??.Id; + } + } + + [CompilerGenerated] + private sealed class ? + { + public GetSymbolRequestParameters ??; + + internal bool ?(Synthetic P_0) + { + return P_0.Id == ??.SymbolId; + } + + internal bool ?(HistoricalSymbol P_0) + { + return P_0.Id == ??.SymbolId; + } + } + + [CompilerGenerated] + private sealed class ? + { + public string ??; + + internal bool ?(OrderType P_0) + { + return P_0.Id == ??; + } + + internal bool ?(OrderType P_0) + { + return P_0.Id == ??; + } + } + + [CompilerGenerated] + private sealed class ? + { + public string ??; + + internal bool ?(Connection P_0) + { + return P_0.Id == ??; + } + } + + [CompilerGenerated] + private sealed class ? + { + public ModifyOrderRequestParameters ??; + + internal bool ?(Connection P_0) + { + return P_0.Id == ??.ConnectionId; + } + } + + [CompilerGenerated] + private sealed class ? + { + public ClosePositionRequestParameters ??; + + internal bool ?(Connection P_0) + { + return P_0.Id == ??.ConnectionId; + } + } + + [CompilerGenerated] + private sealed class ? + { + public CancelOrderRequestParameters ??; + + internal bool ?(Connection P_0) + { + return P_0.Id == ??.ConnectionId; + } + } + + [CompilerGenerated] + private sealed class ? + { + public string ??; + + internal bool ?(Connection P_0) + { + return P_0.Id == ??; + } + } + + [CompilerGenerated] + private sealed class ? + { + public HistoricalSymbol ??; + + internal bool ?(HistoricalSymbol P_0) + { + return P_0.Id == ??.Id; + } + } + + private static Core ??; + + [CompilerGenerated] + private readonly ConnectionsManager ??; + + [CompilerGenerated] + private readonly LoggerManager ??; + + [CompilerGenerated] + private readonly LicencesManager ??; + + [CompilerGenerated] + private readonly VendorManager ??; + + [CompilerGenerated] + private readonly HistoryAggregationManager ??; + + [CompilerGenerated] + private readonly VolumeAnalysisManager ??; + + [CompilerGenerated] + private readonly IndicatorManager ??; + + [CompilerGenerated] + private readonly StrategyManager ??; + + [CompilerGenerated] + private readonly OrderPlacingStrategiesManager ??; + + [CompilerGenerated] + private readonly MessengersManager ??; + + [CompilerGenerated] + private readonly LocalOrdersManager ??; + + [CompilerGenerated] + private readonly RulesManager ??; + + [CompilerGenerated] + private readonly SymbolsMappingManager ??; + + [CompilerGenerated] + private readonly CustomSessionsManager ??; + + [CompilerGenerated] + private readonly TimeUtils ??; + + [CompilerGenerated] + private readonly MailUtils ??; + + [CompilerGenerated] + private readonly TradingProtector ??; + + [CompilerGenerated] + private IBrandingInformation ??; + + private TradingStatus ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private ? ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private CustomAccountPropertiesProvider ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private AdvancedTradingOperations ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private readonly SymbolsListManager ??; + + private readonly List ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private readonly List ?? = new List(); + + [CompilerGenerated] + private EventHandler ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + private Timer ??; + + [CompilerGenerated] + private IBrowserFactory ??; + + [CompilerGenerated] + private IOAuthBrowserCreator ??; + + [CompilerGenerated] + private Func ??; + + [CompilerGenerated] + private EventHandler ??; + + [CompilerGenerated] + private EventHandler ??; + + /// + /// Gets a singleton instance of . API entry point + /// + public static Core Instance + { + get + { + lock (typeof(Core)) + { + if (?? == null) + { + ?? = new Core(); + } + } + return ??; + } + } + + /// + /// Gets an access to all created connections and manages them + /// + public ConnectionsManager Connections + { + [CompilerGenerated] + get + { + return ??; + } + } + + /// + /// Gets an access to the system logging mechanism + /// + public LoggerManager Loggers + { + [CompilerGenerated] + get + { + return ??; + } + } + + /// + /// Obtains licence rules for the current user + /// + [NotPublished] + public LicencesManager Licences + { + [CompilerGenerated] + get + { + return ??; + } + } + + /// + /// Gets an access to all available trading data vendors and creates them + /// + [NotPublished] + public VendorManager Vendors + { + [CompilerGenerated] + get + { + return ??; + } + } + + /// + /// Gets an access to the all available aggregation types + /// + [NotPublished] + public HistoryAggregationManager HistoryAggregations + { + [CompilerGenerated] + get + { + return ??; + } + } + + /// + /// Access to Volume Analysis calculations + /// + public VolumeAnalysisManager VolumeAnalysis + { + [CompilerGenerated] + get + { + return ??; + } + } + + /// + /// Gets an access to the all available indicators and creates them + /// + public IndicatorManager Indicators + { + [CompilerGenerated] + get + { + return ??; + } + } + + /// + /// Gets an access to the all available trading strategies and manages them + /// + public StrategyManager Strategies + { + [CompilerGenerated] + get + { + return ??; + } + } + + public OrderPlacingStrategiesManager OrderPlacingStrategies + { + [CompilerGenerated] + get + { + return ??; + } + } + + public MessengersManager Messengers + { + [CompilerGenerated] + get + { + return ??; + } + } + + public LocalOrdersManager LocalOrders + { + [CompilerGenerated] + get + { + return ??; + } + } + + /// + /// Gets a permissions checking mechanism + /// + [NotPublished] + public RulesManager RulesManager + { + [CompilerGenerated] + get + { + return ??; + } + } + + public SymbolsMappingManager SymbolsMapping + { + [CompilerGenerated] + get + { + return ??; + } + } + + public CustomSessionsManager CustomSessions + { + [CompilerGenerated] + get + { + return ??; + } + } + + /// + /// Gets a time based conversion and synchronization mechanism + /// + public TimeUtils TimeUtils + { + [CompilerGenerated] + get + { + return ??; + } + } + + /// + /// Gets SMTP mail service for sending emails + /// + public MailUtils MailUtils + { + [CompilerGenerated] + get + { + return ??; + } + } + + public TradingProtector TradingProtection + { + [CompilerGenerated] + get + { + return ??; + } + } + + public IBrandingInformation BrandingInformation + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = brandingInformation; + } + } + + public Version CurrentVersion => new Version(GetType().Assembly.GetName().Version.ToString(3)); + + /// + /// Represents current trading status + /// + public TradingStatus TradingStatus + { + get + { + return ??; + } + set + { + ?? = value; + ???.Invoke(value); + } + } + + internal ? CustomMessageProcessor + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = ?; + } + } + + private bool AlreadyInitialized + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = flag; + } + } + + public CustomAccountPropertiesProvider CustomAccountPropertiesProvider + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = customAccountPropertiesProvider; + } + } + + /// + /// Gets all available s from open connections + /// + public Symbol[] Symbols => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.Symbols).ToArray(); + + /// + /// Gets all available s from open connections + /// + public SymbolType[] SymbolTypes => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.SymbolTypes).Distinct().ToArray(); + + /// + /// Gets all available s from open connections + /// + public Account[] Accounts => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.Accounts).ToArray(); + + /// + /// Gets all available s from open connections + /// + public Asset[] Assets => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.Assets).ToArray(); + + /// + /// Gets all available s from open connections + /// + public Exchange[] Exchanges => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.Exchanges).ToArray(); + + /// + /// Gets all available s from open connections + /// + public Order[] Orders => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.Orders).ToArray(); + + /// + /// Gets all available s from open connections + /// + public OrderType[] OrderTypes => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.OrderTypes).ToArray(); + + /// + /// Gets all available s from open connections + /// + public Position[] Positions => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.Positions).ToArray(); + + /// + /// Gets all available s from open connections + /// + public ClosedPosition[] ClosedPositions => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.ClosedPositions).ToArray(); + + /// + /// Gets all available s from open connections + /// + public CorporateAction[] CorporateActions => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.CorporateActions).ToArray(); + + /// + /// Gets all available s from open connections. Otherwise returns empty list + /// > + public ReportType[] ReportTypes => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.ReportTypes).ToArray(); + + public AccountOperation[] AccountOperations => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.AccountOperations).ToArray(); + + /// + /// Gets all available s from open connections. Otherwise returns empty list + /// > + public TradingSignal[] TradingSignals => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.TradingSignals).ToArray(); + + public AdvancedTradingOperations AdvancedTradingOperations + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = advancedTradingOperations; + } + } + + public DeliveredAsset[] DeliveredAssets => Connections.Connected.SelectMany((Connection P_0) => P_0.BusinessObjects.DeliveredAssets).ToArray(); + + /// + /// Gets all previously configured s + /// + [NotPublished] + public SymbolList[] SymbolList => SymbolListManager.Items; + + /// + /// Gets an access to s and manages them + /// + [NotPublished] + public SymbolsListManager SymbolListManager + { + [CompilerGenerated] + get + { + return ??; + } + } + + /// + /// Represent all available Historical Symbols + /// + [NotPublished] + public List HistoricalSymbols => new List(??); + + /// + /// Represent all available Synthetic items + /// + [NotPublished] + public List Synthetics + { + [CompilerGenerated] + get + { + return ??; + } + } + + [NotPublished] + public IBrowserFactory BrowserFactory + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [NotPublished] + public IOAuthBrowserCreator OAuthBrowserCreator + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Will be triggered when changed + /// + public event Action OnTradingStatusChanged + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + /// + /// Will be triggered when new added to the core + /// + public event Action AccountAdded + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + /// + /// Will be triggered when new added to the core + /// + public event Action SymbolAdded + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + /// + /// Will be triggered when new placed + /// + public event Action OrderAdded + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + /// + /// Will be triggered when canceled + /// + public event Action OrderRemoved + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + /// + /// Will be triggered when new opened + /// + public event Action PositionAdded + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + /// + /// Will be triggered when closed + /// + public event Action PositionRemoved + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + /// + /// Will be triggered when new added + /// + public event Action ClosedPositionAdded + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + /// + /// Will be triggered when removed + /// + public event Action ClosedPositionRemoved + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + /// + /// Will be triggered when new occured + /// + public event Action TradeAdded + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + /// + /// Will be triggered when new occured + /// + public event Action CorporateActionAdded + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + /// + /// Will be triggered when new added + /// + public event Action OrdersHistoryAdded + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public event Action DeliveredAssetAdded + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public event Action DeliveredAssetRemoved + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + /// + /// Will be triggered when new received + /// + public event Action DealTicketReceived + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + [NotPublished] + public event Action HistoricalSymbolAdded + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + [NotPublished] + public event Action HistoricalSymbolRemoved + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + [NotPublished] + public event Action HistoricalSymbolUpdated + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + /// + /// Will be triggered when custom symbol added + /// + [NotPublished] + public event Action SyntheticAdded + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + /// + /// Will be triggered when custom symbol removed + /// + [NotPublished] + public event Action SyntheticRemoved + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + /// + /// Will be triggered when custom symbol updated + /// + [NotPublished] + public event Action SyntheticUpdated + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + /// + /// Will be triggered when created/chenged/removed + /// + public event EventHandler TradingSignalUpdate + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + public event Action OnAlert + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public event Action OnRequestOTP + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public event Func OnAskUserConfirmationForTradingWithRunningEmulator + { + [CompilerGenerated] + add + { + Func func = ??; + Func func2; + do + { + func2 = func; + Func value2 = (Func)Delegate.Combine(func2, value); + func = Interlocked.CompareExchange(ref ??, value2, func2); + } + while ((object)func != func2); + } + [CompilerGenerated] + remove + { + Func func = ??; + Func func2; + do + { + func2 = func; + Func value2 = (Func)Delegate.Remove(func2, value); + func = Interlocked.CompareExchange(ref ??, value2, func2); + } + while ((object)func != func2); + } + } + + public event EventHandler NewRequest + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + public event EventHandler NewPerformedRequest + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + private Core() + { + global::?.?.?(GetType().Assembly.Location); + ?? = new ConnectionsManager(); + ?? = new LoggerManager(); + ?? = new LicencesManager(); + ?? = new VendorManager(); + ?? = new HistoryAggregationManager(); + ?? = new VolumeAnalysisManager(); + ?? = new IndicatorManager(); + ?? = new StrategyManager(); + ?? = new OrderPlacingStrategiesManager(); + ?? = new SymbolsListManager(); + ?? = new RulesManager(); + ?? = new SymbolsMappingManager(); + ?? = new CustomSessionsManager(); + ?? = new MessengersManager(); + ?? = new LocalOrdersManager(); + ?? = new TimeUtils(); + ?? = new MailUtils(); + ?? = new TradingProtector(); + ?? = new List(); + CustomAccountPropertiesProvider = new CustomAccountPropertiesProvider(); + } + + /// + /// Starts a initialization process which initializes given Managers, and Utils. And provides a subscribing on events. + /// + [NotPublished] + public void Initialize() + { + lock (??) + { + if (AlreadyInitialized) + { + return; + } + AlreadyInitialized = true; + } + CustomMessageProcessor = new ?(); + ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; + Loggers.?(); + Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + TimeUtils.?(); + Licences.?(); + Vendors.?(); + HistoryAggregations.?(); + VolumeAnalysis.?(); + Indicators.?(); + Strategies.?(); + OrderPlacingStrategies.?(); + Connections.Initialize(); + SymbolsMapping.?(); + Messengers.?(); + SymbolListManager.?(); + LocalOrders.Initialize(); + AdvancedTradingOperations = new AdvancedTradingOperations(); + ?(); + Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + } + + /// + /// Disposes all previously initialized modules and unsubscribe from events + /// + [NotPublished] + public void Dispose() + { + lock (??) + { + if (!AlreadyInitialized) + { + return; + } + Licences.Dispose(); + Vendors.?(); + HistoryAggregations.?(); + VolumeAnalysis.?(); + Indicators.Dispose(); + Strategies.Dispose(); + OrderPlacingStrategies.Dispose(); + Messengers.Dispose(); + Connections.Dispose(); + TimeUtils.?(); + MailUtils.?(); + Loggers.Dispose(); + if (?? != null) + { + ??.Dispose(); + ?? = null; + } + AlreadyInitialized = false; + lock (typeof(Core)) + { + ?? = null; + } + } + } + + /// + /// Gets an instance of exist Account or creates a new one with given info parameter + /// + /// + /// + public Account GetAccount(BusinessObjectInfo accountInfo) + { + if (accountInfo == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + Account account = Connections[accountInfo.ConnectionId]?.BusinessObjects?.Accounts?.FirstOrDefault((Account P_0) => P_0.Id == accountInfo.Id); + if (account != null) + { + return account; + } + if (accountInfo is ? { IsCrypto: not false }) + { + return new CryptoAccount(accountInfo); + } + return new Account(accountInfo); + } + + internal void ?(Account P_0) + { + ??.InvokeSafely(P_0); + } + + internal void ?(Symbol P_0) + { + ??.InvokeSafely(P_0); + } + + /// + /// Returns all s from open connections which satisfy given request parameters, otherwise returns empty list + /// + /// + /// + [NotPublished] + public IList SearchSymbols(SearchSymbolsRequestParameters requestParameters) + { + List list = new List(); + if (string.IsNullOrEmpty(requestParameters.ConnectionId)) + { + Connection[] connected = Connections.Connected; + for (int i = 0; i < connected.Length; i++) + { + IList list2 = connected[i].?(requestParameters); + if (list2 != null) + { + list.AddRange(list2); + } + } + } + else + { + IList list3 = Connections[requestParameters.ConnectionId]?.?(requestParameters); + if (list3 != null) + { + list.AddRange(list3); + } + } + return list; + } + + /// + /// Retrieves any by given request parameters. Otherwise returns null + /// + /// + /// Must be specified if open connections total is more than one. Will search only in Synthetic symbols list if id is equal to + /// + /// + public Symbol GetSymbol(GetSymbolRequestParameters requestParameters, string connectionId = null, NonFixedListDownload downloadSymbol = NonFixedListDownload.Download) + { + if (connectionId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + return Synthetics.Find((Synthetic P_0) => P_0.Id == requestParameters.SymbolId); + } + if (connectionId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + return HistoricalSymbols.Find((HistoricalSymbol P_0) => P_0.Id == requestParameters.SymbolId); + } + if (!string.IsNullOrEmpty(connectionId)) + { + return Connections[connectionId]?.?(requestParameters, downloadSymbol); + } + if (Connections.All.Count((Connection P_0) => P_0.Connected) > 1) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return Connections.All.FirstOrDefault((Connection P_0) => P_0.Connected)?.?(requestParameters, downloadSymbol); + } + + /// + /// Gets an instance of exist symbol or creates a new one with given info parameter + /// + /// + /// + public Symbol GetSymbol(BusinessObjectInfo symbolInfo) + { + if (symbolInfo == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + GetSymbolRequestParameters requestParameters = new GetSymbolRequestParameters + { + SymbolId = symbolInfo.Id + }; + return GetSymbol(requestParameters, symbolInfo.ConnectionId) ?? new Symbol(symbolInfo); + } + + [NotPublished] + public IList GetFutureContracts(Symbol underlier) + { + return GetFutureContracts(new GetFutureContractsRequestParameters + { + ConnectionId = underlier.ConnectionId, + ExchangeId = underlier.Exchange.Id, + UnderlierId = underlier.Id + }); + } + + [NotPublished] + public IList GetFutureContracts(string root, string exchangeId, string connectionId = null) + { + return GetFutureContracts(new GetFutureContractsRequestParameters + { + ConnectionId = connectionId, + Root = root, + ExchangeId = exchangeId + }); + } + + [NotPublished] + public IList GetFutureContracts(GetFutureContractsRequestParameters requestParameters) + { + if (requestParameters == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (string.IsNullOrEmpty(requestParameters.Root) && string.IsNullOrEmpty(requestParameters.UnderlierId)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (!string.IsNullOrEmpty(requestParameters.ConnectionId)) + { + return Connections[requestParameters.ConnectionId]?.?(requestParameters); + } + if (Connections.All.Count((Connection P_0) => P_0.Connected) > 1) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return Connections.All.FirstOrDefault()?.?(requestParameters); + } + + [NotPublished] + public virtual IList GetOptionSeries(Symbol underlier) + { + return GetOptionSeries(new GetOptionSeriesRequestParameters(underlier)); + } + + [NotPublished] + public virtual IList GetOptionSeries(GetOptionSeriesRequestParameters requestParameters) + { + if (requestParameters == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (string.IsNullOrEmpty(requestParameters.ConnectionId)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (string.IsNullOrEmpty(requestParameters.UnderlierId)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return Connections[requestParameters.ConnectionId]?.?(requestParameters); + } + + [NotPublished] + public virtual IList GetStrikes(OptionSerie serie) + { + return GetStrikes(new GetStrikesRequestParameters(serie)); + } + + [NotPublished] + public virtual IList GetStrikes(GetStrikesRequestParameters requestParameters) + { + if (requestParameters == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (string.IsNullOrEmpty(requestParameters.ConnectionId)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (string.IsNullOrEmpty(requestParameters.UnderlierId)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (string.IsNullOrEmpty(requestParameters.SerieId)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return Connections[requestParameters.ConnectionId]?.?(requestParameters); + } + + internal void ?(Order P_0) + { + Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.ToString()); + ??.InvokeSafely(P_0); + } + + internal void ?(Order P_0) + { + Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.ToString()); + ??.InvokeSafely(P_0); + } + + /// + /// Gets instance by given Id string. Otherwise returns null + /// + /// + /// Must be specified if open connections total is more than one + /// + public OrderType GetOrderType(string orderTypeId, string connectionId = null) + { + if (string.IsNullOrEmpty(orderTypeId)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (!string.IsNullOrEmpty(connectionId)) + { + return Connections[connectionId]?.BusinessObjects?.OrderTypes?.FirstOrDefault((OrderType P_0) => P_0.Id == orderTypeId); + } + Connection[] array = Connections.All.Where((Connection P_0) => P_0.Connected).ToArray(); + if (array.Length > 1) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return array.First().BusinessObjects.OrderTypes.SingleOrDefault((OrderType P_0) => P_0.Id == orderTypeId); + } + + /// + /// Gets instance by given Id string. Otherwise returns null + /// + /// + /// Must be specified if open connections total is more than one + /// + public Order GetOrderById(string orderId, string connectionId = null) + { + Connection connection = Connections[connectionId]; + if (connection != null) + { + return connection.?(orderId); + } + Connection[] all = Connections.All; + for (int i = 0; i < all.Length; i++) + { + Order order = all[i].?(orderId); + if (order != null) + { + return order; + } + } + return null; + } + + internal void ?(Position P_0) + { + ??.InvokeSafely(P_0); + } + + internal void ?(Position P_0) + { + ??.InvokeSafely(P_0); + } + + /// + /// Gets instance by given Id string. Otherwise returns null + /// + /// + /// Must be specified if open connections total is more than one + /// + public Position GetPositionById(string positionId, string connectionId = null) + { + Connection connection = Connections[connectionId]; + if (connection != null) + { + return connection.?(positionId); + } + Connection[] all = Connections.All; + for (int i = 0; i < all.Length; i++) + { + Position position = all[i].?(positionId); + if (position != null) + { + return position; + } + } + return null; + } + + /// + /// Gets Profit'n'Loss with given request parameters from open connection. Otherwise returns null + /// + /// + /// + public PnL CalculatePnL(PnLRequestParameters parameters) + { + string ?? = parameters.Account?.ConnectionId ?? parameters.Symbol.ConnectionId; + Connection connection = Connections.All.FirstOrDefault((Connection P_0) => P_0.Id == ??); + if (connection == null) + { + Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Error); + return null; + } + if (!connection.Connected) + { + Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Error); + return null; + } + return connection.?(parameters); + } + + internal void ?(ClosedPosition P_0) + { + ??.InvokeSafely(P_0); + } + + internal void ?(ClosedPosition P_0) + { + ??.InvokeSafely(P_0); + } + + internal void ?(Trade P_0) + { + Order orderById = GetOrderById(P_0.OrderId, P_0.ConnectionId); + LoggerManager loggers = Loggers; + string text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 2); + defaultInterpolatedStringHandler.AppendFormatted(P_0); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted((orderById == null) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : $"{orderById}"); + loggers.Log(text, defaultInterpolatedStringHandler.ToStringAndClear()); + ??.InvokeSafely(P_0); + } + + /// + /// Gets collection of by given parameters + /// + /// + /// + /// + public IList GetTrades(TradesHistoryRequestParameters parameters, string connectionId = null) + { + if (parameters == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (string.IsNullOrEmpty(connectionId)) + { + List list = new List(); + Connection[] all = Connections.All; + for (int i = 0; i < all.Length; i++) + { + IList trades = all[i].GetTrades(new TradesHistoryRequestParameters(parameters)); + if (trades != null) + { + list.AddRange(trades); + } + } + return list; + } + return Connections[connectionId]?.GetTrades(parameters) ?? new List(); + } + + /// + /// Gets collection of by given parameters and callback + /// + /// + /// + /// + /// + public void GetTrades(TradesHistoryRequestParameters parameters, AccountTradesLoadingCallback callback, string connectionId = null) + { + if (parameters == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (callback == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (string.IsNullOrEmpty(connectionId)) + { + Connection[] all = Connections.All; + for (int i = 0; i < all.Length; i++) + { + all[i].?(new TradesHistoryRequestParameters(parameters), callback); + } + } + Connections[connectionId]?.?(parameters, callback); + } + + internal void ?(CorporateAction P_0) + { + ??.InvokeSafely(P_0); + } + + internal void ?(OrderHistory P_0) + { + Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.ToString()); + ??.InvokeSafely(P_0); + } + + /// + /// Gets collection of by given parameters + /// + /// + /// + /// + public IList GetOrdersHistory(OrdersHistoryRequestParameters parameters, string connectionId = null) + { + if (parameters == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (string.IsNullOrEmpty(connectionId)) + { + List list = new List(); + Connection[] all = Connections.All; + for (int i = 0; i < all.Length; i++) + { + IList ordersHistory = all[i].GetOrdersHistory(parameters); + if (ordersHistory != null) + { + list.AddRange(ordersHistory); + } + } + return list; + } + return Connections[connectionId]?.GetOrdersHistory(parameters) ?? new List(); + } + + public TradingOperationResult PlaceOrder(Symbol symbol, Account account, Side side, TimeInForce timeInForce = TimeInForce.Day, double quantity = 1.0, double price = -1.0, double triggerPrice = -1.0, double trailOffset = -1.0) + { + if (symbol == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + if (account == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + PlaceOrderRequestParameters placeOrderRequestParameters = new PlaceOrderRequestParameters + { + Symbol = symbol, + Account = account, + Side = side, + Quantity = quantity, + TimeInForce = timeInForce + }; + if (price > 0.0 && triggerPrice <= 0.0 && trailOffset <= 0.0) + { + placeOrderRequestParameters.OrderTypeId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + placeOrderRequestParameters.Price = price; + } + else if (triggerPrice > 0.0 && price <= 0.0 && trailOffset <= 0.0) + { + placeOrderRequestParameters.OrderTypeId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + placeOrderRequestParameters.TriggerPrice = triggerPrice; + } + else if (price > 0.0 && triggerPrice > 0.0 && trailOffset <= 0.0) + { + placeOrderRequestParameters.OrderTypeId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + placeOrderRequestParameters.Price = price; + placeOrderRequestParameters.TriggerPrice = triggerPrice; + } + else if (trailOffset > 0.0 && price <= 0.0 && triggerPrice <= 0.0) + { + placeOrderRequestParameters.OrderTypeId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + placeOrderRequestParameters.TrailOffset = trailOffset; + } + else + { + placeOrderRequestParameters.OrderTypeId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + return PlaceOrder(placeOrderRequestParameters); + } + + /// + /// Places with given request parameters + /// + /// + /// + public TradingOperationResult PlaceOrder(PlaceOrderRequestParameters request) + { + if (request == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (!?(request.Symbol?.Connection, request.RequestId, out var result)) + { + return result; + } + if (!?(request.Symbol?.Connection, request.RequestId, out result)) + { + return result; + } + return request.Symbol?.?(request); + } + + /// + /// Places multiple s with given request parameters + /// + /// + /// + /// + public void PlaceOrders(ICollection requests, GroupOrderType groupOrderType = GroupOrderType.None) + { + if (requests == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (requests.Count == 1) + { + PlaceOrder(requests.Single()); + return; + } + foreach (IGrouping item in from P_0 in requests + group P_0 by P_0.ConnectionId) + { + Connection connection = Connections[item.Key]; + if (RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), connection.Id).Status == TradingOperationStatus.Allowed) + { + PlaceMultiOrderOrderRequestParameters placeMultiOrderOrderRequestParameters = new PlaceMultiOrderOrderRequestParameters + { + GroupOrderType = groupOrderType, + OrderParameters = item.ToArray() + }; + if (?(connection, placeMultiOrderOrderRequestParameters.RequestId, out var tradingOperationResult) && ?(connection, placeMultiOrderOrderRequestParameters.RequestId, out tradingOperationResult)) + { + connection.?(placeMultiOrderOrderRequestParameters); + } + } + else if (groupOrderType == GroupOrderType.None) + { + PlaceOrderRequestParameters[] array = item.ToArray(); + foreach (PlaceOrderRequestParameters request in array) + { + PlaceOrder(request); + } + } + } + } + + public TradingOperationResult ModifyOrder(Order order, TimeInForce timeInForce = TimeInForce.Default, double quantity = 1.0, double price = -1.0, double triggerPrice = -1.0, double trailOffset = -1.0) + { + if (order == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ModifyOrderRequestParameters modifyOrderRequestParameters = new ModifyOrderRequestParameters(order); + if (timeInForce != TimeInForce.Default) + { + modifyOrderRequestParameters.TimeInForce = timeInForce; + } + if (quantity > 0.0) + { + modifyOrderRequestParameters.Quantity = quantity; + } + if (price > 0.0) + { + modifyOrderRequestParameters.Price = price; + } + if (triggerPrice > 0.0) + { + modifyOrderRequestParameters.TriggerPrice = triggerPrice; + } + if (trailOffset > 0.0) + { + modifyOrderRequestParameters.TrailOffset = trailOffset; + } + return ModifyOrder(modifyOrderRequestParameters); + } + + /// + /// Modifies by given request parameters + /// + /// + /// + public TradingOperationResult ModifyOrder(ModifyOrderRequestParameters request) + { + if (request == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (LocalOrders.TryHandleTradingOperationRequest(request, out var result)) + { + return result; + } + Connection connection = Connections.All.FirstOrDefault((Connection P_0) => P_0.Id == request.ConnectionId); + if (connection == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (!?(connection, request.RequestId, out result)) + { + return result; + } + return connection.?(request); + } + + public TradingOperationResult ClosePosition(Position position, double closeQuantity = -1.0) + { + if (position == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ClosePositionRequestParameters request = new ClosePositionRequestParameters + { + Position = position, + CloseQuantity = ((closeQuantity > 0.0) ? closeQuantity : position.Quantity) + }; + return ClosePosition(request); + } + + /// + /// Closes with given request parameters + /// + /// + /// + public TradingOperationResult ClosePosition(ClosePositionRequestParameters request) + { + if (request == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + Connection connection = Connections.All.FirstOrDefault((Connection P_0) => P_0.Id == request.ConnectionId); + if (connection == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (!?(Connections[request.ConnectionId], request.RequestId, out var result)) + { + return result; + } + return connection.?(request); + } + + [Obsolete("Use CancelOrder(IOrder order) instead")] + public TradingOperationResult CancelOrder(Order order, string sendingSource = null) + { + if (order == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + CancelOrderRequestParameters request = new CancelOrderRequestParameters + { + Order = order, + SendingSource = sendingSource + }; + return CancelOrder(request); + } + + public TradingOperationResult CancelOrder(IOrder order, string sendingSource = null) + { + if (order == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + CancelOrderRequestParameters request = new CancelOrderRequestParameters + { + Order = order, + SendingSource = sendingSource + }; + return CancelOrder(request); + } + + /// + /// Cancels with given request parameters + /// + /// + /// + public TradingOperationResult CancelOrder(CancelOrderRequestParameters request) + { + if (request == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (LocalOrders.TryHandleTradingOperationRequest(request, out var result)) + { + return result; + } + Connection connection = Connections.All.FirstOrDefault((Connection P_0) => P_0.Id == request.ConnectionId); + if (connection == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (!?(connection, request.RequestId, out result)) + { + return result; + } + return connection.?(request); + } + + /// + /// Returns with given request parameters from open connection + /// + /// + /// + public Report GetReport(ReportRequestParameters requestParameters) + { + Connection connection = requestParameters.ReportType.Connection; + if (connection == null) + { + Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Error); + return null; + } + if (!connection.Connected) + { + Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Error); + return null; + } + return connection.?(requestParameters); + } + + internal void ?(DeliveredAsset P_0) + { + ??.InvokeSafely(P_0); + } + + internal void ?(DeliveredAsset P_0) + { + ??.InvokeSafely(P_0); + } + + internal void ?(DealTicket P_0) + { + ??.InvokeSafely(P_0); + } + + [NotPublished] + public void PushDealTicket(string header, string description, DealTicketType type) + { + ??.InvokeSafely(new DealTicket(header, description, type)); + } + + [NotPublished] + public void PushDealTicket(DealTicket dealTicket) + { + ??.InvokeSafely(dealTicket); + } + + /// + /// Sends custom request if connection with given Id is open + /// + /// + /// + public void SendCustomRequest(string connectionId, RequestParameters parameters) + { + Connections.Connected.FirstOrDefault((Connection P_0) => P_0.Id == connectionId)?.SendCustomRequest(parameters); + } + + /// + /// Subscribe on custom messages + /// + /// custom message handler + /// custom messages Id + public void SubscribeToCustomMessages(Action handler, params int[] messagesTypes) + { + CustomMessageProcessor.?(handler, messagesTypes); + } + + /// + /// Unsubscribe from custom messages + /// + /// custom message handler + /// custom messages Id + public void UnsubscribeFromCustomMessages(Action handler, params int[] messagesTypes) + { + CustomMessageProcessor.?(handler, messagesTypes); + } + + /// + /// Adds if given parameters are valid + /// + /// + /// + [NotPublished] + public void AddSymbolList(string symbolsListName, IEnumerable symbols) + { + if (string.IsNullOrEmpty(symbolsListName)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (symbols == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + SymbolListManager.?(symbolsListName, symbols); + } + + /// + /// Replaces exist list by new list in if given parameters are valid + /// + /// + /// + [NotPublished] + public void ReplaceSymbolList(string symbolsListName, IList symbols) + { + if (string.IsNullOrEmpty(symbolsListName)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (symbols == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + SymbolListManager.?(symbolsListName, symbols); + } + + /// + /// Removes with a given name + /// + /// + [NotPublished] + public void RemoveSymbolList(string symbolsListName) + { + if (string.IsNullOrEmpty(symbolsListName)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + SymbolListManager.?(symbolsListName); + } + + /// + /// Replaces list name by new given name in if given parameters are valid + /// + /// + /// + [NotPublished] + public void RenameSymbolList(string symbolsListName, string newSymbolsListName) + { + if (string.IsNullOrEmpty(symbolsListName)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (string.IsNullOrEmpty(newSymbolsListName)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + SymbolListManager.?(symbolsListName, newSymbolsListName); + } + + [NotPublished] + public void AddHistoricalSymbol(HistoricalSymbol historicalSymbol) + { + if (!??.Contains(historicalSymbol) && !??.Any((HistoricalSymbol P_0) => P_0.Id == historicalSymbol.Id)) + { + ??.Add(historicalSymbol); + historicalSymbol.Updated += ?; + ??.InvokeSafely(historicalSymbol); + } + } + + [NotPublished] + public void RemoveHistoricalSymbol(HistoricalSymbol historicalSymbol) + { + if (??.Contains(historicalSymbol)) + { + ??.Remove(historicalSymbol); + historicalSymbol.Updated -= ?; + ??.InvokeSafely(historicalSymbol); + historicalSymbol.Dispose(); + } + } + + private void ?(Symbol P_0) + { + if (P_0 is HistoricalSymbol historicalSymbol) + { + ??.InvokeSafely(historicalSymbol); + } + } + + /// + /// Adds given Synthetic to the list if it does not contain + /// + /// + [NotPublished] + public void AddSynthetic(Synthetic synthetic) + { + if (!Synthetics.Contains(synthetic)) + { + Synthetics.Add(synthetic); + synthetic.Reinitialized += ?; + ??.InvokeSafely(synthetic); + } + } + + private void ?(Synthetic P_0) + { + ??.InvokeSafely(P_0); + } + + /// + /// Removes given Synthetic from the list if it exists + /// + /// + [NotPublished] + public void RemoveSynthetic(Synthetic synthetic) + { + if (Synthetics.Contains(synthetic)) + { + Synthetics.Remove(synthetic); + synthetic.Reinitialized -= ?; + ??.InvokeSafely(synthetic); + synthetic.Dispose(); + } + } + + internal void ?(TradingSignal P_0, EntityLifecycle P_1) + { + ??.InvokeSafely(this, new TradingSignalEventArgs + { + TradingSignal = P_0, + Lifecycle = P_1 + }); + } + + public void Alert(string text, string symbolName, string connectionName, Action onConfirm, string alertName) + { + Alert(new Alert + { + Text = text, + SymbolName = symbolName, + ConnectionName = connectionName, + ActionOnConfirm = onConfirm, + Name = alertName + }); + } + + public void Alert(string text, string symbolName = "", string connectionName = "", Action onConfirm = null) + { + Alert(text, symbolName, connectionName, onConfirm, null); + } + + public void Alert(Alert alert) + { + ??.InvokeSafely(alert); + } + + public void RequestOTP(OTPHolder otpHolder, string title, string text) + { + ??.InvokeSafely(otpHolder, title, text); + } + + [SpecialName] + [CompilerGenerated] + internal void ?(Action P_0) + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value = (Action)Delegate.Combine(action2, P_0); + action = Interlocked.CompareExchange(ref ??, value, action2); + } + while ((object)action != action2); + } + + [SpecialName] + [CompilerGenerated] + internal void ?(Action P_0) + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value = (Action)Delegate.Remove(action2, P_0); + action = Interlocked.CompareExchange(ref ??, value, action2); + } + while ((object)action != action2); + } + + private void ?() + { + if (?? == null) + { + ?? = new Timer(?); + ??.Change(100, 100); + } + } + + private void ?(object P_0) + { + try + { + ?(); + ??.InvokeSafely(); + TradingProtection.?(); + } + catch (Exception ex) + { + Loggers.Log(ex); + } + } + + private void ?() + { + Position[] positions = Positions; + foreach (Position position in positions) + { + try + { + PnL pnL = CalculatePnL(new PnLRequestParameters + { + Symbol = position.Symbol, + Account = position.Account, + OpenPrice = position.OpenPrice, + ClosePrice = position.CurrentPrice, + Side = position.Side, + Quantity = position.Quantity, + PositionId = position.Id + }); + if (pnL != null) + { + position.?(pnL); + } + } + catch (Exception ex) + { + Instance.Loggers.Log(ex); + } + } + ClosedPosition[] closedPositions = ClosedPositions; + foreach (ClosedPosition closedPosition in closedPositions) + { + try + { + if (closedPosition.GrossPnL != null) + { + continue; + } + PnL pnL2 = CalculatePnL(new PnLRequestParameters + { + Symbol = closedPosition.Symbol, + Account = closedPosition.Account, + OpenPrice = closedPosition.OpenPrice, + ClosePrice = closedPosition.CurrentPrice, + Side = closedPosition.Side, + Quantity = 0.0, + PositionId = closedPosition.Id + }); + if (pnL2 != null) + { + closedPosition.?(pnL2); + ClosedPosition closedPosition2 = closedPosition; + if (closedPosition2.GrossPnL == null) + { + PnLItem pnLItem = (closedPosition2.GrossPnL = new PnLItem()); + } + } + } + catch (Exception ex2) + { + Instance.Loggers.Log(ex2); + } + } + } + + public void InitializeBrandingInformation() + { + IBrandingInformation brandingInformation = new ?(); + try + { + TypeWrapper typeWrapper = AssemblyLoader.LoadTypes(string.Empty, typeof(IBrandingInformation), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).FirstOrDefault(); + if (typeWrapper != null) + { + IBrandingInformation brandingInformation2 = (IBrandingInformation)Activator.CreateInstance(typeWrapper); + if (brandingInformation2 != null) + { + brandingInformation = brandingInformation2; + } + } + } + catch (Exception ex) + { + Instance.Loggers.Log(ex); + } + BrandingInformation = brandingInformation; + } + + public void ForceTimeSync() + { + TimeUtils.TimeSynchronizer.?(); + } + + private bool ?(Connection P_0, long P_1, out TradingOperationResult P_2) + { + P_2 = null; + bool flag; + if (P_0 != null) + { + string vendorName = P_0.VendorName; + if (vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + flag = true; + goto IL_003a; + } + } + flag = false; + goto IL_003a; + IL_003a: + if (flag) + { + return true; + } + if (TradingProtection.IsOperationAllowed()) + { + return true; + } + string text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + PushDealTicket(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), text, DealTicketType.Refuse); + Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), text, LoggingLevel.Error); + P_2 = TradingOperationResult.CreateError(P_1, text); + return false; + } + + private bool ?(Connection P_0, long P_1, out TradingOperationResult P_2) + { + P_2 = null; + bool flag; + if (P_0 != null) + { + string vendorName = P_0.VendorName; + if (vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + flag = true; + goto IL_003a; + } + } + flag = false; + goto IL_003a; + IL_003a: + if (flag) + { + return true; + } + if (!Instance.Connections.Connected.Any(delegate(Connection connection) + { + if (connection != null) + { + string vendorName2 = connection.VendorName; + if (vendorName2 == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName2 == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName2 == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + return true; + } + } + return false; + })) + { + return true; + } + bool flag2 = false; + if (?? != null) + { + flag2 = ??(Instance.Connections.Connected.FirstOrDefault(delegate(Connection connection) + { + if (connection != null) + { + string vendorName2 = connection.VendorName; + if (vendorName2 == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName2 == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || vendorName2 == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + return true; + } + } + return false; + }).Name, P_0.Name); + } + if (flag2) + { + return true; + } + string text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + PushDealTicket(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), text, DealTicketType.Refuse); + Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), text, LoggingLevel.Error); + P_2 = TradingOperationResult.CreateError(P_1, text); + return false; + } + + internal void ?(RequestParameters P_0, object P_1) + { + ???.InvokeSafely(this, new PerformedRequestEventArgs(P_0, P_1)); + } + + internal void ?(Connection P_0, RequestEventArgs P_1) + { + ???.InvokeSafely(P_0, P_1); + } + } + public class CustomHoliday : ICustomizable + { + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private DateTime ??; + + public bool IsActive + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DateTime Date + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IList Settings + { + get + { + return new List + { + new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsActive), + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name), + new SettingItemDateTime(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Date) + }; + } + set + { + IsActive = value.GetValueOrDefault(IsActive, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + Name = value.GetValueOrDefault(Name, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + Date = value.GetValueOrDefault(Date, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + } + public class CustomSession : ISession, ICustomizable + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal string ?(DayOfWeek P_0) + { + return P_0.ToString(); + } + } + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private SessionType ??; + + [CompilerGenerated] + private TimeSpan ??; + + [CompilerGenerated] + private TimeSpan ??; + + [CompilerGenerated] + private TimeSpan ??; + + [CompilerGenerated] + private TimeSpan ??; + + private bool ??; + + [CompilerGenerated] + private DayOfWeek[] ??; + + [CompilerGenerated] + private bool ??; + + public bool IsActive + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SessionType Type + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public TimeSpan OpenTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = timeSpan; + } + } + + public TimeSpan CloseTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = timeSpan; + } + } + + public TimeSpan OpenOffset + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public TimeSpan CloseOffset + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DayOfWeek[] Days + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool IsPrimary + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IList Settings + { + get + { + return new List + { + new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsActive), + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name), + new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)Type), + new SettingItemLong(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OpenOffset.Ticks), + new SettingItemLong(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CloseOffset.Ticks), + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), string.Join(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Days.Select((DayOfWeek P_0) => P_0.ToString()))) + }; + } + set + { + IsActive = value.GetValueOrDefault(IsActive, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + Name = value.GetValueOrDefault(Name, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + Type = (SessionType)value.GetValueOrDefault((int)Type, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (value.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value2)) + { + OpenOffset = TimeSpan.FromTicks(value2); + if (value.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value3)) + { + CloseOffset = TimeSpan.FromTicks(value3); + } + } + else + { + ?? = true; + if (value.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value4)) + { + OpenTime = TimeSpan.FromTicks(value4); + } + if (value.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value5)) + { + CloseTime = TimeSpan.FromTicks(value5); + } + } + if (!value.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value6)) + { + return; + } + string[] array = value6.Split(new string[1] { 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() }, StringSplitOptions.RemoveEmptyEntries); + List list = new List(); + string[] array2 = array; + for (int i = 0; i < array2.Length; i++) + { + if (Enum.TryParse(array2[i], ignoreCase: true, out var result)) + { + list.Add(result); + } + } + Days = list.ToArray(); + } + } + + public void RecalculateOpenCloseTime(TimeZoneInfo timeZoneInfo) + { + if (??) + { + OpenOffset = OpenTime.ConvertTimeZone(TimeZoneInfo.Utc, timeZoneInfo); + CloseOffset = CloseTime.ConvertTimeZone(TimeZoneInfo.Utc, timeZoneInfo); + } + else + { + OpenTime = OpenOffset.ConvertTimeZone(timeZoneInfo, TimeZoneInfo.Utc); + CloseTime = CloseOffset.ConvertTimeZone(timeZoneInfo, TimeZoneInfo.Utc); + } + } + } + public class CustomSessionEventArgs : EntityLifecycleEventArgs + { + [CompilerGenerated] + private readonly CustomSessionsAssignment ??; + + [CompilerGenerated] + private readonly CustomSessionsContainer ??; + + public CustomSessionsAssignment Assignment + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public CustomSessionsContainer Container + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + } + public sealed class CustomSessionsAssignment : IUniqueID, ICustomizable, IEquatable + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + public IList Settings + { + get + { + return new List + { + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), UniqueId), + new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsActive), + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ConnectionId), + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExchangeId), + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SymbolId), + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CustomSessionsContainerId) + }; + } + set + { + UniqueId = value.GetValueOrDefault(UniqueId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + IsActive = value.GetValueOrDefault(IsActive, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + ConnectionId = value.GetValueOrDefault(ConnectionId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + ExchangeId = value.GetValueOrDefault(ExchangeId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + SymbolId = value.GetValueOrDefault(SymbolId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + CustomSessionsContainerId = value.GetValueOrDefault(CustomSessionsContainerId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public string UniqueId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public bool IsActive + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string ConnectionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public string ExchangeId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public string SymbolId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public string CustomSessionsContainerId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + public ExchangeComplexIdentifier ExchangeComplexId => new ExchangeComplexIdentifier(ConnectionId, ExchangeId); + + public SymbolComplexIdentifier SymbolComplexId => new SymbolComplexIdentifier(ConnectionId, ExchangeId, SymbolId); + + public Connection Connection => Core.Instance.Connections[ConnectionId]; + + public Exchange Exchange => Core.Instance.Exchanges.FirstOrDefault(delegate(Exchange P_0) + { + ExchangeComplexIdentifier complexId = P_0.ComplexId; + ExchangeComplexIdentifier? obj = this?.ExchangeComplexId; + return complexId == obj; + }); + + public Symbol Symbol + { + get + { + try + { + if (string.IsNullOrEmpty(SymbolId)) + { + return null; + } + return Core.Instance.GetSymbol(new GetSymbolRequestParameters + { + SymbolId = SymbolId + }, ConnectionId); + } + catch + { + return null; + } + } + } + + public CustomSessionsContainer SessionsContainer => Core.Instance.CustomSessions[CustomSessionsContainerId]; + + public CustomSessionsAssignment(string containerId, string connectionId = null, string exchangeId = null, string symbolId = null) + : this() + { + IsActive = true; + CustomSessionsContainerId = containerId; + ConnectionId = connectionId; + ExchangeId = exchangeId; + SymbolId = symbolId; + } + + public CustomSessionsAssignment(CustomSessionsAssignment origin) + : this() + { + IsActive = origin.IsActive; + ConnectionId = origin.ConnectionId; + ExchangeId = origin.ExchangeId; + SymbolId = origin.SymbolId; + CustomSessionsContainerId = origin.CustomSessionsContainerId; + } + + internal CustomSessionsAssignment() + { + UniqueId = Guid.NewGuid().ToShortString(); + } + + internal void ?(CustomSessionsAssignment P_0) + { + IsActive = P_0.IsActive; + ConnectionId = P_0.ConnectionId; + ExchangeId = P_0.ExchangeId; + SymbolId = P_0.SymbolId; + CustomSessionsContainerId = P_0.CustomSessionsContainerId; + } + + public bool Equals(CustomSessionsAssignment other) + { + if (other == null) + { + return false; + } + if (this == other) + { + return true; + } + if (ConnectionId == other.ConnectionId && ExchangeId == other.ExchangeId && SymbolId == other.SymbolId) + { + return CustomSessionsContainerId == other.CustomSessionsContainerId; + } + return false; + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + if (this == obj) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((CustomSessionsAssignment)obj); + } + + public override int GetHashCode() + { + return (((((((ConnectionId != null) ? ConnectionId.GetHashCode() : 0) * 397) ^ ((ExchangeId != null) ? ExchangeId.GetHashCode() : 0)) * 397) ^ ((SymbolId != null) ? SymbolId.GetHashCode() : 0)) * 397) ^ ((CustomSessionsContainerId != null) ? CustomSessionsContainerId.GetHashCode() : 0); + } + + [CompilerGenerated] + private bool ?(Exchange P_0) + { + ExchangeComplexIdentifier complexId = P_0.ComplexId; + ExchangeComplexIdentifier? obj = this?.ExchangeComplexId; + return complexId == obj; + } + } + public class CustomSessionsAssignmentManager : IEnumerable, IEnumerable, ICustomizable + { + private class ? : IComparer + { + public int Compare(CustomSessionsAssignment x, CustomSessionsAssignment y) + { + if (x == null && y != null) + { + return 1; + } + if (x != null && y == null) + { + return -1; + } + if (x == y) + { + return 0; + } + if (!string.IsNullOrEmpty(x.SymbolId)) + { + return -1; + } + if (!string.IsNullOrEmpty(y.SymbolId)) + { + return 1; + } + if (!string.IsNullOrEmpty(x.ExchangeId)) + { + return -1; + } + if (!string.IsNullOrEmpty(y.ExchangeId)) + { + return 1; + } + return 0; + } + } + + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal SettingItemGroup ?(CustomSessionsAssignment P_0) + { + return new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Settings); + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + internal bool ?(CustomSessionsAssignment P_0) + { + if (P_0.IsActive) + { + if (!(P_0.SymbolComplexId == ??.ComplexId)) + { + if (string.IsNullOrEmpty(P_0.SymbolId)) + { + ExchangeComplexIdentifier exchangeComplexId = P_0.ExchangeComplexId; + ExchangeComplexIdentifier? obj = ??.Exchange?.ComplexId; + if (exchangeComplexId == obj) + { + goto IL_00ab; + } + } + if (!string.IsNullOrEmpty(P_0.ExchangeId) || !(P_0.ConnectionId == ??.ConnectionId)) + { + return string.IsNullOrEmpty(P_0.ConnectionId); + } + } + goto IL_00ab; + } + return false; + IL_00ab: + return true; + } + } + + [CompilerGenerated] + private EventHandler ??; + + private readonly IDictionary ??; + + private readonly ? ??; + + public IList Settings + { + get + { + return this.Select((CustomSessionsAssignment P_0) => new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Settings)).Cast().ToList(); + } + set + { + foreach (SettingItem item in value) + { + if (item.Value is IList settings) + { + CustomSessionsAssignment assignment = new CustomSessionsAssignment + { + Settings = settings + }; + Add(assignment); + } + } + } + } + + public event EventHandler Updated + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + public CustomSessionsAssignmentManager() + { + ?? = new Dictionary(); + ?? = new ?(); + } + + public void Add(CustomSessionsAssignment assignment) + { + ??.Add(assignment.UniqueId, assignment); + ?(assignment, EntityLifecycle.Created); + } + + public void Edit(string assignmentId, CustomSessionsAssignment newAssignment) + { + if (??.TryGetValue(assignmentId, out var value)) + { + value.?(newAssignment); + ?(value, EntityLifecycle.Changed); + } + } + + public void Delete(string assignmentId) + { + if (??.TryGetValue(assignmentId, out var value)) + { + ??.Remove(assignmentId); + ?(value, EntityLifecycle.Removed); + } + } + + public bool TryGetSessionsContainer(Symbol symbol, out CustomSessionsContainer container) + { + container = null; + List list = this.ToList(); + list.Sort(??); + container = list.FirstOrDefault(delegate(CustomSessionsAssignment P_0) + { + if (!P_0.IsActive) + { + return false; + } + if (!(P_0.SymbolComplexId == symbol.ComplexId)) + { + if (string.IsNullOrEmpty(P_0.SymbolId)) + { + ExchangeComplexIdentifier exchangeComplexId = P_0.ExchangeComplexId; + ExchangeComplexIdentifier? obj = symbol.Exchange?.ComplexId; + if (exchangeComplexId == obj) + { + goto IL_00ab; + } + } + if (!string.IsNullOrEmpty(P_0.ExchangeId) || !(P_0.ConnectionId == symbol.ConnectionId)) + { + return string.IsNullOrEmpty(P_0.ConnectionId); + } + } + goto IL_00ab; + IL_00ab: + return true; + })?.SessionsContainer; + return container != null; + } + + private void ?(CustomSessionsAssignment P_0, EntityLifecycle P_1) + { + ???.InvokeSafely(this, new CustomSessionEventArgs + { + Assignment = P_0, + Lifecycle = P_1 + }); + } + + public IEnumerator GetEnumerator() + { + return ??.Values.GetEnumerator(); + } + + private IEnumerator ?() + { + return GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(); + } + } + public class CustomSessionsContainer : ISessionsContainer, ICustomizable, IComparable, IComparable, IMessageBuilder + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func, SessionsSet> ??; + + internal bool ?(CustomSession P_0) + { + return P_0.IsActive; + } + + internal SettingItemGroup ?(CustomSession P_0) + { + return new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Settings); + } + + internal SettingItemGroup ?(CustomHoliday P_0) + { + return new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Settings); + } + + internal HolidayInfo ?(CustomHoliday P_0) + { + return new HolidayInfo + { + Name = P_0.Name, + Date = P_0.Date + }; + } + + internal int ?(CustomSession P_0) + { + return ((IStructuralEquatable)P_0.Days.Select((DayOfWeek result) => (int)result).ToArray()).GetHashCode((IEqualityComparer)EqualityComparer.Default); + } + + internal int ?(DayOfWeek P_0) + { + return (int)P_0; + } + + internal SessionsSet ?(IGrouping P_0) + { + return new SessionsSet + { + Days = P_0.FirstOrDefault().Days, + Sessions = P_0.Select((CustomSession customSession) => new Session(customSession.Name, customSession.OpenTime, customSession.CloseTime, customSession.Type)).ToArray() + }; + } + + internal Session ?(CustomSession P_0) + { + return new Session(P_0.Name, P_0.OpenTime, P_0.CloseTime, P_0.Type); + } + } + + [CompilerGenerated] + private sealed class ? + { + public DateTime ??; + + public DayOfWeek ??; + + internal bool ?(CustomHoliday P_0) + { + return P_0.Date.Date == ??.Date; + } + + internal bool ?(CustomSession P_0) + { + if (P_0.IsActive) + { + return P_0.Days.Contains(??); + } + return false; + } + } + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private TimeZone ??; + + [CompilerGenerated] + private CustomSession[] ??; + + [CompilerGenerated] + private CustomHoliday[] ??; + + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public TimeZone TimeZone + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = timeZone; + } + } + + public CustomSession[] Sessions + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = array; + } + } + + public ISession[] ActiveSessions => Sessions.Where((CustomSession P_0) => P_0.IsActive).Cast().ToArray(); + + public CustomHoliday[] Holidays + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = array; + } + } + + TimeZoneInfo ISessionsContainer.TimeZone + { + get + { + if (!TimeZone.IsEmpty) + { + return TimeZone.TimeZoneInfo; + } + return null; + } + } + + public IList Settings + { + get + { + List list = new List(); + list.AddRange(new SettingItem[4] + { + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id), + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name), + new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new List + { + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TimeZone.TimeZoneInfo.Id), + new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)TimeZone.Type) + }), + new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Sessions.Select((CustomSession P_0) => new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Settings)).Cast().ToList()) + }); + if (Holidays != null) + { + list.Add(new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Holidays?.Select((CustomHoliday P_0) => new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Settings)).Cast().ToList())); + } + return list; + } + set + { + Id = value.GetValueOrDefault(Id, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + Name = value.GetValueOrDefault(Name, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (value.TryGetValue>(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value2)) + { + TimeZoneType value3 = value2.GetValue(new string[1] { 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() }); + TimeZoneInfo timeZoneInfo = null; + if (value3 != TimeZoneType.Local) + { + timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(value2.GetValue(new string[1] { 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() })); + } + TimeZone = new TimeZone(value3, timeZoneInfo); + } + if (value.TryGetValue>(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value4)) + { + List list = new List(); + foreach (SettingItem item2 in value4) + { + if (item2.Value is IList settings) + { + CustomSession customSession = new CustomSession + { + Settings = settings + }; + customSession.RecalculateOpenCloseTime(TimeZone.TimeZoneInfo); + list.Add(customSession); + } + } + Sessions = list.ToArray(); + } + if (!value.TryGetValue>(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value5)) + { + return; + } + List list2 = new List(); + foreach (SettingItem item3 in value5) + { + if (item3.Value is IList settings2) + { + CustomHoliday item = new CustomHoliday + { + Settings = settings2 + }; + list2.Add(item); + } + } + Holidays = list2.ToArray(); + } + } + + internal CustomSessionsContainer() + { + } + + public CustomSessionsContainer(string name, TimeZone? timeZone = null, CustomSession[] sessions = null, CustomHoliday[] holidays = null) + { + Id = Guid.NewGuid().ToShortString(); + Name = name; + TimeZone = timeZone ?? Core.Instance.TimeUtils.SelectedTimeZone; + Sessions = sessions ?? Array.Empty(); + Holidays = holidays ?? Array.Empty(); + } + + internal void ?(CustomSessionsContainer P_0) + { + Name = P_0.Name; + TimeZone = P_0.TimeZone; + Sessions = P_0.Sessions ?? Array.Empty(); + Holidays = P_0.Holidays ?? Array.Empty(); + } + + public ISession[] GetSessionsForDate(DateTime dateTime) + { + DateTime ?? = TimeZoneInfo.ConvertTimeFromUtc(dateTime, TimeZone.TimeZoneInfo); + if (Holidays?.FirstOrDefault((CustomHoliday P_0) => P_0.Date.Date == ??.Date) != null) + { + return Array.Empty(); + } + DayOfWeek ?? = ??.DayOfWeek; + return Sessions.Where((CustomSession P_0) => P_0.IsActive && P_0.Days.Contains(??)).Cast().ToArray(); + } + + public int CompareTo(CustomSessionsContainer other) + { + return string.Compare(Name, other.Name, StringComparison.Ordinal); + } + + public int CompareTo(object obj) + { + if (!(obj is CustomSessionsContainer other)) + { + return 0; + } + return CompareTo(other); + } + + public override string ToString() + { + return Name; + } + + public MessageSessionsContainer BuildMessage() + { + return new MessageSessionsContainer + { + Id = Id, + Name = Name, + Description = string.Empty, + Holidays = Holidays?.Select((CustomHoliday P_0) => new HolidayInfo + { + Name = P_0.Name, + Date = P_0.Date + }).ToArray(), + SessionsSets = (from P_0 in Sessions?.GroupBy((CustomSession P_0) => ((IStructuralEquatable)P_0.Days.Select((DayOfWeek result) => (int)result).ToArray()).GetHashCode((IEqualityComparer)EqualityComparer.Default)) + select new SessionsSet + { + Days = P_0.FirstOrDefault().Days, + Sessions = P_0.Select((CustomSession customSession) => new Session(customSession.Name, customSession.OpenTime, customSession.CloseTime, customSession.Type)).ToArray() + }).ToArray() + }; + } + } + public class CustomSessionsManager : IEnumerable, IEnumerable, ICustomizable + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal SettingItemGroup ?(CustomSessionsContainer P_0) + { + return new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Settings); + } + } + + [CompilerGenerated] + private readonly CustomSessionsAssignmentManager ??; + + [CompilerGenerated] + private EventHandler ??; + + private readonly IDictionary ??; + + public CustomSessionsAssignmentManager Assignments + { + [CompilerGenerated] + get + { + return ??; + } + } + + public CustomSessionsContainer this[string id] + { + get + { + if (!string.IsNullOrEmpty(id) && ??.TryGetValue(id, out var value)) + { + return value; + } + return null; + } + } + + public IList Settings + { + get + { + return new List + { + new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), this.Select((CustomSessionsContainer P_0) => new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Settings)).Cast().ToList()), + new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Assignments.Settings) + }; + } + set + { + if (value.TryGetValue>(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value2)) + { + ??.Clear(); + foreach (SettingItem item in value2) + { + if (item.Value is IList settings) + { + CustomSessionsContainer customSessionsContainer = new CustomSessionsContainer + { + Settings = settings + }; + ??.Add(customSessionsContainer.Id, customSessionsContainer); + } + } + } + if (value.TryGetValue>(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value3)) + { + Assignments.Settings = value3; + } + } + } + + public event EventHandler Updated + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + internal CustomSessionsManager() + { + ?? = new CustomSessionsAssignmentManager(); + ?? = new Dictionary(); + } + + public void Add(CustomSessionsContainer container) + { + ??.Add(container.Id, container); + ?(container, EntityLifecycle.Created); + } + + public void Edit(string containerId, CustomSessionsContainer newContainer) + { + if (??.TryGetValue(containerId, out var value)) + { + value.?(newContainer); + ?(value, EntityLifecycle.Changed); + } + } + + public void Delete(string containerId) + { + if (??.TryGetValue(containerId, out var value)) + { + ??.Remove(containerId); + ?(value, EntityLifecycle.Removed); + } + } + + private void ?(CustomSessionsContainer P_0, EntityLifecycle P_1) + { + ???.InvokeSafely(this, new CustomSessionEventArgs + { + Container = P_0, + Lifecycle = P_1 + }); + } + + public IEnumerator GetEnumerator() + { + return ??.Values.GetEnumerator(); + } + + private IEnumerator ?() + { + return GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(); + } + } + public enum TimeScaleType + { + Linear, + NonLinear + } + public enum BarCreationBehavior + { + Realtime, + Deferred + } + [Published] + public abstract class HistoryAggregation : ICustomizable, ICloneable, IComparable, IEquatable + { + public const string TICK = "Tick"; + + public const string TICK_BARS = "Tick bars"; + + public const string TIME = "Time"; + + public const string RENKO = "Renko"; + + public const string HEIKIN_ASHI = "Heikin Ashi"; + + public const string RANGE_BARS = "Range bars"; + + public const string POINTS_AND_FIGURES = "Points & Figures"; + + public const string KAGI = "Kagi"; + + public const string LINE_BREAK = "Line Break"; + + public const string VOLUME = "Volume"; + + public const string REVERSAL = "Reversal"; + + public const string POWER_TRADES = "Power Trades"; + + public const string VWAP = "VWAP"; + + public const string LEVEL2 = "Level2"; + + public const string DOM_BY_TICKS_COUNT = "DOM by ticks count"; + + public const string DOM_BY_TIME = "DOM by time"; + + public const string DOM_AGGREGATED = "Aggregated DOM"; + + public const string DELTA_BARS = "Delta bars"; + + public const string TICK_LAST_AGGREGATED = "Aggregated ticks (Last)"; + + public const string PRICE_CHANGES_COUNT_BARS = "Price changes count bars"; + + public const string TIME_STATISTICS = "Time statistics"; + + public const string VOLUME_PROFILE = "Volume profile"; + + public const string SETTINGS_AGGREGATION_PERIOD = "Period"; + + public const string SETTINGS_AGGREGATION_HISTORY_TYPE = "History type"; + + [CompilerGenerated] + private Type ??; + + private static readonly ListEqualityComparer ?? = new ListEqualityComparer(EqualityComparer.Default); + + public abstract string Name { get; } + + public virtual string Title => Name; + + [NotPublished] + public virtual TimeScaleType TimeScaleType => TimeScaleType.NonLinear; + + [NotPublished] + public virtual BarCreationBehavior BarCreationBehavior => BarCreationBehavior.Realtime; + + public virtual bool IsWaitingFirstQuoteRequired => false; + + public virtual IList Settings + { + get + { + return new List(); + } + set + { + } + } + + internal Type HistoryProcessorType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = type; + } + } + + public virtual Period DefaultRange => Period.DAY1; + + [NotPublished] + [Obsolete("This property is retained for compatibility - will be removed in the future. Use casting to a specific type of aggregation and refer to the properties of the aggregation directly")] + public abstract Period GetPeriod { get; } + + [NotPublished] + [Obsolete("This property is retained for compatibility - will be removed in the future. Use casting to a specific type of aggregation and refer to the properties of the aggregation directly")] + public abstract HistoryType GetHistoryType { get; } + + protected HistoryAggregation() + { + } + + protected HistoryAggregation(HistoryAggregation _) + { + } + + [NotPublished] + public abstract object Clone(); + + [NotPublished] + public int CompareTo(object obj) + { + return (obj as HistoryAggregation).Name.CompareTo(Name); + } + + /// + /// Override to change string representation of aggregation + /// + [NotPublished] + public override string ToString() + { + return Name; + } + + [NotPublished] + public virtual string FormatTime(DateTime dt) + { + return Core.Instance.TimeUtils.GetFormatedDateTime(dt); + } + + public abstract HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata); + + public bool Equals(HistoryAggregation other) + { + if (other == null) + { + return false; + } + if (this == other) + { + return true; + } + if (Name == other.Name) + { + return ??.Equals(Settings, other.Settings); + } + return false; + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + if (this == obj) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((HistoryAggregation)obj); + } + + public override int GetHashCode() + { + return HashCode.Combine(Name, ??.GetHashCode(Settings)); + } + } + [Published] + public interface IHistoryAggregationHistoryTypeSupport + { + HistoryType HistoryType { get; set; } + } + public sealed class HistoryAggregationDeltaBars : HistoryAggregation + { + public const string SETTINGS_AGGREGATION_VOLUME_VALUE = "Delta value"; + + [CompilerGenerated] + private int ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public int DeltaValue + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public override IList Settings + { + get + { + return new List + { + new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), DeltaValue) + { + Minimum = 1, + Increment = 1, + SortIndex = 10 + } + }; + } + set + { + if (value == null) + { + return; + } + foreach (SettingItem item in value) + { + if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + DeltaValue = (int)item.Value; + } + } + } + } + + public override Period GetPeriod => Period.TICK1; + + public override HistoryType GetHistoryType => HistoryType.Last; + + [NotPublished] + public override Period DefaultRange => Period.HOUR1; + + public HistoryAggregationDeltaBars(int deltaValue) + { + DeltaValue = deltaValue; + } + + private HistoryAggregationDeltaBars(HistoryAggregationDeltaBars P_0) + : base(P_0) + { + DeltaValue = P_0.DeltaValue; + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 2); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(DeltaValue); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + [NotPublished] + public override object Clone() + { + return new HistoryAggregationDeltaBars(this); + } + + [NotPublished] + public override string FormatTime(DateTime dt) + { + return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dt); + } + + public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) + { + return new HistoryAggregationTick(HistoryType.Last); + } + } + public sealed class HistoryAggregationDomAggregated : HistoryAggregation + { + private const string ?? = "Price levels limit"; + + [CompilerGenerated] + private Period ??; + + [CompilerGenerated] + private int ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public Period Period + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = period; + } + } + + public int PriceLevelsLimit + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public override IList Settings + { + get + { + return new List + { + new SettingItemPeriod(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), Period) + { + SortIndex = 10, + Description = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }, + new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), PriceLevelsLimit) + { + SortIndex = 11, + Minimum = 0, + Maximum = 1000 + } + }; + } + set + { + if (value == null) + { + return; + } + foreach (SettingItem item in value) + { + string name = item.Name; + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())) + { + if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + PriceLevelsLimit = (int)item.Value; + } + } + else + { + Period = (Period)item.Value; + } + } + } + } + + [NotPublished] + public override Period GetPeriod => Period; + + [NotPublished] + public override HistoryType GetHistoryType + { + get + { + throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public HistoryAggregationDomAggregated(Period period) + { + Period = period; + } + + protected HistoryAggregationDomAggregated(HistoryAggregationDomAggregated aggregation) + : base(aggregation) + { + Period = aggregation.Period; + PriceLevelsLimit = aggregation.PriceLevelsLimit; + } + + [NotPublished] + public override object Clone() + { + return new HistoryAggregationDomAggregated(this); + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(13, 3); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Period.Format()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(PriceLevelsLimit); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) + { + if (!metadata.AllowedAggregations.Contains(Name)) + { + return null; + } + return this; + } + } + public sealed class HistoryAggregationDomByTime : HistoryAggregation + { + [CompilerGenerated] + private Period ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public Period Period + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = period; + } + } + + public override IList Settings + { + get + { + List list = new List(); + list.Add(new SettingItemPeriod(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), Period) + { + SortIndex = 10, + ExcludedPeriods = new BasePeriod[1], + Description = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }); + return list; + } + set + { + if (value == null) + { + return; + } + foreach (SettingItem item in value) + { + if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) + { + Period = (Period)item.Value; + } + } + } + } + + [NotPublished] + public override Period GetPeriod => Period; + + [NotPublished] + public override HistoryType GetHistoryType + { + get + { + throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public HistoryAggregationDomByTime(Period period) + { + Period = period; + } + + protected HistoryAggregationDomByTime(HistoryAggregationDomByTime aggregation) + : base(aggregation) + { + Period = aggregation.Period; + } + + [NotPublished] + public override object Clone() + { + return new HistoryAggregationDomByTime(this); + } + + [NotPublished] + public override string ToString() + { + return Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Period.Format(); + } + + public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) + { + if (!metadata.AllowedAggregations.Contains(Name)) + { + return null; + } + return this; + } + } + public sealed class HistoryAggregationDomByUpdatesCount : HistoryAggregation + { + private const string ?? = "Ticks count"; + + [CompilerGenerated] + private int ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public int TicksCount + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public override IList Settings + { + get + { + return new List + { + new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TicksCount) + { + Minimum = 1, + Increment = 1, + SortIndex = 10 + } + }; + } + set + { + if (value == null) + { + return; + } + foreach (SettingItem item in value) + { + if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + TicksCount = (int)item.Value; + } + } + } + } + + [NotPublished] + public override Period GetPeriod => new Period(BasePeriod.Tick, TicksCount); + + [NotPublished] + public override HistoryType GetHistoryType + { + get + { + throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public HistoryAggregationDomByUpdatesCount(int ticksCount) + { + TicksCount = ticksCount; + } + + private HistoryAggregationDomByUpdatesCount(HistoryAggregationDomByUpdatesCount P_0) + : base(P_0) + { + TicksCount = P_0.TicksCount; + } + + [NotPublished] + public override object Clone() + { + return new HistoryAggregationDomByUpdatesCount(this); + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 3); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(TicksCount); + defaultInterpolatedStringHandler.AppendFormatted(Period.BasePeriodToShortString(BasePeriod.Tick)); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) + { + if (!metadata.AllowedAggregations.Contains(Name)) + { + return null; + } + return this; + } + } + [Published] + public sealed class HistoryAggregationHeikenAshi : HistoryAggregation, IHistoryAggregationHistoryTypeSupport + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal SelectItem ?(HeikenAshiSource P_0) + { + return new SelectItem(P_0.ToString(), P_0); + } + } + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private HeikenAshiSource ??; + + [CompilerGenerated] + private HistoryType ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public int Value + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public HeikenAshiSource Source + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [NotPublished] + public override TimeScaleType TimeScaleType + { + get + { + HeikenAshiSource source = Source; + if (source == HeikenAshiSource.Tick || source == HeikenAshiSource.Volume) + { + return TimeScaleType.NonLinear; + } + return TimeScaleType.Linear; + } + } + + public HistoryType HistoryType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override IList Settings + { + get + { + List list = (from HeikenAshiSource P_0 in Enum.GetValues(typeof(HeikenAshiSource)) + select new SelectItem(P_0.ToString(), P_0)).ToList(); + List list2 = new List + { + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 5), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 2) + }; + return new List + { + new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Value) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + Minimum = 1 + }, + new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list.FirstOrDefault((SelectItem P_0) => P_0.Value.Equals(Source)), list) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + }, + new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list2.FirstOrDefault((SelectItem P_0) => (int)(object)P_0.Value == (int)HistoryType) ?? list2.FirstOrDefault(), list2) + { + SortIndex = 11 + } + }; + } + set + { + Value = value.GetValueOrDefault(Value, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + Source = value.GetValueOrDefault(Source, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + HistoryType = value.GetValueOrDefault(HistoryType, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + [NotPublished] + public override Period GetPeriod + { + get + { + if (Source != HeikenAshiSource.Volume) + { + return new Period((BasePeriod)Source, Value); + } + return Period.TICK1; + } + } + + [NotPublished] + public override HistoryType GetHistoryType => HistoryType; + + [NotPublished] + public override Period DefaultRange + { + get + { + if (Source == HeikenAshiSource.Volume || Source == HeikenAshiSource.Tick) + { + return Period.HOUR1; + } + if (Source <= HeikenAshiSource.Minute) + { + return Period.DAY1; + } + if (Source <= HeikenAshiSource.Day) + { + return Period.MONTH1; + } + return new Period(BasePeriod.Year, 10); + } + } + + public HistoryAggregationHeikenAshi(HeikenAshiSource source, int value, HistoryType historyType) + { + Source = source; + Value = value; + HistoryType = historyType; + } + + [NotPublished] + public override string FormatTime(DateTime dt) + { + return GetPeriod.Format(dt); + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 3); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Value); + defaultInterpolatedStringHandler.AppendFormatted((Source == HeikenAshiSource.Volume) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() : Period.BasePeriodToShortString((BasePeriod)Source)); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + protected HistoryAggregationHeikenAshi(HistoryAggregationHeikenAshi aggregation) + : base(aggregation) + { + Source = aggregation.Source; + Value = aggregation.Value; + HistoryType = aggregation.HistoryType; + } + + [NotPublished] + public override object Clone() + { + return new HistoryAggregationHeikenAshi(this); + } + + public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) + { + return (Source switch + { + HeikenAshiSource.Volume => new HistoryAggregationVolume(Value), + HeikenAshiSource.Tick => new HistoryAggregationTickBars(Value, HistoryType), + _ => new HistoryAggregationTime(new Period((BasePeriod)Source, Value), HistoryType), + }).GetAggregationToDirectDownload(metadata); + } + + [CompilerGenerated] + private bool ?(SelectItem P_0) + { + return P_0.Value.Equals(Source); + } + + [CompilerGenerated] + private bool ?(SelectItem P_0) + { + return (int)(object)P_0.Value == (int)HistoryType; + } + } + public enum HeikenAshiSource + { + [EnumMember] + Tick, + [EnumMember] + Second, + [EnumMember] + Minute, + [EnumMember] + Hour, + [EnumMember] + Day, + [EnumMember] + Week, + [EnumMember] + Month, + [EnumMember] + Year, + [EnumMember] + Volume + } + [Published] + public sealed class HistoryAggregationKagi : HistoryAggregationTime + { + public const string SETTINGS_AGGREGATION_REVERSAL = "Reversal"; + + [CompilerGenerated] + private int ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public int Reversal + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [NotPublished] + public override TimeScaleType TimeScaleType => TimeScaleType.NonLinear; + + [NotPublished] + public override BarCreationBehavior BarCreationBehavior => BarCreationBehavior.Deferred; + + public override IList Settings + { + get + { + IList settings = base.Settings; + if (settings.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) is SettingItemPeriod settingItemPeriod) + { + settingItemPeriod.ExcludedPeriods = new BasePeriod[2] + { + BasePeriod.Month, + BasePeriod.Year + }; + } + settings.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Reversal) + { + Minimum = 1, + SortIndex = 20 + }); + return settings; + } + set + { + if (value == null) + { + return; + } + base.Settings = value; + foreach (SettingItem item in value) + { + if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + Reversal = (int)item.Value; + } + } + } + } + + public HistoryAggregationKagi(Period period, HistoryType historyType, int reversal) + : base(period, historyType) + { + Reversal = reversal; + } + + private HistoryAggregationKagi(HistoryAggregationKagi P_0) + : base(P_0) + { + Reversal = P_0.Reversal; + } + + public override object Clone() + { + return new HistoryAggregationKagi(this); + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(7, 3); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Reversal); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.Period.Format()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + public sealed class HistoryAggregationLevel2 : HistoryAggregation + { + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + [NotPublished] + public override Period GetPeriod => Period.TICK1; + + [NotPublished] + public override HistoryType GetHistoryType + { + get + { + throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public HistoryAggregationLevel2() + { + } + + public override string FormatTime(DateTime dt) + { + return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dt); + } + + private HistoryAggregationLevel2(HistoryAggregationLevel2 P_0) + : base(P_0) + { + } + + [NotPublished] + public override object Clone() + { + return new HistoryAggregationLevel2(this); + } + + public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) + { + if (!metadata.AllowedAggregations.Contains(Name)) + { + return null; + } + return this; + } + } + [Published] + public sealed class HistoryAggregationLineBreak : HistoryAggregationTime + { + public const string SETTINGS_AGGREGATION_LINE_BREAK = "Line break"; + + [CompilerGenerated] + private int ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public int LineBreak + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [NotPublished] + public override TimeScaleType TimeScaleType => TimeScaleType.NonLinear; + + public override IList Settings + { + get + { + IList settings = base.Settings; + if (settings.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) is SettingItemPeriod settingItemPeriod) + { + settingItemPeriod.ExcludedPeriods = new BasePeriod[2] + { + BasePeriod.Month, + BasePeriod.Year + }; + } + SettingItemInteger item = new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LineBreak) + { + Minimum = 1, + Maximum = 100, + SortIndex = 20 + }; + settings.Add(item); + return settings; + } + set + { + if (value == null) + { + return; + } + base.Settings = value; + foreach (SettingItem item in value) + { + if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + LineBreak = (int)item.Value; + } + } + } + } + + public override Period GetPeriod => base.Period; + + public HistoryAggregationLineBreak(Period period, HistoryType historyType, int lineBreak) + : base(period, historyType) + { + LineBreak = lineBreak; + } + + private HistoryAggregationLineBreak(HistoryAggregationLineBreak P_0) + : base(P_0) + { + LineBreak = P_0.LineBreak; + } + + public override object Clone() + { + return new HistoryAggregationLineBreak(this); + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(11, 3); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(LineBreak); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.Period.Format()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + public sealed class HistoryAggregationManager + { + private const string ? = "HistoryProcessors"; + + private Dictionary ?; + + public HistoryAggregation[] All => ?.Values.ToArray(); + + public HistoryAggregation this[string aggregatorName] + { + get + { + if (?.TryGetValue(aggregatorName, out var value)) + { + return value; + } + return null; + } + } + + internal HistoryAggregationManager() + { + ? = new Dictionary(); + } + + internal void ?() + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), LoggingLevel.Verbose); + List list = AssemblyLoader.LoadTypes(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), typeof(IHistoryProcessor), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), SearchOption.AllDirectories); + if (list == null) + { + return; + } + foreach (TypeWrapper item in list) + { + Type type = item; + try + { + MethodInfo method = type.GetMethod(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), BindingFlags.Static | BindingFlags.Public); + if (method == null) + { + Core.Instance.Loggers.Log(type.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), LoggingLevel.Verbose); + continue; + } + if (!(method.Invoke(null, null) is HistoryAggregation historyAggregation)) + { + Core.Instance.Loggers.Log(type.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), LoggingLevel.Verbose); + continue; + } + if (?.ContainsKey(historyAggregation.Name)) + { + Core.Instance.Loggers.Log(type.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), LoggingLevel.Verbose); + continue; + } + historyAggregation.HistoryProcessorType = type; + ?.Add(historyAggregation.Name, historyAggregation); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), LoggingLevel.Verbose); + } + + public IHistoryProcessor CreateHistoryProcessor(HistoryRequestParameters parameter) + { + if (parameter == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + if (parameter.Aggregation == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + HistoryAggregation historyAggregation = this[parameter.Aggregation.Name]; + if (historyAggregation == null) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + parameter.Aggregation.Name); + } + try + { + IHistoryProcessor obj = Activator.CreateInstance(historyAggregation.HistoryProcessorType) as IHistoryProcessor; + obj?.Initialize(parameter.Copy); + return obj; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + return null; + } + + internal void ?() + { + if (? != null) + { + ?.Clear(); + ? = null; + } + } + } + [Published] + public sealed class HistoryAggregationPointsAndFigures : HistoryAggregationTime + { + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private PointsAndFiguresStyle ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public int BoxSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public int Reversal + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public PointsAndFiguresStyle Style + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = pointsAndFiguresStyle; + } + } + + public override IList Settings + { + get + { + List list = new List(); + SelectItem value = null; + foreach (PointsAndFiguresStyle value2 in Enum.GetValues(typeof(PointsAndFiguresStyle))) + { + SelectItem selectItem = new SelectItem(loc._(value2.GetDescription(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), (int)value2); + list.Add(selectItem); + if (Style == value2) + { + value = selectItem; + } + } + IList settings = base.Settings; + if (settings.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) is SettingItemPeriod settingItemPeriod) + { + settingItemPeriod.ExcludedPeriods = null; + } + settings.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), BoxSize, 10) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + Minimum = 1, + Maximum = int.MaxValue + }); + settings.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Reversal, 20) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + Minimum = 1, + Maximum = int.MaxValue + }); + settings.Add(new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value, list, 30) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + }); + return settings; + } + set + { + base.Settings = value; + SettingItem itemByName = value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (itemByName != null) + { + BoxSize = (int)itemByName.Value; + } + itemByName = value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (itemByName != null) + { + Reversal = (int)itemByName.Value; + } + if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value is SelectItem selectItem) + { + Style = (PointsAndFiguresStyle)(int)(object)selectItem.Value; + } + } + } + + [NotPublished] + public override TimeScaleType TimeScaleType => TimeScaleType.NonLinear; + + [NotPublished] + public override BarCreationBehavior BarCreationBehavior => BarCreationBehavior.Deferred; + + public HistoryAggregationPointsAndFigures(Period period, HistoryType historyType, int boxSize, int reversal, PointsAndFiguresStyle style) + : base(period, historyType) + { + BoxSize = boxSize; + Reversal = reversal; + Style = style; + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(9, 4); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Reversal); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(BoxSize); + defaultInterpolatedStringHandler.AppendFormatted((Style == PointsAndFiguresStyle.Classic) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.Period.Format()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + protected HistoryAggregationPointsAndFigures(HistoryAggregationPointsAndFigures aggregation) + : base(aggregation) + { + BoxSize = aggregation.BoxSize; + Reversal = aggregation.Reversal; + Style = aggregation.Style; + } + + [NotPublished] + public override object Clone() + { + return new HistoryAggregationPointsAndFigures(this); + } + } + public sealed class HistoryAggregationPowerTrades : HistoryAggregation + { + [CompilerGenerated] + private readonly HistoryAggregationPowerTradesParameters ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public HistoryAggregationPowerTradesParameters Parameters + { + [CompilerGenerated] + get + { + return ??; + } + } + + public override Period GetPeriod => Period.TICK1; + + public override HistoryType GetHistoryType => HistoryType.Last; + + [NotPublished] + public override Period DefaultRange => Period.HOUR1; + + public override IList Settings + { + get + { + return Parameters?.Settings ?? new List(); + } + set + { + if (Parameters != null) + { + Parameters.Settings = value; + } + } + } + + public HistoryAggregationPowerTrades() + { + ?? = new HistoryAggregationPowerTradesParameters(); + } + + public HistoryAggregationPowerTrades(HistoryAggregationPowerTradesParameters parameters) + : this() + { + ?? = parameters; + } + + protected HistoryAggregationPowerTrades(HistoryAggregationPowerTrades aggregation) + : base(aggregation) + { + ?? = aggregation.Parameters?.Clone() as HistoryAggregationPowerTradesParameters; + } + + [NotPublished] + public override object Clone() + { + return new HistoryAggregationPowerTrades(this); + } + + public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) + { + return new HistoryAggregationTick(HistoryType.Last); + } + } + public sealed class HistoryAggregationPriceChangesCountBars : HistoryAggregation, IHistoryAggregationHistoryTypeSupport + { + private const string ?? = "Ticks count"; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private HistoryType ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public int PriceChangesCount + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public HistoryType HistoryType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override IList Settings + { + get + { + List list = new List + { + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 5), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0) + }; + return new List + { + new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), PriceChangesCount) + { + Minimum = 1, + Increment = 1, + SortIndex = 10 + }, + new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list.FirstOrDefault((SelectItem P_0) => (int)(object)P_0.Value == (int)HistoryType) ?? list.FirstOrDefault(), list) + { + SortIndex = 11 + } + }; + } + set + { + if (value == null) + { + return; + } + foreach (SettingItem item in value) + { + string name = item.Name; + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + HistoryType = (HistoryType)(int)(object)((SelectItem)item.Value).Value; + } + } + else + { + PriceChangesCount = (int)item.Value; + } + } + } + } + + [NotPublished] + public override Period DefaultRange => Period.HOUR1; + + [NotPublished] + public override Period GetPeriod => Period.TICK1; + + [NotPublished] + public override HistoryType GetHistoryType => HistoryType; + + public HistoryAggregationPriceChangesCountBars(int priceChangesCount, HistoryType historyType) + { + PriceChangesCount = priceChangesCount; + HistoryType = historyType; + } + + public HistoryAggregationPriceChangesCountBars(HistoryAggregationPriceChangesCountBars aggregation) + : base(aggregation) + { + PriceChangesCount = aggregation.PriceChangesCount; + HistoryType = aggregation.HistoryType; + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 3); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(PriceChangesCount); + defaultInterpolatedStringHandler.AppendFormatted(Period.BasePeriodToShortString(BasePeriod.Tick)); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + [NotPublished] + public override string FormatTime(DateTime dt) + { + if (PriceChangesCount <= 1) + { + return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dt); + } + return Core.Instance.TimeUtils.GetFormatedDateTime(dt); + } + + [NotPublished] + public override object Clone() + { + return new HistoryAggregationPriceChangesCountBars(this); + } + + public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) + { + if (!metadata.AllowedAggregations.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + return null; + } + HistoryType value = ((HistoryType == HistoryType.Ask || HistoryType == HistoryType.Bid) ? HistoryType.BidAsk : HistoryType); + if (!metadata.AllowedHistoryTypesHistoryAggregationTick.Contains(value)) + { + return null; + } + return new HistoryAggregationTick(HistoryType); + } + + [CompilerGenerated] + private bool ?(SelectItem P_0) + { + return (int)(object)P_0.Value == (int)HistoryType; + } + } + [Published] + public sealed class HistoryAggregationRangeBars : HistoryAggregation, IHistoryAggregationHistoryTypeSupport + { + public const string SETTINGS_AGGREGATION_RANGE_BARS = "Range bars"; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private HistoryType ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public int RangeBars + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public HistoryType HistoryType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override IList Settings + { + get + { + List list = new List + { + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 5), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 2) + }; + return new List + { + new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), RangeBars) + { + Minimum = 1, + Increment = 1, + SortIndex = 10, + Text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }, + new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list.FirstOrDefault((SelectItem P_0) => (int)(object)P_0.Value == (int)HistoryType) ?? list.FirstOrDefault(), list) + { + SortIndex = 11 + } + }; + } + set + { + if (value == null) + { + return; + } + foreach (SettingItem item in value) + { + string name = item.Name; + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + HistoryType = (HistoryType)(int)(object)((SelectItem)item.Value).Value; + } + } + else + { + RangeBars = (int)item.Value; + } + } + } + } + + public override Period GetPeriod => Period.TICK1; + + [NotPublished] + public override HistoryType GetHistoryType => HistoryType; + + public HistoryAggregationRangeBars(int rangeBars, HistoryType historyType) + { + RangeBars = rangeBars; + HistoryType = historyType; + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 3); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(RangeBars); + defaultInterpolatedStringHandler.AppendFormatted(Period.BasePeriodToShortString(BasePeriod.Tick)); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + private HistoryAggregationRangeBars(HistoryAggregationRangeBars P_0) + : base(P_0) + { + RangeBars = P_0.RangeBars; + HistoryType = P_0.HistoryType; + } + + [NotPublished] + public override object Clone() + { + return new HistoryAggregationRangeBars(this); + } + + [NotPublished] + public override string FormatTime(DateTime dt) + { + return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dt); + } + + public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) + { + HistoryType historyType = ((HistoryType == HistoryType.Ask || HistoryType == HistoryType.Bid) ? HistoryType.BidAsk : HistoryType); + if (!metadata.AllowedHistoryTypesHistoryAggregationTick.Contains(historyType)) + { + return null; + } + return new HistoryAggregationTick(historyType); + } + + [CompilerGenerated] + private bool ?(SelectItem P_0) + { + return (int)(object)P_0.Value == (int)HistoryType; + } + } + [Published] + public sealed class HistoryAggregationRenko : HistoryAggregationTime + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + internal bool ?(SelectItem P_0) + { + return (int)(object)P_0.Value == 2; + } + + internal bool ?(SelectItem P_0) + { + return (int)(object)P_0.Value == 3; + } + } + + public const string SETTINGS_AGGREGATION_RENKO_BRICK_SIZE = "Brick size"; + + public const string SETTINGS_AGGREGATION_RENKO_STYLE = "Style"; + + public const string SETTINGS_AGGREGATION_RENKO_BUILD_CURRENT_BAR = "Build current bar"; + + public const string SETTINGS_AGGREGATION_RENKO_EXTENSION = "Extension, %"; + + public const string SETTINGS_AGGREGATION_RENKO_INVERSION = "Inversion, %"; + + public const string SETTINGS_AGGREGATION_RENKO_SHOW_WICKS = "Show wicks"; + + private const string ?? = "W"; + + private static readonly Dictionary ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private RenkoStyle ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public int BrickSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public RenkoStyle RenkoStyle + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = renkoStyle; + } + } + + public int Extension + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public int Inversion + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public bool ShowWicks + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = flag; + } + } + + public bool BuildCurrentBar + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = flag; + } + } + + private protected override IList SupportedHistoryTypes + { + get + { + IList supportedHistoryTypes = base.SupportedHistoryTypes; + supportedHistoryTypes.Add(HistoryType.BidAsk); + return supportedHistoryTypes; + } + } + + public override IList Settings + { + get + { + List list = new List + { + new SelectItem(RenkoStyle.Classic.ToString(), 0), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 2), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3) + }; + SettingItemRelationVisibility relation = new SettingItemRelationVisibility(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list.FirstOrDefault((SelectItem P_0) => (int)(object)P_0.Value == 2), list.FirstOrDefault((SelectItem P_0) => (int)(object)P_0.Value == 3)); + IList settings = base.Settings; + if (settings.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) is SettingItemPeriod settingItemPeriod) + { + settingItemPeriod.ExcludedPeriods = null; + } + settings.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), BrickSize) + { + SortIndex = 20, + Minimum = 1, + Maximum = int.MaxValue, + Increment = 1 + }); + settings.Add(new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list.GetItemByValue((int)RenkoStyle), list) + { + SortIndex = 30, + Description = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }); + settings.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Extension) + { + Minimum = 1, + Maximum = 1000, + SortIndex = 40, + Relation = relation + }); + settings.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Inversion) + { + Minimum = 1, + Maximum = 1000, + SortIndex = 50, + Relation = relation + }); + settings.Add(new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ShowWicks) + { + SortIndex = 60 + }); + settings.Add(new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), BuildCurrentBar) + { + SortIndex = 70 + }); + return settings; + } + set + { + if (value == null) + { + return; + } + foreach (SettingItem item in value) + { + if (item == null) + { + continue; + } + string name = item.Name; + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + ShowWicks = (bool)item.Value; + } + } + else + { + BuildCurrentBar = (bool)item.Value; + } + } + else + { + Inversion = (int)item.Value; + } + } + else + { + Extension = (int)item.Value; + } + } + else + { + RenkoStyle = (RenkoStyle)(int)(object)((SelectItem)item.Value).Value; + } + } + else + { + BrickSize = (int)item.Value; + } + } + base.Settings = value; + } + } + + [NotPublished] + public override TimeScaleType TimeScaleType => TimeScaleType.NonLinear; + + [NotPublished] + public override BarCreationBehavior BarCreationBehavior => BarCreationBehavior.Deferred; + + static HistoryAggregationRenko() + { + ?? = new Dictionary + { + { + RenkoStyle.Classic, + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }, + { + RenkoStyle.HighLow, + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }, + { + RenkoStyle.AdvancedClassic, + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }, + { + RenkoStyle.AdvancedHighLow, + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + } + }; + } + + public HistoryAggregationRenko(Period period, HistoryType historyType, int brickSize, RenkoStyle renkoStyle, int extension = 100, int inversion = 100, bool showWicks = false, bool buildCurrentBar = true) + : base(period, historyType) + { + BrickSize = brickSize; + RenkoStyle = renkoStyle; + Extension = extension; + Inversion = inversion; + ShowWicks = showWicks; + BuildCurrentBar = buildCurrentBar; + } + + public HistoryAggregation GetBaseAggregation() + { + if (base.Period.BasePeriod == BasePeriod.Tick) + { + if (base.Period.PeriodMultiplier == 1) + { + return new HistoryAggregationTick(base.HistoryType); + } + if (base.Period.PeriodMultiplier > 1) + { + return new HistoryAggregationTickBars(base.Period.PeriodMultiplier, base.HistoryType); + } + } + return new HistoryAggregationTime(base.Period, base.HistoryType); + } + + public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) + { + HistoryAggregation baseAggregation = GetBaseAggregation(); + if (baseAggregation is HistoryAggregationTime && !metadata.AllowedHistoryTypesHistoryAggregationTime.Contains(base.HistoryType)) + { + return null; + } + return baseAggregation.GetAggregationToDirectDownload(metadata); + } + + private HistoryAggregationRenko(HistoryAggregationRenko P_0) + : base(P_0) + { + BrickSize = P_0.BrickSize; + RenkoStyle = P_0.RenkoStyle; + ShowWicks = P_0.ShowWicks; + BuildCurrentBar = P_0.BuildCurrentBar; + Extension = P_0.Extension; + Inversion = P_0.Inversion; + } + + [NotPublished] + public override object Clone() + { + return new HistoryAggregationRenko(this); + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(5, 5); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(BrickSize); + defaultInterpolatedStringHandler.AppendFormatted(??[RenkoStyle]); + defaultInterpolatedStringHandler.AppendFormatted(ShowWicks ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : string.Empty); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.Period.Format()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + public sealed class HistoryAggregationReversal : HistoryAggregation + { + private const string ?? = "Length"; + + private const string ?? = "Reversal Length"; + + private const string ?? = "Calculation Type"; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private HistoryProcessorReversalCalculationType ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override IList Settings + { + get + { + return new List + { + new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Length) + { + Minimum = 0, + Increment = 1, + SortIndex = 10 + }, + new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ReversalLength) + { + Minimum = 1, + Increment = 1, + SortIndex = 10 + }, + new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)CalculationType, new List + { + new SelectItem(loc._(HistoryProcessorReversalCalculationType.PreviousBar.GetDescription(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), 0), + new SelectItem(loc._(HistoryProcessorReversalCalculationType.Independent.GetDescription(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), 1) + }) + { + SortIndex = 10 + } + }; + } + set + { + if (value == null) + { + return; + } + foreach (SettingItem item in value) + { + string name = item.Name; + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + ReversalLength = (int)item.Value; + } + } + else + { + Length = (int)item.Value; + } + } + CalculationType = (HistoryProcessorReversalCalculationType)value.GetValueOrDefault((int)CalculationType, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public int Length + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public int ReversalLength + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public HistoryProcessorReversalCalculationType CalculationType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = historyProcessorReversalCalculationType; + } + } + + public override Period GetPeriod => Period.TICK1; + + public override HistoryType GetHistoryType => HistoryType.Last; + + [NotPublished] + public override Period DefaultRange => Period.HOUR1; + + public HistoryAggregationReversal(int length, int reversalLength, HistoryProcessorReversalCalculationType calculationType) + { + Length = length; + ReversalLength = reversalLength; + CalculationType = calculationType; + } + + private HistoryAggregationReversal(HistoryAggregationReversal P_0) + : base(P_0) + { + Length = P_0.Length; + ReversalLength = P_0.ReversalLength; + CalculationType = P_0.CalculationType; + } + + public HistoryAggregationReversal(int length, int reversalLength) + : this(length, reversalLength, HistoryProcessorReversalCalculationType.PreviousBar) + { + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(9, 4); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Length); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(ReversalLength); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(CalculationType.GetDescription()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + [NotPublished] + public override object Clone() + { + return new HistoryAggregationReversal(this); + } + + [NotPublished] + public override string FormatTime(DateTime dt) + { + return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dt); + } + + public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) + { + return new HistoryAggregationTick(HistoryType.Last); + } + } + [Published] + public sealed class HistoryAggregationTick : HistoryAggregation, IHistoryAggregationHistoryTypeSupport + { + [CompilerGenerated] + private HistoryType ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public HistoryType HistoryType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override IList Settings + { + get + { + List list = new List + { + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 4), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 5) + }; + return new List + { + new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list.FirstOrDefault((SelectItem P_0) => (int)(object)P_0.Value == (int)HistoryType) ?? list.FirstOrDefault(), list) + { + SortIndex = 11 + } + }; + } + set + { + if (value == null) + { + return; + } + foreach (SettingItem item in value) + { + if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + HistoryType = (HistoryType)(int)(object)((SelectItem)item.Value).Value; + } + } + } + } + + [NotPublished] + public override Period DefaultRange => Period.HOUR1; + + [NotPublished] + public override Period GetPeriod => Period.TICK1; + + [NotPublished] + public override HistoryType GetHistoryType => HistoryType; + + public HistoryAggregationTick(HistoryType historyType) + { + HistoryType = historyType; + } + + public HistoryAggregationTick(HistoryAggregationTick aggregation) + : base(aggregation) + { + HistoryType = aggregation.HistoryType; + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 2); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(HistoryType); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + [NotPublished] + public override string FormatTime(DateTime dt) + { + return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dt); + } + + [NotPublished] + public override object Clone() + { + return new HistoryAggregationTick(this); + } + + public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) + { + if (!metadata.AllowedAggregations.Contains(Name)) + { + return null; + } + if (!metadata.AllowedHistoryTypesHistoryAggregationTick.Contains(HistoryType)) + { + return null; + } + return this; + } + + [CompilerGenerated] + private bool ?(SelectItem P_0) + { + return (int)(object)P_0.Value == (int)HistoryType; + } + } + public sealed class HistoryAggregationTickBars : HistoryAggregation, IHistoryAggregationHistoryTypeSupport + { + private const string ?? = "Ticks count"; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private HistoryType ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public int TicksCount + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public HistoryType HistoryType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override bool IsWaitingFirstQuoteRequired => true; + + public override IList Settings + { + get + { + List list = new List + { + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 5), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 2), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 4) + }; + return new List + { + new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TicksCount) + { + Minimum = 1, + Increment = 1, + SortIndex = 10 + }, + new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list.FirstOrDefault((SelectItem P_0) => (int)(object)P_0.Value == (int)HistoryType) ?? list.FirstOrDefault(), list) + { + SortIndex = 11 + } + }; + } + set + { + if (value == null) + { + return; + } + foreach (SettingItem item in value) + { + string name = item.Name; + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + HistoryType = (HistoryType)(int)(object)((SelectItem)item.Value).Value; + } + } + else + { + TicksCount = (int)item.Value; + } + } + } + } + + [NotPublished] + public override Period DefaultRange => Period.HOUR1; + + [NotPublished] + public override Period GetPeriod => new Period(BasePeriod.Tick, TicksCount); + + [NotPublished] + public override HistoryType GetHistoryType => HistoryType; + + public HistoryAggregationTickBars(int ticksCount, HistoryType historyType) + { + TicksCount = ticksCount; + HistoryType = historyType; + } + + public HistoryAggregationTickBars(HistoryAggregationTickBars aggregation) + : base(aggregation) + { + TicksCount = aggregation.TicksCount; + HistoryType = aggregation.HistoryType; + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 3); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(TicksCount); + defaultInterpolatedStringHandler.AppendFormatted(Period.BasePeriodToShortString(BasePeriod.Tick)); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + [NotPublished] + public override string FormatTime(DateTime dt) + { + if (TicksCount <= 1) + { + return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dt); + } + return Core.Instance.TimeUtils.GetFormatedDateTime(dt); + } + + [NotPublished] + public override object Clone() + { + return new HistoryAggregationTickBars(this); + } + + public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) + { + if (metadata.AllowedAggregations.Contains(Name)) + { + return this; + } + HistoryType historyType = HistoryType; + if (!metadata.AllowedHistoryTypesHistoryAggregationTick.Contains(historyType)) + { + return null; + } + return new HistoryAggregationTick(HistoryType); + } + + [CompilerGenerated] + private bool ?(SelectItem P_0) + { + return (int)(object)P_0.Value == (int)HistoryType; + } + } + public sealed class HistoryAggregationTickLastAggregated : HistoryAggregation + { + [CompilerGenerated] + private TimeSpan ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override Period GetPeriod => Period.TICK1; + + public override HistoryType GetHistoryType => HistoryType.Last; + + public TimeSpan TimeDelay + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override IList Settings + { + get + { + return new List + { + new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)TimeDelay.TotalMilliseconds) + { + SortIndex = 10, + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + Minimum = 1 + } + }; + } + set + { + if (value == null) + { + return; + } + foreach (SettingItem item in value) + { + if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + TimeDelay = TimeSpan.FromMilliseconds((int)item.Value); + } + } + } + } + + [NotPublished] + public override Period DefaultRange => Period.HOUR1; + + public HistoryAggregationTickLastAggregated() + { + TimeDelay = TimeSpan.FromMilliseconds(500.0); + } + + public HistoryAggregationTickLastAggregated(HistoryAggregationTickLastAggregated original) + { + TimeDelay = original.TimeDelay; + } + + public override object Clone() + { + return new HistoryAggregationTickLastAggregated(this); + } + + [NotPublished] + public override string FormatTime(DateTime dt) + { + return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dt); + } + + public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) + { + return new HistoryAggregationTick(HistoryType.Last); + } + } + [Published] + public class HistoryAggregationTime : HistoryAggregation, IHistoryAggregationHistoryTypeSupport + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal SelectItem ?(HistoryType P_0) + { + return new SelectItem(P_0.GetDescription(), (int)P_0); + } + } + + [CompilerGenerated] + private Period ??; + + [CompilerGenerated] + private HistoryType ??; + + [CompilerGenerated] + private bool ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public Period Period + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public HistoryType HistoryType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool UsePrevCloseAsOpenPriceBar + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + private protected virtual IList SupportedHistoryTypes => new List + { + HistoryType.Last, + HistoryType.Mark, + HistoryType.Bid, + HistoryType.Ask, + HistoryType.Midpoint + }; + + public override IList Settings + { + get + { + List list = SupportedHistoryTypes.Select((HistoryType P_0) => new SelectItem(P_0.GetDescription(), (int)P_0)).ToList(); + List list2 = new List(); + list2.Add(new SettingItemPeriod(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), Period) + { + SortIndex = 10, + ExcludedPeriods = new BasePeriod[1], + Description = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }); + list2.Add(new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list.FirstOrDefault((SelectItem P_0) => (int)(object)P_0.Value == (int)HistoryType) ?? list.FirstOrDefault(), list) + { + SortIndex = 11 + }); + return list2; + } + set + { + if (value == null) + { + return; + } + foreach (SettingItem item in value) + { + string name = item.Name; + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())) + { + if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + HistoryType = (HistoryType)(int)(object)((SelectItem)item.Value).Value; + } + } + else + { + Period = (Period)item.Value; + } + } + } + } + + [NotPublished] + public override Period GetPeriod => Period; + + [NotPublished] + public override HistoryType GetHistoryType => HistoryType; + + [NotPublished] + public override TimeScaleType TimeScaleType => TimeScaleType.Linear; + + [NotPublished] + public override Period DefaultRange + { + get + { + if (Period.Ticks < 600000000) + { + return Period.DAY1; + } + if (Period.Ticks == 600000000) + { + return new Period(BasePeriod.Day, 3); + } + if (Period.Ticks <= 864000000000L) + { + return Period.MONTH1; + } + return new Period(BasePeriod.Year, 10); + } + } + + public HistoryAggregationTime(Period period, HistoryType historyType) + { + Period = period; + HistoryType = historyType; + } + + [NotPublished] + public override string ToString() + { + return Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Period.Format(); + } + + protected HistoryAggregationTime(HistoryAggregationTime aggregation) + : base(aggregation) + { + Period = aggregation.Period; + HistoryType = aggregation.HistoryType; + } + + [NotPublished] + public override object Clone() + { + return new HistoryAggregationTime(this); + } + + [NotPublished] + public override string FormatTime(DateTime dt) + { + return Period.Format(dt); + } + + public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) + { + if (metadata.AllowedAggregations.Contains(Name) && metadata.AllowedHistoryTypesHistoryAggregationTime.Contains(HistoryType)) + { + if (metadata.AllowedPeriodsHistoryAggregationTime.Contains(Period)) + { + return this; + } + if (metadata.AllowedBasePeriodsHistoryAggregationTime.Contains(Period.BasePeriod)) + { + return new HistoryAggregationTime(Period, HistoryType); + } + Period period = metadata.AllowedPeriodsHistoryAggregationTime.FirstOrDefault((Period P_0) => Period.Ticks % P_0.Ticks == 0); + if (period != default(Period)) + { + return new HistoryAggregationTime(period, HistoryType); + } + } + if (!metadata.AllowedAggregations.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + return null; + } + HistoryType historyType = ((HistoryType == HistoryType.Ask || HistoryType == HistoryType.Bid) ? HistoryType.BidAsk : HistoryType); + if (!metadata.AllowedHistoryTypesHistoryAggregationTick.Contains(historyType)) + { + return null; + } + return new HistoryAggregationTick(historyType); + } + + [CompilerGenerated] + private bool ?(SelectItem P_0) + { + return (int)(object)P_0.Value == (int)HistoryType; + } + + [CompilerGenerated] + private bool ?(Period P_0) + { + return Period.Ticks % P_0.Ticks == 0; + } + } + public sealed class HistoryAggregationTimeStatistics : HistoryAggregation + { + [CompilerGenerated] + private Period ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public Period Period + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = period; + } + } + + public override IList Settings + { + get + { + List list = new List(); + list.Add(new SettingItemPeriod(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), Period) + { + SortIndex = 10, + ExcludedPeriods = new BasePeriod[1], + Description = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }); + return list; + } + set + { + if (value == null) + { + return; + } + foreach (SettingItem item in value) + { + if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) + { + Period = (Period)item.Value; + } + } + } + } + + [NotPublished] + public override Period GetPeriod => Period; + + [NotPublished] + public override HistoryType GetHistoryType => HistoryType.Last; + + public HistoryAggregationTimeStatistics(Period period) + { + Period = period; + } + + protected HistoryAggregationTimeStatistics(HistoryAggregationTimeStatistics aggregation) + : base(aggregation) + { + Period = aggregation.Period; + } + + [NotPublished] + public override object Clone() + { + return new HistoryAggregationTimeStatistics(this); + } + + [NotPublished] + public override string ToString() + { + return Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Period.Format(); + } + + public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) + { + if (metadata.AllowedAggregations.Contains(Name) && (metadata.AllowedBasePeriodsHistoryAggregationTimeStatistics.Contains(Period.BasePeriod) || metadata.AllowedPeriodsHistoryAggregationTimeStatistics.Contains(Period))) + { + return this; + } + if (metadata.AllowedAggregations.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) && (metadata.AllowedBasePeriodsHistoryAggregationTimeStatistics.Contains(Period.BasePeriod) || metadata.AllowedPeriodsHistoryAggregationTimeStatistics.Contains(Period))) + { + return new HistoryAggregationVolumeProfile(Period); + } + if (metadata.AllowedAggregations.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) && metadata.AllowedHistoryTypesHistoryAggregationTick.Contains(HistoryType.Last)) + { + return new HistoryAggregationTick(HistoryType.Last); + } + return null; + } + } + public sealed class HistoryAggregationVolume : HistoryAggregation + { + public const string SETTINGS_AGGREGATION_VOLUME_VALUE = "Volume value"; + + [CompilerGenerated] + private int ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); + + public int VolumeValue + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public override IList Settings + { + get + { + return new List + { + new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), VolumeValue) + { + Minimum = 1, + Increment = 1, + SortIndex = 10 + } + }; + } + set + { + if (value == null) + { + return; + } + foreach (SettingItem item in value) + { + if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + VolumeValue = (int)item.Value; + } + } + } + } + + public override Period GetPeriod => Period.TICK1; + + public override HistoryType GetHistoryType => HistoryType.Last; + + [NotPublished] + public override Period DefaultRange => Period.HOUR1; + + public HistoryAggregationVolume(int volumeValue) + { + VolumeValue = volumeValue; + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 2); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(VolumeValue); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + private HistoryAggregationVolume(HistoryAggregationVolume P_0) + : base(P_0) + { + VolumeValue = P_0.VolumeValue; + } + + [NotPublished] + public override object Clone() + { + return new HistoryAggregationVolume(this); + } + + [NotPublished] + public override string FormatTime(DateTime dt) + { + return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dt); + } + + public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) + { + return new HistoryAggregationTick(HistoryType.Last); + } + } + public sealed class HistoryAggregationVolumeProfile : HistoryAggregation + { + [CompilerGenerated] + private Period ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public Period Period + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = period; + } + } + + public override IList Settings + { + get + { + List list = new List(); + list.Add(new SettingItemPeriod(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), Period) + { + SortIndex = 10, + ExcludedPeriods = new BasePeriod[1], + Description = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }); + return list; + } + set + { + if (value == null) + { + return; + } + foreach (SettingItem item in value) + { + if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()) + { + Period = (Period)item.Value; + } + } + } + } + + [NotPublished] + public override Period GetPeriod => Period; + + [NotPublished] + public override HistoryType GetHistoryType => HistoryType.Last; + + public HistoryAggregationVolumeProfile(Period period) + { + Period = period; + } + + protected HistoryAggregationVolumeProfile(HistoryAggregationVolumeProfile aggregation) + : base(aggregation) + { + Period = aggregation.Period; + } + + [NotPublished] + public override object Clone() + { + return new HistoryAggregationVolumeProfile(this); + } + + [NotPublished] + public override string ToString() + { + return Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Period.Format(); + } + + public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) + { + if (metadata.AllowedAggregations.Contains(Name) && metadata.AllowedPeriodsHistoryAggregationTime.Contains(Period)) + { + return this; + } + if (metadata.AllowedAggregations.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) && metadata.AllowedHistoryTypesHistoryAggregationTick.Contains(HistoryType.Last)) + { + return new HistoryAggregationTick(HistoryType.Last); + } + return null; + } + } + public sealed class HistoryAggregationVwap : HistoryAggregation + { + [CompilerGenerated] + private readonly HistoryAggregationVwapParameters ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public HistoryAggregationVwapParameters Parameters + { + [CompilerGenerated] + get + { + return ??; + } + } + + public override TimeScaleType TimeScaleType => Parameters.Aggregation.TimeScaleType; + + public override Period DefaultRange => Period.HOUR1; + + public override Period GetPeriod + { + get + { + if (Parameters.DataType == VwapDataType.Tick) + { + return Period.TICK1; + } + return Parameters.Aggregation.GetPeriod; + } + } + + public override HistoryType GetHistoryType => Parameters.Aggregation.GetHistoryType; + + public override IList Settings + { + get + { + return Parameters?.Settings ?? new List(); + } + set + { + if (Parameters != null) + { + Parameters.Settings = value; + } + } + } + + public HistoryAggregationVwap() + { + ?? = new HistoryAggregationVwapParameters(); + } + + public HistoryAggregationVwap(HistoryAggregationVwapParameters parameters) + : this() + { + ?? = new HistoryAggregationVwapParameters(parameters); + } + + protected HistoryAggregationVwap(HistoryAggregationVwap aggregation) + : base(aggregation) + { + ?? = new HistoryAggregationVwapParameters(aggregation.Parameters); + } + + [NotPublished] + public override object Clone() + { + return new HistoryAggregationVwap(this); + } + + public override HistoryAggregation GetAggregationToDirectDownload(HistoryMetadata metadata) + { + if (Parameters.DataType == VwapDataType.Tick) + { + if (!metadata.AllowedHistoryTypesHistoryAggregationTick.Contains(HistoryType.Last)) + { + return null; + } + return new HistoryAggregationTick(HistoryType.Last); + } + return Parameters.Aggregation.GetAggregationToDirectDownload(metadata); + } + } + public abstract class HistoryProcessor : IHistoryProcessor, IDisposable + { + protected long sessionOffset; + + [CompilerGenerated] + private HistoryEventHandler ??; + + [CompilerGenerated] + private HistoryEventHandler ??; + + public virtual SubscribeQuoteType? GetSubscribeQuoteType => null; + + public event HistoryEventHandler NewHistoryItem + { + [CompilerGenerated] + add + { + HistoryEventHandler historyEventHandler = ??; + HistoryEventHandler historyEventHandler2; + do + { + historyEventHandler2 = historyEventHandler; + HistoryEventHandler value2 = (HistoryEventHandler)Delegate.Combine(historyEventHandler2, value); + historyEventHandler = Interlocked.CompareExchange(ref ??, value2, historyEventHandler2); + } + while ((object)historyEventHandler != historyEventHandler2); + } + [CompilerGenerated] + remove + { + HistoryEventHandler historyEventHandler = ??; + HistoryEventHandler historyEventHandler2; + do + { + historyEventHandler2 = historyEventHandler; + HistoryEventHandler value2 = (HistoryEventHandler)Delegate.Remove(historyEventHandler2, value); + historyEventHandler = Interlocked.CompareExchange(ref ??, value2, historyEventHandler2); + } + while ((object)historyEventHandler != historyEventHandler2); + } + } + + public event HistoryEventHandler HistoryItemUpdated + { + [CompilerGenerated] + add + { + HistoryEventHandler historyEventHandler = ??; + HistoryEventHandler historyEventHandler2; + do + { + historyEventHandler2 = historyEventHandler; + HistoryEventHandler value2 = (HistoryEventHandler)Delegate.Combine(historyEventHandler2, value); + historyEventHandler = Interlocked.CompareExchange(ref ??, value2, historyEventHandler2); + } + while ((object)historyEventHandler != historyEventHandler2); + } + [CompilerGenerated] + remove + { + HistoryEventHandler historyEventHandler = ??; + HistoryEventHandler historyEventHandler2; + do + { + historyEventHandler2 = historyEventHandler; + HistoryEventHandler value2 = (HistoryEventHandler)Delegate.Remove(historyEventHandler2, value); + historyEventHandler = Interlocked.CompareExchange(ref ??, value2, historyEventHandler2); + } + while ((object)historyEventHandler != historyEventHandler2); + } + } + + public HistoryProcessor() + { + } + + public virtual void Initialize(HistoryRequestParameters historyRequestParameters) + { + try + { + if (historyRequestParameters?.SessionsContainer != null) + { + sessionOffset = -historyRequestParameters.SessionsContainer.GetSessionOpenTime(Core.Instance.TimeUtils.SelectedTimeZone); + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + public virtual IList AggregateHistory(HistoryHolder historyHolder) + { + return historyHolder.History; + } + + public virtual void ProcessQuote(MessageQuote messageQuote) + { + } + + public virtual void CorrectHistoryRequestBorders(HistoryRequestParameters historyRequestParameters) + { + } + + public virtual string GetTimeToNextBar() + { + return null; + } + + public virtual void Dispose() + { + } + + protected void OnNewHistoryItem(HistoryEventArgs e) + { + ???.Invoke(this, e); + } + + protected void OnHistoryItemUpdated(HistoryEventArgs e) + { + ???.Invoke(this, e); + } + + public static bool IsDayOpeningNow(long barTime, long currentTime, long sessionOffset) + { + return (barTime + sessionOffset) / 864000000000L != (currentTime + sessionOffset) / 864000000000L; + } + } + public class HistoryProcessorEventArgs : EventArgs + { + [CompilerGenerated] + private UpdateReason ?; + + public new static HistoryProcessorEventArgs Empty => new HistoryProcessorEventArgs(); + + public UpdateReason IndicatorUpdateReason + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = updateReason; + } + } + + public HistoryProcessorEventArgs(UpdateReason updateReason = UpdateReason.Unknown) + { + IndicatorUpdateReason = updateReason; + } + } + public class HistoryProcessorItemUpdatedEventArgs : HistoryProcessorEventArgs + { + [CompilerGenerated] + private int ??; + + public int ItemOffset + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public HistoryProcessorItemUpdatedEventArgs(int itemOffset = 0) + { + ItemOffset = itemOffset; + } + } + public sealed class HistoricalDataCustom : HistoricalData + { + private Indicator ??; + + public double this[PriceType priceType, int offset = 0] + { + get + { + IHistoryItem historyItem = this[offset, SeekOriginHistory.End]; + switch (priceType) + { + case PriceType.Open: + return historyItem[PriceType.Open]; + case PriceType.High: + return historyItem[PriceType.High]; + case PriceType.Low: + return historyItem[PriceType.Low]; + case PriceType.Close: + return historyItem[PriceType.Close]; + default: + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(priceType); + throw new InvalidOperationException(defaultInterpolatedStringHandler.ToStringAndClear()); + } + } + } + set + { + IHistoryItem historyItem = this[offset, SeekOriginHistory.End]; + switch (priceType) + { + case PriceType.Open: + SetValue(value, historyItem[PriceType.High], historyItem[PriceType.Low], historyItem[PriceType.Close], offset); + return; + case PriceType.High: + SetValue(historyItem[PriceType.Open], value, historyItem[PriceType.Low], historyItem[PriceType.Close], offset); + return; + case PriceType.Low: + SetValue(historyItem[PriceType.Open], historyItem[PriceType.High], value, historyItem[PriceType.Close], offset); + return; + case PriceType.Close: + SetValue(historyItem[PriceType.Open], historyItem[PriceType.High], historyItem[PriceType.Low], value, offset); + return; + } + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(priceType); + throw new InvalidOperationException(defaultInterpolatedStringHandler.ToStringAndClear()); + } + } + + public HistoricalDataCustom(Indicator indicator = null) + { + Parameters = new HistoryRequestParameters(); + if (indicator != null) + { + ?? = indicator; + Parameters.Symbol = indicator.HistoricalData.Symbol; + Parameters.Aggregation = indicator.HistoricalData.Aggregation.Clone() as HistoryAggregation; + indicator.?(this); + } + else + { + Parameters.Aggregation = new HistoryAggregationTime(Period.MIN1, HistoryType.Bid); + } + } + + public void AddValue(double open, double high, double low, double close) + { + if (?? != null) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(153, 4); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(??.ShortName); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + throw new InvalidOperationException(defaultInterpolatedStringHandler.ToStringAndClear()); + } + AddNewItem(new HistoryItemCustom(open, high, low, close)); + } + + public void SetValue(double open, double high, double low, double close, int offset = 0) + { + if (!(this[offset, SeekOriginHistory.End] is HistoryItemCustom historyItemCustom)) + { + throw new IndexOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + Indicator[] all = Indicators.All; + if (all.Length != 0) + { + while (Count - all[0].Count > 1) + { + Indicators.Update(new UpdateArgs(UpdateReason.NewBar)); + } + } + bool isEmpty = historyItemCustom.IsEmpty; + historyItemCustom.Open = open; + historyItemCustom.High = high; + historyItemCustom.Low = low; + historyItemCustom.Close = close; + historyItemCustom.IsEmpty = false; + if (offset == 0) + { + Indicators.Update(new UpdateArgs(isEmpty ? UpdateReason.NewBar : UpdateReason.NewTick)); + } + } + + internal void ?() + { + AddNewItem(new HistoryItemCustom(double.NaN, double.NaN, double.NaN, double.NaN) + { + IsEmpty = true + }, updateIndicators: false); + } + + private protected override void ?(IHistoryItem P_0) + { + HistoryItemCustom obj = P_0 as HistoryItemCustom; + if (obj != null && !obj.IsEmpty) + { + base.?(P_0); + } + } + + private protected override void ?(HistoryEventArgs P_0 = null, IndicatorUpdateType? P_1 = null) + { + if (Count != 0 && !(base[0, SeekOriginHistory.End] as HistoryItemCustom).IsEmpty) + { + base.?(P_0, P_1); + } + } + + public override void Dispose() + { + base.Dispose(); + ?? = null; + } + + internal HistoricalDataCustom(HistoryRequestParameters P_0) + : base(P_0) + { + } + + private protected override void ?() + { + } + + protected override void SubscribeSymbol() + { + } + + protected override void UnSubscribeSymbol() + { + } + } + public sealed class HistoryItemCustom : HistoryItem + { + private const int ?? = 0; + + private const int ?? = 1; + + private const int ?? = 2; + + private const int ?? = 3; + + private double[] ??; + + [CompilerGenerated] + private bool ??; + + internal double Open + { + get + { + return ??[0]; + } + set + { + ??[0] = num; + } + } + + internal double High + { + get + { + return ??[1]; + } + set + { + ??[1] = num; + } + } + + internal double Low + { + get + { + return ??[2]; + } + set + { + ??[2] = num; + } + } + + internal double Close + { + get + { + return ??[3]; + } + set + { + ??[3] = num; + } + } + + public override double this[PriceType priceType] => priceType switch + { + PriceType.Open => Open, + PriceType.High => High, + PriceType.Low => Low, + PriceType.Close => Close, + _ => base[priceType], + }; + + internal bool IsEmpty + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = flag; + } + } + + internal HistoryItemCustom(double P_0, double P_1, double P_2, double P_3) + { + ?? = new double[4]; + Open = P_0; + High = P_1; + Low = P_2; + Close = P_3; + IsEmpty = double.IsNaN(P_0) && double.IsNaN(P_1) && double.IsNaN(P_2) && double.IsNaN(P_3); + } + + private HistoryItemCustom(HistoryItemCustom P_0) + : base(P_0) + { + ?? = new double[4]; + for (int i = 0; i < P_0.??.Length; i++) + { + ??[i] = P_0.??[i]; + } + } + + public override object Clone() + { + return new HistoryItemCustom(this); + } + } + public class Price + { + [CompilerGenerated] + private PriceType ?; + + [CompilerGenerated] + private double ?; + + public PriceType Type + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = priceType; + } + } + + public double Value + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = num; + } + } + + public Price(PriceType priceType) + { + Type = priceType; + Value = double.NaN; + } + + public Price(PriceType priceType, double value) + { + Type = priceType; + Value = value; + } + } + /// + /// Represent access to historical data information and indicators control. + /// + [Published] + public class HistoricalData : IDisposable, IIndicatorsCollection, IEnumerable, IEnumerable + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func, Period> ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func, Period> ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func, Period> ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + internal BasePeriod ?(Period P_0) + { + return P_0.BasePeriod; + } + + internal Period ?(IGrouping P_0) + { + return P_0.OrderByDescending((Period period) => period.PeriodMultiplier).Last(); + } + + internal int ?(Period P_0) + { + return P_0.PeriodMultiplier; + } + + internal Period ?(BasePeriod P_0) + { + return new Period(P_0, 1); + } + + internal long ?(Period P_0) + { + return P_0.Ticks; + } + + internal BasePeriod ?(Period P_0) + { + return P_0.BasePeriod; + } + + internal Period ?(IGrouping P_0) + { + return P_0.OrderByDescending((Period period) => period.PeriodMultiplier).Last(); + } + + internal int ?(Period P_0) + { + return P_0.PeriodMultiplier; + } + + internal Period ?(BasePeriod P_0) + { + return new Period(P_0, 1); + } + + internal long ?(Period P_0) + { + return P_0.Ticks; + } + + internal HistoryAggregationTimeStatistics ?(Period P_0) + { + return new HistoryAggregationTimeStatistics(P_0); + } + + internal BasePeriod ?(Period P_0) + { + return P_0.BasePeriod; + } + + internal Period ?(IGrouping P_0) + { + return P_0.OrderByDescending((Period period) => period.PeriodMultiplier).Last(); + } + + internal int ?(Period P_0) + { + return P_0.PeriodMultiplier; + } + + internal Period ?(BasePeriod P_0) + { + return new Period(P_0, 1); + } + + internal long ?(Period P_0) + { + return P_0.Ticks; + } + + internal HistoryAggregationVolumeProfile ?(Period P_0) + { + return new HistoryAggregationVolumeProfile(P_0); + } + } + + [CompilerGenerated] + private sealed class ? + { + public HistoryAggregationTime ??; + + public HistoryAggregationTimeStatistics ??; + + public HistoryAggregationVolumeProfile ??; + + internal bool ?(Period P_0) + { + return ??.Period.Ticks % P_0.Ticks == 0; + } + + internal bool ?(Period P_0) + { + return P_0.Ticks < ??.Period.Ticks; + } + + internal HistoryAggregationTime ?(Period P_0) + { + return new HistoryAggregationTime(P_0, ??.HistoryType); + } + + internal bool ?(Period P_0) + { + return ??.Period.Ticks % P_0.Ticks == 0; + } + + internal bool ?(Period P_0) + { + return P_0.Ticks < ??.Period.Ticks; + } + + internal bool ?(Period P_0) + { + return ??.Period.Ticks % P_0.Ticks == 0; + } + + internal bool ?(Period P_0) + { + return P_0.Ticks < ??.Period.Ticks; + } + } + + [StructLayout(LayoutKind.Auto)] + [CompilerGenerated] + private struct ? + { + public HistoricalData ??; + + public MessageQuote ??; + } + + [CompilerGenerated] + private HistoryEventHandler ??; + + [CompilerGenerated] + private HistoryEventHandler ??; + + [CompilerGenerated] + private HistoryEventHandler ??; + + private readonly List ??; + + protected readonly object itemsLocker; + + protected HistoryRequestParameters Parameters; + + private protected IHistoryProcessor ??; + + [CompilerGenerated] + private readonly BuiltInIndicators ??; + + private bool ??; + + private CancellationTokenSource ??; + + private HistoricalDataState ??; + + private readonly ConcurrentQueue ??; + + private readonly bool ??; + + private MessageQuote ??; + + private MessageQuote ??; + + private MessageQuote ??; + + private readonly ManualResetEventSlim ??; + + protected readonly IndicatorsCollection Indicators; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private IVolumeAnalysisCalculationProgress ??; + + /// + /// Gets HistoricalData symbol + /// + public Symbol Symbol => Parameters?.Symbol; + + /// + /// Gets HistoricalData aggregation + /// + public HistoryAggregation Aggregation => Parameters?.Aggregation; + + /// + /// Gets HistoricalData left time boundary + /// + public DateTime FromTime => Parameters.FromTime; + + /// + /// Gets HistoricalData right time boundary + /// + public DateTime ToTime => Parameters.ToTime; + + /// + /// Gets HistoricalData items amount + /// + public virtual int Count + { + get + { + lock (itemsLocker) + { + return ??.Count; + } + } + } + + /// + /// Retrieves HistoricalData item by indexing offset and direction to find. + /// + /// + /// + /// + public virtual IHistoryItem this[int offset, SeekOriginHistory origin = SeekOriginHistory.End] + { + get + { + if (origin == SeekOriginHistory.End) + { + return ??[Count - 1 - offset]; + } + return ??[offset]; + } + private set + { + lock (itemsLocker) + { + if (seekOriginHistory == SeekOriginHistory.End) + { + ??[Count - 1 - num] = value2; + } + else + { + ??[num] = value2; + } + } + } + } + + /// + /// Gets access to built-in indicators + /// + public BuiltInIndicators BuiltInIndicators + { + [CompilerGenerated] + get + { + return ??; + } + } + + protected virtual bool NeedSubscribe + { + get + { + if (!??) + { + return ToTime == default(DateTime); + } + return false; + } + } + + /// + /// Gets array of attached indicators + /// + public Indicator[] AttachedIndicators => Indicators.All; + + public IndicatorCalculationBehavior IndicatorCalculationBehavior + { + get + { + return Indicators.CalculationBehavior; + } + set + { + Indicators.CalculationBehavior = value; + } + } + + [NotPublished] + public IVolumeAnalysisCalculationProgress VolumeAnalysisCalculationProgress + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Will be triggered when new historical item created + /// + public event HistoryEventHandler NewHistoryItem + { + [CompilerGenerated] + add + { + HistoryEventHandler historyEventHandler = ??; + HistoryEventHandler historyEventHandler2; + do + { + historyEventHandler2 = historyEventHandler; + HistoryEventHandler value2 = (HistoryEventHandler)Delegate.Combine(historyEventHandler2, value); + historyEventHandler = Interlocked.CompareExchange(ref ??, value2, historyEventHandler2); + } + while ((object)historyEventHandler != historyEventHandler2); + } + [CompilerGenerated] + remove + { + HistoryEventHandler historyEventHandler = ??; + HistoryEventHandler historyEventHandler2; + do + { + historyEventHandler2 = historyEventHandler; + HistoryEventHandler value2 = (HistoryEventHandler)Delegate.Remove(historyEventHandler2, value); + historyEventHandler = Interlocked.CompareExchange(ref ??, value2, historyEventHandler2); + } + while ((object)historyEventHandler != historyEventHandler2); + } + } + + /// + /// Will be triggered when current historical item changed or updated + /// + public event HistoryEventHandler HistoryItemUpdated + { + [CompilerGenerated] + add + { + HistoryEventHandler historyEventHandler = ??; + HistoryEventHandler historyEventHandler2; + do + { + historyEventHandler2 = historyEventHandler; + HistoryEventHandler value2 = (HistoryEventHandler)Delegate.Combine(historyEventHandler2, value); + historyEventHandler = Interlocked.CompareExchange(ref ??, value2, historyEventHandler2); + } + while ((object)historyEventHandler != historyEventHandler2); + } + [CompilerGenerated] + remove + { + HistoryEventHandler historyEventHandler = ??; + HistoryEventHandler historyEventHandler2; + do + { + historyEventHandler2 = historyEventHandler; + HistoryEventHandler value2 = (HistoryEventHandler)Delegate.Remove(historyEventHandler2, value); + historyEventHandler = Interlocked.CompareExchange(ref ??, value2, historyEventHandler2); + } + while ((object)historyEventHandler != historyEventHandler2); + } + } + + /// + /// Will be triggered when volume analysis of current historical item changed or updated + /// + public event Action HistoryItemVolumeAnalysisUpdated + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + [SpecialName] + [CompilerGenerated] + internal void ?(HistoryEventHandler P_0) + { + HistoryEventHandler historyEventHandler = ??; + HistoryEventHandler historyEventHandler2; + do + { + historyEventHandler2 = historyEventHandler; + HistoryEventHandler value = (HistoryEventHandler)Delegate.Combine(historyEventHandler2, P_0); + historyEventHandler = Interlocked.CompareExchange(ref ??, value, historyEventHandler2); + } + while ((object)historyEventHandler != historyEventHandler2); + } + + [SpecialName] + [CompilerGenerated] + internal void ?(HistoryEventHandler P_0) + { + HistoryEventHandler historyEventHandler = ??; + HistoryEventHandler historyEventHandler2; + do + { + historyEventHandler2 = historyEventHandler; + HistoryEventHandler value = (HistoryEventHandler)Delegate.Remove(historyEventHandler2, P_0); + historyEventHandler = Interlocked.CompareExchange(ref ??, value, historyEventHandler2); + } + while ((object)historyEventHandler != historyEventHandler2); + } + + private protected HistoricalData() + { + ?? = new List(); + itemsLocker = new object(); + ?? = false; + Indicators = new IndicatorsCollection(this); + ?? = HistoricalDataState.Pending; + ?? = new ConcurrentQueue(); + ?? = new ManualResetEventSlim(); + } + + protected internal HistoricalData(HistoryRequestParameters historyRequestParameters) + : this() + { + Parameters = historyRequestParameters; + HistoryAggregation historyAggregation = Core.Instance.HistoryAggregations[Parameters.Aggregation.Name]; + if (historyAggregation == null) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Parameters.Aggregation.Name); + } + historyAggregation = historyAggregation.Clone() as HistoryAggregation; + if (historyAggregation != null) + { + historyAggregation.Settings = Parameters.Aggregation.Settings; + } + Parameters.Aggregation = historyAggregation; + ?? = historyRequestParameters.ForceReload; + ?? = new BuiltInIndicators(this); + } + + /// + /// Reloads entire HistoricalData + /// + public void Reload() + { + if (Symbol == null || Symbol.State == BusinessObjectState.Fake) + { + return; + } + try + { + ?? = HistoricalDataState.Loading; + ???.Cancel(); + if (Parameters.CancellationToken == CancellationToken.None) + { + ?? = new CancellationTokenSource(); + } + ?(); + ?(); + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + HistoryRequestParameters copy = Parameters.Copy; + copy.ToTime = ((ToTime == default(DateTime) || ToTime >= dateTimeUtcNow) ? dateTimeUtcNow : ToTime); + if (Symbol.QuoteDelay != default(TimeSpan) && copy.ToTime > dateTimeUtcNow - Symbol.QuoteDelay) + { + copy.ToTime = dateTimeUtcNow - Symbol.QuoteDelay; + } + copy.ForceReload = ??; + copy.CancellationToken = ???.Token ?? Parameters.CancellationToken; + copy.ProgressInfo = Parameters.ProgressInfo; + if (Core.Instance.SymbolsMapping.TryGetHistorySymbol(Symbol, copy.Aggregation.GetPeriod, out var historySymbol)) + { + copy.Symbol = historySymbol; + } + if (NeedSubscribe) + { + SubscribeSymbol(); + if (Aggregation.IsWaitingFirstQuoteRequired) + { + WaitHandle.WaitAny(new WaitHandle[3] + { + copy.CancellationToken.WaitHandle, + ??.WaitHandle, + new CancellationTokenSource(TimeSpan.FromSeconds(3.0)).Token.WaitHandle + }); + } + if (?? != null) + { + copy.ToTime = ??.Time.AddMilliseconds(1.0); + } + } + if (!(FromTime == ToTime) || !(ToTime == default(DateTime))) + { + IList list = ?(copy); + if (Parameters.ExcludeOutOfSession && list != null && list.Count > 0 && Parameters.SessionsContainer != null && Parameters.SessionsContainer.ActiveSessions.Any()) + { + HistoryAggregation aggregationToDirectDownload = Parameters.Aggregation.GetAggregationToDirectDownload(Parameters.Symbol.HistoryMetadata); + if (aggregationToDirectDownload == null || !(aggregationToDirectDownload is HistoryAggregationTime historyAggregationTime) || !(historyAggregationTime.Period >= Period.DAY1)) + { + list = list.Where((IHistoryItem P_0) => Parameters.SessionsContainer.ContainsDate(P_0.TicksLeft)).ToList(); + } + } + if (list != null) + { + lock (itemsLocker) + { + ??.AddRange(list); + } + } + } + Indicators.Refresh(); + ?(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + ?? = HistoricalDataState.Working; + } + } + + private protected virtual IList ?(HistoryRequestParameters P_0) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(49, 4); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.Symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.Aggregation); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.Interval); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + long num = 0L; + int num2 = 0; + List list = new List(); + if (P_0.Symbol.State == BusinessObjectState.Fake) + { + return list; + } + if (P_0.FromTime > P_0.ToTime) + { + return list; + } + Connection connection = Core.Instance.Connections[P_0.Symbol.ConnectionId]; + if (connection == null || !connection.Connected) + { + return list; + } + CancellationToken cancellationToken = P_0.CancellationToken; + HistoryRequestParameters copy = P_0.Copy; + copy.ProgressInfo = P_0.ProgressInfo; + HistoryAggregation aggregationToDirectDownload = copy.Aggregation.GetAggregationToDirectDownload(P_0.Symbol.HistoryMetadata); + if (aggregationToDirectDownload == null) + { + return list; + } + copy.Aggregation = aggregationToDirectDownload; + Interval[] array = copy.Interval.Split(P_0.Symbol.GetHistoryDownloadingStep(copy.Aggregation)).ToArray(); + if (!array.Any()) + { + return list; + } + long num3 = copy.FromTime.Ticks; + Interval[] array2 = array; + for (int i = 0; i < array2.Length; i++) + { + Interval interval = array2[i]; + if (cancellationToken.IsCancellationRequested) + { + return list; + } + int num4 = ++num2 * 100 / array.Length; + HistoryRequestParameters copy2 = copy.Copy; + copy2.FromTime = interval.From; + copy2.ToTime = interval.To; + LoggerManager loggers2 = Core.Instance.Loggers; + defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(35, 4); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(num2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(array.Length); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(copy2.Interval); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers2.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); + IList list2 = connection.HistoryLoadingManager.?(copy2); + IHistoryItem historyItem = list2.LastOrDefault(); + if (historyItem != null) + { + num3 = historyItem.TicksLeft + copy.Aggregation.GetPeriod.Ticks; + } + LoggerManager loggers3 = Core.Instance.Loggers; + defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(75, 4); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(num2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(array.Length); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(list2.Count); + loggers3.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); + if (cancellationToken.IsCancellationRequested) + { + return list; + } + num += list2.Count; + IList list4; + if (list2.Count <= 0) + { + IList list3 = new List(); + list4 = list3; + } + else + { + list4 = ??.AggregateHistory(new HistoryHolder(list2, copy, (P_0.Symbol.HistoryMetadata.BuildUncompletedBars && num4 == 100) ? 99 : num4)); + } + IList list5 = list4; + if (cancellationToken.IsCancellationRequested) + { + return list; + } + list.AddRange(list5); + LoggerManager loggers4 = Core.Instance.Loggers; + defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(76, 4); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(num2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(array.Length); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(list5.Count); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers4.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); + if (P_0.ProgressInfo != null && array.Length > 2) + { + P_0.ProgressInfo.Report((float)num4 / 100f); + } + LoggerManager loggers5 = Core.Instance.Loggers; + defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(40, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(num2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(array.Length); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers5.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); + if (!P_0.Symbol.HistoryMetadata.BuildUncompletedBars || num4 != 100) + { + continue; + } + HistoryAggregation aggregation = copy.Aggregation; + HistoryAggregationTime ?? = aggregation as HistoryAggregationTime; + if (?? == null) + { + if (!(aggregation is HistoryAggregationTickBars historyAggregationTickBars)) + { + HistoryAggregationTimeStatistics ?? = aggregation as HistoryAggregationTimeStatistics; + if (?? == null) + { + HistoryAggregationVolumeProfile ?? = aggregation as HistoryAggregationVolumeProfile; + if (?? == null) + { + continue; + } + HistoryAggregation[] array3 = (from period in (from period in P_0.Symbol.HistoryMetadata.AllowedPeriodsHistoryAggregationTimeStatistics + where ??.Period.Ticks % period.Ticks == 0 + group period by period.BasePeriod into source + select source.OrderByDescending((Period period) => period.PeriodMultiplier).Last()).Union(P_0.Symbol.HistoryMetadata.AllowedBasePeriodsHistoryAggregationTimeStatistics.Select((BasePeriod basePeriod) => new Period(basePeriod, 1))) + where period.Ticks < ??.Period.Ticks + orderby period.Ticks descending + select new HistoryAggregationVolumeProfile(period)).Union((!P_0.Symbol.HistoryMetadata.AllowedAggregations.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) ? ((IEnumerable)Array.Empty()) : ((IEnumerable)new HistoryAggregation[1] + { + new HistoryAggregationTick(HistoryType.Last) + })).ToArray(); + for (int num5 = 0; num5 < array3.Length; num5++) + { + HistoryAggregation historyAggregation = array3[num5]; + TimeSpan historyDownloadingStep = P_0.Symbol.GetHistoryDownloadingStep(historyAggregation); + if (copy.ToTime.Ticks - num3 > historyDownloadingStep.Ticks) + { + num3 = copy.ToTime.Ticks - historyDownloadingStep.Ticks; + } + HistoryRequestParameters historyRequestParameters = new HistoryRequestParameters(copy) + { + FromTime = new DateTime(num3, DateTimeKind.Utc), + Aggregation = historyAggregation + }; + IList list6 = connection.HistoryLoadingManager.?(historyRequestParameters); + historyItem = list6.LastOrDefault(); + if (historyItem != null && historyAggregation is HistoryAggregationVolumeProfile historyAggregationVolumeProfile) + { + num3 = historyItem.TicksLeft + historyAggregationVolumeProfile.Period.Ticks; + } + IList collection = ??.AggregateHistory(new HistoryHolder(list6, historyRequestParameters, (num5 == array3.Length - 1) ? 100 : 99)); + list.AddRange(collection); + } + continue; + } + HistoryAggregation[] array4 = (from period in (from period in P_0.Symbol.HistoryMetadata.AllowedPeriodsHistoryAggregationTimeStatistics + where ??.Period.Ticks % period.Ticks == 0 + group period by period.BasePeriod into source + select source.OrderByDescending((Period period) => period.PeriodMultiplier).Last()).Union(P_0.Symbol.HistoryMetadata.AllowedBasePeriodsHistoryAggregationTimeStatistics.Select((BasePeriod basePeriod) => new Period(basePeriod, 1))) + where period.Ticks < ??.Period.Ticks + orderby period.Ticks descending + select new HistoryAggregationTimeStatistics(period)).Union((!P_0.Symbol.HistoryMetadata.AllowedAggregations.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) ? ((IEnumerable)Array.Empty()) : ((IEnumerable)new HistoryAggregation[1] + { + new HistoryAggregationTick(HistoryType.Last) + })).ToArray(); + for (int num6 = 0; num6 < array4.Length; num6++) + { + HistoryAggregation historyAggregation2 = array4[num6]; + TimeSpan historyDownloadingStep2 = P_0.Symbol.GetHistoryDownloadingStep(historyAggregation2); + if (copy.ToTime.Ticks - num3 > historyDownloadingStep2.Ticks) + { + num3 = copy.ToTime.Ticks - historyDownloadingStep2.Ticks; + } + HistoryRequestParameters historyRequestParameters2 = new HistoryRequestParameters(copy) + { + FromTime = new DateTime(num3, DateTimeKind.Utc), + Aggregation = historyAggregation2 + }; + IList list7 = connection.HistoryLoadingManager.?(historyRequestParameters2); + historyItem = list7.LastOrDefault(); + if (historyItem != null && historyAggregation2 is HistoryAggregationTimeStatistics historyAggregationTimeStatistics) + { + num3 = historyItem.TicksLeft + historyAggregationTimeStatistics.Period.Ticks; + } + IList collection2 = ??.AggregateHistory(new HistoryHolder(list7, historyRequestParameters2, (num6 == array4.Length - 1) ? 100 : 99)); + list.AddRange(collection2); + } + } + else + { + if (!P_0.Symbol.HistoryMetadata.AllowedAggregations.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) || !P_0.Symbol.HistoryMetadata.AllowedHistoryTypesHistoryAggregationTick.Contains(historyAggregationTickBars.HistoryType)) + { + continue; + } + if (list.Any()) + { + IHistoryItem historyItem2 = list.Last(); + if (historyItem2.TicksRight == 0L) + { + list.RemoveAt(list.Count - 1); + num3 = historyItem2.TicksLeft; + } + else + { + num3 = historyItem2.TicksRight + 1; + } + } + TimeSpan downloadingStep_Tick = P_0.Symbol.HistoryMetadata.DownloadingStep_Tick; + if (copy.ToTime.Ticks - num3 > downloadingStep_Tick.Ticks) + { + num3 = copy.ToTime.Ticks - downloadingStep_Tick.Ticks; + } + HistoryRequestParameters historyRequestParameters3 = new HistoryRequestParameters(copy) + { + FromTime = new DateTime(num3, DateTimeKind.Utc), + Aggregation = new HistoryAggregationTick(historyAggregationTickBars.HistoryType) + }; + IList history = connection.HistoryLoadingManager.?(historyRequestParameters3); + IList collection3 = ??.AggregateHistory(new HistoryHolder(history, historyRequestParameters3)); + list.AddRange(collection3); + } + continue; + } + HistoryAggregation[] array5 = (from period in (from period in P_0.Symbol.HistoryMetadata.AllowedPeriodsHistoryAggregationTime + where ??.Period.Ticks % period.Ticks == 0 + group period by period.BasePeriod into source + select source.OrderByDescending((Period period) => period.PeriodMultiplier).Last()).Union(P_0.Symbol.HistoryMetadata.AllowedBasePeriodsHistoryAggregationTime.Select((BasePeriod basePeriod) => new Period(basePeriod, 1))) + where period.Ticks < ??.Period.Ticks + orderby period.Ticks descending + select new HistoryAggregationTime(period, ??.HistoryType)).Union((!P_0.Symbol.HistoryMetadata.AllowedAggregations.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) ? ((IEnumerable)Array.Empty()) : ((IEnumerable)new HistoryAggregation[1] + { + new HistoryAggregationTick((??.HistoryType == HistoryType.Bid || ??.HistoryType == HistoryType.Ask) ? HistoryType.BidAsk : ??.HistoryType) + })).ToArray(); + for (int num7 = 0; num7 < array5.Length; num7++) + { + HistoryAggregation historyAggregation3 = array5[num7]; + TimeSpan historyDownloadingStep3 = P_0.Symbol.GetHistoryDownloadingStep(historyAggregation3); + if (copy.ToTime.Ticks - num3 > historyDownloadingStep3.Ticks) + { + num3 = copy.ToTime.Ticks - historyDownloadingStep3.Ticks; + } + HistoryRequestParameters historyRequestParameters4 = new HistoryRequestParameters(copy) + { + FromTime = new DateTime(num3, DateTimeKind.Utc), + Aggregation = historyAggregation3, + HistoryRequestType = HistoryRequestType.BuildUncompleteBarLogic + }; + IList list8 = connection.HistoryLoadingManager.?(historyRequestParameters4); + historyItem = list8.LastOrDefault(); + if (historyItem != null && historyAggregation3 is HistoryAggregationTime historyAggregationTime) + { + num3 = historyItem.TicksLeft + historyAggregationTime.Period.Ticks; + } + IList collection4 = ??.AggregateHistory(new HistoryHolder(list8, historyRequestParameters4, (num7 == array5.Length - 1) ? 100 : 99)); + list.AddRange(collection4); + } + } + LoggerManager loggers6 = Core.Instance.Loggers; + defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(123, 4); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted((Core.Instance.TimeUtils.DateTimeUtcNow - dateTimeUtcNow).TotalSeconds, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(num); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(list.Count); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers6.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); + return list; + } + + /// + /// Gets index by time with counting on search direction + /// + public double GetIndexByTime(long time, SeekOriginHistory origin = SeekOriginHistory.End) + { + if (Count == 0) + { + return -1.0; + } + if (time > this[0, SeekOriginHistory.End].TicksRight) + { + return -1.0; + } + double num = -1.0; + int num2 = 0; + int num3 = Count - 1; + while (num2 <= num3) + { + int num4 = (num2 + num3) / 2; + if (num3 - num2 < 2) + { + num = ((time >= this[num2, SeekOriginHistory.Begin].TicksLeft) ? ((time >= this[num3, SeekOriginHistory.Begin].TicksLeft) ? ((double)num3) : ((double)num2)) : ((double)(--num2))); + break; + } + if (time < this[num4, SeekOriginHistory.Begin].TicksLeft) + { + num3 = num4 - 1; + } + else + { + num2 = num4 + 1; + } + } + if (origin == SeekOriginHistory.End && num != -1.0) + { + return (double)(Count - 1) - num; + } + return num; + } + + private void ?() + { + if (?? != null) + { + ??.NewHistoryItem -= ?; + ??.HistoryItemUpdated -= ?; + ??.Dispose(); + ?? = null; + } + ??.Clear(); + lock (itemsLocker) + { + ??.Clear(); + } + } + + [NotPublished] + public virtual void Dispose() + { + ???.Cancel(); + Indicators.Clear(); + UnSubscribeSymbol(); + ?(); + if (VolumeAnalysisCalculationProgress != null) + { + VolumeAnalysisCalculationProgress.AbortLoading(); + VolumeAnalysisCalculationProgress.Dispose(); + VolumeAnalysisCalculationProgress = null; + } + Parameters = null; + } + + protected virtual void SubscribeSymbol() + { + if (Symbol != null && ?? != null) + { + switch (??.GetSubscribeQuoteType) + { + case SubscribeQuoteType.Quote: + Symbol.NewQuote += Symbol_NewQuote; + break; + case SubscribeQuoteType.Level2: + Symbol.NewLevel2 += ?; + break; + case SubscribeQuoteType.Last: + Symbol.NewLast += Symbol_NewLast; + break; + case SubscribeQuoteType.Mark: + Symbol.NewMark += ?; + break; + } + Symbol.NewDayBar += ?; + ?? = true; + } + } + + protected virtual void UnSubscribeSymbol() + { + if (Symbol != null && ?? != null) + { + switch (??.GetSubscribeQuoteType) + { + case SubscribeQuoteType.Quote: + Symbol.NewQuote -= Symbol_NewQuote; + break; + case SubscribeQuoteType.Level2: + Symbol.NewLevel2 -= ?; + break; + case SubscribeQuoteType.Last: + Symbol.NewLast -= Symbol_NewLast; + break; + case SubscribeQuoteType.Mark: + Symbol.NewMark -= ?; + break; + } + Symbol.NewDayBar -= ?; + ?? = null; + ?? = null; + ??.Reset(); + } + } + + protected void Symbol_NewQuote(Symbol symbol, Quote quote) + { + if (!?(quote)) + { + ProcessQuote(quote); + } + } + + protected void Symbol_NewLast(Symbol symbol, Last last) + { + if (!?(last)) + { + ProcessLast(last); + } + } + + private void ?(Symbol P_0, Mark P_1) + { + if (!?(P_1)) + { + ProcessMark(P_1); + } + } + + private void ?(Symbol P_0, DayBar P_1) + { + if (!?((MessageQuote)P_1)) + { + ?(P_1); + } + } + + private void ?(Symbol P_0, Level2Quote P_1, DOMQuote P_2) + { + MessageQuote messageQuote = (MessageQuote)(((object)P_1) ?? ((object)P_2)); + if (!?(messageQuote)) + { + ProcessLevel2Qute(messageQuote); + } + } + + private bool ?(MessageQuote P_0) + { + ? ? = default(?); + ?.?? = this; + ?.?? = P_0; + if (?? != HistoricalDataState.Loading && ??.IsEmpty) + { + return false; + } + if (?? == null && ?(ref ?)) + { + ?? = ?.??; + ??.Set(); + } + ??.Enqueue(?.??); + return true; + } + + private void ?() + { + DateTime? dateTime = this.LastOrDefault()?.TimeLeft; + MessageQuote result; + while (??.TryDequeue(out result)) + { + if (result == null) + { + continue; + } + if (dateTime.HasValue) + { + DateTime time = result.Time; + DateTime? dateTime2 = dateTime; + if (time <= dateTime2) + { + continue; + } + } + if (!(result is Quote quote)) + { + if (!(result is Last last)) + { + if (result is Mark mark) + { + ProcessMark(mark); + } + } + else + { + ProcessLast(last); + } + } + else + { + ProcessQuote(quote); + } + } + } + + protected virtual void ProcessQuote(Quote quote) + { + ?? = quote; + ???.ProcessQuote(quote); + } + + protected virtual void ProcessLast(Last last) + { + ?? = last; + ???.ProcessQuote(last); + } + + protected virtual void ProcessMark(Mark mark) + { + ?? = mark; + ???.ProcessQuote(mark); + } + + private void ?(DayBar P_0) + { + ?? = P_0; + ???.ProcessQuote(P_0); + } + + protected virtual void ProcessLevel2Qute(MessageQuote quote) + { + ?? = quote; + ???.ProcessQuote(quote); + } + + /// + /// Creates indicator by it's name and if it successfully created adds it to the HistoricalData + /// + /// + /// + /// + public Indicator AddIndicator(string indicatorName, params SettingItem[] settings) + { + if (string.IsNullOrEmpty(indicatorName)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + Indicator indicator = Core.Instance.Indicators.CreateIndicator(indicatorName, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + if (indicator == null) + { + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + indicator.Settings = settings; + AddIndicator(indicator); + return indicator; + } + + /// + /// Adds indicator to the HistoricalData + /// + /// + public void AddIndicator(Indicator indicator) + { + Indicators.AddIndicator(indicator); + } + + /// + /// Removes indicator from the HistoricalData + /// + /// + public void RemoveIndicator(Indicator indicator) + { + Indicators.RemoveIndicator(indicator); + } + + [NotPublished] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool TryGetIndicatorWrapper(Indicator indicator, out IndicatorWrapper indicatorWrapper) + { + return Indicators.TryGetWrapper(indicator, out indicatorWrapper); + } + + public IVolumeAnalysisCalculationProgress CalculateVolumeProfile(VolumeAnalysisCalculationParameters volumeAnalysisCalculationParameters) + { + return Core.Instance.VolumeAnalysis.CalculateProfile(this, volumeAnalysisCalculationParameters); + } + + public IEnumerator GetEnumerator() + { + return ??.GetEnumerator(); + } + + private IEnumerator ?() + { + return ??.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(); + } + + protected virtual IHistoryProcessor CreateHistoryProcessor() + { + return Core.Instance.HistoryAggregations.CreateHistoryProcessor(Parameters); + } + + private protected virtual void ?() + { + ?? = CreateHistoryProcessor(); + if (?? == null) + { + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ??.CorrectHistoryRequestBorders(Parameters); + ??.NewHistoryItem += ?; + ??.HistoryItemUpdated += ?; + } + + private void ?(object P_0, HistoryEventArgs P_1) + { + if (P_1.HistoryItem != null && (!Parameters.ExcludeOutOfSession || Parameters.SessionsContainer == null || Parameters.SessionsContainer.ContainsDate(P_1.HistoryItem.TicksLeft))) + { + AddNewItem(P_1.HistoryItem, updateIndicators: true, P_1); + } + } + + private void ?(object P_0, HistoryEventArgs P_1) + { + if (P_1.HistoryItem == null || (Parameters.ExcludeOutOfSession && Parameters.SessionsContainer != null && !Parameters.SessionsContainer.ContainsDate(P_1.HistoryItem.TicksLeft))) + { + return; + } + if (P_1.ResetVolumeAnalysisRequired) + { + P_1.HistoryItem.VolumeAnalysisData = null; + } + else + { + IHistoryItem historyItem = P_1.HistoryItem; + if (historyItem.VolumeAnalysisData == null) + { + VolumeAnalysisData volumeAnalysisData = (historyItem.VolumeAnalysisData = this[0, SeekOriginHistory.End]?.VolumeAnalysisData); + } + } + this[0, SeekOriginHistory.End] = P_1.HistoryItem; + ?(P_1.HistoryItem); + Indicators.Update(new UpdateArgs(UpdateReason.NewTick), IndicatorUpdateType.OnTick); + ?(P_1); + } + + protected virtual void AddNewItem(IHistoryItem historyItem, bool updateIndicators = true, HistoryEventArgs e = null) + { + if (updateIndicators) + { + ?(e, IndicatorUpdateType.OnBarClose); + } + lock (itemsLocker) + { + ??.Add(historyItem); + } + ?(historyItem); + if (updateIndicators) + { + ?(e, IndicatorUpdateType.OnTick); + } + ?(historyItem); + } + + private protected virtual void ?(IHistoryItem P_0) + { + ??.InvokeSafely(this, new HistoryEventArgs + { + HistoryItem = P_0 + }); + } + + private void ?(HistoryEventArgs P_0) + { + ???.Invoke(this, P_0); + } + + private void ?(IHistoryItem P_0) + { + if (?? != ??) + { + ?? = ??; + ???.Invoke(this, new ? + { + HistoryItem = P_0, + MessageQuote = ?? + }); + } + } + + private protected virtual void ?(HistoryEventArgs P_0 = null, IndicatorUpdateType? P_1 = null) + { + Indicators.Update(new UpdateArgs(UpdateReason.NewBar), P_1); + } + + internal void ?() + { + ???.Invoke(); + } + + [NotPublished] + [EditorBrowsable(EditorBrowsableState.Never)] + public void CutItems(int count) + { + lock (itemsLocker) + { + count = Math.Min(??.Count, Math.Abs(count)); + ??.RemoveRange(0, count); + } + Parameters.FromTime = ((Count > 0) ? this[0, SeekOriginHistory.Begin].TimeLeft : Core.Instance.TimeUtils.DateTimeUtcNow); + } + + [NotPublished] + protected void InsertRange(int index, IList range) + { + lock (itemsLocker) + { + ??.InsertRange(index, range); + } + Indicators.Refresh(); + } + + public string GetTimeToNextBar() + { + return ??.GetTimeToNextBar(); + } + + [CompilerGenerated] + private bool ?(IHistoryItem P_0) + { + return Parameters.SessionsContainer.ContainsDate(P_0.TicksLeft); + } + + [CompilerGenerated] + private bool ?(ref ? P_0) + { + if (?? == null) + { + return false; + } + return ??.GetSubscribeQuoteType switch + { + SubscribeQuoteType.Quote => P_0.?? is Quote, + SubscribeQuoteType.Level2 => (P_0.?? is Level2Quote || P_0.?? is DOMQuote) ? true : false, + SubscribeQuoteType.Last => P_0.?? is Last, + SubscribeQuoteType.Mark => P_0.?? is Mark, + _ => false, + }; + } + } + /// + /// Period that can be used as a basis for history aggregations + /// + [DataContract(Name = "BasePeriod", Namespace = "TradingPlatform")] + [Published] + public enum BasePeriod + { + [EnumMember] + Tick, + [EnumMember] + Second, + [EnumMember] + Minute, + [EnumMember] + Hour, + [EnumMember] + Day, + [EnumMember] + Week, + [EnumMember] + Month, + [EnumMember] + Year + } + [Published] + public enum RenkoStyle + { + Classic, + HighLow, + AdvancedClassic, + AdvancedHighLow + } + [Published] + public enum PointsAndFiguresStyle + { + [Description("Classic")] + Classic, + [Description("High/Low")] + HighLow + } + [Published] + public enum PriceType + { + Open, + High, + Low, + Close, + Median, + Typical, + Weighted, + Bid, + BidSize, + Ask, + AskSize, + Last, + Volume, + Ticks, + AggressorFlag, + TickDirection, + BidTickDirection, + AskTickDirection, + OpenInterest, + Mark, + FundingRate, + QuoteAssetVolume + } + public enum SeekOriginHistory + { + Begin, + End + } + public enum HistoricalDataState + { + Pending, + Working, + Loading + } + public class HistoryEventArgs : EventArgs + { + [CompilerGenerated] + private IHistoryItem ?; + + [CompilerGenerated] + private bool ?; + + public IHistoryItem HistoryItem + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + public bool ResetVolumeAnalysisRequired + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + } + public delegate void HistoryEventHandler(object sender, HistoryEventArgs e); + public class HistoryHolder + { + [CompilerGenerated] + private readonly IList ?; + + [CompilerGenerated] + private readonly HistoryRequestParameters ?; + + [CompilerGenerated] + private int ?; + + public IList History + { + [CompilerGenerated] + get + { + return ?; + } + } + + public HistoryRequestParameters RequestParameters + { + [CompilerGenerated] + get + { + return ?; + } + } + + public int ProgressPercent + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = num; + } + } + + public HistoryHolder(IList history, HistoryRequestParameters requestParameters, int progressPercent = 100) + { + ? = history; + ? = requestParameters; + ProgressPercent = progressPercent; + } + + public HistoryInterval ToHistoryInterval() + { + return new HistoryInterval + { + Description = RequestParameters.ToDescription(), + Interval = RequestParameters.Interval, + History = History + }; + } + } + [ProtoContract] + [ProtoInclude(2, typeof(HistoryItemLast))] + [ProtoInclude(3, typeof(HistoryItemTick))] + [ProtoInclude(4, typeof(HistoryItemMark))] + [ProtoInclude(5, typeof(HistoryItemBar))] + [ProtoInclude(6, typeof(HistoryItemLevel2))] + [ProtoInclude(7, typeof(HistoryItemDom))] + [ProtoInclude(8, typeof(HistoryItemTimeStatistics))] + [DataContract] + public abstract class HistoryItem : IHistoryItem, ICloneable + { + public static class CustomFields + { + public static class Trend + { + public const string UP = "up"; + + public const string DOWN = "down"; + } + + public const string IS_TEMPORARY_BAR = "isTemporaryBar"; + + public const string TREND = "trend"; + + public const string ONE_STEP_BACK = "OneStepBack"; + } + + [CompilerGenerated] + private long ??; + + private Dictionary ??; + + [CompilerGenerated] + private VolumeAnalysisData ??; + + public DateTime TimeLeft => new DateTime(TicksLeft, DateTimeKind.Utc); + + [ProtoMember(1)] + [DataMember(Order = 1)] + public long TicksLeft + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public virtual long TicksRight + { + get + { + return TicksLeft; + } + set + { + } + } + + public virtual double this[PriceType priceType] => double.NaN; + + public VolumeAnalysisData VolumeAnalysisData + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + protected HistoryItem() + { + TicksLeft = 0L; + } + + public void SetData(string key, object value) + { + if (string.IsNullOrEmpty(key)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (value == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (?? == null) + { + ?? = new Dictionary(); + } + ??[key] = value; + } + + public bool TryGetData(string key, out TData data) + { + data = default(TData); + if (?? == null) + { + return false; + } + if (!??.TryGetValue(key, out var value) || !(value is TData)) + { + return false; + } + data = (TData)value; + return true; + } + + protected HistoryItem(MessageQuote message) + { + TicksLeft = message.Time.Ticks; + } + + protected HistoryItem(HistoryItem original) + { + TicksLeft = original.TicksLeft; + if (original.VolumeAnalysisData != null) + { + VolumeAnalysisData = new VolumeAnalysisData(original.VolumeAnalysisData); + } + if (original.?? == null) + { + return; + } + foreach (KeyValuePair item in original.??) + { + SetData(item.Key, item.Value); + } + } + + public abstract object Clone(); + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(1, 2); + defaultInterpolatedStringHandler.AppendFormatted(TicksLeft); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(TimeLeft); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + /// + /// Represents historical data bar item + /// + [Published] + [ProtoContract] + public class HistoryItemBar : HistoryItem + { + [CompilerGenerated] + private long ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private long ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + /// + /// Gets bar's right time border + /// + public DateTime TimeRight => new DateTime(TicksRight, DateTimeKind.Utc); + + /// + /// Defines bar's ticks count + /// + public override long TicksRight + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Defines Open price + /// + [ProtoMember(1)] + public double Open + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Defines High price + /// + [ProtoMember(2)] + public double High + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Defines Low price + /// + [ProtoMember(3)] + public double Low + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Defines Close price + /// + [ProtoMember(4)] + public double Close + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets Median (High+Low)/2 price + /// + public double Median => (High + Low) / 2.0; + + /// + /// Gets Typical (High+Low+Close)/3 price + /// + public double Typical => (High + Low + Close) / 3.0; + + /// + /// Gets Weighted (High+Low+Close+Close)/4 price + /// + public double Weighted => (High + Low + Close + Close) / 4.0; + + /// + /// Defines ticks amount + /// + [ProtoMember(5)] + public long Ticks + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Defines volume value + /// + [ProtoMember(6)] + public double Volume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(7)] + public double OpenInterest + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(8)] + public double FundingRate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(9)] + public double QuoteAssetVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets price by indexing + /// + /// + /// + public override double this[PriceType priceType] => priceType switch + { + PriceType.Open => Open, + PriceType.High => High, + PriceType.Low => Low, + PriceType.Close => Close, + PriceType.Median => Median, + PriceType.Typical => Typical, + PriceType.Weighted => Weighted, + PriceType.Ticks => Ticks, + PriceType.Volume => Volume, + PriceType.OpenInterest => OpenInterest, + PriceType.FundingRate => FundingRate, + PriceType.QuoteAssetVolume => QuoteAssetVolume, + _ => base[priceType], + }; + + /// + /// Creates HistoryItemBar instance with default OHLC price = + /// + public HistoryItemBar() + { + Open = double.NaN; + High = double.NaN; + Low = double.NaN; + Close = double.NaN; + } + + /// + /// Comparing by , OHLC, + /// + /// + /// + [NotPublished] + public override bool Equals(object obj) + { + HistoryItemBar historyItemBar = obj as HistoryItemBar; + if (historyItemBar == null) + { + return false; + } + if (base.TicksLeft == historyItemBar.TicksLeft && Open == historyItemBar.Open && High == historyItemBar.High && Low == historyItemBar.Low && Close == historyItemBar.Close && Ticks == historyItemBar.Ticks && Volume == historyItemBar.Volume) + { + return QuoteAssetVolume == historyItemBar.QuoteAssetVolume; + } + return false; + } + + [NotPublished] + public override int GetHashCode() + { + return base.TicksLeft.GetHashCode() ^ Open.GetHashCode() ^ High.GetHashCode() ^ Low.GetHashCode() ^ Close.GetHashCode() ^ Ticks.GetHashCode() ^ Volume.GetHashCode() ^ QuoteAssetVolume.GetHashCode(); + } + + [NotPublished] + public static bool operator ==(HistoryItemBar a, HistoryItemBar b) + { + if ((object)a == b) + { + return true; + } + if ((object)a == null || (object)b == null) + { + return false; + } + return a.Equals(b); + } + + [NotPublished] + public static bool operator !=(HistoryItemBar a, HistoryItemBar b) + { + return !(a == b); + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(39, 10); + defaultInterpolatedStringHandler.AppendFormatted(base.TicksLeft); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(TicksRight); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Ticks); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.TimeLeft); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(TimeRight); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Open); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(High); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Low); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Close); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted((Close > Open) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + private HistoryItemBar(HistoryItemBar P_0) + : base(P_0) + { + TicksRight = P_0.TicksRight; + Open = P_0.Open; + High = P_0.High; + Low = P_0.Low; + Close = P_0.Close; + Ticks = P_0.Ticks; + Volume = P_0.Volume; + OpenInterest = P_0.OpenInterest; + FundingRate = P_0.FundingRate; + QuoteAssetVolume = P_0.QuoteAssetVolume; + base.VolumeAnalysisData = P_0.VolumeAnalysisData; + } + + [NotPublished] + public override object Clone() + { + return new HistoryItemBar(this); + } + } + [ProtoContract] + public sealed class HistoryItemDom : HistoryItem + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + internal HistoryItemLevel2 ?(Level2Quote P_0) + { + return new HistoryItemLevel2(P_0); + } + + internal HistoryItemLevel2 ?(Level2Quote P_0) + { + return new HistoryItemLevel2(P_0); + } + + internal HistoryItemLevel2 ?(HistoryItemLevel2 P_0) + { + return new HistoryItemLevel2(P_0); + } + + internal HistoryItemLevel2 ?(HistoryItemLevel2 P_0) + { + return new HistoryItemLevel2(P_0); + } + } + + [CompilerGenerated] + private List ??; + + [CompilerGenerated] + private List ??; + + [ProtoMember(1)] + public List Asks + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(2)] + public List Bids + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Creates HistoryItemLast instance + /// + public HistoryItemDom() + { + Asks = new List(); + Bids = new List(); + } + + public HistoryItemDom(DOMQuote domQuote) + : base(domQuote) + { + Asks = domQuote.Asks.Select((Level2Quote P_0) => new HistoryItemLevel2(P_0)).ToList(); + Bids = domQuote.Bids.Select((Level2Quote P_0) => new HistoryItemLevel2(P_0)).ToList(); + } + + public HistoryItemDom(HistoryItemDom original) + : base(original) + { + Asks = original.Asks.Select((HistoryItemLevel2 P_0) => new HistoryItemLevel2(P_0)).ToList(); + Bids = original.Bids.Select((HistoryItemLevel2 P_0) => new HistoryItemLevel2(P_0)).ToList(); + } + + [NotPublished] + public override object Clone() + { + return new HistoryItemDom(this); + } + } + /// + /// Represents historical data trade item + /// + [Published] + [ProtoContract] + [DataContract] + public sealed class HistoryItemLast : HistoryItem, IVolumeTickData, IBuyerSellerData + { + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private AggressorFlag ??; + + [CompilerGenerated] + private TickDirection ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + /// + /// Defines price value + /// + [ProtoMember(1)] + [DataMember(Order = 2)] + public double Price + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Defines volume value + /// + [ProtoMember(2)] + [DataMember(Order = 3)] + public double Volume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Defines trade operation side as aggressor flag + /// + [ProtoMember(3)] + [DataMember(Order = 4)] + public AggressorFlag AggressorFlag + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(4)] + [DataMember(Order = 5)] + public TickDirection TickDirection + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(5)] + [DataMember(Order = 6)] + public double OpenInterest + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(6)] + [DataMember(Order = 7)] + public string Buyer + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(7)] + [DataMember(Order = 8)] + public string Seller + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(8)] + [DataMember(Order = 9)] + public double FundingRate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(9)] + [DataMember(Order = 10)] + public double QuoteAssetVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets price by indexing + /// + /// + /// + public override double this[PriceType priceType] => priceType switch + { + PriceType.Last => Price, + PriceType.Open => Price, + PriceType.High => Price, + PriceType.Low => Price, + PriceType.Close => Price, + PriceType.Median => Price, + PriceType.Weighted => Price, + PriceType.Typical => Price, + PriceType.Bid => Price, + PriceType.Ask => Price, + PriceType.Mark => Price, + PriceType.Volume => Volume, + PriceType.AggressorFlag => (double)AggressorFlag, + PriceType.TickDirection => (double)TickDirection, + PriceType.BidTickDirection => (double)TickDirection, + PriceType.AskTickDirection => (double)TickDirection, + PriceType.OpenInterest => OpenInterest, + PriceType.FundingRate => FundingRate, + PriceType.QuoteAssetVolume => QuoteAssetVolume, + _ => base[priceType], + }; + + VolumeTickDataType IVolumeTickData.VolumeTickDataType => VolumeTickDataType.Lasts; + + long IVolumeTickData.Time => base.TicksLeft; + + /// + /// Creates HistoryItemLast instance + /// + public HistoryItemLast() + { + Price = double.NaN; + Volume = double.NaN; + QuoteAssetVolume = double.NaN; + AggressorFlag = AggressorFlag.NotSet; + TickDirection = TickDirection.NotSet; + } + + public HistoryItemLast(Last last) + : base(last) + { + Price = last.Price; + Volume = last.Size; + AggressorFlag = last.AggressorFlag; + TickDirection = last.TickDirection; + OpenInterest = last.OpenInterest; + Buyer = last.Buyer; + Seller = last.Seller; + QuoteAssetVolume = last.QuoteAssetVolume; + } + + private HistoryItemLast(HistoryItemLast P_0) + : base(P_0) + { + Price = P_0.Price; + Volume = P_0.Volume; + AggressorFlag = P_0.AggressorFlag; + TickDirection = P_0.TickDirection; + OpenInterest = P_0.OpenInterest; + FundingRate = P_0.FundingRate; + Buyer = P_0.Buyer; + Seller = P_0.Seller; + QuoteAssetVolume = P_0.QuoteAssetVolume; + } + + [NotPublished] + public override object Clone() + { + return new HistoryItemLast(this); + } + + /// + /// Comparing by , OHLC, + /// + /// + /// + [NotPublished] + public override bool Equals(object obj) + { + HistoryItemLast historyItemLast = obj as HistoryItemLast; + if (historyItemLast == null) + { + return false; + } + if (base.TicksLeft == historyItemLast.TicksLeft && Price == historyItemLast.Price && Volume == historyItemLast.Volume && QuoteAssetVolume == historyItemLast.QuoteAssetVolume) + { + return AggressorFlag == historyItemLast.AggressorFlag; + } + return false; + } + + [NotPublished] + public override int GetHashCode() + { + return base.TicksLeft.GetHashCode() ^ Price.GetHashCode() ^ Volume.GetHashCode() ^ QuoteAssetVolume.GetHashCode() ^ AggressorFlag.GetHashCode(); + } + + [NotPublished] + public static bool operator ==(HistoryItemLast a, HistoryItemLast b) + { + if ((object)a == b) + { + return true; + } + if ((object)a == null || (object)b == null) + { + return false; + } + return a.Equals(b); + } + + [NotPublished] + public static bool operator !=(HistoryItemLast a, HistoryItemLast b) + { + return !(a == b); + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(22, 3); + defaultInterpolatedStringHandler.AppendFormatted(base.ToString()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Price); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Volume); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + [ProtoContract] + public sealed class HistoryItemLevel2 : HistoryItem + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private QuotePriceType ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private bool ??; + + [ProtoMember(1)] + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(2)] + public QuotePriceType PriceType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(3)] + public double Price + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(4)] + public double Size + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(5)] + public bool Closed + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Creates HistoryItemLast instance + /// + public HistoryItemLevel2() + { + Price = double.NaN; + Size = double.NaN; + } + + public HistoryItemLevel2(Level2Quote level2Quote) + : base(level2Quote) + { + Id = level2Quote.Id; + PriceType = level2Quote.PriceType; + Price = level2Quote.Price; + Size = level2Quote.Size; + Closed = level2Quote.Closed; + } + + public HistoryItemLevel2(HistoryItemLevel2 original) + : base(original) + { + Id = original.Id; + PriceType = original.PriceType; + Price = original.Price; + Size = original.Size; + Closed = original.Closed; + } + + [NotPublished] + public override object Clone() + { + return new HistoryItemLevel2(this); + } + } + [ProtoContract] + public class HistoryItemMark : HistoryItem + { + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [ProtoMember(1)] + public double Price + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(2)] + public double Volume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets price by indexing + /// + /// + /// + public override double this[PriceType priceType] + { + get + { + switch (priceType) + { + case PriceType.Open: + case PriceType.High: + case PriceType.Low: + case PriceType.Close: + case PriceType.Median: + case PriceType.Typical: + case PriceType.Weighted: + case PriceType.Bid: + case PriceType.Ask: + case PriceType.Last: + case PriceType.Mark: + return Price; + case PriceType.Volume: + return Volume; + default: + return base[priceType]; + } + } + } + + /// + /// Creates HistoryItemLast instance + /// + public HistoryItemMark() + { + Price = double.NaN; + Volume = double.NaN; + } + + private HistoryItemMark(HistoryItemMark P_0) + : base(P_0) + { + Price = P_0.Price; + Volume = P_0.Volume; + } + + [NotPublished] + public override object Clone() + { + return new HistoryItemMark(this); + } + } + /// + /// Represents historical data tick item + /// + [Published] + [ProtoContract] + public class HistoryItemTick : HistoryItem, IVolumeTickData + { + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private TickDirection ??; + + [CompilerGenerated] + private TickDirection ??; + + /// + /// Defines Bid price + /// + [ProtoMember(1)] + public double Bid + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Defines Bid size + /// + [ProtoMember(2)] + public double BidSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Defines Ask price + /// + [ProtoMember(3)] + public double Ask + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Defines Ask size + /// + [ProtoMember(4)] + public double AskSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(5)] + public TickDirection BidTickDirection + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(6)] + public TickDirection AskTickDirection + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets price by indexing + /// + /// + /// + public override double this[PriceType priceType] + { + get + { + switch (priceType) + { + case PriceType.Open: + case PriceType.High: + case PriceType.Low: + case PriceType.Close: + case PriceType.Median: + case PriceType.Typical: + case PriceType.Weighted: + case PriceType.Bid: + case PriceType.Last: + case PriceType.Mark: + return Bid; + case PriceType.BidSize: + return BidSize; + case PriceType.Ask: + return Ask; + case PriceType.AskSize: + return AskSize; + case PriceType.Volume: + return 0.0; + case PriceType.TickDirection: + case PriceType.BidTickDirection: + return (double)BidTickDirection; + case PriceType.AskTickDirection: + return (double)AskTickDirection; + default: + return base[priceType]; + } + } + } + + VolumeTickDataType IVolumeTickData.VolumeTickDataType => VolumeTickDataType.Ticks; + + long IVolumeTickData.Time => base.TicksLeft; + + double IVolumeTickData.Price => Bid; + + double IVolumeTickData.Volume => 1.0; + + TickDirection IVolumeTickData.TickDirection => BidTickDirection; + + AggressorFlag IVolumeTickData.AggressorFlag => Symbol.ConvertTickDirection(BidTickDirection); + + /// + /// Creates HistoryItemBar instance with default Ask/AskSize/Bid/BidSize = + /// + public HistoryItemTick() + { + Bid = double.NaN; + BidSize = double.NaN; + Ask = double.NaN; + AskSize = double.NaN; + BidTickDirection = TickDirection.NotSet; + AskTickDirection = TickDirection.NotSet; + } + + private HistoryItemTick(HistoryItemTick P_0) + : base(P_0) + { + Bid = P_0.Bid; + BidSize = P_0.BidSize; + Ask = P_0.Ask; + AskSize = P_0.AskSize; + } + + [NotPublished] + public override object Clone() + { + return new HistoryItemTick(this); + } + + /// + /// Comparing by , OHLC, , , , + /// + /// + /// + [NotPublished] + public override bool Equals(object obj) + { + HistoryItemTick historyItemTick = obj as HistoryItemTick; + if (historyItemTick == null) + { + return false; + } + if (base.TicksLeft == historyItemTick.TicksLeft && Ask == historyItemTick.Ask && AskSize == historyItemTick.AskSize && Bid == historyItemTick.Bid) + { + return BidSize == historyItemTick.BidSize; + } + return false; + } + + [NotPublished] + public override int GetHashCode() + { + return base.TicksLeft.GetHashCode() ^ Ask.GetHashCode() ^ AskSize.GetHashCode() ^ Bid.GetHashCode() ^ BidSize.GetHashCode(); + } + + [NotPublished] + public static bool operator ==(HistoryItemTick a, HistoryItemTick b) + { + if ((object)a == b) + { + return true; + } + if ((object)a == null || (object)b == null) + { + return false; + } + return a.Equals(b); + } + + [NotPublished] + public static bool operator !=(HistoryItemTick a, HistoryItemTick b) + { + return !(a == b); + } + } + public sealed class HistoryItemTimeStatistics : HistoryItem, IVolumeData + { + [CompilerGenerated] + private long ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private int ??; + + public override long TicksRight + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double Volume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int Trades + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double BuyVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int BuyTrades + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double SellVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int SellTrades + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public HistoryItemTimeStatistics() + { + } + + public HistoryItemTimeStatistics(HistoryItemTimeStatistics item) + : base(item) + { + TicksRight = item.TicksRight; + Volume = item.Volume; + BuyVolume = item.BuyVolume; + SellVolume = item.SellVolume; + Trades = item.Trades; + BuyTrades = item.BuyTrades; + SellTrades = item.SellTrades; + } + + public override object Clone() + { + return new HistoryItemTimeStatistics(this); + } + } + public sealed class HistoryItemVolumeProfile : HistoryItem + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func, double> ??; + + public static Func, VolumeDataItem> ??; + + internal double ?(KeyValuePair P_0) + { + return P_0.Key; + } + + internal VolumeDataItem ?(KeyValuePair P_0) + { + return new VolumeDataItem(P_0.Value); + } + } + + [CompilerGenerated] + private long ??; + + [CompilerGenerated] + private Dictionary ??; + + public override long TicksRight + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Dictionary PriceLevels + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public HistoryItemVolumeProfile() + { + } + + public HistoryItemVolumeProfile(HistoryItemVolumeProfile item) + : base(item) + { + TicksRight = item.TicksRight; + PriceLevels = item.PriceLevels.ToDictionary((KeyValuePair P_0) => P_0.Key, (KeyValuePair P_0) => new VolumeDataItem(P_0.Value)); + } + + public override object Clone() + { + return new HistoryItemVolumeProfile(this); + } + } + public interface IVolumeData + { + double Volume { get; set; } + + double BuyVolume { get; set; } + + double SellVolume { get; set; } + + int Trades { get; set; } + + int BuyTrades { get; set; } + + int SellTrades { get; set; } + } + public sealed class VolumeDataItem : IVolumeData + { + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private int ??; + + public double Volume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double BuyVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double SellVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int Trades + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int BuyTrades + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int SellTrades + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public VolumeDataItem() + { + } + + public VolumeDataItem(VolumeDataItem volumeData) + { + Volume = volumeData.Volume; + BuyVolume = volumeData.BuyVolume; + SellVolume = volumeData.SellVolume; + Trades = volumeData.Trades; + BuyTrades = volumeData.BuyTrades; + SellTrades = volumeData.SellTrades; + } + } + /// + /// Resolves a history request parameters per symbol + /// + [Published] + [ProtoContract] + public sealed class HistoryRequestParameters : RequestParameters + { + private Symbol ??; + + private string ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private HistoryAggregation ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private ISessionsContainer ??; + + [CompilerGenerated] + private IProgress ??; + + [CompilerGenerated] + private readonly HistoryRequestType ??; + + public override RequestType Type => RequestType.History; + + public Symbol Symbol + { + get + { + return ??; + } + set + { + ?? = value; + ?? = ???.Id; + } + } + + [ProtoMember(1)] + public string SymbolId + { + get + { + string id = ??; + if (id == null) + { + Symbol symbol = Symbol; + if (symbol == null) + { + return null; + } + id = symbol.Id; + } + return id; + } + set + { + ?? = value; + } + } + + [ProtoMember(2)] + public DateTime FromTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(3)] + public DateTime ToTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Interval Interval + { + get + { + return new Interval(FromTime, ToTime); + } + set + { + FromTime = value.From; + ToTime = value.To; + } + } + + public HistoryAggregation Aggregation + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool ForceReload + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool ExcludeOutOfSession + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public ISessionsContainer SessionsContainer + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IProgress ProgressInfo + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public HistoryRequestParameters Copy => new HistoryRequestParameters(this); + + public HistoryRequestType HistoryRequestType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public HistoryRequestParameters() + { + ProgressInfo = new PercentageProgress(); + ForceReload = false; + ExcludeOutOfSession = true; + } + + public HistoryRequestParameters(HistoryRequestParameters original) + { + Symbol = original.Symbol; + SymbolId = original.SymbolId; + Aggregation = original.Aggregation?.Clone() as HistoryAggregation; + FromTime = original.FromTime; + ToTime = original.ToTime; + ForceReload = original.ForceReload; + base.CancellationToken = original.CancellationToken; + SessionsContainer = original.SessionsContainer; + ExcludeOutOfSession = original.ExcludeOutOfSession; + HistoryRequestType = original.HistoryRequestType; + } + + public HistoryDescription ToDescription() + { + return new HistoryDescription(SymbolId, Aggregation); + } + } + public enum HistoryRequestType + { + General, + BuildUncompleteBarLogic + } + public class PercentageProgress : IProgress + { + [CompilerGenerated] + private float ?; + + public float ProgressValue + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = num; + } + } + + public void Report(float value) + { + ProgressValue = value; + } + + public override string ToString() + { + return ProgressValue.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), CultureInfo.DefaultThreadCurrentUICulture); + } + } + /// + /// Represents mechanism for supporting predefined and custom periods + /// + [Serializable] + [Published] + [DataContract(Name = "Period", Namespace = "TradingPlatform")] + [ProtoContract] + public struct Period : IComparable, IXElementSerialization + { + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private BasePeriod ??; + + /// + /// Gets period multiplier + /// + [DataMember(Name = "PeriodMultiplier")] + [ProtoMember(1)] + public int PeriodMultiplier + { + [CompilerGenerated] + readonly get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Gets base period type + /// + [DataMember(Name = "BasePeriod")] + [ProtoMember(2)] + public BasePeriod BasePeriod + { + [CompilerGenerated] + readonly get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = basePeriod; + } + } + + /// + /// Gets ticks value as an result of base period multiplicated by + /// + public long Ticks => TicksInBasePeriod(BasePeriod) * PeriodMultiplier; + + public TimeSpan Duration => TimeSpan.FromTicks(Ticks); + + /// + /// Predefined period + /// + public static Period TICK1 => new Period(BasePeriod.Tick, 1); + + /// + /// Predefined period + /// + public static Period SECOND1 => new Period(BasePeriod.Second, 1); + + /// + /// Predefined period + /// + public static Period SECOND5 => new Period(BasePeriod.Second, 5); + + /// + /// Predefined period + /// + public static Period SECOND10 => new Period(BasePeriod.Second, 10); + + /// + /// Predefined period + /// + public static Period SECOND15 => new Period(BasePeriod.Second, 15); + + /// + /// Predefined period + /// + public static Period SECOND30 => new Period(BasePeriod.Second, 30); + + /// + /// Predefined period + /// + public static Period MIN1 => new Period(BasePeriod.Minute, 1); + + /// + /// Predefined period + /// + public static Period MIN2 => new Period(BasePeriod.Minute, 2); + + /// + /// Predefined period + /// + public static Period MIN3 => new Period(BasePeriod.Minute, 3); + + /// + /// Predefined period + /// + public static Period MIN4 => new Period(BasePeriod.Minute, 4); + + /// + /// Predefined period + /// + public static Period MIN5 => new Period(BasePeriod.Minute, 5); + + /// + /// Predefined period + /// + public static Period MIN10 => new Period(BasePeriod.Minute, 10); + + /// + /// Predefined period + /// + public static Period MIN15 => new Period(BasePeriod.Minute, 15); + + /// + /// Predefined period + /// + public static Period MIN30 => new Period(BasePeriod.Minute, 30); + + /// + /// Predefined period + /// + public static Period HOUR1 => new Period(BasePeriod.Hour, 1); + + /// + /// Predefined period + /// + public static Period HOUR2 => new Period(BasePeriod.Hour, 2); + + /// + /// Predefined period + /// + public static Period HOUR3 => new Period(BasePeriod.Hour, 3); + + /// + /// Predefined period + /// + public static Period HOUR4 => new Period(BasePeriod.Hour, 4); + + /// + /// Predefined period + /// + public static Period HOUR6 => new Period(BasePeriod.Hour, 6); + + /// + /// Predefined period + /// + public static Period HOUR8 => new Period(BasePeriod.Hour, 8); + + /// + /// Predefined period + /// + public static Period HOUR12 => new Period(BasePeriod.Hour, 12); + + /// + /// Predefined period + /// + public static Period DAY1 => new Period(BasePeriod.Day, 1); + + /// + /// Predefined period + /// + public static Period WEEK1 => new Period(BasePeriod.Week, 1); + + /// + /// Predefined period + /// + public static Period MONTH1 => new Period(BasePeriod.Month, 1); + + /// + /// Predefined period + /// + public static Period YEAR1 => new Period(BasePeriod.Year, 1); + + /// + /// Creates Period instance with greater than 0 + /// + /// + /// + public Period(BasePeriod basePeriod, int periodMultiplier) + { + if (periodMultiplier <= 0) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + BasePeriod = basePeriod; + PeriodMultiplier = periodMultiplier; + } + + /// + /// True if their base paeriods and are respectively equal. + /// + /// + /// + /// + [NotPublished] + public static bool operator ==(Period period1, Period period2) + { + if (period1.BasePeriod == period2.BasePeriod) + { + return period1.PeriodMultiplier == period2.PeriodMultiplier; + } + return false; + } + + /// + /// True if any of their base paeriods and are respectively not equal. + /// + /// + /// + /// + [NotPublished] + public static bool operator !=(Period period1, Period period2) + { + if (period1.BasePeriod == period2.BasePeriod) + { + return period1.PeriodMultiplier != period2.PeriodMultiplier; + } + return true; + } + + /// + /// True if their ticks values are satisfying initial condition + /// + /// + /// + /// + [NotPublished] + public static bool operator <(Period period1, Period period2) + { + long ticks = period1.Ticks; + long ticks2 = period2.Ticks; + if (ticks < 0 && ticks2 < 0) + { + return ticks > ticks2; + } + return ticks < ticks2; + } + + /// + /// True if their ticks values are satisfying initial condition + /// + /// + /// + /// + [NotPublished] + public static bool operator >(Period period1, Period period2) + { + long ticks = period1.Ticks; + long ticks2 = period2.Ticks; + if (ticks < 0 && ticks2 < 0) + { + return ticks < ticks2; + } + return ticks > ticks2; + } + + /// + /// True if their ticks values are satisfying initial condition + /// + /// + /// + /// + [NotPublished] + public static bool operator <=(Period period1, Period period2) + { + long ticks = period1.Ticks; + long ticks2 = period2.Ticks; + if (ticks < 0 && ticks2 < 0) + { + return ticks >= ticks2; + } + return ticks <= ticks2; + } + + /// + /// True if their ticks values are satisfying initial condition + /// + /// + /// + /// + [NotPublished] + public static bool operator >=(Period period1, Period period2) + { + long ticks = period1.Ticks; + long ticks2 = period2.Ticks; + if (ticks < 0 && ticks2 < 0) + { + return ticks <= ticks2; + } + return ticks >= ticks2; + } + + /// + /// True if their base paeriods and are respectively equal. + /// + /// + /// + [NotPublished] + public override bool Equals(object obj) + { + if (obj is Period period) + { + if (BasePeriod == period.BasePeriod) + { + return PeriodMultiplier == period.PeriodMultiplier; + } + return false; + } + return false; + } + + [NotPublished] + public override int GetHashCode() + { + return PeriodMultiplier ^ (int)BasePeriod; + } + + /// + /// Formats given value to a specific user friendly string + /// + /// + /// + [NotPublished] + public string Format(DateTime dateTime) + { + switch (BasePeriod) + { + case BasePeriod.Tick: + if (PeriodMultiplier > 1) + { + return Core.Instance.TimeUtils.GetFormatedDateTime(dateTime); + } + return Core.Instance.TimeUtils.GetFormatedDateTimeWithMilliseconds(dateTime); + case BasePeriod.Second: + return Core.Instance.TimeUtils.GetFormatedDateTime(dateTime); + case BasePeriod.Minute: + case BasePeriod.Hour: + return Core.Instance.TimeUtils.GetFormatedDateShortTime(dateTime); + case BasePeriod.Day: + case BasePeriod.Week: + return Core.Instance.TimeUtils.GetFormatedDate(dateTime); + case BasePeriod.Month: + case BasePeriod.Year: + return Core.Instance.TimeUtils.GetFormatedDate(dateTime); + default: + return Core.Instance.TimeUtils.GetFormatedDate(dateTime); + } + } + + [NotPublished] + public string Format() + { + return $"{PeriodMultiplier}{BasePeriodToShortString(BasePeriod)}"; + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 2); + defaultInterpolatedStringHandler.AppendFormatted(PeriodMultiplier); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(BasePeriod); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + /// + /// Returns value in ticks according to base period type + /// + /// + /// + public static long TicksInBasePeriod(BasePeriod basePeriod) + { + return basePeriod switch + { + BasePeriod.Tick => -1L, + BasePeriod.Second => 10000000L, + BasePeriod.Minute => 600000000L, + BasePeriod.Hour => 36000000000L, + BasePeriod.Day => 864000000000L, + BasePeriod.Week => 6048000000000L, + BasePeriod.Month => 25920000000000L, + BasePeriod.Year => 315360000000000L, + _ => throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + }; + } + + /// + /// Returns shorted string according to base period type + /// + /// + /// + public static string BasePeriodToShortString(BasePeriod basePeriod) + { + return basePeriod switch + { + BasePeriod.Tick => loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + BasePeriod.Second => loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + BasePeriod.Minute => loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + BasePeriod.Hour => loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + BasePeriod.Day => loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + BasePeriod.Week => loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + BasePeriod.Month => loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + BasePeriod.Year => loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + _ => string.Empty, + }; + } + + /// + /// Converts time gap into dates range + /// + /// + /// + public void ToDatesRange(out DateTime from, out DateTime to) + { + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + if (BasePeriod == BasePeriod.Day) + { + from = dateTimeUtcNow.AddDays(-PeriodMultiplier); + } + else if (BasePeriod == BasePeriod.Month) + { + from = dateTimeUtcNow.AddMonths(-PeriodMultiplier); + } + else if (BasePeriod == BasePeriod.Year) + { + from = dateTimeUtcNow.AddYears(-PeriodMultiplier); + } + else + { + from = dateTimeUtcNow.AddTicks(-Ticks); + } + to = dateTimeUtcNow; + } + + /// + /// Compares by + /// + /// + /// + [NotPublished] + public int CompareTo(object other) + { + return Ticks.CompareTo(((Period)other).Ticks); + } + + public static bool TryParse(string value, out Period period) + { + period = default(Period); + string[] array = value.Split('-'); + if (array.Length != 2) + { + return false; + } + if (!int.TryParse(array[0].Trim(), out var result)) + { + return false; + } + if (!Enum.TryParse(array[1].Trim(), ignoreCase: true, out var result2)) + { + return false; + } + period = new Period(result2, result); + return true; + } + + /// + /// Serialize into object + /// + /// + [NotPublished] + public XElement ToXElement() + { + return new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)BasePeriod).ToString()), new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), PeriodMultiplier.ToString())); + } + + /// + /// Deserialize from + /// + /// + /// + [NotPublished] + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + BasePeriod = (BasePeriod)xElement.ToInt(); + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + PeriodMultiplier = xElement2.ToInt(); + } + } + } +} +namespace ? +{ + internal class ? : HistoryEventArgs + { + [CompilerGenerated] + private MessageQuote ??; + + public MessageQuote MessageQuote + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = messageQuote; + } + } + } +} +namespace TradingPlatform.BusinessLayer +{ + /// + /// Represent access to DayBar quote, which contains summary information about instrument prices. + /// + [DataContract(Name = "DayBar", Namespace = "TradingPlatform")] + [ProtoContract] + [Published] + public class DayBar : MessageQuote, IXElementSerialization + { + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private long ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private long ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private bool ??; + + [NotPublished] + public override MessageType Type => MessageType.DayBar; + + /// + /// High price + /// + [DataMember(Name = "High")] + [ProtoMember(1)] + public double High + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Open price + /// + [DataMember(Name = "Open")] + [ProtoMember(2)] + public double Open + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Low price + /// + [DataMember(Name = "Low")] + [ProtoMember(3)] + public double Low + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Previous Close price + /// + [DataMember(Name = "PreviousClose")] + [ProtoMember(4)] + public double PreviousClose + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Ticks value + /// + [DataMember(Name = "Ticks")] + [ProtoMember(5)] + public long Ticks + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Volume value + /// + [DataMember(Name = "Volume")] + [ProtoMember(6)] + public double Volume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Volume value + /// + [DataMember(Name = "quoteAssetVolume")] + [ProtoMember(7)] + public double QuoteAssetVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Previous settlement price + /// + [DataMember(Name = "PrevSettlementPrice")] + [ProtoMember(8)] + public double PrevSettlementPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Bid price + /// + [DataMember(Name = "Bid")] + [ProtoMember(9)] + public double Bid + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Bid size + /// + [DataMember(Name = "BidSize")] + [ProtoMember(10)] + public double BidSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Ask price + /// + [DataMember(Name = "Ask")] + [ProtoMember(11)] + public double Ask + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Ask size + /// + [DataMember(Name = "AskSize")] + [ProtoMember(12)] + public double AskSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Last price + /// + [DataMember(Name = "Last")] + [ProtoMember(13)] + public double Last + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Last size + /// + [DataMember(Name = "LastSize")] + [ProtoMember(14)] + public double LastSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Trades value + /// + [DataMember(Name = "Trades")] + [ProtoMember(15)] + public long Trades + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Change value + /// + [DataMember(Name = "Change")] + [ProtoMember(16)] + public double Change + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Change value in percentage + /// + [DataMember(Name = "ChangePercentage")] + [ProtoMember(17)] + public double ChangePercentage + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// + /// + [DataMember(Name = "OpenInterest")] + [ProtoMember(18)] + public double OpenInterest + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "TopPriceLimit")] + [ProtoMember(19)] + public double TopPriceLimit + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "BottomPriceLimit")] + [ProtoMember(20)] + public double BottomPriceLimit + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "AverageTradedPrice")] + [ProtoMember(21)] + public double AverageTradedPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "TotalBuyQuantity")] + [ProtoMember(22)] + public double TotalBuyQuantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "TotalSellQuantity")] + [ProtoMember(23)] + public double TotalSellQuantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "IV")] + [ProtoMember(24)] + public double IV + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Delta")] + [ProtoMember(25)] + public double Delta + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Vega")] + [ProtoMember(26)] + public double Vega + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Gamma")] + [ProtoMember(27)] + public double Gamma + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Theta")] + [ProtoMember(28)] + public double Theta + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Rho")] + [ProtoMember(29)] + public double Rho + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Mark")] + [ProtoMember(30)] + public double Mark + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "MarkSize")] + [ProtoMember(31)] + public double MarkSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "FundingRate")] + [ProtoMember(32)] + public double FundingRate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "FundingTime")] + [ProtoMember(33)] + public DateTime FundingTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + internal bool FullRefresh + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = flag; + } + } + + private DayBar() + { + } + + [NotPublished] + public DayBar(string symbolId, DateTime time) + : base(symbolId, time) + { + High = double.NaN; + Open = double.NaN; + Low = double.NaN; + PreviousClose = double.NaN; + Ticks = -1L; + Volume = double.NaN; + QuoteAssetVolume = double.NaN; + PrevSettlementPrice = double.NaN; + Bid = double.NaN; + BidSize = double.NaN; + Ask = double.NaN; + AskSize = double.NaN; + Last = double.NaN; + LastSize = double.NaN; + Mark = double.NaN; + Trades = -1L; + Change = double.NaN; + ChangePercentage = double.NaN; + OpenInterest = double.NaN; + TopPriceLimit = double.NaN; + BottomPriceLimit = double.NaN; + AverageTradedPrice = double.NaN; + TotalBuyQuantity = double.NaN; + TotalSellQuantity = double.NaN; + IV = double.NaN; + Delta = double.NaN; + Vega = double.NaN; + Gamma = double.NaN; + Theta = double.NaN; + Rho = double.NaN; + FundingRate = double.NaN; + FundingTime = default(DateTime); + } + + [NotPublished] + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), base.SymbolId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Ask)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AskSize)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Bid)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), BidSize)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Last)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LastSize)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), Mark); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Open)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), High)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Low)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), PreviousClose)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Ticks)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Trades)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), Volume)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), QuoteAssetVolume)); + return xElement; + } + + [NotPublished] + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + base.SymbolId = xElement.Value; + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + Ask = xElement2.ToDouble(); + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + AskSize = xElement3.ToDouble(); + } + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + Bid = xElement4.ToDouble(); + } + XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement5 != null) + { + BidSize = xElement5.ToDouble(); + } + XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement6 != null) + { + Last = xElement6.ToDouble(); + } + XElement xElement7 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement7 != null) + { + LastSize = xElement7.ToDouble(); + } + XElement xElement8 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement8 != null) + { + Mark = xElement8.ToDouble(); + } + XElement xElement9 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement9 != null) + { + Open = xElement9.ToDouble(); + } + XElement xElement10 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement10 != null) + { + High = xElement10.ToDouble(); + } + XElement xElement11 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement11 != null) + { + Low = xElement11.ToDouble(); + } + XElement xElement12 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement12 != null) + { + PreviousClose = xElement12.ToDouble(); + } + XElement xElement13 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement13 != null) + { + Ticks = xElement13.ToLong(); + } + XElement xElement14 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement14 != null) + { + Trades = xElement14.ToLong(); + } + XElement xElement15 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + if (xElement15 != null) + { + Volume = xElement15.ToDouble(); + } + XElement xElement16 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement16 != null) + { + QuoteAssetVolume = xElement16.ToDouble(); + } + } + } + /// + /// Represent access to DOM2 quote, which contains Bids and Asks. + /// + [DataContract(Name = "DOMQuote", Namespace = "TradingPlatform")] + [ProtoContract] + [Published] + public class DOMQuote : MessageQuote + { + [CompilerGenerated] + private List ??; + + [CompilerGenerated] + private List ??; + + [NotPublished] + public override MessageType Type => MessageType.DOM; + + /// + /// Collection of Asks quotes + /// + [DataMember(Name = "Asks")] + [ProtoMember(1)] + public List Asks + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Collection of Bids quotes + /// + [DataMember(Name = "Bids")] + [ProtoMember(2)] + public List Bids + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + private DOMQuote() + { + } + + [NotPublished] + public DOMQuote(string symbolId, DateTime time) + : base(symbolId, time) + { + Asks = new List(); + Bids = new List(); + } + + [NotPublished] + public override string ToString() + { + StringBuilder stringBuilder = new StringBuilder(); + StringBuilder stringBuilder2 = stringBuilder; + StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(2, 1, stringBuilder2); + handler.AppendFormatted(base.ToString()); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + stringBuilder2.Append(ref handler); + foreach (Level2Quote ask in Asks) + { + stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + stringBuilder.Append(ask.ToString()); + } + foreach (Level2Quote bid in Bids) + { + stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + stringBuilder.Append(bid.ToString()); + } + return stringBuilder.ToString(); + } + } + /// + /// Represent access to trade information. + /// + [DataContract(Name = "Last", Namespace = "TradingPlatform")] + [ProtoContract] + [Published] + public class Last : MessageQuote, IVolumeTickData, IBuyerSellerData + { + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private AggressorFlag ??; + + [CompilerGenerated] + private TickDirection ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private double ??; + + [NotPublished] + public override MessageType Type => MessageType.Last; + + /// + /// Price at which trade occured + /// + [DataMember(Name = "Price")] + [ProtoMember(1)] + public double Price + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Size of the trade + /// + [DataMember(Name = "Size")] + [ProtoMember(2)] + public double Size + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Information about operation side of the trade + /// + [DataMember(Name = "AggressorFlag")] + [ProtoMember(3)] + public AggressorFlag AggressorFlag + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Shows the direction of price movement, comparing to previous value. + /// + [DataMember(Name = "TickDirection")] + [ProtoMember(4)] + public TickDirection TickDirection + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "OpenInterest")] + [ProtoMember(5)] + public double OpenInterest + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Buyer")] + [ProtoMember(6)] + public string Buyer + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Seller")] + [ProtoMember(7)] + public string Seller + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "TradeId")] + [ProtoMember(8)] + public string TradeId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "QuoteAssetVolume")] + [ProtoMember(9)] + public double QuoteAssetVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + VolumeTickDataType IVolumeTickData.VolumeTickDataType => VolumeTickDataType.Lasts; + + long IVolumeTickData.Time => base.Time.Ticks; + + double IVolumeTickData.Volume => Size; + + private Last() + { + } + + [NotPublished] + public Last(string symbol, double price, double size, DateTime time) + : base(symbol, time) + { + OpenInterest = double.NaN; + Price = price; + Size = size; + QuoteAssetVolume = double.NaN; + AggressorFlag = AggressorFlag.NotSet; + TickDirection = TickDirection.NotSet; + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(23, 4); + defaultInterpolatedStringHandler.AppendFormatted(base.ToString()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Price); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Size); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(TradeId); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + /// + /// Represent access to Level2 quote. + /// + [DataContract(Name = "Level2Quote", Namespace = "TradingPlatform")] + [ProtoContract] + [Published] + public class Level2Quote : MessageQuote + { + [CompilerGenerated] + private QuotePriceType ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private long ??; + + [CompilerGenerated] + private int ??; + + [NotPublished] + public override MessageType Type => MessageType.Level2; + + /// + /// Price type of Level2 quote: Bid or Ask + /// + [DataMember(Name = "PriceType")] + [ProtoMember(1)] + public QuotePriceType PriceType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = quotePriceType; + } + } + + /// + /// Price of Level2 quote + /// + [DataMember(Name = "Price")] + [ProtoMember(2)] + public double Price + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Size of Level2 quote + /// + [DataMember(Name = "Size")] + [ProtoMember(3)] + public double Size + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Unique ID of Level2 quote + /// + [DataMember(Name = "Id")] + [ProtoMember(4)] + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Shows, whether Level2 quote is using only for removing from depth + /// + [DataMember(Name = "Closed")] + [ProtoMember(5)] + public bool Closed + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Broker identifier that send level2 quote + /// + [DataMember(Name = "Broker")] + [ProtoMember(6)] + public string Broker + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// specifies the implied quantity associated with the price for the quote. Subtracting this amount from the Size yields the outright quantity for the price level. A value of zero indicates that the implied size is not available/defined or that it is actually zero. + /// + [DataMember(Name = "ImpliedSize")] + [ProtoMember(7)] + public double ImpliedSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Priority")] + [ProtoMember(8)] + public long Priority + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Number orders of Level2 quote + /// + [DataMember(Name = "NumberOrders")] + [ProtoMember(9)] + public int NumberOrders + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + private Level2Quote() + { + } + + [NotPublished] + public Level2Quote(QuotePriceType priceType, string symbolId, string id, double price, double size, DateTime time) + : base(symbolId, time) + { + PriceType = priceType; + Price = price; + Size = size; + Id = id; + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(33, 5); + defaultInterpolatedStringHandler.AppendFormatted(base.ToString()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Id); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Price); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Size); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Closed); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + [DataContract(Name = "Mark", Namespace = "TradingPlatform")] + [ProtoContract] + [Published] + public class Mark : MessageQuote + { + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [NotPublished] + public override MessageType Type => MessageType.Mark; + + [DataMember(Name = "Price")] + [ProtoMember(1)] + public double Price + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + [DataMember(Name = "Size")] + [ProtoMember(2)] + public double Size + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + private Mark() + { + } + + [NotPublished] + public Mark(string symbol, DateTime time, double price, double size = double.NaN) + : base(symbol, time) + { + Price = price; + Size = size; + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(17, 3); + defaultInterpolatedStringHandler.AppendFormatted(base.ToString()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Price); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Size); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + [Serializable] + [KnownType(typeof(Level2Quote))] + [KnownType(typeof(Last))] + [KnownType(typeof(Quote))] + [KnownType(typeof(DOMQuote))] + [KnownType(typeof(DayBar))] + [KnownType(typeof(Mark))] + [DataContract(Name = "MessageQuote", Namespace = "TradingPlatform")] + [ProtoContract] + [ProtoInclude(3, typeof(Quote))] + [ProtoInclude(4, typeof(Last))] + [ProtoInclude(5, typeof(Level2Quote))] + [ProtoInclude(6, typeof(DOMQuote))] + [ProtoInclude(7, typeof(DayBar))] + [ProtoInclude(8, typeof(Mark))] + public abstract class MessageQuote : Message + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private DateTime ??; + + [DataMember(Name = "Symbol")] + [ProtoMember(1)] + public string SymbolId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected internal set + { + ?? = value; + } + } + + /// + /// Time of the quote + /// + [DataMember(Name = "Time")] + [ProtoMember(2)] + public DateTime Time + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + private protected MessageQuote() + { + } + + protected MessageQuote(string symbolId, DateTime time) + { + SymbolId = symbolId; + Time = time; + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(5, 4); + defaultInterpolatedStringHandler.AppendFormatted(Time.Ticks); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Type); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Time); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(SymbolId); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + /// + /// Represent access to quote information. + /// + [DataContract(Name = "Quote", Namespace = "TradingPlatform")] + [ProtoContract] + [Published] + public class Quote : MessageQuote, IVolumeTickData + { + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private TickDirection ??; + + [CompilerGenerated] + private TickDirection ??; + + [NotPublished] + public override MessageType Type => MessageType.Quote; + + /// + /// Bid price + /// + [DataMember(Name = "Bid")] + [ProtoMember(1)] + public double Bid + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Bid size + /// + [DataMember(Name = "BidSize")] + [ProtoMember(2)] + public double BidSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Ask price + /// + [DataMember(Name = "Ask")] + [ProtoMember(3)] + public double Ask + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Ask size + /// + [DataMember(Name = "AskSize")] + [ProtoMember(4)] + public double AskSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Shows the direction of bid price movement, comparing to previous value. + /// + [DataMember(Name = "BidTickDirection")] + [ProtoMember(5)] + public TickDirection BidTickDirection + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = tickDirection; + } + } + + /// + /// Shows the direction of ask price movement, comparing to previous value. + /// + [DataMember(Name = "AskTickDirection")] + [ProtoMember(6)] + public TickDirection AskTickDirection + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = tickDirection; + } + } + + VolumeTickDataType IVolumeTickData.VolumeTickDataType => VolumeTickDataType.Ticks; + + long IVolumeTickData.Time => base.Time.Ticks; + + double IVolumeTickData.Price => Bid; + + double IVolumeTickData.Volume => 1.0; + + TickDirection IVolumeTickData.TickDirection => BidTickDirection; + + AggressorFlag IVolumeTickData.AggressorFlag => Symbol.ConvertTickDirection(BidTickDirection); + + private Quote() + { + } + + [NotPublished] + public Quote(string symbol, double bid, double bidSize, double ask, double askSize, DateTime time) + : base(symbol, time) + { + Bid = bid; + BidSize = bidSize; + Ask = ask; + AskSize = askSize; + BidTickDirection = TickDirection.NotSet; + AskTickDirection = TickDirection.NotSet; + } + + [NotPublished] + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(36, 5); + defaultInterpolatedStringHandler.AppendFormatted(base.ToString()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Bid); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Ask); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(BidSize); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(AskSize); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + /// + /// Specifies the reason of price data updating. + /// + public enum UpdateReason + { + Unknown, + /// + /// Indicates the processing of new historical bar. + /// + HistoricalBar, + /// + /// Indicates the coming of new real-time tick. + /// + NewTick, + /// + /// Indicates a start of new real-time bar. + /// + NewBar + } + /// + /// Specifies the type of events when indicator should recalculate itself. + /// + public enum IndicatorUpdateType + { + OnTick, + OnBarClose + } + /// + /// Specifies the style of indicator line. + /// + [Published] + public enum LineStyle + { + [Description("Solid")] + Solid, + [Description("Dash")] + Dash, + [Description("Dot")] + Dot, + [Description("Dash dot")] + DashDot, + [Description("Histogramm")] + Histogramm, + [Description("Points")] + Points, + [Description("Columns")] + Columns, + [Description("Step line")] + StepLine + } + [Published] + public enum StrategyState + { + Created = 10, + Working = 20, + Stopped = 30, + Removed = 40, + WaitingForConnection = 50 + } + [Published] + public enum StrategyLoggingLevel + { + Info, + Trading, + Error + } + /// + /// Moving average mode + /// + [Published] + public enum MaMode + { + /// + /// Simple Moving Average + /// + SMA, + /// + /// Exponential Moving Average + /// + EMA, + /// + /// Smoothed Moving Average + /// + SMMA, + /// + /// Linearly Weighted Moving Average + /// + LWMA + } + public enum AfirmaMode + { + Hanning, + Hamming, + Blackman, + BlackmanHarris + } + public enum RSIMode + { + Simple, + Exponential + } + public enum AMATrendType + { + Fixed, + Average + } + /// + /// + /// + public enum HVSheduleMode + { + /// + /// Displays HV schedule and percentile value. + /// + HV, + /// + /// Displays the percentile schedule only. + /// + Percentile + } + public enum ScriptCreationType + { + [Description("Default")] + [EnumMember(Value = "Default")] + Default, + [Description("Custom")] + [EnumMember(Value = "Custom")] + Custom + } + [NotPublished] + public enum TemplateType + { + Indicator, + DrawingTool + } + [NotPublished] + public enum IndicatorCalculationType + { + ByPeriod, + AllAvailableData + } + public abstract class ExecutionEntity : IDisposable, ICustomizable + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + internal bool ?(FieldInfo P_0) + { + return Attribute.IsDefined(P_0, typeof(InputParameterAttribute)); + } + + internal bool ?(PropertyInfo P_0) + { + return Attribute.IsDefined(P_0, typeof(InputParameterAttribute)); + } + + internal bool ?(FieldInfo P_0) + { + if (??.IsAssignableFrom(P_0.FieldType)) + { + return !Attribute.IsDefined(P_0, typeof(InputParameterAttribute)); + } + return false; + } + + internal bool ?(PropertyInfo P_0) + { + if (??.IsAssignableFrom(P_0.PropertyType)) + { + return !Attribute.IsDefined(P_0, typeof(InputParameterAttribute)); + } + return false; + } + + internal bool ?(FieldInfo P_0) + { + return Attribute.IsDefined(P_0, typeof(InputParameterAttribute)); + } + + internal bool ?(PropertyInfo P_0) + { + return Attribute.IsDefined(P_0, typeof(InputParameterAttribute)); + } + + internal bool ?(FieldInfo P_0) + { + if (??.IsAssignableFrom(P_0.FieldType)) + { + return !Attribute.IsDefined(P_0, typeof(InputParameterAttribute)); + } + return false; + } + + internal bool ?(PropertyInfo P_0) + { + if (??.IsAssignableFrom(P_0.PropertyType)) + { + return !Attribute.IsDefined(P_0, typeof(InputParameterAttribute)); + } + return false; + } + } + + [CompilerGenerated] + private sealed class ? + { + public SettingItem ??; + + internal bool ?(SettingItem P_0) + { + return P_0.Name == ??.Name; + } + } + + [CompilerGenerated] + private sealed class ? + { + public SettingItem ??; + + internal bool ?(SettingItem P_0) + { + return P_0.Name == ??.Name; + } + } + + private static readonly Type ??; + + private static readonly Dictionary ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private ScriptKey ??; + + [CompilerGenerated] + private readonly Version ??; + + [CompilerGenerated] + private Action ??; + + private readonly Type ??; + + [CompilerGenerated] + private bool ??; + + protected static Core Core => Core.Instance; + + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected set + { + ?? = value; + } + } + + public string Description + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected set + { + ?? = value; + } + } + + public ScriptKey Key + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = scriptKey; + } + } + + public Version Version + { + [CompilerGenerated] + get + { + return ??; + } + } + + public virtual IList Settings + { + get + { + List list = new List(); + SettingItemSeparatorGroup separatorGroup = new SettingItemSeparatorGroup(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), -1000) + { + Key = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }; + foreach (FieldInfo item in from P_0 in ??.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) + where Attribute.IsDefined(P_0, typeof(InputParameterAttribute)) + select P_0) + { + InputParameterAttribute customAttribute = item.GetCustomAttribute(inherit: true); + object value = item.GetValue(this); + SettingItem ?? = ?(customAttribute, item.FieldType, item.Name, value); + if (?? != null) + { + if (list.Any((SettingItem P_0) => P_0.Name == ??.Name)) + { + Core.Loggers.Log(Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ??.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + else + { + list.Add(??); + } + } + } + foreach (PropertyInfo item2 in from P_0 in ??.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) + where Attribute.IsDefined(P_0, typeof(InputParameterAttribute)) + select P_0) + { + InputParameterAttribute customAttribute2 = item2.GetCustomAttribute(inherit: true); + object value2 = item2.GetValue(this); + SettingItem ?? = ?(customAttribute2, item2.PropertyType, item2.Name, value2); + if (?? != null) + { + if (list.Any((SettingItem P_0) => P_0.Name == ??.Name)) + { + Core.Loggers.Log(Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ??.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + else + { + list.Add(??); + } + } + } + foreach (FieldInfo item3 in from P_0 in ??.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) + where ??.IsAssignableFrom(P_0.FieldType) && !Attribute.IsDefined(P_0, typeof(InputParameterAttribute)) + select P_0) + { + if (item3.GetValue(this) is SettingItem settingItem) + { + list.Add(settingItem.GetCopy()); + } + } + foreach (PropertyInfo item4 in from P_0 in ??.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) + where ??.IsAssignableFrom(P_0.PropertyType) && !Attribute.IsDefined(P_0, typeof(InputParameterAttribute)) + select P_0) + { + if (item4.GetValue(this) is SettingItem settingItem2) + { + list.Add(settingItem2.GetCopy()); + } + } + list.Add(new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Key.ToString()) + { + VisibilityMode = VisibilityMode.Hidden + }); + for (int num = 0; num < list.Count; num++) + { + list[num].SeparatorGroup = separatorGroup; + } + return list; + } + set + { + if (value == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + bool flag = false; + Dictionary dictionary = null; + Dictionary dictionary2 = null; + IEnumerable enumerable = from P_0 in ??.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) + where Attribute.IsDefined(P_0, typeof(InputParameterAttribute)) + select P_0; + IEnumerable enumerable2 = from P_0 in ??.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) + where Attribute.IsDefined(P_0, typeof(InputParameterAttribute)) + select P_0; + if (enumerable.Count() > 0) + { + dictionary = new Dictionary(); + foreach (FieldInfo item in enumerable) + { + InputParameterAttribute customAttribute = item.GetCustomAttribute(inherit: true); + string key = (string.IsNullOrEmpty(customAttribute.Name) ? item.Name : customAttribute.Name); + dictionary.TryAdd(key, item); + } + } + if (enumerable2.Count() > 0) + { + dictionary2 = new Dictionary(); + foreach (PropertyInfo item2 in enumerable2) + { + InputParameterAttribute customAttribute2 = item2.GetCustomAttribute(inherit: true); + string key2 = (string.IsNullOrEmpty(customAttribute2.Name) ? item2.Name : customAttribute2.Name); + dictionary2.TryAdd(key2, item2); + } + } + foreach (SettingItem item3 in value) + { + object value2; + if (item3.Type == SettingItemType.SelectorLocalized) + { + if (!(item3.Value is SelectItem selectItem)) + { + continue; + } + value2 = selectItem.Value; + } + else + { + value2 = item3.Value; + } + FieldInfo value3 = null; + if (dictionary != null && dictionary.TryGetValue(item3.Name, out value3)) + { + value3.SetValue(this, value2); + flag = true; + continue; + } + PropertyInfo value4 = null; + if (dictionary2 != null && dictionary2.TryGetValue(item3.Name, out value4)) + { + value4.SetValue(this, value2); + flag = true; + } + } + foreach (FieldInfo item4 in from P_0 in ??.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) + where ??.IsAssignableFrom(P_0.FieldType) && !Attribute.IsDefined(P_0, typeof(InputParameterAttribute)) + select P_0) + { + if (item4.GetValue(this) is SettingItem settingItem) + { + flag |= settingItem.?(value); + } + } + foreach (PropertyInfo item5 in from P_0 in ??.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) + where ??.IsAssignableFrom(P_0.PropertyType) && !Attribute.IsDefined(P_0, typeof(InputParameterAttribute)) + select P_0) + { + if (item5.GetValue(this) is SettingItem settingItem2) + { + flag |= settingItem2.?(value); + } + } + if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemString settingItemString && !string.IsNullOrEmpty(settingItemString.Value as string)) + { + Key = ScriptKey.CreateScriptKeyFromString(settingItemString.Value.ToString()); + } + if (flag) + { + OnSettingsUpdated(); + } + } + } + + private protected bool Disposed + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = flag; + } + } + + public event Action OnDispose + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + static ExecutionEntity() + { + ?? = typeof(SettingItem); + ?? = new Dictionary + { + { + typeof(bool), + SettingItemType.Boolean + }, + { + typeof(int), + SettingItemType.Integer + }, + { + typeof(string), + SettingItemType.String + }, + { + typeof(long), + SettingItemType.Integer + }, + { + typeof(double), + SettingItemType.Double + }, + { + typeof(decimal), + SettingItemType.Double + }, + { + typeof(DateTime), + SettingItemType.DateTime + }, + { + typeof(Period), + SettingItemType.Period + }, + { + typeof(Account), + SettingItemType.Account + }, + { + typeof(Symbol), + SettingItemType.Symbol + }, + { + typeof(Color), + SettingItemType.Color + }, + { + typeof(PairColor), + SettingItemType.PairColor + }, + { + typeof(LineOptions), + SettingItemType.LineOptions + } + }; + } + + protected ExecutionEntity() + { + ?? = GetType(); + string text = ??.Assembly.?(); + ?? = (string.IsNullOrEmpty(text) ? null : new Version(text)); + } + + public virtual void Dispose() + { + Disposed = true; + ???.Invoke(this); + } + + protected virtual void OnSettingsUpdated() + { + } + + protected void CheckDisposed() + { + if (Disposed) + { + throw new ObjectDisposedException(Name); + } + } + + private static SettingItem ?(InputParameterAttribute P_0, Type P_1, string P_2, object P_3) + { + string name = (string.IsNullOrEmpty(P_0.Name) ? P_2 : P_0.Name); + int sortIndex = P_0.SortIndex; + double minimum = P_0.Minimum; + double maximum = P_0.Maximum; + double increment = P_0.Increment; + int decimalPlaces = P_0.DecimalPlaces; + SettingItem result = null; + SettingItemType value2; + if (P_0.Variants != null) + { + if (P_0.Variants.Length % 2 != 0) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + IComparable comparable = P_3 as IComparable; + if (comparable == null) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + List list = new List(); + SelectItem value = null; + for (int i = 0; i < P_0.Variants.Length; i += 2) + { + IComparable comparable2 = P_0.Variants[i + 1]; + if (comparable2 == null) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (comparable2.GetType() != P_1) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(70, 2); + defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_1); + throw new ArgumentException(defaultInterpolatedStringHandler.ToStringAndClear()); + } + if (comparable2 is Enum) + { + comparable2 = (int)(object)comparable2; + comparable = (int)(object)comparable; + } + SelectItem selectItem = new SelectItem(P_0.Variants[i].ToString(), comparable2); + list.Add(selectItem); + if (comparable2.CompareTo(comparable) == 0) + { + value = selectItem; + } + } + result = new SettingItemSelectorLocalized(name, value, list, sortIndex); + } + else if (??.TryGetValue(P_1, out value2)) + { + SettingItem settingItem; + switch (value2) + { + case SettingItemType.Boolean: + settingItem = new SettingItemBoolean(name, P_3 != null && (bool)P_3, sortIndex); + break; + case SettingItemType.Integer: + settingItem = new SettingItemInteger(name, (P_3 != null) ? ((int)P_3) : 0, sortIndex) + { + Minimum = (int)minimum, + Maximum = (int)maximum, + Increment = Math.Max((int)increment, 1) + }; + break; + case SettingItemType.String: + settingItem = new SettingItemString(name, (P_3 == null) ? null : ((string)P_3), sortIndex); + break; + case SettingItemType.Double: + settingItem = new SettingItemDouble(name, (P_3 == null) ? 0.0 : ((double)P_3), sortIndex) + { + Minimum = minimum, + Maximum = maximum, + Increment = increment, + DecimalPlaces = decimalPlaces + }; + break; + case SettingItemType.DateTime: + settingItem = new SettingItemDateTime(name, (P_3 == null) ? default(DateTime) : ((DateTime)P_3), sortIndex); + break; + case SettingItemType.Period: + settingItem = new SettingItemPeriod(name, (P_3 == null) ? default(Period) : ((Period)P_3), sortIndex); + break; + case SettingItemType.Account: + settingItem = new SettingItemAccount(name, (P_3 == null) ? null : ((Account)P_3), sortIndex); + break; + case SettingItemType.Symbol: + settingItem = new SettingItemSymbol(name, (P_3 == null) ? null : ((Symbol)P_3), sortIndex); + break; + case SettingItemType.Color: + settingItem = new SettingItemColor(name, (P_3 == null) ? default(Color) : ((Color)P_3), sortIndex); + break; + case SettingItemType.PairColor: + settingItem = new SettingItemPairColor(name, (P_3 == null) ? null : ((PairColor)P_3), sortIndex); + break; + case SettingItemType.LineOptions: + settingItem = new SettingItemLineOptions(name, (P_3 == null) ? null : ((LineOptions)P_3), sortIndex); + break; + default: + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(37, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_3.GetType()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + throw new ArgumentException(defaultInterpolatedStringHandler.ToStringAndClear()); + } + } + result = settingItem; + } + return result; + } + } + [Published] + public sealed class BuiltInIndicators + { + private readonly IIndicatorsCollection ?; + + internal BuiltInIndicators(IIndicatorsCollection P_0 = null) + { + ? = P_0; + } + + private void ?(Indicator P_0) + { + ??.AddIndicator(P_0); + } + + /// + /// Returns an instance of the Exponential Moving Average (EMA) indicator. + /// EMA provides a weighted price calculation for the last N periods. + /// + /// Period of Exponential Moving Average + /// Sources prices for MA + /// Calculation type + public Indicator EMA(int maPeriod, PriceType priceType, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), maPeriod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the Linearly Weighted Moving Average + /// Linear Weighted Moving Average makes the most recent bar more important unlike SMA. + /// + /// Moving average period + /// Type of the price + /// + public Indicator LWMA(int maPeriod, PriceType priceType) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), maPeriod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the SMA(Simple Moving Average) indicator. + /// The 'SMA' indicator provides an average price for the last N periods. + /// + /// Period of simple moving average. + /// Sources prices for MA. + /// + public Indicator SMA(int period, PriceType priceType) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Returns an instance of the Smoothed Moving Average (SMMA) indicator. + /// SMMA indicator provides a smoothed average price for the last N periods. + /// + /// Moving average period + /// Type of the price + /// Calculation type + /// + public Indicator SMMA(int period, PriceType priceType, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the PPMA(Pivot Point Moving Average) indicator. + /// The 'PPMA' indicator uses the pivot point calculation as the input a simple moving average. + /// + /// Period of PPMA indicator + /// + /// + public Indicator PPMA(int period) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the MAS3 (3MASignal) indicator. + /// The 'MAS3' indicator offers buy and sell signals according to intersections of three moving averages. + /// + /// Short moving average period. + /// Middle moving average period. + /// Long moving average period. + /// The count of bars. The trend will be determined on this interval. + /// + /// + public Indicator MAS3(int shortPeriod, int middlePeriod, int longPeriod, int barsInterval) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), shortPeriod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), middlePeriod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), longPeriod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), barsInterval); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the specific MA indicator, according to selected 'MaMode'. + /// + /// Period of moving average. + /// Type of price. + /// MA mode. + /// Calculation type + /// + /// + public Indicator MA(int period, PriceType priceType, MaMode maMode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + return maMode switch + { + MaMode.SMA => SMA(period, priceType), + MaMode.EMA => EMA(period, priceType, calculationType), + MaMode.SMMA => SMMA(period, priceType, calculationType), + MaMode.LWMA => LWMA(period, priceType), + _ => null, + }; + } + + /// + /// Gets the BB(Bollinger Bands) indicator. + /// The 'BB' indicator provides a relative definition of high and low based on standard deviation and a simple moving average. + /// + /// Period of MA for envelopes. + /// Value of confidence interval. + /// Sources prices for MA. + /// Type of moving average. + /// Calculation type + /// + public Indicator BB(int period, double coefficient, PriceType priceType, MaMode maMode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), coefficient); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(maMode.ToString(), (int)maMode)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the Commodity Channel Index. + /// Measures the position of price in relation to its moving average. + /// + /// Period for CCI MA + /// Sources prices for CCI + /// MA mode for CCI + /// Calculation type + /// + public Indicator CCI(int maPeriod, PriceType priceType, MaMode maMode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), maPeriod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(maMode.ToString(), (int)maMode)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Returns an instance of the Modified Moving Average (MMA) indicator. + /// MMA comprises a sloping factor to help it overtake with the growing or declining value of the trading price of the currency. + /// + /// Period of Modified Moving Average + /// Sources prices for MA + /// + public Indicator MMA(int maPeriod, PriceType priceType) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), maPeriod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the Regression indicator + /// The Linear Regression Indicator plots the ending value of a Linear Regression Line for a specified number of bars; showing, statistically, where the price is expected to be. + /// + /// Moving average period + /// Type of the price + /// + public Indicator Regression(int period, PriceType priceType) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the Channel (Price Channel) indicator. + /// The 'Channel' indicator is based on measurement of min and max prices for the definite number of periods. + /// + /// Period of price channel + /// + /// + public Indicator Channel(int period) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the AFIRMA indicator + /// Autoregressive finite impulse response moving average. A digital filter accurately shows the price movement as powered with least square method to minimise time lag + /// + /// Moving average period + /// Type of the price + /// Afirma mode + /// with least squares method overlapping if true + /// + public Indicator AFIRMA(int period, PriceType priceType, AfirmaMode afirmaMode, bool least_squares_method) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(afirmaMode.ToString(), (int)afirmaMode)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), least_squares_method); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the RSI indicator. + /// Relative Strength Index (RSI) is a momentum oscillator that measures the speed and change of price movements. + /// + /// RSI Period + /// Price Type + /// RSI Mode (Simple or Exponential) + /// MA Mode for smooth data + /// MA period for smooth data + /// Calculation type + /// + public Indicator RSI(int period, PriceType priceType, RSIMode rsiMode, MaMode maMode, int maperiod, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(rsiMode.ToString(), (int)rsiMode)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(maMode.ToString(), (int)maMode)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), maperiod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Returns an instance of the McGinley Dynamic indicator. + /// McGinley Dynamic avoids of most whipsaws and it rapidly moves up or down according to a quickly changing market. It needs no adjusting because it is dynamic and it adjusts itself. + /// + /// Period of exponential moving average + /// Dynamic tracking factor + /// Source price type + /// Calculation type + /// + public Indicator MD(int period, int trackingFactor, PriceType priceType, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), trackingFactor); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the MAE (Moving Average Envelope) indicator. + /// The 'MAE' indicator demonstrates a range of the prices discrepancy from a Moving Average. + /// + /// Period of MA for envelopes. + /// Sources prices for MA. + /// Type of moving average. + /// Upband deviation in %. + /// Downband deviation in %. + /// Calculation type + /// + public Indicator MAE(int period, PriceType priceType, MaMode maMode, double upShift, double downShift, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(maMode.ToString(), (int)maMode)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), upShift); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), downShift); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Returns an instance of the Parabolic Time/Price System (SAR) indicator. + /// SAR indicator helps to define the direction of the prevailing trend and the moment to close positions opened during the reversal. + /// + /// Step of parabolic SAR system + /// Maximum value for the acceleration factor + /// + /// + public Indicator SAR(double step, double maximum) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), step); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), maximum); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the AO (Awesome Oscillator) indicator. + /// The 'AO' indicator determines market momentum. + /// + /// + public Indicator AO() + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + ?(indicator); + return indicator; + } + + /// + /// Gets the CMO (Chande Momentum Oscillator) indicator. + /// The CMO calculates the dividing of difference between the sum of all recent gains and the sum of all recent losses by the sum of all price movement over the period. + /// + /// Period of MA for envelopes. + /// Sources prices for MA. + /// + /// + public Indicator CMO(int period, PriceType priceType) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Returns an instance of the ZigZag indicator. + /// ZigZag is a trend following indicator that is used to predict when a given symbol's momentum is reversing. + /// + /// Percent Deviation + /// + /// + public Indicator ZZ(double deviation) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), deviation); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the Aroon indicator. + /// Reveals the beginning of a new trend and determines how strong it is + /// + /// Aroons period + /// + /// + public Indicator AROON(int period) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Returns an instance of the Standart Deviation (SD) indicator. + /// The SD shows the difference of the volatility value from the average one. + /// + /// Period of indicator + /// Sources prices for MA + /// Type of Moving Average + /// Calculation type + /// + public Indicator SD(int period, PriceType priceType, MaMode mode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(mode.ToString(), (int)mode)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the MACD (Moving Average Convergence/Divergence) indicator. + /// The MACD is a trend-following momentum indicator that shows the relationship between two moving averages of prices. + /// + /// Period of fast EMA. + /// Period of slow EMA. + /// Period of signal EMA. + /// Calculation type + /// + public Indicator MACD(int fastEMA, int slowEMA, int signalEMA, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), fastEMA); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), slowEMA); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), signalEMA); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Returns an instance of the Kairi Relative Index (KRI) indicator. + /// KRI calculates deviation of the current price from its simple moving average as a percent of the moving average. + /// + /// + /// + /// + public Indicator KRI(int period) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Returns an instance of the Bollinger Bands Flat (BBF) indicator. + /// The BBF provides the same data as BB, but drawn in separate field and easier to recognize whether price is in or out of the band. + /// + /// Period + /// Deviation + /// Sources prices for MA + /// Type of Moving Average + /// Calculation type + /// + public Indicator BBF(int period, double deviation, PriceType priceType, MaMode mode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), deviation); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(mode.ToString(), (int)mode)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the ROC (Rate of Change) indicator. + /// The ROC shows the speed at which price is changing. + /// + /// Period of momentum. + /// + /// + public Indicator ROC(int period) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the Momentum indicator. + /// Momentum compares where the current price is in relation to where the price was in the past. + /// + /// Period for Momentum + /// Sources prices for Momentum + /// + /// + public Indicator Momentum(int period, PriceType priceType) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the %R Larry Williams. + /// Uses Stochastic to determine overbought and oversold levels. + /// + /// Period for Momentum + /// + /// + public Indicator RLW(int period) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Returns an instance of the Price Oscillator (PO) indicator. + /// PO calculates the variation between price moving averages. + /// + /// Period of MA1 + /// Period of MA2 + /// Sources prices for MA + /// Type of Moving Average + /// Calculation type + /// + public Indicator PO(int period1, int period2, PriceType priceType, MaMode mode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period1); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period2); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(mode.ToString(), (int)mode)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the OsMA (Moving Average of Oscillator) indicator. + /// The OsMA reflects the difference between an oscillator (MACD) and its moving average (signal line). + /// + /// Period of fast EMA. + /// Period of slow EMA. + /// Period of signal EMA. + /// Calculation type + /// + public Indicator OsMA(int fastEMA, int slowEMA, int signalEMA, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), fastEMA); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), slowEMA); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), signalEMA); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets On Balance Volume. + /// On Balance Volume (OBV) measures buying and selling pressure as a cumulative indicator that adds volume on up days and subtracts volume on down days. + /// + /// Sources prices for OBV + /// + /// + public Indicator OBV(PriceType priceType) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Returns an instance of the Positive Volume Index (PVI) indicator. + /// The PVI value changes on the periods in which value of volume has increased in comparison with the previous period. + /// + /// + /// + /// + public Indicator PVI(PriceType priceType) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Returns an instance of the Volume indicator. + /// Volume allows to confirm the strength of a trend or to suggest about it's weakness. + /// + /// + /// + public Indicator Volume() + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + ?(indicator); + return indicator; + } + + /// + /// Gets the MFI(Money Flow Index) indicator. + /// The MFI(Money Flow Index) is an oscillator that uses both price and volume to measure buying and selling pressure. + /// + /// Period of MFI. + /// + /// + public Indicator MFI(int period) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), period); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Returns an instance of the Acceleration/Deceleration Oscillator (AC). + /// AC measures the acceleration and deceleration of the current momentum. + /// + /// + /// + public Indicator AC() + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + ?(indicator); + return indicator; + } + + /// + /// Gets the Average True Range (ATR) indicator. + /// The ATR measures of market volatility. + /// + /// + /// Period of Moving Average. + /// Type of Moving Average + /// Calculation type + /// + public Indicator ATR(int period, MaMode mode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), period); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(mode.ToString(), (int)mode)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Returns an instance of the Kaufman Adaptive Moving Average (KAMA) indicator. + /// KAMA is an exponential style average with a smoothing that varies according to recent data. + /// + /// Period + /// Fast factor + /// Slow factor + /// Sources prices for MA + /// + /// + public Indicator KAMA(int period, double fast, double slow, PriceType priceType) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), fast); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), slow); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Returns an instance of the Qstick indicator. + /// The Qstick is a moving average that shows the difference between the prices at which an issue opens and closes. + /// + /// + /// + /// Calculation type + /// + public Indicator Qstick(int period, MaMode mode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(mode.ToString(), (int)mode)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Get the Swing Index (SI) indicator. + /// The SI is used to confirm trend line breakouts on price charts. + /// + /// The divider. + /// + /// + public Indicator SI(double divider) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), divider); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Get the True Strength Index (TSI) indicator. + /// + /// The TSI is a variation of the Relative Strength Indicator which uses a doubly-smoothed + /// EMA of price momentum to eliminate choppy price changes and spot trend changes. + /// + /// + /// First MA period. + /// Second MA period. + /// Calculation type + /// + public Indicator TSI(int firstPeriod, int secondPeriod, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), firstPeriod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), secondPeriod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Returns an instance of the Average Directional Index (ADX) indicator. + /// The ADX determines the strength of a prevailing trend. + /// + /// Period + /// Type of Moving Average + /// Calculation type + /// + public Indicator ADX(int period, MaMode mode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(mode.ToString(), (int)mode)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Returns an instance of the Keltner Channel indicator. + /// Keltner Channels are volatility-based envelopes set above and below an exponential moving average. + /// + /// Period of MA for Keltner's Channel + /// Coefficient of channel's width + /// Sources prices for MA + /// Type of Moving Average + /// Calculation type + /// + public Indicator Keltner(int period, double offset, PriceType priceType, MaMode mode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), period); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), offset); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(priceType.ToString(), (int)priceType)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(mode.ToString(), (int)mode)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Returns an instance of the Percentage Price Oscillator (PPO). + /// Percentage Price Oscillator is a momentum indicator. Signal line is EMA of PPO. Formula: (FastEMA-SlowEMA)/SlowEMA. + /// + /// Fast EMA Period + /// Slow EMA Period + /// Signal EMA Period + /// Calculation type + /// + public Indicator PPO(int fastPeriod, int slowPeriod, int signalPeriod, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), fastPeriod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), slowPeriod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), signalPeriod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the Stochastic Slow. + /// Shows the location of the current close relative to the high/low range over a set number of periods (Slow). + /// + /// Period + /// Smoothing + /// Double smoothing + /// Moving type + /// Calculation type + /// + public Indicator Stochastic(int period, int smooth, int doubleSmooth, MaMode MaType, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), period); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), smooth); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), doubleSmooth); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new SelectItem(MaType.ToString(), (int)MaType)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the Stochastic x Relative Strength Index. + /// StochRSI is an oscillator that measures the level of RSI relative to its range. + /// + /// Period + /// Smoothing + /// Double smoothing + /// + /// + public Indicator StochasticxRSI(int rsiPeriod, int kPeriod, int dPeriod) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), rsiPeriod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), kPeriod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), dPeriod); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the Ichimoku. + /// Enables to quickly discern and filter 'at a glance' the low-probability trading setups from those of higher probability. + /// + /// Tenkan Period + /// Kijun Period + /// Senkou Span B + /// + /// + public Indicator ICH(int TenkanPeriod, int KijunPeriod, int SenkouSpanB) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TenkanPeriod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), KijunPeriod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SenkouSpanB); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the Directional Movement Index(DMI) indicator. + /// The DMI ?dentifies whether there is a definable trend in the market. + /// + /// Period of Moving Average. + /// Type of Moving Average. + /// Calculation type + /// + public Indicator DMI(int period, MaMode mode, IndicatorCalculationType calculationType = IndicatorCalculationType.AllAvailableData) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), period); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(mode.ToString(), (int)mode)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new SelectItem(calculationType.ToString(), (int)calculationType)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + /// + /// Gets the Alligator. + /// Three moving averages with different colors, periods and calculation methods. + /// + /// Type of Jaw Moving Average. + /// SourcePrice of Jaw Moving Average. + /// Period of Jaw Moving Average. + /// Shift of Jaw Moving Average. + /// Period of Moving Average. + /// Type of Moving Average. + /// Period of Moving Average. + /// Type of Moving Average. + /// Period of Moving Average. + /// Type of Moving Average. + /// Period of Moving Average. + /// Type of Moving Average. + /// + /// + public Indicator Alligator(MaMode JawMAType, PriceType JawSourcePrice, int JawMAPeiod, int JawMAShift, MaMode TeethMAType, PriceType TeethSourcePrice, int TeethMAPeiod, int TeethMAShift, MaMode LipsMAType, PriceType LipsSourcePrice, int LipsMAPeiod, int LipsMAShift) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new SelectItem(JawMAType.ToString(), (int)JawMAType)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new SelectItem(JawSourcePrice.ToString(), (int)JawSourcePrice)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), JawMAPeiod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), JawMAShift); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new SelectItem(TeethMAType.ToString(), (int)TeethMAType)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new SelectItem(TeethSourcePrice.ToString(), (int)TeethSourcePrice)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TeethMAPeiod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TeethMAShift); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new SelectItem(LipsMAType.ToString(), (int)LipsMAType)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new SelectItem(LipsSourcePrice.ToString(), (int)LipsSourcePrice)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LipsMAPeiod); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LipsMAShift); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + + public Indicator HV(int stdPeriod, int volatilityPeriod, PriceType priceType, HVSheduleMode hvMode) + { + return ?(stdPeriod, volatilityPeriod, priceType, hvMode, true, 0); + } + + public Indicator HV(int stdPeriod, int volatilityPeriod, PriceType priceType, HVSheduleMode hvMode, int percentilePeriod) + { + return ?(stdPeriod, volatilityPeriod, priceType, hvMode, false, percentilePeriod); + } + + private Indicator ?(int P_0, int P_1, PriceType P_2, HVSheduleMode P_3, bool P_4, int P_5) + { + Indicator indicator = Core.Instance.Indicators.CreateIndicator(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ScriptCreationType.Default); + IList settings = indicator.Settings; + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_1); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new SelectItem(P_2.ToString(), (int)P_2)); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_4); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_5); + settings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new SelectItem(P_3.ToString(), (int)P_3)); + indicator.Settings = settings; + ?(indicator); + return indicator; + } + } + /// + /// Base class for all indicators. + /// + [Published] + public abstract class Indicator : ExecutionEntity, IIndicatorsCollection + { + private class ? + { + [CompilerGenerated] + private Color? ??; + + [CompilerGenerated] + private Color? ??; + + public Color? BeginColor + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = color; + } + } + + public Color? EndColor + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = color; + } + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(15, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(BeginColor); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(EndColor); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + + [NotPublished] + public const string EMA = "Exponential Moving Average"; + + [NotPublished] + public const string LWMA = "Linearly Weighted Moving Average"; + + [NotPublished] + public const string SMA = "Simple Moving Average"; + + [NotPublished] + public const string SMMA = "Smoothed Moving Average"; + + [NotPublished] + public const string PPMA = "Pivot Point Moving Average"; + + [NotPublished] + public const string CCI = "Commodity Channel Index"; + + [NotPublished] + public const string MAS3 = "3MASignal"; + + [NotPublished] + public const string MMA = "Modified Moving Average"; + + [NotPublished] + public const string Regression = "Regression Line"; + + [NotPublished] + public const string BB = "Bollinger Bands"; + + [NotPublished] + public const string Channel = "Price Channel"; + + [NotPublished] + public const string AFIRMA = "Autoregressive Finite Impulse Response Moving Average"; + + [NotPublished] + public const string RSI = "Relative Strength Index"; + + [NotPublished] + public const string MD = "McGinley Dynamic"; + + [NotPublished] + public const string MAE = "Moving Average Envelope"; + + [NotPublished] + public const string SAR = "Parabolic SAR"; + + [NotPublished] + public const string AO = "Awesome Oscillator"; + + [NotPublished] + public const string CMO = "Chande Momentum Oscillator"; + + [NotPublished] + public const string ZZ = "ZigZag"; + + [NotPublished] + public const string AROON = "Aroon"; + + [NotPublished] + public const string MACD = "Moving Average Convergence/Divergence"; + + [NotPublished] + public const string SD = "Standard Deviation"; + + [NotPublished] + public const string KRI = "Kairi Relative Index"; + + [NotPublished] + public const string BBF = "Bollinger Bands Flat"; + + [NotPublished] + public const string ROC = "Rate of Change"; + + [NotPublished] + public const string Momentum = "Momentum"; + + [NotPublished] + public const string RLW = "%R Larry Williams"; + + [NotPublished] + public const string PO = "Price Oscillator"; + + [NotPublished] + public const string OBV = "On Balance Volume"; + + [NotPublished] + public const string OsMA = "Moving Average of Oscillator"; + + [NotPublished] + public const string PVI = "Positive Volume Index"; + + [NotPublished] + public const string VOLUME = "Volume"; + + [NotPublished] + public const string MFI = "Money Flow Index"; + + [NotPublished] + public const string AC = "Acceleration Oscillator"; + + [NotPublished] + public const string ATR = "Average True Range"; + + [NotPublished] + public const string KAMA = "Kaufman Adaptive Moving Average"; + + [NotPublished] + public const string Stochastic = "Stochastic Slow"; + + [NotPublished] + public const string StochasticxRSI = "Stochastic x Relative Strength Index"; + + [NotPublished] + public const string Qstick = "Qstick"; + + [NotPublished] + public const string SI = "Swing Index"; + + [NotPublished] + public const string ADX = "Average Directional Index"; + + [NotPublished] + public const string Keltner = "Keltner Channel"; + + [NotPublished] + public const string PPO = "Percentage Price Oscillator"; + + [NotPublished] + public const string TSI = "True Strength Index"; + + [NotPublished] + public const string DMI = "Directional Movement Index"; + + [NotPublished] + public const string ICH = "Ichimoku"; + + [NotPublished] + public const string Alligator = "Alligator"; + + [NotPublished] + public const string HV = "Historical Volatility"; + + [NotPublished] + public const string PAZ = "Price Action Zones"; + + [NotPublished] + public const string OSCILLATOR_GROUP = "Oscillators"; + + [NotPublished] + public const string MOVING_AVERAGE_GROUP = "Moving averages"; + + [NotPublished] + public const string TREND_GROUP = "Trend"; + + [NotPublished] + public const string VOLATILITY_GROUP = "Volatility"; + + [NotPublished] + public const string CHANNEL_GROUP = "Channels"; + + [NotPublished] + public const string VOLUME_GROUP = "Volume"; + + [NotPublished] + public const string HIDDEN_GROUP = "Hidden"; + + [NotPublished] + protected internal const IndicatorCalculationType DEFAULT_CALCULATION_TYPE = IndicatorCalculationType.AllAvailableData; + + private string ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private HistoricalData ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ?? = true; + + [CompilerGenerated] + private int ?? = -1; + + [CompilerGenerated] + private TimeFrameConfig ?? = new TimeFrameConfig(); + + [CompilerGenerated] + private IndicatorUpdateType ??; + + [CompilerGenerated] + private bool ?? = true; + + private const string ?? = "Line_"; + + private const string ?? = "Level_"; + + [CompilerGenerated] + private IChart ??; + + private readonly List ??; + + private readonly List ??; + + private readonly object ??; + + private readonly List ??; + + private readonly object ??; + + private readonly List ??; + + private readonly object ??; + + [EditorBrowsable(EditorBrowsableState.Never)] + [Obfuscation(Exclude = true)] + private bool debugMode; + + private bool ??; + + private readonly IDictionary> ??; + + private readonly object ??; + + private readonly List ??; + + [CompilerGenerated] + private ? ??; + + /// + /// Short name of indicator + /// + public virtual string ShortName + { + get + { + if (string.IsNullOrEmpty(??)) + { + return base.Name; + } + return ??; + } + [Obsolete("Override getter")] + protected set + { + ?? = value; + } + } + + /// + /// Access to current Symbol of indicator + /// + public Symbol Symbol => HistoricalData?.Symbol; + + /// + /// Amount of items in internal buffers + /// + public int Count + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Represent access to current used historical data. + /// + public HistoricalData HistoricalData + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = historicalData; + } + } + + /// + /// Represent access indicator series + /// + public LineSeries[] LinesSeries => ??.ToArray(); + + /// + /// + /// + public LineLevel[] LinesLevels => ??.ToArray(); + + /// + /// Specified, whether indicator should use main or additional window on the chart + /// + public bool SeparateWindow + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Specified, whether indicator should draw on chart background by default. + /// + public bool OnBackGround + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Specified, whether indicator should participate into price auto scale system. + /// + public bool AllowFitAuto + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Precision amount for formatting price (the count of digits after decimal point); By default = -1, which means to use precision from indicator's symbol + /// + public int Digits + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public TimeFrameConfig TFConfig + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = timeFrameConfig; + } + } + + public IndicatorUpdateType UpdateType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + protected bool IsUpdateTypesSupported + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Indicator's settings + /// + public override IList Settings + { + get + { + IList settings = base.Settings; + if (?? != null) + { + for (int i = 0; i < ??.Count; i++) + { + int num = i + 1; + LineSeries lineSeries = ??[i]; + string text = string.Format(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), num); + SettingItemSeparatorGroup separatorGroup = new SettingItemSeparatorGroup((string.IsNullOrEmpty(lineSeries.Name) || lineSeries.Name.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) ? text : string.Format(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), lineSeries.Name), num); + IList settings2 = lineSeries.Settings; + foreach (SettingItem item in settings2) + { + item.SeparatorGroup = separatorGroup; + } + settings.Add(new SettingItemGroup($"{3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()}{i}", settings2) + { + Text = text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }); + } + if (?? != null) + { + for (int j = 0; j < ??.Count; j++) + { + int num2 = ??.Count + j; + LineLevel lineLevel = ??[j]; + string text2 = string.Format(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), j + 1); + SettingItemSeparatorGroup separatorGroup2 = new SettingItemSeparatorGroup((string.IsNullOrEmpty(lineLevel.Name) || lineLevel.Name.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) ? text2 : string.Format(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), lineLevel.Name), num2 + 1); + IList settings3 = lineLevel.Settings; + foreach (SettingItem item2 in settings3) + { + item2.SeparatorGroup = separatorGroup2; + } + settings.Add(new SettingItemGroup($"{3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()}{num2}", settings3) + { + Text = text2 + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }); + } + } + } + if (HistoricalData != null && (TFConfig.DefaultAggregation == null || (HistoricalData.Aggregation != null && !HistoricalData.Aggregation.Equals(TFConfig.DefaultAggregation)))) + { + TFConfig.DefaultAggregation = HistoricalData.Aggregation; + } + settings.Add(new SettingItemTimeFrameConfig(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TFConfig) + { + SeparatorGroup = new SettingItemSeparatorGroup(string.Empty, 1000) + }); + List list = new List + { + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 0), + new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1) + }; + if (IsUpdateTypesSupported) + { + settings.Add(new SettingItemSelectorLocalized(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), list.GetItemByValue((int)UpdateType), list) + { + SeparatorGroup = new SettingItemSeparatorGroup(string.Empty, 1100) + }); + } + return settings; + } + set + { + base.Settings = value; + foreach (SettingItem item in value) + { + if (!(item is SettingItemGroup { Value: IList value2 }) || !value2.Any() || value2[0].Group == null || !int.TryParse(value2[0].Group.Name.Replace(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()), out var result)) + { + continue; + } + if (result < ??.Count) + { + ??[result].Settings = value2; + continue; + } + int num = result - ??.Count; + if (num < ??.Count) + { + ??[num].Settings = value2; + } + } + bool flag = false; + if (value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemTimeFrameConfig settingItemTimeFrameConfig) + { + TFConfig = (TimeFrameConfig)settingItemTimeFrameConfig.Value; + } + if (IsUpdateTypesSupported && value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) is SettingItemSelectorLocalized settingItemSelectorLocalized) + { + UpdateType = (IndicatorUpdateType)(int)(object)((SelectItem)settingItemSelectorLocalized.Value).Value; + flag = settingItemSelectorLocalized.ValueChangingReason == SettingItemValueChangingReason.Manually; + } + if (flag) + { + OnSettingsUpdated(); + } + } + } + + /// + /// Represent access to the chart, that created indicator + /// + public IChart CurrentChart + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public virtual string HelpLink => string.Empty; + + public virtual string SourceCodeLink => string.Empty; + + internal int ChildIndicatorsCount + { + get + { + lock (??) + { + return ??.Count; + } + } + } + + internal ? Refresher + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = ?; + } + } + + protected virtual void OnInit() + { + } + + protected virtual void OnUpdate(UpdateArgs args) + { + } + + protected virtual void OnClear() + { + } + + public LineSeries AddLineSeries(string lineName = "", Color lineColor = default(Color), int lineWidth = 1, LineStyle lineStyle = LineStyle.Solid) + { + if (string.IsNullOrEmpty(lineName)) + { + lineName = $"{3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()}{??.Count + 1}"; + } + if (lineColor == default(Color)) + { + lineColor = Color.Blue; + } + LineSeries lineSeries = new LineSeries(lineName, lineColor, lineWidth, lineStyle); + AddLineSeries(lineSeries); + return lineSeries; + } + + public void AddLineSeries(LineSeries lineSeries) + { + if (lineSeries == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + lock (??) + { + ??.Add(lineSeries); + } + } + + public LineLevel AddLineLevel(double level, string lineName = "", Color lineColor = default(Color), int lineWidth = 1, LineStyle lineStyle = LineStyle.Solid) + { + if (string.IsNullOrEmpty(lineName)) + { + lineName = $"{3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()}{level}"; + } + if (lineColor == default(Color)) + { + lineColor = Color.Blue; + } + LineLevel lineLevel = new LineLevel(level, lineName, lineColor, lineWidth, lineStyle); + AddLineLevel(lineLevel); + return lineLevel; + } + + public void AddLineLevel(LineLevel lineLevel) + { + if (lineLevel == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ??.Add(lineLevel); + } + + /// + /// Recalculate indicator + /// + public void Refresh() + { + Refresher?.?(this); + } + + /// + /// + /// + /// + public void AddIndicator(Indicator indicator) + { + if (indicator == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + lock (??) + { + if (??.Contains(indicator)) + { + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + indicator.HistoricalData = HistoricalData; + indicator.Init(); + for (int i = 0; i < Count; i++) + { + indicator.Update(new UpdateArgs(UpdateReason.HistoricalBar)); + } + ??.Add(indicator); + } + } + + public void RemoveIndicator(Indicator indicator) + { + if (indicator == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + lock (??) + { + ??.Remove(indicator); + } + indicator.Clear(); + indicator.Dispose(); + } + + /// + /// Sets the value of indicator into internal buffer + /// + /// Value + /// Index of indicator line + /// Offset value + public void SetValue(double value, int lineIndex = 0, int offset = 0) + { + ??[lineIndex].SetValue(value, offset); + } + + /// + /// Gets the value of indicator from internal buffer + /// + /// Offset value + /// Index of indicator line + /// Offset start point + /// + public double GetValue(int offset = 0, int lineIndex = 0, SeekOriginHistory origin = SeekOriginHistory.End) + { + double result = double.NaN; + if (lineIndex < 0 || lineIndex >= ??.Count) + { + return result; + } + return ??[lineIndex].GetValue(offset, origin); + } + + /// + /// Set line break point. + /// + /// Offset value + /// Index of indicator line + /// Offset start point + public void SetLineBreak(int offset = 0, int lineIndex = 0, SeekOriginHistory origin = SeekOriginHistory.End) + { + if (lineIndex < 0 || lineIndex >= ??.Count) + { + throw new ArgumentOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + int lineBreak = ((origin == SeekOriginHistory.End) ? offset : (Count - offset - 1)); + LinesSeries[lineIndex].SetLineBreak(lineBreak); + } + + /// + /// Remove line break point. + /// + /// Offset value + /// Index of indicator line + /// Offset start point + public void RemoveLineBreak(int offset = 0, int lineIndex = 0, SeekOriginHistory origin = SeekOriginHistory.End) + { + if (lineIndex < 0 || lineIndex >= ??.Count) + { + throw new ArgumentOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + int offset2 = ((origin == SeekOriginHistory.End) ? offset : (Count - offset - 1)); + LinesSeries[lineIndex].RemoveLineBreak(offset2); + } + + /// + /// Check if the point is a break point. + /// + /// Offset value + /// Index of indicator line + /// Offset start point + public bool GetLineBreak(int offset = 0, int lineIndex = 0, SeekOriginHistory origin = SeekOriginHistory.End) + { + if (lineIndex < 0 || lineIndex >= ??.Count) + { + throw new ArgumentOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + int offset2 = ((origin == SeekOriginHistory.End) ? offset : (Count - offset - 1)); + return LinesSeries[lineIndex].GetLineBreak(offset2); + } + + /// + /// Gets the price from historical data + /// + /// + /// + /// + protected double GetPrice(PriceType priceType, int offset = 0) + { + return HistoricalData[Count - 1 - offset, SeekOriginHistory.Begin][priceType]; + } + + protected VolumeAnalysisData GetVolumeAnalysisData(int offset = 0) + { + return HistoricalData[Count - 1 - offset, SeekOriginHistory.Begin].VolumeAnalysisData; + } + + /// + /// Get Bid price + /// + /// Offset value + /// + protected double Bid(int offset = 0) + { + return GetPrice(PriceType.Bid, offset); + } + + /// + /// Get Ask price + /// + /// Offset value + /// + protected double Ask(int offset = 0) + { + return GetPrice(PriceType.Ask, offset); + } + + /// + /// Get Last price + /// + /// Offset value + /// + protected double Last(int offset = 0) + { + return GetPrice(PriceType.Last, offset); + } + + /// + /// Get Open price + /// + /// Offset value + /// + protected double Open(int offset = 0) + { + return GetPrice(PriceType.Open, offset); + } + + /// + /// Get High price + /// + /// Offset value + /// + protected double High(int offset = 0) + { + return GetPrice(PriceType.High, offset); + } + + /// + /// Get Low price + /// + /// Offset value + /// + protected double Low(int offset = 0) + { + return GetPrice(PriceType.Low, offset); + } + + /// + /// Get Close price + /// + /// Offset value + /// + protected double Close(int offset = 0) + { + return GetPrice(PriceType.Close, offset); + } + + /// + /// Get Median price + /// + /// Offset value + /// + protected double Median(int offset = 0) + { + return GetPrice(PriceType.Median, offset); + } + + /// + /// Get Typical price + /// + /// Offset value + /// + protected double Typical(int offset = 0) + { + return GetPrice(PriceType.Typical, offset); + } + + /// + /// Get Weighted price + /// + /// Offset value + /// + protected double Weighted(int offset = 0) + { + return GetPrice(PriceType.Weighted, offset); + } + + /// + /// Get Volume + /// + /// Offset value + /// + protected double Volume(int offset = 0) + { + return GetPrice(PriceType.Volume, offset); + } + + /// + /// Get Volume in quoting asset + /// + /// Offset value + /// + protected double QuoteAssetVolume(int offset = 0) + { + return GetPrice(PriceType.QuoteAssetVolume, offset); + } + + /// + /// Get Ticks + /// + /// Offset value + /// + protected double Ticks(int offset = 0) + { + return GetPrice(PriceType.Ticks, offset); + } + + /// + /// Get Open interest + /// + /// Offset value + /// + protected double OpenInterest(int offset = 0) + { + return GetPrice(PriceType.OpenInterest, offset); + } + + /// + /// Get Funding rate + /// + /// Offset value + /// + protected double FundingRate(int offset = 0) + { + return GetPrice(PriceType.FundingRate, offset); + } + + /// + /// Get Time + /// + /// Offset value + /// + protected DateTime Time(int offset = 0) + { + return new DateTime(HistoricalData[Count - 1 - offset, SeekOriginHistory.Begin].TicksLeft, DateTimeKind.Utc); + } + + /// + /// Formatting price, using precision from assigned symbol or Digits value if specified + /// + /// Price value + /// + public string FormatPrice(double price) + { + if (Digits != -1) + { + return price.Format(Digits); + } + if (Symbol != null) + { + return Symbol.FormatPrice(price); + } + return price.ToString(); + } + + [NotPublished] + public override void Dispose() + { + base.Dispose(); + HistoricalData = null; + } + + public virtual void OnPaintChart(PaintChartEventArgs args) + { + } + + public void Calculate(HistoricalData historicalData) + { + if (historicalData == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + HistoricalData?.RemoveIndicator(this); + historicalData.AddIndicator(this); + } + + /// + /// Marks cloud begin between two line series with specific color + /// + /// First line series index + /// Second line series index + /// Cloud color + /// Offset + protected void BeginCloud(int line1Index, int line2Index, Color color, int offset = 0) + { + IndicatorCloudKey indicatorCloudKey = new IndicatorCloudKey(line1Index, line2Index); + int num = Count - 1 - offset; + ? ? = this.?(indicatorCloudKey, num); + if (?.EndColor == color) + { + ?.EndColor = null; + } + else + { + ?.BeginColor = color; + } + } + + /// + /// Marks cloud end between two line series with specific color + /// + /// First line series index + /// Second line series index + /// Cloud color + /// Offset + protected void EndCloud(int line1Index, int line2Index, Color color, int offset = 0) + { + IndicatorCloudKey indicatorCloudKey = new IndicatorCloudKey(line1Index, line2Index); + int num = Count - 1 - offset; + ? ? = this.?(indicatorCloudKey, num); + if (?.BeginColor == color) + { + ?.BeginColor = null; + } + else + { + ?.EndColor = color; + } + } + + private ? ?(IndicatorCloudKey P_0, int P_1) + { + lock (??) + { + if (!??.TryGetValue(P_0, out var value)) + { + value = (??[P_0] = new List()); + for (int i = 0; i < Count; i++) + { + value.Add(new ?()); + } + } + ? ? = value[P_1]; + if (? == null) + { + ? = (value[P_1] = new ?()); + } + return ?; + } + } + + [NotPublished] + public IDictionary AnalyzeClouds() + { + IDictionary> dictionary; + lock (??) + { + if (??.Count == 0) + { + return null; + } + dictionary = new Dictionary>(??); + } + Dictionary dictionary2 = new Dictionary(); + foreach (KeyValuePair> item in dictionary) + { + IndicatorCloudKey key = item.Key; + List value = item.Value; + List list = new List(); + IndicatorCloud indicatorCloud = null; + for (int i = 0; i < value.Count; i++) + { + ? ? = value[i]; + if (?.EndColor.HasValue && indicatorCloud != null) + { + indicatorCloud.ToIndex = i; + if (indicatorCloud.ToIndex - indicatorCloud.FromIndex > 0) + { + indicatorCloud.ToIndex--; + } + list.Add(indicatorCloud); + indicatorCloud = null; + } + if (?.BeginColor.HasValue) + { + indicatorCloud = new IndicatorCloud + { + Color = ?.BeginColor.Value, + FromIndex = i + }; + } + } + if (indicatorCloud != null) + { + if (indicatorCloud.ToIndex == -1) + { + indicatorCloud.ToIndex = Count - 1; + } + list.Add(indicatorCloud); + } + dictionary2.Add(key, list.ToArray()); + } + return dictionary2; + } + + public void SetBarColor(Color? color = null, int offset = 0) + { + int index = ??.Count - 1 - offset; + if (!color.HasValue) + { + ??[index] = null; + return; + } + ??[index] = new IndicatorBarAppearance + { + BarColor = color.Value + }; + } + + public IndicatorBarAppearance GetBarAppearance(int offset = 0) + { + int num = ??.Count - 1 - offset; + if (num < 0) + { + return null; + } + return ??[num]; + } + + public void SetBarAppearance(IndicatorBarAppearance barAppearance, int offset = 0) + { + int index = ??.Count - 1 - offset; + ??[index] = barAppearance; + } + + protected virtual bool OnTryGetMinMax(int fromOffset, int toOffset, out double min, out double max) + { + min = double.NaN; + max = double.NaN; + return false; + } + + protected Indicator() + { + ?? = new object(); + ?? = new List(); + ?? = new List(); + ?? = new List(); + ?? = new object(); + ?? = new List(); + ?? = new object(); + ?? = new Dictionary>(); + ?? = new object(); + ?? = new List(); + } + + public void Init() + { + try + { + OnInit(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public void Update(UpdateArgs args) + { + if (debugMode) + { + while (!base.Disposed) + { + Thread.Sleep(100); + if (??) + { + break; + } + } + } + bool num = ?(args.Reason); + ?(args); + if (num) + { + Count++; + ?(); + ?(); + } + try + { + OnUpdate(args); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ?? = false; + } + + public void Clear() + { + ?(); + ?(); + Count = 0; + if (?? == null) + { + return; + } + lock (??) + { + foreach (LineSeries item in ??) + { + item.Clear(); + } + } + lock (??) + { + ??.Clear(); + } + ??.Clear(); + try + { + OnClear(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public bool TryGetMinMax(int fromOffset, int toOffset, out double min, out double max) + { + min = double.NaN; + max = double.NaN; + try + { + return OnTryGetMinMax(fromOffset, toOffset, out min, out max); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return false; + } + + public void PaintChart(PaintChartEventArgs ev) + { + try + { + OnPaintChart(ev); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + ?? = true; + } + + private bool ?(UpdateReason P_0) + { + switch (P_0) + { + case UpdateReason.HistoricalBar: + return true; + case UpdateReason.NewBar: + return true; + case UpdateReason.NewTick: + if (HistoricalData.Aggregation == null) + { + return false; + } + if (HistoricalData.Aggregation.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() && HistoricalData.Aggregation.GetPeriod == Period.TICK1) + { + return true; + } + break; + } + return false; + } + + private void ?() + { + lock (??) + { + foreach (LineSeries item in ??) + { + item.?(); + } + } + lock (??) + { + foreach (KeyValuePair> item2 in ??) + { + item2.Value.Add(new ?()); + } + } + ??.Add(null); + } + + private void ?(UpdateArgs P_0) + { + lock (??) + { + foreach (Indicator item in ??) + { + item.Update(P_0); + } + } + } + + private void ?() + { + lock (??) + { + foreach (Indicator item in ??) + { + item.Clear(); + item.Dispose(); + } + ??.Clear(); + } + } + + internal void ?(HistoricalDataCustom P_0) + { + if (P_0 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + lock (??) + { + if (??.Contains(P_0)) + { + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + for (int i = 0; i < Count; i++) + { + P_0.?(); + } + ??.Add(P_0); + } + } + + private void ?() + { + lock (??) + { + foreach (HistoricalDataCustom item in ??) + { + item.?(); + } + } + } + + private void ?() + { + lock (??) + { + foreach (HistoricalDataCustom item in ??) + { + item.Dispose(); + } + ??.Clear(); + } + } + + protected override void OnSettingsUpdated() + { + Refresh(); + } + } + public class IndicatorBarAppearance + { + [CompilerGenerated] + private Color ?; + + [CompilerGenerated] + private Color ?; + + [CompilerGenerated] + private Color ?; + + public Color BarColor + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + public Color BorderColor + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + public Color WickColor + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + } + public enum IndicatorCalculationBehavior + { + Synchronous, + Asynchronous + } + public class IndicatorCloud : IComparable + { + [CompilerGenerated] + private int ?; + + [CompilerGenerated] + private int ?; + + private Color ?; + + [CompilerGenerated] + private SolidBrush ?; + + internal const int ? = -1; + + public int FromIndex + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + public int ToIndex + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + public Interval Interval => new Interval(FromIndex, ToIndex); + + public Color Color + { + get + { + return ?; + } + set + { + ? = value; + Brush = new SolidBrush(?); + } + } + + public SolidBrush Brush + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = solidBrush; + } + } + + public IndicatorCloud() + { + FromIndex = -1; + ToIndex = -1; + } + + public int CompareTo(IndicatorCloud other) + { + if (this == other) + { + return 0; + } + if (other == null) + { + return 1; + } + return FromIndex.CompareTo(other.FromIndex); + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 3); + defaultInterpolatedStringHandler.AppendFormatted(FromIndex); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(ToIndex); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Color.Name); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + public readonly struct IndicatorCloudKey : IEquatable + { + [CompilerGenerated] + private readonly int ?; + + [CompilerGenerated] + private readonly int ?; + + public int Line1Index + { + [CompilerGenerated] + get + { + return ?; + } + } + + public int Line2Index + { + [CompilerGenerated] + get + { + return ?; + } + } + + public IndicatorCloudKey(int line1Index, int line2Index) + { + ? = line1Index; + ? = line2Index; + } + + public bool Equals(IndicatorCloudKey other) + { + if (Line1Index == other.Line1Index) + { + return Line2Index == other.Line2Index; + } + return false; + } + + public override bool Equals(object obj) + { + if (obj is IndicatorCloudKey other) + { + return Equals(other); + } + return false; + } + + public override int GetHashCode() + { + return (Line1Index * 397) ^ Line2Index; + } + } + public class IndicatorInfo : ScriptInfo + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private string ??; + + public string Group + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public bool IsAvailableInWatchlist + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = flag; + } + } + + public string ShortName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + internal IndicatorInfo(ConstructorInfo P_0, ScriptCreationType P_1, string P_2, string P_3) + : base(P_0, P_1, P_2, P_3) + { + } + + protected override void Initialize(string relativePath, string assemblyName) + { + using Indicator indicator = ctor.Invoke(null) as Indicator; + base.Name = indicator.Name; + ShortName = ?(indicator); + base.Description = indicator.Description; + base.Version = indicator.Version; + base.Key = new ScriptKey(base.ScriptCreationType, relativePath, assemblyName, base.Name); + indicator.Key = base.Key; + base.Settings = indicator.Settings as List; + IsAvailableInWatchlist = indicator is IWatchlistIndicator; + } + + internal Indicator ?() + { + Indicator indicator = ctor?.Invoke(null) as Indicator; + if (indicator != null) + { + indicator.Key = base.Key; + } + return indicator; + } + + public override string ToString() + { + return base.Name; + } + + private string ?(Indicator P_0) + { + if (string.IsNullOrEmpty(P_0.ShortName)) + { + return string.Empty; + } + int num = P_0.ShortName.IndexOf('('); + if (num == -1) + { + return P_0.ShortName; + } + return P_0.ShortName.Substring(0, num).TrimEnd(); + } + } + public sealed class IndicatorManager : ScriptManager + { + [CompilerGenerated] + private BuiltInIndicators ?; + + public BuiltInIndicators BuiltIn + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = builtInIndicators; + } + } + + protected override string DefaultScriptsPath => Const.DEFAULT_INDICATORS_RELATIVE_PATH; + + public override string CustomScriptsPath => Const.CUSTOM_INDICATORS_PATH; + + internal IndicatorManager() + { + BuiltIn = new BuiltInIndicators(); + } + + internal override void ?() + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + try + { + base.?(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + } + + public Indicator CreateIndicator(string indicatorName, string assemblyName = "", string relativePath = "", ScriptCreationType scriptCreationType = ScriptCreationType.Custom) + { + if (string.IsNullOrEmpty(indicatorName)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ScriptKey scriptKey = SearchScriptKey(indicatorName, assemblyName, relativePath, scriptCreationType); + return CreateIndicator(scriptKey); + } + + public Indicator CreateIndicator(ScriptKey scriptKey) + { + if (scriptsInfoCache.TryGetValue(scriptKey, out var value)) + { + return CreateIndicator(value); + } + return null; + } + + public Indicator CreateIndicator(IndicatorInfo indicatorInfo) + { + return indicatorInfo.?(); + } + + protected override string GetScriptsFolderPath(ScriptCreationType scriptCreationType) + { + if (scriptCreationType != ScriptCreationType.Default) + { + return Const.CUSTOM_INDICATORS_PATH; + } + return Path.Combine(Const.EXECUTING_FOLDER, Const.DEFAULT_INDICATORS_RELATIVE_PATH); + } + + protected override IndicatorInfo CreateScriptInfo(ConstructorInfo ctor, ScriptCreationType scriptCreationType, string relativePath, string assemblyName) + { + return new IndicatorInfo(ctor, scriptCreationType, relativePath, assemblyName); + } + } + /// + /// Using IndicatorLineMarker class you can mark by color or icon any point of your indicator's line. + /// + public class IndicatorLineMarker + { + [CompilerGenerated] + private Color ? = Color.Empty; + + [CompilerGenerated] + private IndicatorLineMarkerIconType ?; + + [CompilerGenerated] + private IndicatorLineMarkerIconType ?; + + /// + /// Color of the marker + /// + public Color Color + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + /// + /// Icon that will be drawn above the indicator line + /// + public IndicatorLineMarkerIconType UpperIcon + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + /// + /// Icon that will be drawn beyond the indicator line + /// + public IndicatorLineMarkerIconType BottomIcon + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + /// + /// Constructor for IndicatorLineMarker + /// + /// + /// + /// + public IndicatorLineMarker(Color color, IndicatorLineMarkerIconType upperIcon = IndicatorLineMarkerIconType.None, IndicatorLineMarkerIconType bottomIcon = IndicatorLineMarkerIconType.None) + { + Color = color; + UpperIcon = upperIcon; + BottomIcon = bottomIcon; + } + + /// + /// Constructor for IndicatorLineMarker + /// + public IndicatorLineMarker() + { + } + } + /// + /// Different type of icons for Indicator marker + /// + public enum IndicatorLineMarkerIconType + { + None, + UpArrow, + DownArrow, + Flag, + FillCircle + } + public class IndicatorsCollection : IIndicatorsCollection, ?, ITaskSchedulerProvider + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal Indicator ?(IndicatorWrapper P_0) + { + return P_0.Indicator; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Indicator ??; + + internal bool ?(IndicatorWrapper P_0) + { + return object.Equals(P_0.Indicator, ??); + } + } + + [CompilerGenerated] + private sealed class ? + { + public Indicator ??; + + internal bool ?(IndicatorWrapper P_0) + { + return object.Equals(P_0.Indicator, ??); + } + } + + [CompilerGenerated] + private sealed class ? + { + public Indicator ??; + + internal bool ?(IndicatorWrapper P_0) + { + return object.Equals(P_0.Indicator, ??); + } + } + + private IndicatorCalculationBehavior ??; + + private readonly HistoricalData ??; + + private readonly List ??; + + private readonly object ??; + + private TaskScheduler ??; + + public Indicator[] All + { + get + { + lock (??) + { + return ??.Select((IndicatorWrapper P_0) => P_0.Indicator).ToArray(); + } + } + } + + public IndicatorCalculationBehavior CalculationBehavior + { + get + { + return ??; + } + set + { + if (?? != value) + { + ?? = value; + ?? = ((?? == IndicatorCalculationBehavior.Synchronous) ? null : new DegreeOfParallelismTaskScheduler(3)); + } + } + } + + TaskScheduler ITaskSchedulerProvider.TaskScheduler => ??; + + public IndicatorsCollection(HistoricalData historicalData) + { + ?? = historicalData; + ?? = new List(); + ?? = new object(); + CalculationBehavior = IndicatorCalculationBehavior.Synchronous; + } + + public void AddIndicator(Indicator indicator) + { + if (indicator == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + lock (??) + { + if (??.Any((IndicatorWrapper P_0) => object.Equals(P_0.Indicator, indicator))) + { + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + IndicatorWrapper indicatorWrapper = new IndicatorWrapper(indicator, this); + ??.Add(indicatorWrapper); + indicator.HistoricalData = ??; + indicator.Refresher = this; + indicatorWrapper.?(??.Count, false); + } + } + + public void RemoveIndicator(Indicator indicator) + { + if (indicator == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + IndicatorWrapper indicatorWrapper; + lock (??) + { + indicatorWrapper = ??.FirstOrDefault((IndicatorWrapper P_0) => object.Equals(P_0.Indicator, indicator)); + if (indicatorWrapper != null) + { + ??.Remove(indicatorWrapper); + } + } + indicatorWrapper?.Dispose(); + } + + public void Update(UpdateArgs args, IndicatorUpdateType? updateType = null) + { + lock (??) + { + foreach (IndicatorWrapper item in ??) + { + item.?(args, updateType); + } + } + } + + public void Refresh() + { + lock (??) + { + int count = ??.Count; + foreach (IndicatorWrapper item in ??) + { + item.?(count, true); + } + } + } + + private void ?(Indicator P_0) + { + if (TryGetWrapper(P_0, out var wrapper)) + { + wrapper.?(??.Count, true); + } + } + + void global::?.?.?(Indicator P_0) + { + //ILSpy generated this explicit interface implementation from .override directive in ? + this.?(P_0); + } + + public bool TryGetWrapper(Indicator indicator, out IndicatorWrapper wrapper) + { + lock (??) + { + wrapper = ??.FirstOrDefault((IndicatorWrapper P_0) => object.Equals(P_0.Indicator, indicator)); + } + return wrapper != null; + } + + public void Clear() + { + lock (??) + { + foreach (IndicatorWrapper item in ??) + { + item.Dispose(); + } + ??.Clear(); + } + } + } + public enum IndicatorStatus + { + Pending, + Loading, + Working + } + public class IndicatorWrapper : IDisposable + { + [CompilerGenerated] + private sealed class ? + { + public IndicatorWrapper ??; + + public int ??; + + public bool ??; + + public CancellationToken ??; + + internal void ?() + { + ??.?(??, ??, ??); + } + + internal void ?(Task P_0) + { + ??.?(??, ??); + } + } + + [CompilerGenerated] + private IndicatorStatus ?; + + [CompilerGenerated] + private readonly Indicator ?; + + [CompilerGenerated] + private IProgress ?; + + private readonly ITaskSchedulerProvider ?; + + private CancellationTokenSource ?; + + private readonly Queue ?; + + private SpinLock ?; + + private Task ?; + + private readonly object ?; + + private bool ?; + + private readonly ManualResetEventSlim ?; + + public IndicatorStatus Status + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = indicatorStatus; + } + } + + public Indicator Indicator + { + [CompilerGenerated] + get + { + return ?; + } + } + + public IProgress CalculatingProgress + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + private set + { + ? = progress; + } + } + + public IndicatorWrapper(Indicator indicator, ITaskSchedulerProvider taskSchedulerProvider) + { + ? = taskSchedulerProvider; + ? = indicator; + Status = IndicatorStatus.Pending; + ? = new Queue(); + ? = default(SpinLock); + ? = Task.CompletedTask; + ? = new object(); + ? = new ManualResetEventSlim(); + } + + internal void ?(int P_0, bool P_1) + { + Status = IndicatorStatus.Pending; + CancellationToken cancellationToken = ?(); + if (Indicator.UpdateType == IndicatorUpdateType.OnBarClose) + { + P_0--; + } + if (?.TaskScheduler != null) + { + lock (?) + { + if (!?.IsCompleted) + { + ? = true; + } + else + { + ?(P_0, P_1, cancellationToken); + } + return; + } + } + ?(P_0, P_1, cancellationToken); + } + + private void ?(int P_0, bool P_1, CancellationToken P_2) + { + try + { + CalculatingProgress = new PercentageProgress(); + Status = IndicatorStatus.Loading; + ?.Reset(); + if (P_1) + { + Indicator.Clear(); + } + Indicator.Init(); + float num = P_0; + for (int i = 0; i < P_0; i++) + { + if (P_2.IsCancellationRequested) + { + return; + } + Indicator.Update(new UpdateArgs(UpdateReason.HistoricalBar)); + CalculatingProgress.Report((float)i / num); + } + while (!P_2.IsCancellationRequested) + { + bool lockTaken = false; + UpdateArgs updateArgs; + try + { + ?.Enter(ref lockTaken); + if (?.Count == 0) + { + Status = IndicatorStatus.Working; + break; + } + updateArgs = ?.Dequeue(); + } + finally + { + if (lockTaken) + { + ?.Exit(); + } + } + if (updateArgs != null) + { + Indicator.Update(updateArgs); + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + ?.Set(); + } + } + + internal void ?(UpdateArgs P_0, IndicatorUpdateType? P_1 = null) + { + if (P_1.HasValue && P_1.Value != Indicator.UpdateType) + { + return; + } + bool lockTaken = false; + try + { + ?.Enter(ref lockTaken); + IndicatorStatus status = Status; + bool flag = (uint)status <= 1u; + if (flag || ?.Count > 0) + { + ?.Enqueue(P_0.?()); + return; + } + } + finally + { + if (lockTaken) + { + ?.Exit(); + } + } + Indicator.Update(P_0.?()); + } + + public void CallVolumeAnalysisLoaded() + { + if (Indicator is IVolumeAnalysisIndicator volumeAnalysisIndicator) + { + ?.Wait(); + volumeAnalysisIndicator.VolumeAnalysisData_Loaded(); + } + } + + public void Dispose() + { + ??.Cancel(); + ??.Dispose(); + Indicator?.Clear(); + Indicator?.Dispose(); + } + + private void ?(int P_0, bool P_1) + { + lock (?) + { + if (?) + { + ? = false; + ?(P_0, P_1, ?.Token); + } + } + } + + private void ?(int P_0, bool P_1, CancellationToken P_2) + { + ? = Task.Factory.StartNew(delegate + { + ?(P_0, P_1, P_2); + }, P_2, TaskCreationOptions.None, ?.TaskScheduler).ContinueWith(delegate + { + ?(P_0, P_1); + }, CancellationToken.None, TaskContinuationOptions.None, ?.TaskScheduler); + } + + private CancellationToken ?() + { + lock (?) + { + ??.Cancel(); + ? = new CancellationTokenSource(); + return ?.Token; + } + } + } + public abstract class Line : ICustomizable + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private Color ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private LineStyle ??; + + [CompilerGenerated] + private bool ??; + + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Color Color + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int Width + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public LineStyle Style + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool Visible + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public virtual IList Settings + { + get + { + return new List + { + new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Visible) + { + SortIndex = 0 + }, + new SettingItemLineOptions(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new LineOptions + { + WithCheckBox = false, + Color = Color, + Width = Width, + LineStyle = Style + }) + { + SortIndex = 1 + } + }; + } + set + { + SettingItem itemByName = value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (itemByName != null && itemByName.Value is bool visible) + { + Visible = visible; + } + itemByName = value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (itemByName != null && itemByName.Value is LineOptions lineOptions) + { + Color = lineOptions.Color; + Width = lineOptions.Width; + Style = lineOptions.LineStyle; + } + } + } + + protected Line(string name, Color color, int width, LineStyle style) + { + Name = name; + Color = color; + Width = width; + Style = style; + Visible = true; + } + } + public sealed class LineLevel : Line + { + [CompilerGenerated] + private double ??; + + public double Level + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override IList Settings + { + get + { + IList settings = base.Settings; + settings.Add(new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Level) + { + SortIndex = 2 + }); + return settings; + } + set + { + SettingItem itemByName = value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (itemByName != null && itemByName.Value is double level) + { + Level = level; + } + base.Settings = value; + } + } + + public LineLevel(double level, string name, Color color, int width, LineStyle style) + : base(name, color, width, style) + { + Level = level; + } + } + public sealed class LineSeries : Line + { + internal List ??; + + [CompilerGenerated] + private int ??; + + private static int ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private bool ?? = true; + + private readonly List ??; + + private readonly List ?? = new List(); + + internal int LineSeriesId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + internal int Count => ??.Count; + + /// + /// Sets the bar number (from the data beginning) from which the drawing of the given indicator line must start; + /// + public int DrawBegin + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Time shift of indicator's line + /// + public int TimeShift + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool ShowLineMarker + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double this[int offset = 0, SeekOriginHistory origin = SeekOriginHistory.End] + { + get + { + return GetValue(offset, origin); + } + set + { + SetValue(value, offset); + } + } + + public override IList Settings + { + get + { + IList settings = base.Settings; + settings.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TimeShift) + { + SortIndex = 3 + }); + settings.Add(new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ShowLineMarker) + { + SortIndex = 4 + }); + settings.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LineSeriesId) + { + VisibilityMode = VisibilityMode.Hidden + }); + return settings; + } + set + { + base.Settings = value; + SettingItem itemByName = value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (itemByName != null && itemByName.Value is int timeShift) + { + TimeShift = timeShift; + } + itemByName = value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (itemByName != null && itemByName.Value is bool showLineMarker) + { + ShowLineMarker = showLineMarker; + } + } + } + + public LineSeries(string name, Color color, int width, LineStyle style) + : base(name, color, width, style) + { + LineSeriesId = ??++; + ?? = new List(); + ?? = new List(); + } + + public double GetValue(int offset = 0, SeekOriginHistory origin = SeekOriginHistory.End) + { + double result = double.NaN; + int num = ?(offset, origin); + if (num >= 0 && num < Count) + { + result = ??[num]; + } + return result; + } + + public void SetValue(double value, int offset = 0, SeekOriginHistory origin = SeekOriginHistory.End) + { + int index = ?(offset, origin); + ??[index] = value; + } + + internal void ?() + { + ??.Add(double.NaN); + ??.Add(null); + ??.Add(item: false); + } + + public void Clear() + { + ??.Clear(); + ClearMarkers(); + ??.Clear(); + } + + /// + /// Redraws parts of indicator's line within the interval set by offset + /// + public void SetMarker(int offset, Color color) + { + SetMarker(offset, new IndicatorLineMarker + { + Color = color + }); + } + + public void SetMarker(int offset, IndicatorLineMarker indicatorMarker) + { + if (offset < 0 || offset >= ??.Count) + { + throw new ArgumentOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ??[??.Count - 1 - offset] = indicatorMarker; + } + + /// + /// Removes redrawn parts of indicator's line within the interval set by offset + /// + public void RemoveMarker(int offset) + { + if (offset < 0 || offset >= ??.Count) + { + throw new ArgumentOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ??[??.Count - 1 - offset] = null; + } + + /// + /// + /// + public IndicatorLineMarker GetMarker(int offset) + { + if (offset < 0 || offset >= ??.Count) + { + return null; + } + return ??[??.Count - 1 - offset]; + } + + /// + /// Fully clears markers from line + /// + public void ClearMarkers() + { + for (int i = 0; i < ??.Count; i++) + { + ??[i] = null; + } + } + + public void SetLineBreak(int offset) + { + if (offset < 0 || offset >= ??.Count) + { + throw new ArgumentOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ??[??.Count - 1 - offset] = true; + } + + public void RemoveLineBreak(int offset) + { + if (offset < 0 || offset >= ??.Count) + { + throw new ArgumentOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ??[??.Count - 1 - offset] = false; + } + + public bool GetLineBreak(int offset) + { + if (offset < 0 || offset >= ??.Count) + { + throw new ArgumentOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return ??[??.Count - 1 - offset]; + } + + private int ?(int P_0, SeekOriginHistory P_1) + { + int result = P_0; + if (P_1 == SeekOriginHistory.End) + { + result = Count - 1 - P_0; + } + return result; + } + } + [Published] + public class PaintChartEventArgs + { + [CompilerGenerated] + private Graphics ?; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private Rectangle ??; + + [CompilerGenerated] + private Point ??; + + [CompilerGenerated] + private int ??; + + public Graphics Graphics + { + [CompilerGenerated] + get + { + return ?; + } + [CompilerGenerated] + set + { + ? = value; + } + } + + public bool DrawBackground + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Rectangle Rectangle + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Point MousePosition + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int WindowIndex + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public PaintChartEventArgs(Graphics graphics, Rectangle rectangle, Point mousePosition, int windowIndex) + { + Graphics = graphics; + Rectangle = rectangle; + MousePosition = mousePosition; + WindowIndex = windowIndex; + } + } + /// + /// Use this attribute to mark input parameters of your script. You will see them in the settings screen on adding + /// + [Published] + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class InputParameterAttribute : Attribute + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private IComparable[] ??; + + /// + /// Displayed name of input parameter + /// + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Sort index for input paramter + /// + public int SortIndex + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Minimal value for numeric input parameters + /// + public double Minimum + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Maximal value for numeric input parameters + /// + public double Maximum + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Increment value for numeric input parameters + /// + public double Increment + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// Decimal palces for numeric input parameters + /// + public int DecimalPlaces + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + /// + /// List of predefined values + /// + public IComparable[] Variants + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = array; + } + } + + public InputParameterAttribute(string name = "", int sortIndex = 0, double minimum = -2147483648.0, double maximum = 2147483647.0, double increment = 0.01, int decimalPlaces = 2, object[] variants = null) + { + Name = name; + SortIndex = sortIndex; + Minimum = minimum; + Maximum = maximum; + Increment = increment; + DecimalPlaces = decimalPlaces; + Variants = variants?.Cast()?.ToArray(); + } + } + public sealed class OrderPlacingStrategiesManager : ScriptManager + { + private readonly List ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + public OrderPlacingStrategy[] Created => ??.ToArray(); + + public override string CustomScriptsPath => Const.CUSTOM_PLACE_ORDER_STRATEGIES_PATH; + + protected override string DefaultScriptsPath => Const.DEFAULT_PLACE_ORDER_STRATEGIES_RELATIVE_PATH; + + public event Action StrategyCreated + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public event Action StrategyRemoved + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public OrderPlacingStrategiesManager() + { + ?? = new List(); + } + + internal override void ?() + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + try + { + base.?(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + } + + protected override OrderPlacingStrategyInfo CreateScriptInfo(ConstructorInfo ctor, ScriptCreationType scriptCreationType, string relativePath, string assemblyName) + { + return new OrderPlacingStrategyInfo(ctor, scriptCreationType, relativePath, assemblyName); + } + + protected override string GetScriptsFolderPath(ScriptCreationType scriptCreationType) + { + if (scriptCreationType != ScriptCreationType.Default) + { + return Const.CUSTOM_PLACE_ORDER_STRATEGIES_PATH; + } + return Path.Combine(Const.EXECUTING_FOLDER, Const.DEFAULT_PLACE_ORDER_STRATEGIES_RELATIVE_PATH); + } + + public OrderPlacingStrategy CreateStrategy(OrderPlacingStrategyInfo orderPlacingStrategyInfo) + { + OrderPlacingStrategy orderPlacingStrategy = orderPlacingStrategyInfo.?(); + ??.Add(orderPlacingStrategy); + ???.Invoke(orderPlacingStrategy); + return orderPlacingStrategy; + } + + internal void ?(OrderPlacingStrategy P_0) + { + if (??.Remove(P_0)) + { + P_0.Dispose(); + ???.Invoke(P_0); + } + } + } + public abstract class ScriptInfo + { + [CompilerGenerated] + private ScriptKey ??; + + [CompilerGenerated] + private ScriptCreationType ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private Version ??; + + [CompilerGenerated] + private List ??; + + protected ConstructorInfo ctor; + + public ScriptKey Key + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected set + { + ?? = value; + } + } + + public ScriptCreationType ScriptCreationType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = scriptCreationType; + } + } + + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected set + { + ?? = value; + } + } + + public string Description + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected set + { + ?? = value; + } + } + + public Version Version + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected set + { + ?? = value; + } + } + + public List Settings + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + protected set + { + ?? = value; + } + } + + protected ScriptInfo(ConstructorInfo ctor, ScriptCreationType scriptCreationType, string relativePath, string assemblyName) + { + this.ctor = ctor; + ScriptCreationType = scriptCreationType; + try + { + Initialize(relativePath, assemblyName); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + assemblyName + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + protected abstract void Initialize(string relativePath, string assemblyName); + } + public class ScriptInfoEventArgs : EventArgs + { + } + public struct ScriptKey + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal string ?(DescriptionAttribute P_0) + { + return P_0.Description; + } + } + + [CompilerGenerated] + private string[] ??; + + [CompilerGenerated] + private ScriptCreationType ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + private const string ?? = "|"; + + public string[] FoldersHierarchy + { + [CompilerGenerated] + readonly get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = array; + } + } + + internal ScriptCreationType ScriptCreationType + { + [CompilerGenerated] + readonly get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = scriptCreationType; + } + } + + internal string RelativePath + { + [CompilerGenerated] + readonly get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + internal string AssemblyName + { + [CompilerGenerated] + readonly get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + internal string ScriptName + { + [CompilerGenerated] + readonly get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public ScriptKey(ScriptCreationType scriptCreationType, string relativePath, string assemblyName, string scriptName) + { + this = default(ScriptKey); + ScriptCreationType = scriptCreationType; + RelativePath = relativePath; + AssemblyName = assemblyName; + ScriptName = scriptName; + FoldersHierarchy = relativePath.Split(new char[1] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries); + } + + public override bool Equals(object obj) + { + ScriptKey scriptKey = (ScriptKey)obj; + if (ScriptName != scriptKey.ScriptName) + { + return false; + } + if (AssemblyName != scriptKey.AssemblyName) + { + return false; + } + if (RelativePath != scriptKey.RelativePath) + { + return false; + } + if (ScriptCreationType != scriptKey.ScriptCreationType) + { + return false; + } + return true; + } + + public override int GetHashCode() + { + return ((((((0x50C5D1F ^ ScriptCreationType.GetHashCode()) * 16777619) ^ (RelativePath ?? string.Empty).GetHashCode()) * 16777619) ^ (AssemblyName ?? string.Empty).GetHashCode()) * 16777619) ^ (ScriptName ?? string.Empty).GetHashCode(); + } + + public static bool operator !=(ScriptKey key1, ScriptKey key2) + { + return !key1.Equals(key2); + } + + public static bool operator ==(ScriptKey key1, ScriptKey key2) + { + return key1.Equals(key2); + } + + public static ScriptKey CreateScriptKeyFromString(string stringKey) + { + string[] array = stringKey.Split(new string[1] { 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() }, StringSplitOptions.None); + if (array.Length != 4 || !array[0].TryParseEnum((DescriptionAttribute P_0) => P_0.Description, out var enumValue)) + { + return default(ScriptKey); + } + return new ScriptKey(enumValue, array[1], array[2], array[3]); + } + + public override string ToString() + { + return $"{ScriptCreationType.GetDescription()}{3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()}{RelativePath}{3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()}{AssemblyName}{3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()}{ScriptName}"; + } + } + public abstract class ScriptManager : IDisposable where TScriptInfo : ScriptInfo where TScript : ExecutionEntity + { + [CompilerGenerated] + private sealed class ? + { + public ScriptCreationType ??; + + public string ??; + + public string ??; + + internal bool ?(ScriptKey P_0) + { + return P_0.ScriptCreationType == ??; + } + + internal bool ?(ScriptKey P_0) + { + return P_0.RelativePath == ??; + } + + internal bool ?(ScriptKey P_0) + { + return P_0.AssemblyName == ??; + } + } + + [CompilerGenerated] + private sealed class ? + { + public ScriptManager ??; + + public FileSystemEventArgs ??; + + internal void ?(Task P_0) + { + ??.?(??.FullPath); + } + } + + [CompilerGenerated] + private sealed class ? + { + public ScriptManager ??; + + public FileSystemEventArgs ??; + + internal void ?(Task P_0) + { + ??.?(??.FullPath); + } + } + + [CompilerGenerated] + private sealed class ? + { + public ScriptManager ??; + + public List ??; + + internal void ?(string P_0) + { + ??.??.Add(P_0); + } + + internal void ?(Task P_0) + { + foreach (string item in ??) + { + if (!??.??.Contains(item)) + { + break; + } + ??.??.Remove(item); + if (!??.??.TryGetValue(item, out var value)) + { + continue; + } + foreach (TScriptInfo item2 in new List(value)) + { + ??.?(item2, item); + ??.?(item2); + } + } + } + } + + [CompilerGenerated] + private sealed class ? + { + public string ??; + + internal bool ?(string P_0) + { + return P_0.Contains(??); + } + } + + [CompilerGenerated] + private ScriptInfoEventHandler ??; + + [CompilerGenerated] + private ScriptInfoEventHandler ??; + + [CompilerGenerated] + private ScriptInfoEventHandler ??; + + protected Dictionary scriptsInfoCache; + + private readonly Dictionary> ??; + + private readonly Dictionary> ??; + + private readonly FileSystemWatcher ??; + + private readonly HashSet ??; + + private readonly Dictionary ??; + + private readonly object ??; + + protected abstract string DefaultScriptsPath { get; } + + public abstract string CustomScriptsPath { get; } + + public TScriptInfo[] All => scriptsInfoCache.Values.ToArray(); + + public event ScriptInfoEventHandler ScriptAdded + { + [CompilerGenerated] + add + { + ScriptInfoEventHandler scriptInfoEventHandler = ??; + ScriptInfoEventHandler scriptInfoEventHandler2; + do + { + scriptInfoEventHandler2 = scriptInfoEventHandler; + ScriptInfoEventHandler value2 = (ScriptInfoEventHandler)Delegate.Combine(scriptInfoEventHandler2, value); + scriptInfoEventHandler = Interlocked.CompareExchange(ref ??, value2, scriptInfoEventHandler2); + } + while ((object)scriptInfoEventHandler != scriptInfoEventHandler2); + } + [CompilerGenerated] + remove + { + ScriptInfoEventHandler scriptInfoEventHandler = ??; + ScriptInfoEventHandler scriptInfoEventHandler2; + do + { + scriptInfoEventHandler2 = scriptInfoEventHandler; + ScriptInfoEventHandler value2 = (ScriptInfoEventHandler)Delegate.Remove(scriptInfoEventHandler2, value); + scriptInfoEventHandler = Interlocked.CompareExchange(ref ??, value2, scriptInfoEventHandler2); + } + while ((object)scriptInfoEventHandler != scriptInfoEventHandler2); + } + } + + public event ScriptInfoEventHandler ScriptUpdated + { + [CompilerGenerated] + add + { + ScriptInfoEventHandler scriptInfoEventHandler = ??; + ScriptInfoEventHandler scriptInfoEventHandler2; + do + { + scriptInfoEventHandler2 = scriptInfoEventHandler; + ScriptInfoEventHandler value2 = (ScriptInfoEventHandler)Delegate.Combine(scriptInfoEventHandler2, value); + scriptInfoEventHandler = Interlocked.CompareExchange(ref ??, value2, scriptInfoEventHandler2); + } + while ((object)scriptInfoEventHandler != scriptInfoEventHandler2); + } + [CompilerGenerated] + remove + { + ScriptInfoEventHandler scriptInfoEventHandler = ??; + ScriptInfoEventHandler scriptInfoEventHandler2; + do + { + scriptInfoEventHandler2 = scriptInfoEventHandler; + ScriptInfoEventHandler value2 = (ScriptInfoEventHandler)Delegate.Remove(scriptInfoEventHandler2, value); + scriptInfoEventHandler = Interlocked.CompareExchange(ref ??, value2, scriptInfoEventHandler2); + } + while ((object)scriptInfoEventHandler != scriptInfoEventHandler2); + } + } + + public event ScriptInfoEventHandler ScriptDeleted + { + [CompilerGenerated] + add + { + ScriptInfoEventHandler scriptInfoEventHandler = ??; + ScriptInfoEventHandler scriptInfoEventHandler2; + do + { + scriptInfoEventHandler2 = scriptInfoEventHandler; + ScriptInfoEventHandler value2 = (ScriptInfoEventHandler)Delegate.Combine(scriptInfoEventHandler2, value); + scriptInfoEventHandler = Interlocked.CompareExchange(ref ??, value2, scriptInfoEventHandler2); + } + while ((object)scriptInfoEventHandler != scriptInfoEventHandler2); + } + [CompilerGenerated] + remove + { + ScriptInfoEventHandler scriptInfoEventHandler = ??; + ScriptInfoEventHandler scriptInfoEventHandler2; + do + { + scriptInfoEventHandler2 = scriptInfoEventHandler; + ScriptInfoEventHandler value2 = (ScriptInfoEventHandler)Delegate.Remove(scriptInfoEventHandler2, value); + scriptInfoEventHandler = Interlocked.CompareExchange(ref ??, value2, scriptInfoEventHandler2); + } + while ((object)scriptInfoEventHandler != scriptInfoEventHandler2); + } + } + + protected ScriptManager() + { + scriptsInfoCache = new Dictionary(); + ?? = new Dictionary>(); + ?? = new Dictionary>(); + ?? = new FileSystemWatcher(); + ?? = new HashSet(); + ?? = new Dictionary(); + ?? = new object(); + } + + internal virtual void ?() + { + string customScriptsPath = CustomScriptsPath; + if (!Directory.Exists(customScriptsPath)) + { + Directory.CreateDirectory(customScriptsPath); + } + List list = AssemblyLoader.LoadTypes(DefaultScriptsPath, typeof(TScript), null, SearchOption.AllDirectories, loadInMemory: true); + ?(list, ScriptCreationType.Default); + List list2 = AssemblyLoader.LoadTypes(customScriptsPath, typeof(TScript), null, SearchOption.AllDirectories, loadInMemory: true, allowLoadingReferences: true); + ?(list2, ScriptCreationType.Custom); + ??.Path = customScriptsPath; + ??.NotifyFilter = NotifyFilters.FileName | NotifyFilters.DirectoryName | NotifyFilters.Size; + ??.IncludeSubdirectories = true; + ??.Created += ?; + ??.Changed += ?; + ??.Deleted += ?; + ??.EnableRaisingEvents = true; + } + + private void ?(List P_0, ScriptCreationType P_1) + { + if (P_0 == null) + { + return; + } + string scriptsFolderPath = GetScriptsFolderPath(P_1); + foreach (TypeWrapper item in P_0) + { + try + { + ConstructorInfo constructor = item.Type.GetConstructor(Array.Empty()); + string directoryName = Path.GetDirectoryName(?(item.AssemblyLocation, scriptsFolderPath)); + TScriptInfo val = CreateScriptInfo(constructor, P_1, directoryName, item.Type.Assembly.GetName().Name); + if (!(val.Key == default(ScriptKey))) + { + ?(val, item.AssemblyLocation); + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + } + + protected abstract string GetScriptsFolderPath(ScriptCreationType scriptCreationType); + + protected abstract TScriptInfo CreateScriptInfo(ConstructorInfo ctor, ScriptCreationType scriptCreationType, string relativePath, string assemblyName); + + protected ScriptKey SearchScriptKey(string scriptName, string assemblyName, string relativePath, ScriptCreationType scriptCreationType = ScriptCreationType.Default) + { + if (!??.TryGetValue(scriptName, out var value)) + { + return default(ScriptKey); + } + if (!value.Any()) + { + return default(ScriptKey); + } + List source = new List(value); + source = source.Where((ScriptKey P_0) => P_0.ScriptCreationType == scriptCreationType).ToList(); + if (!string.IsNullOrEmpty(relativePath)) + { + source = source.Where((ScriptKey P_0) => P_0.RelativePath == relativePath).ToList(); + } + if (!string.IsNullOrEmpty(assemblyName)) + { + source = source.Where((ScriptKey P_0) => P_0.AssemblyName == assemblyName).ToList(); + } + return source.FirstOrDefault(); + } + + private static string ?(string P_0, string P_1) + { + Uri uri = new Uri(P_0); + if (!P_1.EndsWith(Path.DirectorySeparatorChar.ToString())) + { + P_1 += Path.DirectorySeparatorChar; + } + return Uri.UnescapeDataString(new Uri(P_1).MakeRelativeUri(uri).ToString().Replace('/', Path.DirectorySeparatorChar)); + } + + public virtual void Dispose() + { + ??.Created -= ?; + ??.Changed -= ?; + ??.Deleted -= ?; + ??.EnableRaisingEvents = false; + ??.Dispose(); + scriptsInfoCache?.Clear(); + ???.Clear(); + } + + private void ?(object P_0, FileSystemEventArgs P_1) + { + if (!?(P_1.FullPath)) + { + ??.Remove(P_1.FullPath); + Task.Delay(1000).ContinueWith(delegate + { + ?(P_1.FullPath); + }); + } + } + + private void ?(object P_0, FileSystemEventArgs P_1) + { + if (!?(P_1.FullPath)) + { + Task.Delay(1000).ContinueWith(delegate + { + ?(P_1.FullPath); + }); + } + } + + private void ?(object P_0, FileSystemEventArgs P_1) + { + List ?? = new List(); + if (!Path.HasExtension(P_1.FullPath)) + { + string ?? = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + MakeRelativePath(CustomScriptsPath, P_1.FullPath) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + ??.AddRange(??.Keys.Where((string text) => text.Contains(??))); + } + else if (Path.GetExtension(P_1.FullPath) == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + ??.Add(P_1.FullPath); + } + if (??.Count == 0) + { + return; + } + ??.ForEach(delegate(string item) + { + ??.Add(item); + }); + Task.Delay(2000).ContinueWith(delegate + { + foreach (string item in ??) + { + if (!??.Contains(item)) + { + break; + } + ??.Remove(item); + if (??.TryGetValue(item, out var value)) + { + foreach (TScriptInfo item2 in new List(value)) + { + ?(item2, item); + ?(item2); + } + } + } + }); + } + + private void ?(ScriptInfo P_0) + { + ???.Invoke(P_0, new ScriptInfoEventArgs()); + } + + protected virtual void OnScriptUpdated(ScriptInfo scriptInfo) + { + ???.Invoke(scriptInfo, new ScriptInfoEventArgs()); + } + + private void ?(ScriptInfo P_0) + { + ???.Invoke(P_0, new ScriptInfoEventArgs()); + } + + private void ?(TScriptInfo P_0, string P_1) + { + ScriptKey key = P_0.Key; + scriptsInfoCache.Add(key, P_0); + if (!??.TryGetValue(key.ScriptName, out var value)) + { + value = new List(); + ??.Add(key.ScriptName, value); + } + value.Add(key); + if (!??.TryGetValue(P_1, out var value2)) + { + value2 = new List(); + ??.Add(P_1, value2); + } + value2.Add(P_0); + } + + private void ?(TScriptInfo P_0, string P_1) + { + ScriptKey key = P_0.Key; + scriptsInfoCache.Remove(key); + if (??.TryGetValue(key.ScriptName, out var value)) + { + value.Remove(key); + } + if (??.TryGetValue(P_1, out var value2)) + { + value2.Remove(P_0); + } + if (!value2.Any()) + { + ??.Remove(P_1); + } + } + + private bool ?(string P_0, DateTime P_1) + { + if (??.TryGetValue(P_0, out var value)) + { + return value == P_1; + } + return false; + } + + private void ?(string P_0) + { + try + { + lock (??) + { + DateTime lastWriteTimeUtc = File.GetLastWriteTimeUtc(P_0); + bool num = ?(P_0, lastWriteTimeUtc); + ??[P_0] = lastWriteTimeUtc; + if (num) + { + return; + } + } + string scriptsFolderPath = GetScriptsFolderPath(ScriptCreationType.Custom); + foreach (TypeWrapper item in AssemblyLoader.?(P_0, typeof(TScript), true, true)) + { + try + { + ConstructorInfo constructor = item.Type.GetConstructor(Array.Empty()); + string directoryName = Path.GetDirectoryName(?(item.AssemblyLocation, scriptsFolderPath)); + TScriptInfo val = CreateScriptInfo(constructor, ScriptCreationType.Custom, directoryName, item.Type.Assembly.GetName().Name); + if (!(val.Key == default(ScriptKey))) + { + ScriptKey key = val.Key; + if (scriptsInfoCache.ContainsKey(key)) + { + scriptsInfoCache[key] = val; + OnScriptUpdated(val); + } + else + { + ?(val, P_0); + ?(val); + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + } + catch (Exception ex2) + { + Core.Instance.Loggers.Log(ex2); + } + } + + private static bool ?(string P_0) + { + if (!Path.HasExtension(P_0)) + { + return true; + } + if (Path.GetExtension(P_0) != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + return true; + } + return false; + } + + public static string MakeRelativePath(string fromPath, string toPath) + { + if (string.IsNullOrEmpty(fromPath)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (string.IsNullOrEmpty(toPath)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + Uri uri = new Uri(fromPath); + Uri uri2 = new Uri(toPath); + if (uri.Scheme != uri2.Scheme) + { + return toPath; + } + string text = Uri.UnescapeDataString(uri.MakeRelativeUri(uri2).ToString()); + if (uri2.Scheme.Equals(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), StringComparison.InvariantCultureIgnoreCase)) + { + text = text.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); + } + return text; + } + } + public delegate void ScriptInfoEventHandler(ScriptInfo scriptInfo, ScriptInfoEventArgs e); + /// + /// The base class for strategies + /// + [Published] + public abstract class Strategy : ExecutionEntity, IXElementSerialization, IConnectionStateDependent + { + [CompilerGenerated] + private string ??; + + private StrategyState ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private StrategyEventHandler ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private bool ??; + + private ILogger ??; + + private DateTime ??; + + private DateTime ??; + + private Meter ??; + + private readonly ConnectionStateObserver ??; + + private StrategyState? ??; + + /// + /// Unique ID of the strategy + /// + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + /// + /// The current state of the strategy + /// + public StrategyState State + { + get + { + return ??; + } + internal set + { + StrategyState strategyState = ??; + ?? = strategyState2; + Core.Instance.Strategies.?(this, ??, strategyState); + } + } + + public string InstanceName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override IList Settings + { + get + { + IList settings = base.Settings; + settings.Add(new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), InstanceName) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + SeparatorGroup = new SettingItemSeparatorGroup(loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), -1100) + }); + return settings; + } + set + { + if (value.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value2)) + { + InstanceName = value2; + } + if (State == StrategyState.Working) + { + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + base.Settings = value; + ???.Invoke(this); + } + } + + public bool NewVersionAvailable + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = flag; + } + } + + public virtual string[] MonitoringConnectionsIds => new string[0]; + + private string DataFolderName => base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + Id + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); + + internal string DataFolderPath => Path.Combine(Const.SCRIPTS_DATA_PATH, DataFolderName); + + /// + /// Event occured when strategy write a new log + /// + public event StrategyEventHandler NewLog + { + [CompilerGenerated] + add + { + StrategyEventHandler strategyEventHandler = ??; + StrategyEventHandler strategyEventHandler2; + do + { + strategyEventHandler2 = strategyEventHandler; + StrategyEventHandler value2 = (StrategyEventHandler)Delegate.Combine(strategyEventHandler2, value); + strategyEventHandler = Interlocked.CompareExchange(ref ??, value2, strategyEventHandler2); + } + while ((object)strategyEventHandler != strategyEventHandler2); + } + [CompilerGenerated] + remove + { + StrategyEventHandler strategyEventHandler = ??; + StrategyEventHandler strategyEventHandler2; + do + { + strategyEventHandler2 = strategyEventHandler; + StrategyEventHandler value2 = (StrategyEventHandler)Delegate.Remove(strategyEventHandler2, value); + strategyEventHandler = Interlocked.CompareExchange(ref ??, value2, strategyEventHandler2); + } + while ((object)strategyEventHandler != strategyEventHandler2); + } + } + + /// + /// Event occured if any of strategy settings was changed + /// + public event Action SettingsChanged + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + internal void ?() + { + CheckDisposed(); + string dataFolderPath = DataFolderPath; + if (!Directory.Exists(dataFolderPath)) + { + Directory.CreateDirectory(dataFolderPath); + } + ?? = Core.Instance.Loggers.GetLogger(new LoggerConfig + { + LoggerName = DataFolderName, + OutputFolderPath = Path.Combine(DataFolderPath, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + Scope = LoggerScope.General + }); + try + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(2, 3); + defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.Key); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Id); + ?? = new Meter(defaultInterpolatedStringHandler.ToStringAndClear(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + OnInitializeMetrics(??); + } + catch (Exception ex) + { + Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + (ex.InnerException?.Message ?? ex.Message), StrategyLoggingLevel.Error); + Core.Instance.Loggers.Log(ex, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + State = StrategyState.Created; + try + { + OnCreated(); + Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + catch (Exception ex2) + { + Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + (ex2.InnerException?.Message ?? ex2.Message), StrategyLoggingLevel.Error); + Core.Instance.Loggers.Log(ex2, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + /// + /// Run strategy + /// + public void Run() + { + CheckDisposed(); + if (State == StrategyState.Working) + { + return; + } + string[] monitoringConnectionsIds = MonitoringConnectionsIds; + if (monitoringConnectionsIds != null) + { + string[] array = monitoringConnectionsIds; + foreach (string text in array) + { + if (text != null) + { + Connection connection = Core.Instance.Connections[text]; + if (connection == null || connection.State != ConnectionState.Connected) + { + State = StrategyState.WaitingForConnection; + return; + } + } + } + } + State = StrategyState.Working; + ?? = Core.Instance.TimeUtils.DateTimeUtcNow; + try + { + OnRun(); + Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + catch (Exception ex) + { + Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + (ex.InnerException?.Message ?? ex.Message), StrategyLoggingLevel.Error); + Core.Instance.Loggers.Log(ex, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + /// + /// Stop strategy + /// + public void Stop() + { + CheckDisposed(); + if (State != StrategyState.Working && State != StrategyState.WaitingForConnection) + { + return; + } + bool num = State != StrategyState.WaitingForConnection; + State = StrategyState.Stopped; + ?? = Core.Instance.TimeUtils.DateTimeUtcNow; + if (!num) + { + return; + } + try + { + OnStop(); + Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + catch (Exception ex) + { + Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + (ex.InnerException?.Message ?? ex.Message), StrategyLoggingLevel.Error); + Core.Instance.Loggers.Log(ex, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + /// + /// Remove the strategy + /// + public void Remove() + { + CheckDisposed(); + if (State == StrategyState.Removed) + { + return; + } + if (State == StrategyState.Working) + { + Stop(); + } + try + { + string dataFolderPath = DataFolderPath; + if (Directory.Exists(dataFolderPath)) + { + Directory.Delete(dataFolderPath, recursive: true); + } + } + catch (Exception ex) + { + Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ex.GetFullMessageRecursive(), StrategyLoggingLevel.Error); + Core.Instance.Loggers.Log(ex, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + State = StrategyState.Removed; + try + { + OnRemove(); + Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + catch (Exception ex2) + { + Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + (ex2.InnerException?.Message ?? ex2.Message), StrategyLoggingLevel.Error); + Core.Instance.Loggers.Log(ex2, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + finally + { + ???.Dispose(); + ?? = null; + } + } + + /// + /// Get current metrics from the strategy + /// + /// + public List GetMetrics() + { + CheckDisposed(); + List result = null; + try + { + result = OnGetMetrics(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return result; + } + + /// + /// Get logs from the strategy for specified date range + /// + /// + /// + /// + public LoggerEvent[] GetLogs(DateTime from, DateTime to) + { + return ???.GetHistory(from, to)?.OfType().ToArray() ?? Array.Empty(); + } + + protected virtual void OnCreated() + { + } + + protected virtual void OnRun() + { + } + + protected virtual void OnStop() + { + } + + protected virtual void OnRemove() + { + } + + [Obsolete("Use OnInitializeMetrics() method to initialize System.Diagnostics.Metrics")] + protected virtual List OnGetMetrics() + { + return new List + { + { + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + (?? == default(DateTime)) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() : Core.Instance.TimeUtils.GetFormatedDateTime(Core.Instance.TimeUtils.ConvertFromUTCToSelectedTimeZone(??)) + }, + { + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + (?? == default(DateTime)) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() : ((State == StrategyState.Working) ? (Core.Instance.TimeUtils.GetFormatedLongTime(Core.Instance.TimeUtils.DateTimeUtcNow) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Core.Instance.TimeUtils.GetFormatedLongTime(??)) : (Core.Instance.TimeUtils.GetFormatedLongTime(??) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Core.Instance.TimeUtils.GetFormatedLongTime(??))) + } + }; + } + + protected virtual void OnInitializeMetrics(Meter meter) + { + } + + /// + /// Write log message + /// + /// + /// + protected internal void Log(string message, StrategyLoggingLevel level = StrategyLoggingLevel.Info) + { + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + LoggingLevel loggingLevel = level switch + { + StrategyLoggingLevel.Trading => LoggingLevel.Trading, + StrategyLoggingLevel.Error => LoggingLevel.Error, + _ => LoggingLevel.System, + }; + ???.Log(message, dateTimeUtcNow, loggingLevel); + if (?? != null) + { + LoggerEvent loggerEvent = new LoggerEvent + { + Date = dateTimeUtcNow, + Event = message, + Type = loggingLevel + }; + ?(loggerEvent); + } + } + + [NotPublished] + public override void Dispose() + { + ??.Dispose(); + ???.Dispose(); + if (State == StrategyState.Working) + { + Stop(); + } + base.Dispose(); + } + + protected Strategy() + { + Id = Guid.NewGuid().ToString(); + ?? = new ConnectionStateObserver(this, ConnectionStateObserverPriority.Normal, ConnectionState.Connected, ConnectionState.Disconnected, ConnectionState.ConnectionLost); + } + + private void ?(LoggerEvent P_0) + { + ???.Invoke(this, new StrategyEventArgs(State, P_0)); + } + + [NotPublished] + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), base.Key.ToString())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), base.Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)State)); + XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (SettingItem setting in Settings) + { + xElement2.Add(setting.ToXElement()); + } + xElement.Add(xElement2); + return xElement; + } + + [NotPublished] + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + string stringKey = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value; + base.Key = ScriptKey.CreateScriptKeyFromString(stringKey); + Id = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value; + base.Name = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value; + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + List settings = Serializer.DeserializeXML(xElement, deserializationInfo).OfType().ToList(); + Settings = settings; + } + ?? = (StrategyState)(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToInt() ?? 10); + } + + internal void ?() + { + bool flag; + switch (??) + { + case StrategyState.Working: + case StrategyState.WaitingForConnection: + flag = true; + break; + default: + flag = false; + break; + } + if (flag) + { + Task.Factory.StartNew(Run); + } + ?? = null; + } + + public ConnectionDependency GetConnectionStateDependency() + { + return new ConnectionDependency + { + Behavior = ConnectionDependencyBehavior.PartialDependency, + DependentConnectionsIds = MonitoringConnectionsIds + }; + } + + private void ?(Connection P_0, ConnectionStateChangedEventArgs P_1) + { + if (P_1.NewState == ConnectionState.Connected) + { + if (State == StrategyState.WaitingForConnection) + { + Task.Factory.StartNew(Run); + } + } + else if (State == StrategyState.Working) + { + Task.Factory.StartNew(Stop).ContinueWith((Task task) => State = StrategyState.WaitingForConnection); + } + } + + void IConnectionStateDependent.OnConnectionStateChanged(Connection P_0, ConnectionStateChangedEventArgs P_1) + { + //ILSpy generated this explicit interface implementation from .override directive in ? + this.?(P_0, P_1); + } + + [CompilerGenerated] + private StrategyState ?(Task P_0) + { + return State = StrategyState.WaitingForConnection; + } + } + public class StrategyEventArgs : EventArgs + { + [CompilerGenerated] + private StrategyState ??; + + [CompilerGenerated] + private StrategyState ??; + + [CompilerGenerated] + private LoggerEvent ??; + + public StrategyState StrategyState + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = strategyState; + } + } + + public StrategyState StrategyPreviousState + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = strategyState; + } + } + + public LoggerEvent LoggerEvent + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = loggerEvent; + } + } + + public StrategyEventArgs(StrategyState strategyState, LoggerEvent loggerEvent = null) + { + StrategyState = strategyState; + LoggerEvent = loggerEvent; + } + } + public class StrategyInfo : ScriptInfo + { + internal StrategyInfo(ConstructorInfo P_0, ScriptCreationType P_1, string P_2, string P_3) + : base(P_0, P_1, P_2, P_3) + { + } + + protected override void Initialize(string relativePath, string assemblyName) + { + using Strategy strategy = ctor.Invoke(null) as Strategy; + base.Name = strategy.Name; + base.Description = strategy.Description; + base.Version = strategy.Version; + base.Key = new ScriptKey(base.ScriptCreationType, relativePath, assemblyName, base.Name); + strategy.Key = base.Key; + base.Settings = strategy.Settings as List; + } + + internal Strategy ?() + { + Strategy strategy = ctor?.Invoke(null) as Strategy; + if (strategy != null) + { + strategy.Key = base.Key; + } + return strategy; + } + + public override string ToString() + { + return base.Name; + } + } + public sealed class StrategyManager : ScriptManager + { + [CompilerGenerated] + private new sealed class ? + { + public Strategy ??; + + public StrategyManager ??; + + internal void ?() + { + ??.?(??); + } + } + + private readonly List ??; + + [CompilerGenerated] + private StrategyEventHandler ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private bool ??; + + public Strategy[] Created => ??.ToArray(); + + protected override string DefaultScriptsPath => Const.DEFAULT_STRATEGIES_RELATIVE_PATH; + + public override string CustomScriptsPath => Const.CUSTOM_STRATEGIES_PATH; + + public bool RestoreStateAfterShutdown + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public event StrategyEventHandler StrategyStateChanged + { + [CompilerGenerated] + add + { + StrategyEventHandler strategyEventHandler = ??; + StrategyEventHandler strategyEventHandler2; + do + { + strategyEventHandler2 = strategyEventHandler; + StrategyEventHandler value2 = (StrategyEventHandler)Delegate.Combine(strategyEventHandler2, value); + strategyEventHandler = Interlocked.CompareExchange(ref ??, value2, strategyEventHandler2); + } + while ((object)strategyEventHandler != strategyEventHandler2); + } + [CompilerGenerated] + remove + { + StrategyEventHandler strategyEventHandler = ??; + StrategyEventHandler strategyEventHandler2; + do + { + strategyEventHandler2 = strategyEventHandler; + StrategyEventHandler value2 = (StrategyEventHandler)Delegate.Remove(strategyEventHandler2, value); + strategyEventHandler = Interlocked.CompareExchange(ref ??, value2, strategyEventHandler2); + } + while ((object)strategyEventHandler != strategyEventHandler2); + } + } + + public event Action StrategyCreated + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public event Action StrategyRemoved + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + internal StrategyManager() + { + ?? = new List(); + RestoreStateAfterShutdown = false; + } + + internal override void ?() + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + try + { + base.?(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + } + + public Strategy CreateStrategy(string strategyName, string assemblyName = "", string relativePath = "", ScriptCreationType scriptCreationType = ScriptCreationType.Default) + { + if (string.IsNullOrEmpty(strategyName)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ScriptKey scriptKey = SearchScriptKey(strategyName, assemblyName, relativePath, scriptCreationType); + return CreateStrategy(scriptKey); + } + + public Strategy CreateStrategy(ScriptKey scriptKey) + { + if (scriptsInfoCache.TryGetValue(scriptKey, out var value)) + { + return CreateStrategy(value); + } + return null; + } + + public Strategy CreateStrategy(StrategyInfo strategyInfo) + { + Strategy strategy = strategyInfo.?(); + ?(strategy); + return strategy; + } + + private void ?(Strategy P_0) + { + P_0.?(); + ??.Add(P_0); + ???.Invoke(P_0); + } + + public void DeleteStrategy(Strategy strategy) + { + if (strategy == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ??.Remove(strategy); + strategy.Remove(); + strategy.Dispose(); + ???.Invoke(strategy); + } + + public void OnSettingsLoaded() + { + if (RestoreStateAfterShutdown) + { + ?(); + } + } + + public void SaveStrategies() + { + if (?? == null) + { + return; + } + foreach (Strategy item in ??) + { + try + { + Serializer.SerializeXML(Path.Combine(item.DataFolderPath, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), new List { item }); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + } + + public void LoadStrategies() + { + if (!Directory.Exists(Const.SCRIPTS_DATA_PATH)) + { + return; + } + foreach (string item in Directory.EnumerateFiles(Const.SCRIPTS_DATA_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SearchOption.AllDirectories)) + { + try + { + double version; + Strategy ?? = Serializer.DeserializeXML(item, out version, ?).FirstOrDefault() as Strategy; + if (?? != null) + { + Task.Run(delegate + { + ?(??); + }); + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + } + + private void ?() + { + Strategy[] created = Created; + for (int i = 0; i < created.Length; i++) + { + created[i].?(); + } + } + + protected override string GetScriptsFolderPath(ScriptCreationType scriptCreationType) + { + if (scriptCreationType != ScriptCreationType.Default) + { + return Const.CUSTOM_STRATEGIES_PATH; + } + return Path.Combine(Const.EXECUTING_FOLDER, Const.DEFAULT_STRATEGIES_RELATIVE_PATH); + } + + protected override StrategyInfo CreateScriptInfo(ConstructorInfo ctor, ScriptCreationType scriptCreationType, string relativePath, string assemblyName) + { + return new StrategyInfo(ctor, scriptCreationType, relativePath, assemblyName); + } + + public override void Dispose() + { + if (?? != null) + { + foreach (Strategy item in ??) + { + item.Stop(); + item.Dispose(); + } + ??.Clear(); + } + base.Dispose(); + } + + internal void ?(Strategy P_0, StrategyState P_1, StrategyState P_2) + { + ???.Invoke(P_0, new StrategyEventArgs(P_1) + { + StrategyPreviousState = P_2 + }); + } + + protected override void OnScriptUpdated(ScriptInfo scriptInfo) + { + Strategy[] created = Created; + foreach (Strategy strategy in created) + { + if (!(strategy.Key != scriptInfo.Key)) + { + strategy.NewVersionAvailable = true; + } + } + base.OnScriptUpdated(scriptInfo); + } + + private IXElementSerialization ?(XElement P_0) + { + if (P_0 == null) + { + return null; + } + string text = P_0.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value; + if (string.IsNullOrEmpty(text)) + { + return SettingItem.DesserrializationFabric(P_0); + } + ScriptKey key = ScriptKey.CreateScriptKeyFromString(text); + if (!scriptsInfoCache.TryGetValue(key, out var value)) + { + return null; + } + return value.?(); + } + } + public delegate void StrategyEventHandler(Strategy strategy, StrategyEventArgs e); + [ProtoContract] + [Published] + public class StrategyMetric : IXElementSerialization + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [ProtoMember(1)] + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(2)] + public string FormattedValue + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + Name = xElement.Value; + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + FormattedValue = xElement2.Value; + } + } + + public XElement ToXElement() + { + XElement xElement = new XElement(GetType().Name); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), FormattedValue)); + return xElement; + } + } + public class UpdateArgs + { + [CompilerGenerated] + private UpdateReason ??; + + [CompilerGenerated] + private MessageQuote ??; + + public UpdateReason Reason + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = updateReason; + } + } + + public MessageQuote MessageQuote + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = messageQuote; + } + } + + internal UpdateArgs(UpdateReason P_0, MessageQuote P_1 = null) + { + Reason = P_0; + MessageQuote = P_1; + } + + internal UpdateArgs ?() + { + return new UpdateArgs(Reason, MessageQuote); + } + } + public abstract class CachedRequestParameters : RequestParameters + { + public abstract int GetCacheKey(); + + protected CachedRequestParameters() + { + } + + protected CachedRequestParameters(CachedRequestParameters origin) + : base(origin) + { + } + } + [ProtoContract] + public class GetFutureContractsRequestParameters : CachedRequestParameters + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + public override RequestType Type => RequestType.FutureContracts; + + public string ConnectionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(1)] + public string Root + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(2)] + public string ExchangeId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(3)] + public string UnderlierId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public GetFutureContractsRequestParameters() + { + } + + public GetFutureContractsRequestParameters(GetFutureContractsRequestParameters origin) + : base(origin) + { + ConnectionId = origin.ConnectionId; + Root = origin.Root; + ExchangeId = origin.ExchangeId; + UnderlierId = origin.UnderlierId; + } + + public override int GetCacheKey() + { + if (!string.IsNullOrEmpty(UnderlierId)) + { + return UnderlierId.GetHashCode(); + } + HashCode hashCode = default(HashCode); + if (Root != null) + { + hashCode.Add(Root); + } + if (ExchangeId != null) + { + hashCode.Add(ExchangeId); + } + if (UnderlierId != null) + { + hashCode.Add(UnderlierId); + } + return hashCode.ToHashCode(); + } + } + [Published] + [ProtoContract] + public class GetSymbolRequestParameters : CachedRequestParameters + { + [CompilerGenerated] + private string ??; + + public override RequestType Type => RequestType.Symbol; + + [ProtoMember(1)] + public string SymbolId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override int GetCacheKey() + { + return SymbolId.GetHashCode(); + } + + public GetSymbolRequestParameters() + { + } + + public GetSymbolRequestParameters(GetSymbolRequestParameters origin) + : base(origin) + { + SymbolId = origin.SymbolId; + } + } + public sealed class GetNewsArticleContentRequestParameters : RequestParameters + { + [CompilerGenerated] + private string ??; + + public override RequestType Type + { + get + { + throw new NotImplementedException(); + } + } + + public string ArticleId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public GetNewsArticleContentRequestParameters() + { + } + + public GetNewsArticleContentRequestParameters(GetNewsArticleContentRequestParameters original) + : base(original) + { + ArticleId = original.ArticleId; + } + } + public abstract class NewsRequestParametersBase : RequestParameters + { + [CompilerGenerated] + private IEnumerable ??; + + public IEnumerable AdditionalParameters + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public NewsRequestParametersBase() + { + } + + public NewsRequestParametersBase(NewsRequestParametersBase original) + : base(original) + { + AdditionalParameters = original.AdditionalParameters; + } + } + public sealed class GetNewsRequestParameters : NewsRequestParametersBase + { + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private DateTime ??; + + public override RequestType Type + { + get + { + throw new NotImplementedException(); + } + } + + public DateTime From + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DateTime To + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public GetNewsRequestParameters() + { + } + + public GetNewsRequestParameters(GetNewsRequestParameters original) + : base(original) + { + From = original.From; + To = original.To; + } + } + public sealed class SubscribeNewsRequestParameters : NewsRequestParametersBase + { + [CompilerGenerated] + private string ??; + + public override RequestType Type + { + get + { + throw new NotImplementedException(); + } + } + + public string SubscribeId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SubscribeNewsRequestParameters() + { + } + + public SubscribeNewsRequestParameters(SubscribeNewsRequestParameters original) + : base(original) + { + SubscribeId = original.SubscribeId; + } + } + [ProtoContract] + public class GetOptionSeriesRequestParameters : CachedRequestParameters + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + public override RequestType Type => RequestType.OptionSeries; + + public string ConnectionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(1)] + public string UnderlierId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(2)] + public string ExchangeId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public GetOptionSeriesRequestParameters() + { + } + + public GetOptionSeriesRequestParameters(GetOptionSeriesRequestParameters origin) + : base(origin) + { + ConnectionId = origin.ConnectionId; + UnderlierId = origin.UnderlierId; + ExchangeId = origin.ExchangeId; + } + + internal GetOptionSeriesRequestParameters(Symbol P_0) + { + ConnectionId = P_0.ConnectionId; + UnderlierId = P_0.Id; + ExchangeId = P_0.ExchangeId; + } + + public override int GetCacheKey() + { + HashCode hashCode = default(HashCode); + if (UnderlierId != null) + { + hashCode.Add(UnderlierId); + } + if (ExchangeId != null) + { + hashCode.Add(ExchangeId); + } + return hashCode.ToHashCode(); + } + } + [ProtoContract] + public class GetStrikesRequestParameters : CachedRequestParameters + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private DateTime ??; + + public override RequestType Type => RequestType.Strikes; + + public string ConnectionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(1)] + public string UnderlierId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(2)] + public string SerieId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(3)] + public DateTime ExpirationDate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public GetStrikesRequestParameters() + { + } + + public GetStrikesRequestParameters(GetStrikesRequestParameters origin) + : base(origin) + { + ConnectionId = origin.ConnectionId; + UnderlierId = origin.UnderlierId; + SerieId = origin.SerieId; + ExpirationDate = origin.ExpirationDate; + } + + internal GetStrikesRequestParameters(OptionSerie P_0) + { + ConnectionId = P_0.ConnectionId; + UnderlierId = P_0.UnderlierId; + SerieId = P_0.Id; + ExpirationDate = P_0.ExpirationDate; + } + + public override int GetCacheKey() + { + HashCode hashCode = default(HashCode); + if (UnderlierId != null) + { + hashCode.Add(UnderlierId); + } + if (SerieId != null) + { + hashCode.Add(SerieId); + } + hashCode.Add(ExpirationDate); + return hashCode.ToHashCode(); + } + } + [Published] + [ProtoContract] + public class OrdersHistoryRequestParameters : ProgressRequestParameters, IXElementSerialization + { + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private DateTime ??; + + public override RequestType Type => RequestType.OrdersHistory; + + [ProtoMember(1)] + public DateTime From + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(2)] + public DateTime To + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), From)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), To)); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + From = xElement.ToDateTime(toUTC: true); + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + From = xElement2.ToDateTime(toUTC: true); + } + } + } + [Published] + public class PnLRequestParameters : RequestParameters + { + [CompilerGenerated] + private Symbol ??; + + [CompilerGenerated] + private Account ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private Side ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private string ??; + + public override RequestType Type => RequestType.PnL; + + public Symbol Symbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Account Account + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double OpenPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double ClosePrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Side Side + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double Quantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string PositionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public PnLRequestParameters() + { + OpenPrice = double.NaN; + ClosePrice = double.NaN; + Quantity = double.NaN; + } + + public PnLRequestParameters(PnLRequestParameters original) + { + Symbol = original.Symbol; + Account = original.Account; + OpenPrice = original.OpenPrice; + ClosePrice = original.ClosePrice; + Side = original.Side; + Quantity = original.Quantity; + PositionId = original.PositionId; + } + } + public abstract class ProgressRequestParameters : RequestParameters + { + [CompilerGenerated] + private IProgress ??; + + public IProgress Progress + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public ProgressRequestParameters() + { + Progress = new Progress(); + } + + protected ProgressRequestParameters(ProgressRequestParameters origin) + : base(origin) + { + Progress = origin.Progress; + } + } + [Published] + public class ReportRequestParameters : ProgressRequestParameters + { + [CompilerGenerated] + private ReportType ??; + + public override RequestType Type => RequestType.Report; + + public ReportType ReportType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public ReportRequestParameters() + { + } + + public ReportRequestParameters(ReportRequestParameters origin) + : base((ProgressRequestParameters)origin) + { + ReportType = origin.ReportType.?(); + } + } + [Published] + public abstract class RequestParameters : IEquatable + { + [CompilerGenerated] + private CancellationToken ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private readonly long ??; + + private static long ??; + + public abstract RequestType Type { get; } + + public CancellationToken CancellationToken + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string SendingSource + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public long RequestId + { + [CompilerGenerated] + get + { + return ??; + } + } + + protected RequestParameters() + { + ?? = Interlocked.Increment(ref ??); + } + + protected RequestParameters(RequestParameters origin) + { + CancellationToken = origin.CancellationToken; + SendingSource = origin.SendingSource; + ?? = origin.RequestId; + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(41, 3); + defaultInterpolatedStringHandler.AppendFormatted(Type); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(RequestId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(SendingSource); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public bool Equals(RequestParameters other) + { + if (other == null) + { + return false; + } + if (this == other) + { + return true; + } + return RequestId == other.RequestId; + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + if (this == obj) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((RequestParameters)obj); + } + + public override int GetHashCode() + { + return RequestId.GetHashCode(); + } + } + [ProtoContract] + public class SearchSymbolsRequestParameters : CachedRequestParameters + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private IList ?? = new List(); + + [CompilerGenerated] + private IList ?? = new List(); + + [CompilerGenerated] + private Func ??; + + public override RequestType Type => RequestType.SearchSymbol; + + public string ConnectionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(1)] + public string FilterName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(2)] + public IList ExchangeIds + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(3)] + public IList SymbolTypes + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Func GetSynonyms + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SearchSymbolsRequestParameters() + { + } + + public SearchSymbolsRequestParameters(SearchSymbolsRequestParameters origin) + : base(origin) + { + ConnectionId = origin.ConnectionId; + FilterName = origin.FilterName; + ExchangeIds = new List(origin.ExchangeIds); + SymbolTypes = new List(origin.SymbolTypes); + GetSynonyms = origin.GetSynonyms; + } + + public override int GetCacheKey() + { + HashCode hashCode = default(HashCode); + hashCode.Add(FilterName ?? string.Empty); + hashCode.Add(((IStructuralEquatable)ExchangeIds.ToArray()).GetHashCode((IEqualityComparer)EqualityComparer.Default)); + hashCode.Add(((IStructuralEquatable)SymbolTypes.Cast().ToArray()).GetHashCode((IEqualityComparer)EqualityComparer.Default)); + return hashCode.ToHashCode(); + } + } + /// + /// Defines quote parameters for subscribtion + /// + [ProtoContract] + public class SubscribeQuotesParameters : RequestParameters + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private SubscribeQuoteType ??; + + public override RequestType Type => RequestType.QuoteSubscribe; + + /// + /// Symbol Id + /// + [ProtoMember(1)] + public string SymbolId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + /// + /// Quote type + /// + [ProtoMember(2)] + public SubscribeQuoteType SubscribeType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = subscribeQuoteType; + } + } + + /// + /// SubscribeQuotesParameters constructor + /// + public SubscribeQuotesParameters(string symbolId, SubscribeQuoteType subscribeQuoteType) + { + SymbolId = symbolId; + SubscribeType = subscribeQuoteType; + } + + internal SubscribeQuotesParameters() + { + } + } + [Published] + [ProtoContract] + public class TradesHistoryRequestParameters : ProgressRequestParameters, IXElementSerialization + { + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private bool ??; + + public override RequestType Type => RequestType.TradesHistory; + + public Interval Interval => new Interval(From, To); + + [ProtoMember(1)] + public DateTime From + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(2)] + public DateTime To + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(3)] + public string SymbolId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(4)] + public bool ForceReload + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), From)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), To)); + if (!string.IsNullOrEmpty(SymbolId)) + { + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SymbolId)); + } + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ForceReload)); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + From = xElement.ToDateTime(toUTC: true); + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + From = xElement2.ToDateTime(toUTC: true); + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + SymbolId = xElement3.ToString(); + } + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + ForceReload = xElement4.ToBool(); + } + } + + public TradesHistoryRequestParameters() + { + } + + public TradesHistoryRequestParameters(TradesHistoryRequestParameters origin) + : base((ProgressRequestParameters)origin) + { + From = origin.From; + To = origin.To; + SymbolId = origin.SymbolId; + ForceReload = origin.ForceReload; + } + } + [Published] + public sealed class CancelOrderRequestParameters : TradingRequestParameters, ILoggable + { + [CompilerGenerated] + private IOrder ??; + + private string ??; + + public override RequestType Type => RequestType.CancelOrder; + + public IOrder Order + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string OrderId + { + get + { + string id = ??; + if (id == null) + { + IOrder order = Order; + if (order == null) + { + return null; + } + id = order.Id; + } + return id; + } + set + { + ?? = value; + } + } + + public override string ConnectionId => Order.Symbol?.ConnectionId; + + public override string Event + { + get + { + try + { + return OrderType.Format(Order) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Order.OrderTypeId; + } + } + + public override string Message + { + get + { + StringBuilder stringBuilder = new StringBuilder(); + StringBuilder stringBuilder2; + StringBuilder.AppendInterpolatedStringHandler handler; + if (Order is Order order) + { + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder3 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(14, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(order.Connection.Name); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder3.Append(ref handler); + } + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder4 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(10, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(Order.Symbol.Name); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder4.Append(ref handler); + string text = Core.Instance.CustomAccountPropertiesProvider.GetProperty(Order.Account, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) as string; + string value = (string.IsNullOrEmpty(text) ? Order.Account.Name : (Order.Account.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())); + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder5 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(11, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(value); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder5.Append(ref handler); + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder6 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(12, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(Order.Symbol.FormatQuantity(Order.RemainingQuantity)); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder6.Append(ref handler); + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder7 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(12, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(Order.Id); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder7.Append(ref handler); + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder8 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(8, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(Order.Side); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder8.Append(ref handler); + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder9 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(14, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(OrderType.Format(Order)); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder9.Append(ref handler); + string orderTypeId = Order.OrderTypeId; + if (!(orderTypeId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) && !(orderTypeId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (!(orderTypeId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (orderTypeId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder10 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(17, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(Order.Symbol.FormatOffset(Order.TrailOffset, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + stringBuilder10.Append(ref handler); + } + } + else + { + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder11 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(17, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(Order.Symbol.FormatPrice(Order.TriggerPrice)); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder11.Append(ref handler); + } + } + else + { + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder12 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(9, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + handler.AppendFormatted(Order.Symbol.FormatPrice(Order.Price)); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder12.Append(ref handler); + } + if (Order.StopLoss != null) + { + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder13 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(11, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(Order.StopLoss.Format(Order.Symbol)); + stringBuilder13.Append(ref handler); + } + if (Order.TakeProfit != null) + { + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder14 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(13, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(Order.TakeProfit.Format(Order.Symbol)); + stringBuilder14.Append(ref handler); + } + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder15 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(13, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(Core.Instance.TimeUtils.DateTimeUtcNow); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder15.Append(ref handler); + if (!string.IsNullOrEmpty(base.SendingSource)) + { + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder16 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(8, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(base.SendingSource); + stringBuilder16.Append(ref handler); + } + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder17 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(13, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(base.RequestId); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder17.Append(ref handler); + return stringBuilder.ToString(); + } + } + + public CancelOrderRequestParameters() + { + } + + public CancelOrderRequestParameters(CancelOrderRequestParameters original) + : base(original) + { + OrderId = original.OrderId; + Order = original.Order; + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 2); + defaultInterpolatedStringHandler.AppendFormatted(base.ToString()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Order); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + protected override Account GetAccount() + { + return Order?.Account; + } + } + [Published] + public class ClosePositionRequestParameters : TradingRequestParameters, ILoggable + { + [CompilerGenerated] + private Position ??; + + [CompilerGenerated] + private double ??; + + public override RequestType Type => RequestType.ClosePosition; + + public Position Position + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double CloseQuantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override string ConnectionId => Position?.Symbol?.ConnectionId; + + public override string Event => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override string Message + { + get + { + StringBuilder stringBuilder = new StringBuilder(); + StringBuilder stringBuilder2 = stringBuilder; + StringBuilder stringBuilder3 = stringBuilder2; + StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(14, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(Position.Connection.Name); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder3.Append(ref handler); + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder4 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(10, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(Position.Symbol.Name); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder4.Append(ref handler); + string text = Core.Instance.CustomAccountPropertiesProvider.GetProperty(Position.Account, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) as string; + string value = (string.IsNullOrEmpty(text) ? Position.Account.Name : (Position.Account.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())); + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder5 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(11, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(value); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder5.Append(ref handler); + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder6 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(12, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(Position.Symbol.FormatQuantity(Position.Quantity)); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder6.Append(ref handler); + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder7 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(15, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(Position.Id); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder7.Append(ref handler); + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder8 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(8, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(Position.Side); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder8.Append(ref handler); + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder9 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(9, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + handler.AppendFormatted(Position.Symbol.FormatPrice(Position.CurrentPrice)); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder9.Append(ref handler); + Order stopLoss = Position.StopLoss; + if (stopLoss != null) + { + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder10 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(11, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted((stopLoss.OrderTypeId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ? Position.Symbol.FormatOffset(stopLoss.TrailOffset, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) : Position.Symbol.FormatPrice(stopLoss.Price)); + stringBuilder10.Append(ref handler); + } + Order takeProfit = Position.TakeProfit; + if (takeProfit != null) + { + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder11 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(13, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(Position.Symbol.FormatPrice(takeProfit.Price)); + stringBuilder11.Append(ref handler); + } + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder12 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(13, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(Core.Instance.TimeUtils.DateTimeUtcNow.ToString()); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder12.Append(ref handler); + if (!string.IsNullOrEmpty(base.SendingSource)) + { + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder13 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(8, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(base.SendingSource); + stringBuilder13.Append(ref handler); + } + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder14 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(13, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(base.RequestId); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder14.Append(ref handler); + return stringBuilder.ToString(); + } + } + + public ClosePositionRequestParameters() + { + } + + public ClosePositionRequestParameters(ClosePositionRequestParameters origin) + : base(origin) + { + Position = origin.Position; + CloseQuantity = origin.CloseQuantity; + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(13, 3); + defaultInterpolatedStringHandler.AppendFormatted(base.ToString()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(CloseQuantity); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Position); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + protected override Account GetAccount() + { + return Position?.Account; + } + } + public class ConvertPositionRequestParameters : ClosePositionRequestParameters + { + [CompilerGenerated] + private string ??; + + public override RequestType Type => RequestType.ConvertPosition; + + public string ProductCode + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + } + public class LinkOCORequestParameters : TradingRequestParameters + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal string ?(IOrder P_0) + { + return P_0.Id; + } + } + + [CompilerGenerated] + private List ??; + + public override RequestType Type => RequestType.Custom; + + public override string Event => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override string Message + { + get + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(21, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.RequestId); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + + public override string ConnectionId => OrdersToLink?.FirstOrDefault()?.ConnectionId; + + public List OrdersToLink + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + protected override Account GetAccount() + { + return OrdersToLink.FirstOrDefault()?.Account; + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(1, 2); + defaultInterpolatedStringHandler.AppendFormatted(base.ToString()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrdersToLink?.Select((IOrder P_0) => P_0.Id).ToArray()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + [Published] + public class ModifyOrderRequestParameters : OrderRequestParameters + { + [CompilerGenerated] + private string ??; + + public override RequestType Type => RequestType.ModifyOrder; + + public override string Event + { + get + { + if (base.OrderType == null) + { + return string.Empty; + } + return base.OrderType.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + } + + /// + /// Id of the order + /// + public string OrderId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [NotPublished] + public ModifyOrderRequestParameters() + { + } + + public ModifyOrderRequestParameters(IOrder order) + : base(order) + { + OrderId = order.Id; + base.Quantity = order.RemainingQuantity; + } + + public ModifyOrderRequestParameters(ModifyOrderRequestParameters original) + : base(original) + { + OrderId = original.OrderId; + } + + public override object Clone() + { + return new ModifyOrderRequestParameters(this); + } + + public override string ToString() + { + return OrderId + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + base.ToString() + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); + } + } + [Published] + public abstract class OrderRequestParameters : TradingRequestParameters, ICloneable, IXElementSerialization, IEquatable + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal int ?(DealTicketItem P_0) + { + return P_0.SortIndex; + } + } + + private string ??; + + private Symbol ??; + + private string ??; + + [CompilerGenerated] + private Account ??; + + [CompilerGenerated] + private Side ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private string ??; + + private string ??; + + private OrderType ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private TimeInForce ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private List ??; + + [CompilerGenerated] + private List ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + private List ??; + + private readonly LocalOrder ??; + + private static readonly ListEqualityComparer ?? = new ListEqualityComparer(EqualityComparer.Default); + + private static readonly ListEqualityComparer ?? = new ListEqualityComparer(EqualityComparer.Default); + + public override string ConnectionId => Symbol?.ConnectionId; + + public string SymbolId + { + get + { + return Symbol?.Id ?? ??; + } + set + { + ?? = value; + } + } + + public Symbol Symbol + { + get + { + return ??; + } + set + { + ?? = value; + ?? = null; + } + } + + public string AccountId + { + get + { + return Account?.Id ?? ??; + } + set + { + ?? = value; + } + } + + public Account Account + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Side Side + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double Quantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double Total + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string QuantityDefinitionSettingName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string OrderTypeId + { + get + { + return ??; + } + set + { + ?? = value; + ?? = null; + } + } + + public OrderType OrderType + { + get + { + if (?? != null) + { + return ??.OrderType; + } + if (?? == null && Symbol != null && !string.IsNullOrEmpty(OrderTypeId)) + { + ?? = Symbol.GetAlowedOrderTypes(null)?.FirstOrDefault((OrderType P_0) => P_0.Id == OrderTypeId); + } + return ??; + } + } + + public double Price + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double TriggerPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double TrailOffset + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public TimeInForce TimeInForce + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DateTime ExpirationTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int Slippage + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string PositionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SlTpHolder StopLoss + { + get + { + return StopLossItems.FirstOrDefault(); + } + set + { + StopLossItems.Clear(); + if (value != null) + { + StopLossItems.Add(value); + } + } + } + + public SlTpHolder TakeProfit + { + get + { + return TakeProfitItems.FirstOrDefault(); + } + set + { + TakeProfitItems.Clear(); + if (value != null) + { + TakeProfitItems.Add(value); + } + } + } + + public List StopLossItems + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = list; + } + } + + public List TakeProfitItems + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = list; + } + } + + public string GroupId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Comment + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IList AdditionalParameters + { + get + { + List list = new List(??); + if (TimeInForce != TimeInForce.Default) + { + list.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)TimeInForce, force: true); + } + if (ExpirationTime != default(DateTime)) + { + list.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExpirationTime, force: true); + } + list.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)Side, force: true); + if (!double.IsNaN(Quantity)) + { + list.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Quantity, force: true); + } + if (!double.IsNaN(Total)) + { + list.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Total, force: true); + } + if (!double.IsNaN(Price)) + { + list.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Price, force: true); + } + if (!double.IsNaN(TriggerPrice)) + { + list.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TriggerPrice, force: true); + } + if (!double.IsNaN(TrailOffset)) + { + list.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)TrailOffset, force: true); + } + if (!string.IsNullOrEmpty(Comment)) + { + list.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Comment, force: true); + } + return list; + } + set + { + if (value == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ??.Clear(); + foreach (SettingItem item in value) + { + string name = item.Name; + if (name != null) + { + switch (name.Length) + { + case 5: + switch (name[0]) + { + case 'T': + if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + Total = (double)item.Value; + } + break; + case 'P': + if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + Price = (double)item.Value; + } + break; + } + break; + case 13: + if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() && item.Value is SelectItem selectItem) + { + TimeInForce = (TimeInForce)(object)selectItem.Value; + } + break; + case 10: + if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + ExpirationTime = (DateTime)item.Value; + } + break; + case 4: + if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() && item.Value is SelectItem selectItem2) + { + Side = (Side)(object)selectItem2.Value; + } + break; + case 8: + if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + Quantity = (double)item.Value; + } + break; + case 12: + if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + TriggerPrice = (double)item.Value; + } + break; + case 11: + if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + TrailOffset = (int)item.Value; + } + break; + case 7: + if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + Comment = item.Value?.ToString(); + } + break; + } + } + ??.Add(item.GetCopy()); + } + } + } + + public override string Message + { + get + { + IOrderedEnumerable orderedEnumerable = OrderType?.GetDealTicketItems(this)?.OrderBy((DealTicketItem P_0) => P_0.SortIndex); + if (orderedEnumerable == null) + { + return string.Empty; + } + StringBuilder stringBuilder = new StringBuilder(); + StringBuilder stringBuilder2; + StringBuilder.AppendInterpolatedStringHandler handler; + foreach (DealTicketItem item in orderedEnumerable) + { + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder3 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(4, 2, stringBuilder2); + handler.AppendFormatted(item.Key); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(item.FormattedValue); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder3.Append(ref handler); + } + stringBuilder2 = stringBuilder; + StringBuilder stringBuilder4 = stringBuilder2; + handler = new StringBuilder.AppendInterpolatedStringHandler(13, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(base.RequestId); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + stringBuilder4.Append(ref handler); + return stringBuilder.ToString(); + } + } + + protected OrderRequestParameters() + { + ?(); + } + + protected OrderRequestParameters(IOrder order) + : this() + { + Symbol = order.Symbol; + Account = order.Account; + Side = order.Side; + Quantity = order.TotalQuantity; + OrderTypeId = order.OrderTypeId; + ?? = order as LocalOrder; + Price = order.Price; + TriggerPrice = order.TriggerPrice; + TrailOffset = order.TrailOffset; + TimeInForce = order.TimeInForce; + ExpirationTime = order.ExpirationTime; + PositionId = order.PositionId; + GroupId = order.GroupId; + Comment = order.Comment; + SlTpHolder[] stopLossItems = order.StopLossItems; + foreach (SlTpHolder slTpHolder in stopLossItems) + { + StopLossItems.Add(slTpHolder.Clone() as SlTpHolder); + } + stopLossItems = order.TakeProfitItems; + foreach (SlTpHolder slTpHolder2 in stopLossItems) + { + TakeProfitItems.Add(slTpHolder2.Clone() as SlTpHolder); + } + try + { + if (OrderType == null) + { + return; + } + IList orderSettings = OrderType.GetOrderSettings(this, new FormatSettings + { + DisplayQuantityInLots = true + }); + orderSettings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)TimeInForce); + orderSettings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExpirationTime); + orderSettings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)Side); + orderSettings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Quantity); + orderSettings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Price); + orderSettings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TriggerPrice); + if (!double.IsNaN(TrailOffset)) + { + orderSettings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)TrailOffset); + } + orderSettings.UpdateItemValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Comment); + if (order.AdditionalInfo != null) + { + foreach (AdditionalInfoItem item in order.AdditionalInfo) + { + orderSettings.UpdateItemValue(item.Id, item.Value); + } + } + AdditionalParameters = orderSettings; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + protected OrderRequestParameters(OrderRequestParameters origin) + : base(origin) + { + ?(); + UpdateFrom(origin); + } + + private void ?() + { + ?? = new List(); + Price = double.NaN; + TriggerPrice = double.NaN; + TrailOffset = double.NaN; + StopLossItems = new List(); + TakeProfitItems = new List(); + } + + protected override Account GetAccount() + { + return Account; + } + + public abstract object Clone(); + + public void UpdateFrom(OrderRequestParameters origin) + { + if (origin == null) + { + return; + } + Symbol = origin.Symbol; + Account = origin.Account; + Side = origin.Side; + Quantity = origin.Quantity; + Total = origin.Total; + OrderTypeId = origin.OrderTypeId; + Price = origin.Price; + TriggerPrice = origin.TriggerPrice; + TrailOffset = origin.TrailOffset; + TimeInForce = origin.TimeInForce; + ExpirationTime = origin.ExpirationTime; + Slippage = origin.Slippage; + PositionId = origin.PositionId; + GroupId = origin.GroupId; + Comment = origin.Comment; + AdditionalParameters = origin.AdditionalParameters; + base.SendingSource = origin.SendingSource; + QuantityDefinitionSettingName = origin.QuantityDefinitionSettingName; + base.CancellationToken = origin.CancellationToken; + foreach (SlTpHolder stopLossItem in origin.StopLossItems) + { + StopLossItems.Add(stopLossItem.Clone() as SlTpHolder); + } + foreach (SlTpHolder takeProfitItem in origin.TakeProfitItems) + { + TakeProfitItems.Add(takeProfitItem.Clone() as SlTpHolder); + } + } + + public void ApplyValuesFrom(OrderRequestParameters other) + { + if (other != null) + { + if (other.Symbol != null) + { + Symbol = other.Symbol; + } + if (other.Account != null) + { + Account = other.Account; + } + if (!string.IsNullOrEmpty(other.OrderTypeId)) + { + OrderTypeId = other.OrderTypeId; + } + if (other.Slippage != 0) + { + Slippage = other.Slippage; + } + if (!string.IsNullOrEmpty(other.PositionId)) + { + PositionId = other.PositionId; + } + if (!string.IsNullOrEmpty(other.GroupId)) + { + GroupId = other.GroupId; + } + if (!string.IsNullOrEmpty(other.SendingSource)) + { + base.SendingSource = other.SendingSource; + } + if (!string.IsNullOrEmpty(other.QuantityDefinitionSettingName)) + { + QuantityDefinitionSettingName = other.QuantityDefinitionSettingName; + } + if (other.CancellationToken != CancellationToken.None) + { + base.CancellationToken = other.CancellationToken; + } + if (other.StopLossItems.Any()) + { + StopLossItems = other.StopLossItems; + } + if (other.TakeProfitItems.Any()) + { + TakeProfitItems = other.TakeProfitItems; + } + IList additionalParameters = AdditionalParameters; + IList additionalParameters2 = other.AdditionalParameters; + additionalParameters.MergeWith(additionalParameters2); + AdditionalParameters = additionalParameters; + } + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(6, 7); + defaultInterpolatedStringHandler.AppendFormatted(base.ToString()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderTypeId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Quantity); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Account); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderType?.GetFillPrice(this)); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (Symbol != null) + { + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Symbol.CreateInfo().ToXElement())); + } + if (Account != null) + { + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Account.CreateInfo().ToXElement())); + } + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)Side).ToString())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Quantity)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Total)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), QuantityDefinitionSettingName)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OrderTypeId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Price)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TriggerPrice)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TrailOffset)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)TimeInForce).ToString())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExpirationTime)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Slippage)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), PositionId)); + if (StopLossItems.Count > 0) + { + XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (SlTpHolder stopLossItem in StopLossItems) + { + xElement2.Add(stopLossItem.ToXElement()); + } + xElement.Add(xElement2); + } + if (TakeProfitItems.Count > 0) + { + XElement xElement3 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (SlTpHolder takeProfitItem in TakeProfitItems) + { + xElement3.Add(takeProfitItem.ToXElement()); + } + xElement.Add(xElement3); + } + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GroupId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Comment)); + if (AdditionalParameters != null) + { + XElement xElement4 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (SettingItem additionalParameter in AdditionalParameters) + { + xElement4.Add(additionalParameter.ToXElement()); + } + xElement.Add(xElement4); + } + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement == null) + { + return; + } + XElement xElement2 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + XElement xElement3 = xElement2.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + SymbolInfo symbolInfo = new SymbolInfo(); + symbolInfo.FromXElement(xElement3, deserializationInfo); + Symbol = Core.Instance.GetSymbol(symbolInfo); + } + } + XElement xElement4 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + XElement xElement5 = xElement4.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement5 != null) + { + ? ? = new ?(); + ?.FromXElement(xElement5, deserializationInfo); + Account = Core.Instance.GetAccount(?); + } + } + XElement xElement6 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement6 != null) + { + Side = (Side)xElement6.ToInt(); + } + XElement xElement7 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement7 != null) + { + Quantity = xElement7.ToDouble(); + } + XElement xElement8 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement8 != null) + { + Total = xElement8.ToDouble(); + } + XElement xElement9 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement9 != null) + { + QuantityDefinitionSettingName = xElement9.ToString(); + } + XElement xElement10 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement10 != null) + { + OrderTypeId = xElement10.Value; + } + XElement xElement11 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement11 != null) + { + Price = xElement11.ToDouble(); + } + XElement xElement12 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement12 != null) + { + TriggerPrice = xElement12.ToDouble(); + } + XElement xElement13 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement13 != null) + { + TrailOffset = xElement13.ToDouble(); + } + XElement xElement14 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement14 != null) + { + TimeInForce = (TimeInForce)xElement14.ToInt(); + } + XElement xElement15 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement15 != null) + { + ExpirationTime = xElement15.ToDateTime(); + } + XElement xElement16 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement16 != null) + { + Slippage = xElement16.ToInt(); + } + XElement xElement17 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement17 != null) + { + PositionId = xElement17.Value; + } + XElement xElement18 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement18 != null) + { + foreach (XElement item2 in xElement18.Elements()) + { + SlTpHolder slTpHolder = new SlTpHolder(); + slTpHolder.FromXElement(item2, deserializationInfo); + StopLossItems.Add(slTpHolder); + } + } + XElement xElement19 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement19 != null) + { + foreach (XElement item3 in xElement19.Elements()) + { + SlTpHolder slTpHolder2 = new SlTpHolder(); + slTpHolder2.FromXElement(item3, deserializationInfo); + TakeProfitItems.Add(slTpHolder2); + } + } + XElement xElement20 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement20 == null) + { + return; + } + List list = new List(); + foreach (XElement item4 in xElement20.Elements()) + { + if (Serializer.DeserializeNode(item4, deserializationInfo) is SettingItem item) + { + list.Add(item); + } + } + AdditionalParameters = list; + } + + public bool Equals(OrderRequestParameters other) + { + if (other == null) + { + return false; + } + if (this == other) + { + return true; + } + if (?? == other.?? && object.Equals(??, other.??) && object.Equals(Account, other.Account) && Side == other.Side && Quantity.Equals(other.Quantity) && Total.Equals(other.Total) && QuantityDefinitionSettingName == other.QuantityDefinitionSettingName && Price.Equals(other.Price) && TriggerPrice.Equals(other.TriggerPrice) && TrailOffset.Equals(other.TrailOffset) && TimeInForce == other.TimeInForce && ExpirationTime.Equals(other.ExpirationTime) && Slippage == other.Slippage && PositionId == other.PositionId && GroupId == other.GroupId && Comment == other.Comment && ??.Equals(StopLossItems, other.StopLossItems) && ??.Equals(TakeProfitItems, other.TakeProfitItems)) + { + return ??.Equals(??, other.??); + } + return false; + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + if (this == obj) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((OrderRequestParameters)obj); + } + + public override int GetHashCode() + { + HashCode hashCode = default(HashCode); + hashCode.Add(??); + hashCode.Add(??); + hashCode.Add(??); + hashCode.Add(Account); + hashCode.Add((int)Side); + hashCode.Add(Quantity); + hashCode.Add(Total); + hashCode.Add(QuantityDefinitionSettingName); + hashCode.Add(Price); + hashCode.Add(TriggerPrice); + hashCode.Add(TrailOffset); + hashCode.Add((int)TimeInForce); + hashCode.Add(ExpirationTime); + hashCode.Add(Slippage); + hashCode.Add(PositionId); + hashCode.Add(StopLossItems); + hashCode.Add(TakeProfitItems); + hashCode.Add(GroupId); + hashCode.Add(Comment); + return hashCode.ToHashCode(); + } + + [CompilerGenerated] + private bool ?(OrderType P_0) + { + return P_0.Id == OrderTypeId; + } + } + public class PaperRequest : PlaceOrderRequestParameters + { + public PaperRequest() + { + } + + public PaperRequest(PaperRequest request) + : base(request) + { + } + } + public class PlaceMultiOrderOrderRequestParameters : TradingRequestParameters + { + [CompilerGenerated] + private PlaceOrderRequestParameters[] ??; + + [CompilerGenerated] + private GroupOrderType ??; + + public override string ConnectionId => OrderParameters?.FirstOrDefault()?.Symbol?.ConnectionId; + + public override string Event => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override string Message + { + get + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(25, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.RequestId); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + + public override RequestType Type => RequestType.PlaceMultiOrderOrder; + + public PlaceOrderRequestParameters[] OrderParameters + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public GroupOrderType GroupOrderType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + protected override Account GetAccount() + { + return null; + } + + public PlaceMultiOrderOrderRequestParameters() + { + } + + public PlaceMultiOrderOrderRequestParameters(PlaceMultiOrderOrderRequestParameters original) + : base(original) + { + OrderParameters = original.OrderParameters; + GroupOrderType = original.GroupOrderType; + } + } + [Published] + public class PlaceOrderRequestParameters : OrderRequestParameters + { + public override RequestType Type => RequestType.PlaceOrder; + + public override string Event => (base.OrderType?.Name ?? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public PlaceOrderRequestParameters() + { + } + + public PlaceOrderRequestParameters(IOrder order) + : base(order) + { + } + + public PlaceOrderRequestParameters(OrderRequestParameters original) + : base(original) + { + } + + public override object Clone() + { + return new PlaceOrderRequestParameters(this); + } + } + public class TradingOperationParameters + { + [CompilerGenerated] + private Account ??; + + [CompilerGenerated] + private Symbol ??; + + [CompilerGenerated] + private IOrder ??; + + [CompilerGenerated] + private Position ??; + + public Account Account + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Symbol Symbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IOrder Order + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Position Position + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + } + [Published] + public abstract class TradingRequestParameters : RequestParameters, IConnectionBindedObject, ILoggable, ICurrentAccount, ISubTradingOperation + { + [CompilerGenerated] + private readonly GroupTradingOperation ??; + + public abstract string ConnectionId { get; } + + public abstract string Event { get; } + + public abstract string Message { get; } + + public GroupTradingOperation ParentOperation + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + Account ICurrentAccount.CurrentAccount + { + get + { + return GetAccount(); + } + set + { + } + } + + protected abstract Account GetAccount(); + + public TradingRequestParameters() + { + } + + public TradingRequestParameters(TradingRequestParameters origin) + : base(origin) + { + ParentOperation = origin.ParentOperation; + } + } + /// + /// SettingItem cast type + /// + public enum SettingItemType + { + Undefined, + String, + Boolean, + BooleanSwitcher, + Integer, + Double, + Selector, + SelectorLocalized, + DateTime, + Account, + Symbol, + Password, + Period, + File, + Group, + RadioLocalized, + Action, + Font, + TimeZone, + Rss, + HotkeyList, + Object, + ConditionSet, + Alignment, + PairColor, + Color, + Sound, + LineOptions, + TimeZoneManager, + FibonacciLevelOptions, + RangeSelector, + DrawingPoints, + TimeFrameConfig, + BooleanLocalized, + OAuth, + Label, + ClusterColoringLevels, + ArbitageSymbols, + TextArea, + OrderRequestParameters, + IconedAction, + PnlAlertsContainer, + TimeInTradeContainer, + SymbolsList, + Slider, + DoubleWithLink, + Custom, + Long, + MinotauroFibonacciLevelOptions, + OTP, + Condition, + BigTextArea + } + /// + /// SettingItem state + /// + public enum VisibilityMode + { + Visible, + Hidden + } + public enum MultipleRelationCondition + { + IfAny, + IfAll + } + /// + /// Specifies the DatePicker time format. + /// + public enum DatePickerFormat + { + /// + /// Date only + /// + Date, + /// + /// Date and time + /// + DateTime, + /// + /// Time only + /// + Time, + /// + /// Time with seconds + /// + LongTime, + /// + /// + /// + LongDateTime + } + public enum SettingItemValueChangingBehavior + { + Default, + WithConfirmation + } + public enum SettingItemValueChangingReason + { + Unknown, + Manually, + Programmatically + } + public enum IconType + { + Plus, + Trash, + Duplicate + } + public enum IconDisplayType + { + Visible, + VisibleOnHover + } + public class GroupActionInfo + { + [CompilerGenerated] + private Func ??; + + [CompilerGenerated] + private IconType ??; + + [CompilerGenerated] + private object ?? = new object(); + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private ManualChangesApplyingType ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + public Func Action + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = func; + } + } + + public IconType IconType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public object Tag + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool NeedActionConfirmation + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public ManualChangesApplyingType ManualChangesApplyingType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string ConfirmationText + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Marker + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Tooltip + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public GroupActionInfo(Func action) + { + Action = action; + } + } + public enum ManualChangesApplyingType + { + Discard, + Apply, + Confirm + } + public interface ISettingsGroup + { + string Text { get; } + + int SortIndex { get; } + + ISettingsGroup ParentGroup { get; } + + IList ChildGroups { get; } + + GroupActionInfo FirstActionInfo { get; } + + GroupActionInfo SecondActionInfo { get; } + } + public interface ISettingsGroupCollapseBehaviour + { + SettingsGroupCollapseBehaviour CollapseBehaviour { get; set; } + } + public enum SettingsGroupCollapseBehaviour + { + Normal, + AlwaysExpanded + } + /// + /// Typecasts setting as TabControl item + /// + [Serializable] + [Published] + [DataContract] + public sealed class SettingItemGroup : SettingItemList, ISettingsGroup + { + public bool AllowCreateEmptyGroup; + + [CompilerGenerated] + private GroupActionInfo ??; + + [CompilerGenerated] + private GroupActionInfo ??; + + public override SettingItemType Type => SettingItemType.Group; + + public GroupActionInfo FirstActionInfo + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public GroupActionInfo SecondActionInfo + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + string ISettingsGroup.Text => Text; + + int ISettingsGroup.SortIndex => base.SortIndex; + + ISettingsGroup ISettingsGroup.ParentGroup => base.Group; + + IList ISettingsGroup.ChildGroups => (Value as IList)?.OfType().ToList() ?? new List(); + + protected override List Items + { + get + { + return base.Items; + } + set + { + if (value != null) + { + foreach (SettingItem item in value) + { + item.Group = this; + } + } + base.Items = value; + } + } + + public SettingItemGroup() + : base(string.Empty, new List()) + { + } + + public SettingItemGroup(string name, IList items, int sortIndex = 0) + : base(name, items, sortIndex) + { + foreach (SettingItem item in items) + { + ?(item); + } + } + + [NotPublished] + public override SettingItem GetCopy() + { + return new SettingItemGroup(base.Name, CopyItems(), base.SortIndex) + { + Text = Text + }; + } + + public void AddItem(SettingItem item) + { + Items.Add(item); + ?(item); + } + + public override int GetHashCode() + { + return SettingItemVisualGroup.?(this); + } + + private void ?(SettingItem P_0) + { + P_0.Group = this; + } + + [NotPublished] + public override XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), base.Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); + for (int i = 0; i < Items.Count; i++) + { + try + { + xElement.Add(Items[i].ToXElement()); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + return xElement; + } + + [NotPublished] + public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + base.Name = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; + Items.Clear(); + foreach (XElement item in element.Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (Serializer.DeserializeNode(item, deserializationInfo) is SettingItem settingItem) + { + settingItem.Group = this; + Items.Add(settingItem); + } + } + } + } + [Serializable] + [DataContract] + public abstract class SettingItemList : SettingItem + { + private static readonly ListEqualityComparer ?? = new ListEqualityComparer(EqualityComparer.Default); + + [DataMember(Name = "Items")] + protected virtual List Items + { + get + { + return Value as List; + } + set + { + Value = value; + } + } + + protected SettingItemList(string name, IList items, int sortIndex = 0) + : base(name, items, sortIndex) + { + if (items == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public SettingItemList() + { + } + + protected SettingItemList(SettingItemList settingItem) + : base(settingItem) + { + Items = settingItem.CopyItems() as List; + } + + protected override bool IsValueTypeValid(object value) + { + return value is IList; + } + + protected IList CopyItems() + { + List list = new List(); + if (Value is IList list2) + { + foreach (SettingItem item in list2) + { + list.Add(item.GetCopy()); + } + } + return list; + } + + protected override bool ValueEquals(object other) + { + return ??.Equals(Items, other as IList); + } + } + [Serializable] + [DataContract] + public class SettingItemSymbolsList : SettingItemList + { + public override SettingItemType Type => SettingItemType.SymbolsList; + + [DataMember(Name = "Items")] + protected override List Items + { + get + { + List list = new List(); + foreach (SettingItemSymbol item in Value as List) + { + if (item.Value is Symbol) + { + list.Add(item); + } + } + return list; + } + set + { + Value = ?(value); + } + } + + public SettingItemSymbolsList(string name, IList items, int sortIndex = 0) + : base(name, new List(), sortIndex) + { + Value = ?(items); + } + + public SettingItemSymbolsList() + { + } + + protected SettingItemSymbolsList(SettingItemSymbolsList settingItem) + : base(settingItem) + { + } + + public override SettingItem GetCopy() + { + return new SettingItemSymbolsList(this); + } + + private new IList ?(IList P_0) + { + List list = new List(); + foreach (SettingItem item in P_0) + { + if (item.Value is Symbol) + { + list.Add(item); + } + } + return list; + } + + protected override XElement ValueToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (SettingItem item in Items) + { + xElement.Add(item.ToXElement()); + } + return xElement; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + List list = new List(); + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + foreach (XElement item in xElement.Elements()) + { + SettingItemSymbol settingItemSymbol = new SettingItemSymbol(); + settingItemSymbol.FromXElement(item, deserializationInfo); + list.Add(settingItemSymbol); + } + } + Items = list; + } + } + /// + /// Typecasts setting as GroupBox item + /// + [Published] + public sealed class SettingItemSeparatorGroup : SettingItemVisualGroup + { + private string ??; + + public string Key + { + get + { + if (string.IsNullOrEmpty(??)) + { + return base.Text; + } + return ??; + } + set + { + ?? = value; + } + } + + public SettingItemSeparatorGroup(string text = "", int sortIndex = 0) + : base(text, sortIndex) + { + } + } + public class SettingItemVisualGroup : ISettingsGroup, ISettingsGroupCollapseBehaviour + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private ISettingsGroup ??; + + [CompilerGenerated] + private GroupActionInfo ??; + + [CompilerGenerated] + private GroupActionInfo ??; + + [CompilerGenerated] + private IList ??; + + [CompilerGenerated] + private SettingsGroupCollapseBehaviour ??; + + public string Text + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public int SortIndex + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public ISettingsGroup ParentGroup + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = settingsGroup; + } + } + + public GroupActionInfo FirstActionInfo + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public GroupActionInfo SecondActionInfo + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IList ChildGroups + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = list; + } + } + + public SettingsGroupCollapseBehaviour CollapseBehaviour + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SettingItemVisualGroup(string text, int sortIndex = 0, ISettingsGroup parentGroup = null) + { + Text = text; + SortIndex = sortIndex; + ParentGroup = parentGroup; + ChildGroups = new List(); + if (ParentGroup != null) + { + ParentGroup.ChildGroups.Add(this); + } + } + + public override bool Equals(object obj) + { + return GetHashCode() == obj.GetHashCode(); + } + + public override int GetHashCode() + { + return ?(this); + } + + public override string ToString() + { + return Text; + } + + internal static int ?(ISettingsGroup P_0) + { + int num = 17; + num = num * 23 + P_0.Text.GetHashCode(); + num = num * 23 + P_0.SortIndex.GetHashCode(); + foreach (ISettingsGroup childGroup in P_0.ChildGroups) + { + num = num * 23 + childGroup.GetHashCode(); + } + return num; + } + } + [Serializable] + [DataContract] + public class OAuthResult : IXElementSerialization, ICloneable + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private bool ??; + + public string AccessToken + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + internal string RefreshToken + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + internal string IdentityToken + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + internal LoginResult RequestTokenResult + { + set + { + AccessToken = loginResult.AccessToken; + RefreshToken = loginResult.RefreshToken; + IdentityToken = loginResult.IdentityToken; + } + } + + internal RefreshTokenResult RequestRefreshResult + { + set + { + AccessToken = refreshTokenResult.AccessToken; + RefreshToken = refreshTokenResult.RefreshToken; + IdentityToken = refreshTokenResult.IdentityToken; + } + } + + internal TokenResponse TokenResponce + { + set + { + AccessToken = tokenResponse.AccessToken; + RefreshToken = tokenResponse.RefreshToken; + IdentityToken = tokenResponse.IdentityToken; + } + } + + public bool UseSavedTokens + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "EncryptedRefreshToken")] + private string EncryptedRefreshToken + { + get + { + if (!UseSavedTokens) + { + return string.Empty; + } + return Encryptor.?(RefreshToken); + } + set + { + RefreshToken = Encryptor.?(text); + } + } + + public OAuthResult() + { + AccessToken = string.Empty; + UseSavedTokens = true; + } + + public OAuthResult(string accessToken) + { + AccessToken = accessToken; + UseSavedTokens = true; + } + + internal OAuthResult(string P_0, string P_1) + { + AccessToken = P_0; + RefreshToken = P_1; + UseSavedTokens = true; + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), EncryptedRefreshToken)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), UseSavedTokens)); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + EncryptedRefreshToken = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; + UseSavedTokens = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); + } + + public object Clone() + { + return new OAuthResult + { + UseSavedTokens = UseSavedTokens, + AccessToken = AccessToken, + RefreshToken = RefreshToken, + IdentityToken = IdentityToken + }; + } + } + [DataContract] + public class SettingItemOAuth : SettingItem + { + [CompilerGenerated] + private readonly OidcClientOptions ??; + + [CompilerGenerated] + private readonly UpdateAuthorityUrlDelegate ??; + + [CompilerGenerated] + private readonly bool ??; + + [CompilerGenerated] + private readonly Parameters ??; + + public override SettingItemType Type => SettingItemType.OAuth; + + [DataMember(Name = "Value")] + private OAuthResult OAuthResultHolder + { + get + { + return (OAuthResult)Value; + } + set + { + Value = oAuthResult; + } + } + + public OidcClientOptions OidcOptions + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal UpdateAuthorityUrlDelegate UpdateIdentityAuthorityUrl + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal bool AllowOpenNewWindow + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal Parameters BackChannelExtraParameters + { + [CompilerGenerated] + get + { + return ??; + } + } + + public SettingItemOAuth() + { + } + + public SettingItemOAuth(string name, OAuthResult passwordHolder, OidcClientOptions oidcClientOptions, int sortIndex = 0, UpdateAuthorityUrlDelegate updateIdentityAuthorityUrl = null, bool allowOpenNewWindow = false, Parameters backChannelExtraParameters = null) + : base(name, passwordHolder, sortIndex) + { + ?? = oidcClientOptions; + ?? = updateIdentityAuthorityUrl; + ?? = allowOpenNewWindow; + ?? = backChannelExtraParameters; + } + + protected SettingItemOAuth(SettingItemOAuth settingItem) + : base(settingItem) + { + ?? = settingItem.OidcOptions; + ?? = settingItem.UpdateIdentityAuthorityUrl; + ?? = settingItem.AllowOpenNewWindow; + ?? = settingItem.BackChannelExtraParameters; + } + + public override SettingItem GetCopy() + { + return new SettingItemOAuth(this); + } + + protected override bool IsValueTypeValid(object value) + { + return value is OAuthResult; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + OAuthResult oAuthResult = new OAuthResult(); + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + oAuthResult.FromXElement(xElement, deserializationInfo); + OAuthResultHolder = oAuthResult; + } + } + } + public delegate string UpdateAuthorityUrlDelegate(IEnumerable settings, CancellationToken token); + public class SettingItemMultipleRelation : SettingItemRelation + { + [Serializable] + [CompilerGenerated] + private new sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func>>> ??; + + public static Func>, string> ??; + + public static Func>, IEnumerable> ??; + + internal IEnumerable>> ?(SettingItemRelation P_0) + { + return P_0.??; + } + + internal string ?(KeyValuePair> P_0) + { + return P_0.Key; + } + + internal IEnumerable ?(KeyValuePair> P_0) + { + return P_0.Value; + } + } + + private readonly List ??; + + public SettingItemMultipleRelation(params SettingItemRelation[] relations) + : base(relations.SelectMany((SettingItemRelation P_0) => P_0.??).ToDictionary((KeyValuePair> P_0) => P_0.Key, (KeyValuePair> P_0) => P_0.Value)) + { + ?? = relations.ToList(); + } + + public void AddRelation(SettingItemRelation relation) + { + foreach (KeyValuePair> item in relation.??) + { + ??.Add(item.Key, item.Value); + } + ??.Add(relation); + } + + public void InsertRelation(int index, SettingItemRelation relation) + { + foreach (KeyValuePair> item in relation.??) + { + ??.Add(item.Key, item.Value); + } + ??.Insert(0, relation); + } + + public override bool CheckRelation(SettingItem dependentItem, SettingItem changedItem, bool isPopulating, params SettingItem[] parentItems) + { + bool flag = false; + foreach (SettingItemRelation item in ??) + { + flag = ((base.MultipleRelationCondition != MultipleRelationCondition.IfAll) ? (flag | item.CheckRelation(dependentItem, changedItem, isPopulating, parentItems)) : (flag & item.CheckRelation(dependentItem, changedItem, isPopulating, parentItems))); + } + return flag; + } + } + public class SettingItemRelation + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func>, bool> ??; + + internal bool ?(KeyValuePair> P_0) + { + ? ? = new ? + { + ?? = P_0.Key + }; + IEnumerable value = P_0.Value; + if (!?.??.Visible) + { + return false; + } + return value.Any(?.?); + } + } + + [CompilerGenerated] + private sealed class ? + { + public SettingItem ??; + + internal bool ?(object P_0) + { + if (P_0 != null) + { + return SettingItemRelation.?(P_0, ??.Value); + } + return false; + } + } + + [CompilerGenerated] + private MultipleRelationCondition ??; + + internal readonly IDictionary> ??; + + protected SettingItemRelationDelegate RelationDelegate; + + public string[] ParentSettingsNames => ??.Keys.ToArray(); + + public MultipleRelationCondition MultipleRelationCondition + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SettingItemRelation(IDictionary> relationValuesByParentItemName, SettingItemRelationDelegate relationDelegate = null) + { + if (relationValuesByParentItemName.Keys.Count == 0) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + RelationDelegate = relationDelegate; + ?? = relationValuesByParentItemName; + MultipleRelationCondition = MultipleRelationCondition.IfAny; + } + + public virtual bool CheckRelation(SettingItem dependentItem, SettingItem changedItem, bool isPopulating, params SettingItem[] parentItems) + { + if (dependentItem == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (parentItems.Length == 0) + { + throw new AggregateException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + SettingItemRelationParameters settingItemRelationParameters = new SettingItemRelationParameters + { + DependentItem = dependentItem, + ChangedItem = changedItem, + RelationValuesByParentItem = new Dictionary>(), + MultipleRelationCondition = MultipleRelationCondition, + IsPopulating = isPopulating + }; + foreach (SettingItem settingItem in parentItems) + { + if (??.TryGetValue(settingItem.Name, out var value) && !settingItemRelationParameters.RelationValuesByParentItem.ContainsKey(settingItem)) + { + settingItemRelationParameters.RelationValuesByParentItem.Add(settingItem, value); + } + } + return RelationDelegate(settingItemRelationParameters); + } + + protected static bool CheckEnabilityRelation(SettingItemRelationParameters relationParameters) + { + SettingItem dependentItem = relationParameters.DependentItem; + bool flag = CheckValues(relationParameters.RelationValuesByParentItem, relationParameters.MultipleRelationCondition); + bool result = dependentItem.Enabled != flag; + dependentItem.Enabled = flag; + return result; + } + + protected static bool CheckVisibilityRelation(SettingItemRelationParameters relationParameters) + { + SettingItem dependentItem = relationParameters.DependentItem; + bool flag = CheckValues(relationParameters.RelationValuesByParentItem, relationParameters.MultipleRelationCondition); + bool result = dependentItem.Visible != flag; + dependentItem.Visible = flag; + return result; + } + + protected static bool CheckValues(IDictionary> relationValuesByParentItem, MultipleRelationCondition condition) + { + Func>, bool> predicate = delegate(KeyValuePair> P_0) + { + ? ? = new ?(); + ?.?? = P_0.Key; + IEnumerable value = P_0.Value; + return ?.??.Visible && value.Any(?.?); + }; + if (condition == MultipleRelationCondition.IfAny) + { + return relationValuesByParentItem.Any(predicate); + } + return relationValuesByParentItem.All(predicate); + } + + [CompilerGenerated] + internal static bool ?(object P_0, object P_1) + { + if (P_0.Equals(P_1) || P_0 == P_1) + { + return true; + } + if (P_1 is SelectItem selectItem) + { + return ?(P_0, selectItem.Value); + } + return false; + } + } + public delegate bool SettingItemRelationDelegate(SettingItemRelationParameters relationParameters); + public class SettingItemRelationAction : SettingItemRelation + { + [Serializable] + [CompilerGenerated] + private new sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func, string> ??; + + public static Func, IEnumerable> ??; + + internal string ?(KeyValuePair P_0) + { + return P_0.Key; + } + + internal IEnumerable ?(KeyValuePair P_0) + { + return Enumerable.Empty(); + } + } + + private readonly IDictionary ??; + + public SettingItemRelationAction(IDictionary callbacks) + : base(callbacks.ToDictionary((KeyValuePair P_0) => P_0.Key, (KeyValuePair P_0) => Enumerable.Empty())) + { + ?? = callbacks; + RelationDelegate = ?; + } + + private bool ?(SettingItemRelationParameters P_0) + { + if (!??.TryGetValue(P_0.ChangedItem.Name, out var value)) + { + return false; + } + try + { + return value(P_0.ChangedItem, P_0.DependentItem); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + return false; + } + } + public delegate bool SettingItemRelationCallback(SettingItem changedItem, SettingItem dependentItem); + public class SettingItemRelationEnability : SettingItemRelation + { + [CompilerGenerated] + private new static class ? + { + public static SettingItemRelationDelegate ??; + } + + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal string ?(string P_0) + { + return P_0; + } + } + + [CompilerGenerated] + private sealed class ? + { + public object ??; + + internal IEnumerable ?(string P_0) + { + return new List { ?? }; + } + } + + public SettingItemRelationEnability(string parentSettingsName, params object[] relationValues) + : base(new Dictionary> { + { + parentSettingsName, + new List(relationValues) + } }, SettingItemRelation.CheckEnabilityRelation) + { + } + + public SettingItemRelationEnability(string[] parentSettingsNames, object relationValue) + : base(((IEnumerable)parentSettingsNames).ToDictionary((Func)((string P_0) => P_0), (Func>)((string P_0) => new List { relationValue })), SettingItemRelation.CheckEnabilityRelation) + { + } + + public SettingItemRelationEnability(IDictionary> relationValuesByParentItemName) + : base(relationValuesByParentItemName, SettingItemRelation.CheckEnabilityRelation) + { + } + } + public class SettingItemRelationParameters + { + [CompilerGenerated] + private SettingItem ??; + + [CompilerGenerated] + private SettingItem ??; + + [CompilerGenerated] + private IDictionary> ??; + + [CompilerGenerated] + private MultipleRelationCondition ??; + + [CompilerGenerated] + private bool ??; + + public SettingItem DependentItem + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SettingItem ChangedItem + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IDictionary> RelationValuesByParentItem + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public MultipleRelationCondition MultipleRelationCondition + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool IsPopulating + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + } + public class SettingItemRelationVisibility : SettingItemRelation + { + [CompilerGenerated] + private new static class ? + { + public static SettingItemRelationDelegate ??; + } + + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal string ?(string P_0) + { + return P_0; + } + } + + [CompilerGenerated] + private sealed class ? + { + public object ??; + + internal IEnumerable ?(string P_0) + { + return new List { ?? }; + } + } + + public SettingItemRelationVisibility(string parentSettingsName, params object[] relationValues) + : base(new Dictionary> { + { + parentSettingsName, + new List(relationValues) + } }, SettingItemRelation.CheckVisibilityRelation) + { + } + + public SettingItemRelationVisibility(string[] parentSettingsNames, object relationValue) + : base(((IEnumerable)parentSettingsNames).ToDictionary((Func)((string P_0) => P_0), (Func>)((string P_0) => new List { relationValue })), SettingItemRelation.CheckVisibilityRelation) + { + } + + public SettingItemRelationVisibility(IDictionary> relationValuesByParentItemName) + : base(relationValuesByParentItemName, SettingItemRelation.CheckVisibilityRelation) + { + } + } + [Serializable] + [DataContract] + [KnownType(typeof(SettingItemAccount))] + [KnownType(typeof(SettingItemBoolean))] + [KnownType(typeof(SettingItemBooleanSwitcher))] + [KnownType(typeof(SettingItemDateTime))] + [KnownType(typeof(SettingItemSymbol))] + [KnownType(typeof(SettingItemPassword))] + [KnownType(typeof(SettingItemPeriod))] + [KnownType(typeof(SettingItemSelector))] + [KnownType(typeof(SettingItemSelectorLocalized))] + [KnownType(typeof(SettingItemString))] + [KnownType(typeof(SettingItemFile))] + [KnownType(typeof(SettingItemGroup))] + [KnownType(typeof(SettingItemRadioLocalized))] + [KnownType(typeof(SettingItemAction))] + [KnownType(typeof(SettingItemFont))] + [KnownType(typeof(SettingItemTimeZone))] + [KnownType(typeof(SettingItemRss))] + [KnownType(typeof(SettingItemAlignment))] + [KnownType(typeof(SettingItemPairColor))] + [KnownType(typeof(SettingItemColor))] + [KnownType(typeof(SettingItemSound))] + [KnownType(typeof(SettingItemLineOptions))] + [KnownType(typeof(SettingItemTimeZoneManager))] + [KnownType(typeof(SettingItemAlert))] + [KnownType(typeof(SettingItemFibonacciLevelOptions))] + [KnownType(typeof(SettingItemMinotauroFibonacciLevelOptions))] + [KnownType(typeof(SettingItemRangeSelector))] + [KnownType(typeof(SettingitemPoints))] + [KnownType(typeof(SettingItemTimeFrameConfig))] + [KnownType(typeof(SettingItemBooleanLocalized))] + [KnownType(typeof(SettingItemNumber))] + [KnownType(typeof(SettingItemNumber))] + [KnownType(typeof(SettingItemNumber))] + [KnownType(typeof(SettingItemClusterColoringLevel))] + [KnownType(typeof(SettingItemOrderRequestParameters))] + [KnownType(typeof(SettingItemIconedAction))] + [KnownType(typeof(SettingItemSlider))] + [KnownType(typeof(SettingItemDoubleWithLink))] + [KnownType(typeof(SettingItemCondition))] + [ProtoContract] + [ProtoInclude(2, typeof(SettingItemAccount))] + [ProtoInclude(3, typeof(SettingItemBoolean))] + [ProtoInclude(4, typeof(SettingItemBooleanSwitcher))] + [ProtoInclude(5, typeof(SettingItemDateTime))] + [ProtoInclude(6, typeof(SettingItemNumber))] + [ProtoInclude(7, typeof(SettingItemSymbol))] + [ProtoInclude(8, typeof(SettingItemNumber))] + [ProtoInclude(9, typeof(SettingItemPassword))] + [ProtoInclude(10, typeof(SettingItemPeriod))] + [ProtoInclude(11, typeof(SettingItemSelector))] + [ProtoInclude(12, typeof(SettingItemSelectorLocalized))] + [ProtoInclude(13, typeof(SettingItemString))] + [ProtoInclude(14, typeof(SettingItemFile))] + [ProtoInclude(15, typeof(SettingItemGroup))] + [ProtoInclude(16, typeof(SettingItemRadioLocalized))] + [ProtoInclude(17, typeof(SettingItemAction))] + [ProtoInclude(18, typeof(SettingItemFont))] + [ProtoInclude(19, typeof(SettingItemTimeZone))] + [ProtoInclude(20, typeof(SettingItemRss))] + [ProtoInclude(21, typeof(SettingItemAlignment))] + [ProtoInclude(22, typeof(SettingItemPairColor))] + [ProtoInclude(23, typeof(SettingItemColor))] + [ProtoInclude(24, typeof(SettingItemSound))] + [ProtoInclude(25, typeof(SettingItemLineOptions))] + [ProtoInclude(26, typeof(SettingItemTimeZoneManager))] + [ProtoInclude(27, typeof(SettingItemAlert))] + [ProtoInclude(28, typeof(SettingItemFibonacciLevelOptions))] + [ProtoInclude(29, typeof(SettingItemRangeSelector))] + [ProtoInclude(30, typeof(SettingitemPoints))] + [ProtoInclude(31, typeof(SettingItemTimeFrameConfig))] + [ProtoInclude(32, typeof(SettingItemBooleanLocalized))] + [ProtoInclude(33, typeof(SettingItemClusterColoringLevel))] + [ProtoInclude(34, typeof(SettingItemArbitageSymbols))] + [ProtoInclude(36, typeof(SettingItemOrderRequestParameters))] + [ProtoInclude(38, typeof(SettingItemIconedAction))] + [ProtoInclude(39, typeof(SettingItemSlider))] + [ProtoInclude(40, typeof(SettingItemDoubleWithLink))] + [ProtoInclude(41, typeof(SettingItemNumber))] + [ProtoInclude(42, typeof(SettingItemCondition))] + public abstract class SettingItem : BindableEntity, IComparable, IEquatable, IXElementSerialization + { + [CompilerGenerated] + private string ??; + + private string ??; + + protected object value; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private VisibilityMode ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private SettingItemGroup ??; + + [CompilerGenerated] + private SettingItemSeparatorGroup ??; + + [CompilerGenerated] + private ISettingsGroup ??; + + private bool ??; + + [CompilerGenerated] + private SettingItemValueChangingBehavior ??; + + [CompilerGenerated] + private SettingItemValueChangingReason ??; + + private bool ??; + + [CompilerGenerated] + private SettingItemEventHandler ??; + + [CompilerGenerated] + private SettingItemRelation ??; + + [CompilerGenerated] + private bool ??; + + public abstract SettingItemType Type { get; } + + [DataMember(Name = "Name")] + [ProtoMember(1)] + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [Bindable("text")] + public virtual string Text + { + get + { + if (string.IsNullOrEmpty(??)) + { + return Name; + } + return ??; + } + set + { + SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + [Bindable("value")] + public virtual object Value + { + get + { + return value; + } + set + { + if (this.value == value) + { + return; + } + if (value == null) + { + SetValue(ref this.value, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return; + } + if (IsValueTypeValid(value)) + { + SetValue(ref this.value, ValidateValue(value), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return; + } + throw new InvalidCastException(); + } + } + + public int SortIndex + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public VisibilityMode VisibilityMode + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Description + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SettingItemGroup Group + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SettingItemSeparatorGroup SeparatorGroup + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public ISettingsGroup VisualGroup + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [Bindable("enabled")] + public bool Enabled + { + get + { + return ??; + } + set + { + SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public SettingItemValueChangingBehavior ValueChangingBehavior + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SettingItemValueChangingReason ValueChangingReason + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [Bindable("visible")] + public bool Visible + { + get + { + return ??; + } + set + { + SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public bool IsVisualizationAllowed + { + get + { + if (VisibilityMode == VisibilityMode.Hidden) + { + return false; + } + if (Group != null) + { + return Group.IsVisualizationAllowed; + } + return true; + } + } + + public SettingItemRelation Relation + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool UseEnabilityToggler + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public event SettingItemEventHandler Updated + { + [CompilerGenerated] + add + { + SettingItemEventHandler settingItemEventHandler = ??; + SettingItemEventHandler settingItemEventHandler2; + do + { + settingItemEventHandler2 = settingItemEventHandler; + SettingItemEventHandler settingItemEventHandler3 = (SettingItemEventHandler)Delegate.Combine(settingItemEventHandler2, value); + settingItemEventHandler = Interlocked.CompareExchange(ref ??, settingItemEventHandler3, settingItemEventHandler2); + } + while ((object)settingItemEventHandler != settingItemEventHandler2); + } + [CompilerGenerated] + remove + { + SettingItemEventHandler settingItemEventHandler = ??; + SettingItemEventHandler settingItemEventHandler2; + do + { + settingItemEventHandler2 = settingItemEventHandler; + SettingItemEventHandler settingItemEventHandler3 = (SettingItemEventHandler)Delegate.Remove(settingItemEventHandler2, value); + settingItemEventHandler = Interlocked.CompareExchange(ref ??, settingItemEventHandler3, settingItemEventHandler2); + } + while ((object)settingItemEventHandler != settingItemEventHandler2); + } + } + + public static IXElementSerialization DesserrializationFabric(XElement node) + { + string text = node?.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value; + if (text != null) + { + switch (text.Length) + { + case 18: + switch (text[11]) + { + case 'A': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemAccount(); + case 'B': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemBoolean(); + case 'I': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemInteger(); + } + break; + case 26: + switch (text[15]) + { + case 'e': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemBooleanSwitcher(); + case 'Z': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemTimeZoneManager(); + case 'F': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemTimeFrameConfig(); + } + break; + case 19: + switch (text[13]) + { + case 't': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemDateTime(); + case 's': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemPassword(); + case 'l': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemSelector(); + case 'm': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemTimeZone(); + case 'x': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemTextArea(); + } + break; + case 17: + switch (text[16]) + { + case 'l': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemSymbol(); + case 'd': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemPeriod(); + case 'g': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemString(); + case 'n': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemAction(); + case 's': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingitemPoints(); + case 'e': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemDouble(); + case 'r': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemSlider(); + } + break; + case 15: + switch (text[14]) + { + case 'e': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemFile(); + case 't': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemFont(); + case 'g': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemLong(); + } + break; + case 16: + switch (text[11]) + { + case 'G': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemGroup(); + case 'C': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemColor(); + case 'S': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemSound(); + case 'A': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemAlert(); + case 'O': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemOAuth(); + } + break; + case 25: + switch (text[11]) + { + case 'R': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemRadioLocalized(); + case 'D': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemDoubleWithLink(); + } + break; + case 20: + switch (text[11]) + { + case 'A': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemAlignment(); + case 'P': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemPairColor(); + case 'C': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemCondition(); + } + break; + case 22: + switch (text[11]) + { + case 'L': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemLineOptions(); + case 'B': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemBigTextArea(); + } + break; + case 28: + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemSelectorLocalized(); + case 14: + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemRss(); + case 32: + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemFibonacciLevelOptions(); + case 41: + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemMinotauroFibonacciLevelOptions(); + case 24: + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemRangeSelector(); + case 27: + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemBooleanLocalized(); + case 31: + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemClusterColoringLevel(); + case 33: + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemOrderRequestParameters(); + case 23: + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new SettingItemIconedAction(); + } + } + return null; + } + + public void Update() + { + ???.Invoke(this, SettingItemEventArgs.Empty); + } + + protected SettingItem(string name, object value, int sortIndex = 0) + : this() + { + Name = name; + this.value = value; + SortIndex = sortIndex; + VisibilityMode = VisibilityMode.Visible; + ValueChangingBehavior = SettingItemValueChangingBehavior.Default; + Enabled = true; + Visible = true; + } + + protected SettingItem() + { + ValueChangingReason = SettingItemValueChangingReason.Unknown; + } + + protected SettingItem(SettingItem settingItem) + : this() + { + Name = settingItem.Name; + SortIndex = settingItem.SortIndex; + Text = settingItem.Text; + Description = settingItem.Description; + Enabled = settingItem.Enabled; + Group = settingItem.Group; + Relation = settingItem.Relation; + SeparatorGroup = settingItem.SeparatorGroup; + VisibilityMode = settingItem.VisibilityMode; + Visible = settingItem.Visible; + VisualGroup = settingItem.VisualGroup; + if (settingItem.value is ICloneable cloneable) + { + value = cloneable.Clone(); + } + else + { + value = settingItem.Value; + } + ValueChangingBehavior = settingItem.ValueChangingBehavior; + UseEnabilityToggler = settingItem.UseEnabilityToggler; + } + + public abstract SettingItem GetCopy(); + + protected abstract bool IsValueTypeValid(object value); + + protected virtual object ValidateValue(object value) + { + return value; + } + + internal bool ?(IList P_0) + { + if (P_0 == null) + { + return false; + } + SettingItem itemByName = P_0.GetItemByName(Name); + if (itemByName != null) + { + Value = itemByName.Value; + return true; + } + return false; + } + + internal virtual void ?(object P_0, bool P_1 = false) + { + if (P_1) + { + SetValue(ref value, P_0, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + else + { + Value = P_0; + } + } + + internal virtual void ?(SettingItem P_0) + { + ?(P_0.Value); + VisibilityMode = P_0.VisibilityMode; + SortIndex = P_0.SortIndex; + } + + public int CompareTo(SettingItem other) + { + return SortIndex.CompareTo(other.SortIndex); + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Value); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public virtual XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); + if (UseEnabilityToggler) + { + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Enabled)); + } + xElement.Add(ValueToXElement()); + return xElement; + } + + protected virtual XElement ValueToXElement() + { + if (Value is IXElementSerialization iXElementSerialization) + { + return iXElementSerialization.ToXElement(); + } + return new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Value); + } + + public virtual void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + Name = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; + UseEnabilityToggler = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) != null; + Enabled = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToBool() ?? false; + ValueFromXElement(element, deserializationInfo); + } + + protected virtual void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + Value = xElement.Value; + } + } + + public virtual bool Equals(SettingItem other) + { + if (other == null) + { + return false; + } + if (this == other) + { + return true; + } + if (Text == other.Text && ValueEquals(other.Value) && Enabled == other.Enabled && Visible == other.Visible && Type == other.Type && Name == other.Name && SortIndex == other.SortIndex && VisibilityMode == other.VisibilityMode && Description == other.Description && object.Equals(SeparatorGroup, other.SeparatorGroup) && object.Equals(VisualGroup, other.VisualGroup) && ValueChangingReason == other.ValueChangingReason && ValueChangingBehavior == other.ValueChangingBehavior) + { + return UseEnabilityToggler == other.UseEnabilityToggler; + } + return false; + } + + protected virtual bool ValueEquals(object other) + { + return object.Equals(Value, other); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + if (this == obj) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((SettingItem)obj); + } + + public override int GetHashCode() + { + HashCode hashCode = default(HashCode); + hashCode.Add(Text); + hashCode.Add(Value); + hashCode.Add(Enabled); + hashCode.Add(Visible); + hashCode.Add((int)Type); + hashCode.Add(Name); + hashCode.Add(SortIndex); + hashCode.Add((int)VisibilityMode); + hashCode.Add(Description); + hashCode.Add(SeparatorGroup); + hashCode.Add(VisualGroup); + hashCode.Add(ValueChangingReason); + hashCode.Add((int)ValueChangingBehavior); + hashCode.Add(UseEnabilityToggler); + return hashCode.ToHashCode(); + } + } + /// + /// Typecasts setting as AccountLookup item + /// + [Serializable] + [DataContract] + public sealed class SettingItemAccount : SettingItem + { + public override SettingItemType Type => SettingItemType.Account; + + [DataMember(Name = "Value")] + private BusinessObjectInfo ValueInfo + { + get + { + return (Value as Account)?.CreateInfo() ?? BusinessObjectInfo.Empty; + } + set + { + Value = Core.Instance.GetAccount(accountInfo); + } + } + + public SettingItemAccount() + { + } + + public SettingItemAccount(string name, Account value = null, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemAccount(SettingItemAccount P_0) + : base(P_0) + { + } + + public override SettingItem GetCopy() + { + return new SettingItemAccount(this); + } + + public static implicit operator Account(SettingItemAccount item) + { + return item.Value as Account; + } + + protected override bool IsValueTypeValid(object value) + { + return value is Account; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + ? ? = new ?(); + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + ?.FromXElement(xElement, deserializationInfo); + if (!string.IsNullOrEmpty(?.Id)) + { + ValueInfo = ?; + } + } + } + + protected override XElement ValueToXElement() + { + return ValueInfo.ToXElement(); + } + } + /// + /// Typecasts setting as Button item + /// + [Serializable] + [Published] + [DataContract] + public sealed class SettingItemAction : SettingItem + { + [CompilerGenerated] + private string ??; + + public override SettingItemType Type => SettingItemType.Action; + + public string LabelText + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SettingItemAction() + { + } + + public SettingItemAction(string name, SettingItemActionDelegate value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + public SettingItemAction(SettingItemAction settingItem) + : base(settingItem) + { + LabelText = settingItem.LabelText; + } + + [NotPublished] + public override SettingItem GetCopy() + { + return new SettingItemAction(this); + } + + [NotPublished] + public static implicit operator SettingItemActionDelegate(SettingItemAction item) + { + return item.Value as SettingItemActionDelegate; + } + + [NotPublished] + protected override bool IsValueTypeValid(object value) + { + return value is SettingItemActionDelegate; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + } + } + public delegate object SettingItemActionDelegate(object args = null); + [Serializable] + [DataContract] + public class SettingItemAlert : SettingItem + { + public override SettingItemType Type => SettingItemType.ConditionSet; + + [DataMember(Name = "Value")] + private AlertData ValueAlert + { + get + { + return Value as AlertData; + } + set + { + Value = alertData; + } + } + + public SettingItemAlert() + { + } + + public SettingItemAlert(string name, object value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemAlert(SettingItemAlert P_0) + : base(P_0) + { + } + + public override SettingItem GetCopy() + { + return new SettingItemAlert(this); + } + + protected override bool IsValueTypeValid(object value) + { + return value is AlertData; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + AlertData alertData = new AlertData(); + alertData.FromXElement(element, deserializationInfo); + value = alertData; + } + } + [Serializable] + [DataContract] + public class SettingItemAlignment : SettingItem + { + public override SettingItemType Type => SettingItemType.Alignment; + + [DataMember(Name = "Value")] + private NativeAlignment ValueAlignment + { + get + { + return (NativeAlignment)Value; + } + set + { + Value = nativeAlignment; + } + } + + public SettingItemAlignment() + { + } + + public SettingItemAlignment(string name, NativeAlignment value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemAlignment(SettingItemAlignment P_0) + : base(P_0) + { + } + + public override SettingItem GetCopy() + { + return new SettingItemAlignment(this); + } + + protected override bool IsValueTypeValid(object value) + { + return value is NativeAlignment; + } + + protected override XElement ValueToXElement() + { + return new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)ValueAlignment); + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + ValueAlignment = (NativeAlignment)xElement.ToInt(); + } + } + } + [Serializable] + [DataContract] + public class SettingItemArbitageSymbols : SettingItem + { + [CompilerGenerated] + private ArbitrageSymbol ??; + + [CompilerGenerated] + private decimal ??; + + [CompilerGenerated] + private decimal ??; + + [CompilerGenerated] + private ArbitrageSymbol ??; + + [CompilerGenerated] + private ArbitrageSymbol ??; + + [CompilerGenerated] + private ArbitrageSymbol ??; + + [DataMember(Name = "Value")] + private List ArbitrageSymbols + { + get + { + return Value as List; + } + set + { + Value = list; + } + } + + public override SettingItemType Type => SettingItemType.ArbitageSymbols; + + public ArbitrageSymbol FirstArbitrageSymbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public decimal BaseMaxTradingQuantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public decimal QuotingMaxTradingQuantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public ArbitrageSymbol AddedSymbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public ArbitrageSymbol RemovedSymbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public ArbitrageSymbol ModifiedSymbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SettingItemArbitageSymbols() + { + } + + public SettingItemArbitageSymbols(string name, List symbols, int sortIndex = 0) + : base(name, symbols, sortIndex) + { + BaseMaxTradingQuantity = 0m; + QuotingMaxTradingQuantity = 0m; + } + + private SettingItemArbitageSymbols(SettingItemArbitageSymbols P_0) + : base(P_0) + { + BaseMaxTradingQuantity = P_0.BaseMaxTradingQuantity; + QuotingMaxTradingQuantity = P_0.QuotingMaxTradingQuantity; + } + + public override SettingItem GetCopy() + { + return new SettingItemArbitageSymbols(this); + } + + protected override bool IsValueTypeValid(object value) + { + return value is List; + } + + public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + BaseMaxTradingQuantity = xElement.ToDecimal(); + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + QuotingMaxTradingQuantity = xElement2.ToDecimal(); + } + base.FromXElement(element, deserializationInfo); + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + List list = new List(); + IEnumerable enumerable = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Elements(); + if (enumerable != null) + { + foreach (XElement item in enumerable) + { + ArbitrageSymbol arbitrageSymbol = new ArbitrageSymbol(); + arbitrageSymbol.FromXElement(item, deserializationInfo); + list.Add(arbitrageSymbol); + } + } + Value = list; + base.ValueFromXElement(element, deserializationInfo); + } + + public override XElement ToXElement() + { + XElement xElement = base.ToXElement(); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), BaseMaxTradingQuantity)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), QuotingMaxTradingQuantity)); + return xElement; + } + + protected override XElement ValueToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (ArbitrageSymbol arbitrageSymbol in ArbitrageSymbols) + { + xElement.Add(arbitrageSymbol.ToXElement()); + } + return xElement; + } + } + /// + /// Typecasts setting as TextBox item + /// + [Serializable] + [DataContract] + [ProtoContract] + public sealed class SettingItemBigTextArea : SettingItem + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + public override SettingItemType Type => SettingItemType.BigTextArea; + + public string HelpLink + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string HelpLinkTitle + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Value")] + [ProtoMember(1)] + private string ValueString + { + get + { + return Value as string; + } + set + { + Value = text; + } + } + + public SettingItemBigTextArea() + { + } + + public SettingItemBigTextArea(string name, string value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemBigTextArea(SettingItemBigTextArea P_0) + : base(P_0) + { + } + + public override SettingItem GetCopy() + { + return new SettingItemBigTextArea(this); + } + + public static implicit operator string(SettingItemBigTextArea item) + { + return item.Value as string; + } + + protected override bool IsValueTypeValid(object value) + { + return value is string; + } + } + /// + /// Typecasts setting as CheckBox item + /// + [Serializable] + [Published] + [DataContract] + public sealed class SettingItemBoolean : SettingItem + { + public override SettingItemType Type => SettingItemType.Boolean; + + [DataMember(Name = "Value")] + [ProtoMember(1, IsRequired = true)] + private bool ValueBool + { + get + { + return (bool)value; + } + set + { + value = flag; + } + } + + public SettingItemBoolean() + { + } + + public SettingItemBoolean(string name, bool value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemBoolean(SettingItemBoolean P_0) + : base(P_0) + { + } + + [NotPublished] + public override SettingItem GetCopy() + { + return new SettingItemBoolean(this); + } + + [NotPublished] + public static implicit operator bool(SettingItemBoolean item) + { + return (bool)item.Value; + } + + [NotPublished] + protected override bool IsValueTypeValid(object value) + { + return value is bool; + } + + [NotPublished] + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + ValueBool = xElement.ToBool(); + } + } + } + [Serializable] + [DataContract] + public class SettingItemBooleanLocalized : SettingItemList + { + [Serializable] + [CompilerGenerated] + private new sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Predicate ??; + + internal bool ?(SettingItem P_0) + { + return P_0 is SettingItemBoolean; + } + } + + public override SettingItemType Type => SettingItemType.BooleanLocalized; + + public SettingItemBooleanLocalized() + { + } + + public SettingItemBooleanLocalized(string name, IList items, int sortIndex = 0) + : base(name, items, sortIndex) + { + } + + private SettingItemBooleanLocalized(SettingItemBooleanLocalized P_0) + : base(P_0) + { + } + + public override SettingItem GetCopy() + { + return new SettingItemBooleanLocalized(this); + } + + protected override bool IsValueTypeValid(object value) + { + if (value is List list) + { + return list.TrueForAll((SettingItem P_0) => P_0 is SettingItemBoolean); + } + return false; + } + + protected override XElement ValueToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + List items = Items; + for (int i = 0; i < items.Count; i++) + { + xElement.Add(items[i].ToXElement()); + } + return xElement; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + List list = new List(); + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (XElement item in xElement.Elements()) + { + SettingItemBoolean settingItemBoolean = new SettingItemBoolean(); + settingItemBoolean.FromXElement(item, deserializationInfo); + list.Add(settingItemBoolean); + } + Items = list; + } + } + /// + /// Typecasts setting as CheckBox item + /// + [Serializable] + [DataContract] + public sealed class SettingItemBooleanSwitcher : SettingItem + { + public override SettingItemType Type => SettingItemType.BooleanSwitcher; + + [DataMember(Name = "Value")] + [ProtoMember(1)] + private bool ValueBool + { + get + { + return (bool)value; + } + set + { + value = flag; + } + } + + public SettingItemBooleanSwitcher() + { + } + + public SettingItemBooleanSwitcher(string name, bool value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemBooleanSwitcher(SettingItemBooleanSwitcher P_0) + : base(P_0) + { + } + + public override SettingItem GetCopy() + { + return new SettingItemBooleanSwitcher(this); + } + + public static implicit operator bool(SettingItemBooleanSwitcher item) + { + return (bool)item.Value; + } + + protected override bool IsValueTypeValid(object value) + { + return value is bool; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + ValueBool = xElement.ToBool(); + } + } + } + [Serializable] + [DataContract] + public class SettingItemClusterColoringLevel : SettingItem + { + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private decimal ?? = 1m; + + [CompilerGenerated] + private decimal ?? = decimal.MinValue; + + [CompilerGenerated] + private decimal ?? = decimal.MaxValue; + + [CompilerGenerated] + private bool ?? = true; + + public int NumericPrecision + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public decimal Increment + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public decimal Minimum + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public decimal Maximum + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool WithRightColor + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override SettingItemType Type => SettingItemType.ClusterColoringLevels; + + [DataMember(Name = "Value")] + private ClusterCustomColoringLevel Level + { + get + { + return Value as ClusterCustomColoringLevel; + } + set + { + Value = clusterCustomColoringLevel; + } + } + + public SettingItemClusterColoringLevel() + { + } + + public SettingItemClusterColoringLevel(string name, ClusterCustomColoringLevel level, int sortIndex = 0) + : base(name, level, sortIndex) + { + NumericPrecision = 0; + } + + public SettingItemClusterColoringLevel(SettingItemClusterColoringLevel settingItem) + : base(settingItem) + { + NumericPrecision = settingItem.NumericPrecision; + Increment = settingItem.Increment; + Minimum = settingItem.Minimum; + Maximum = settingItem.Maximum; + } + + public override SettingItem GetCopy() + { + return new SettingItemClusterColoringLevel(this); + } + + protected override bool IsValueTypeValid(object value) + { + return value is ClusterCustomColoringLevel; + } + + protected override XElement ValueToXElement() + { + return Level.ToXElement(); + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + ClusterCustomColoringLevel clusterCustomColoringLevel = new ClusterCustomColoringLevel(); + clusterCustomColoringLevel.FromXElement(element, deserializationInfo); + Value = clusterCustomColoringLevel; + } + } + /// + /// Typecasts setting as Color item + /// + [Serializable] + [Published] + [DataContract] + public sealed class SettingItemColor : SettingItem + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + public override SettingItemType Type => SettingItemType.Color; + + public string ColorText + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool Checked + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool WithCheckBox + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool AllowDisableColor + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Value")] + private Color ValueColor + { + get + { + return (Color)Value; + } + set + { + Value = color; + } + } + + public SettingItemColor() + { + } + + public SettingItemColor(string name, Color value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemColor(SettingItemColor P_0) + : base(P_0) + { + ColorText = P_0.ColorText; + Checked = P_0.Checked; + WithCheckBox = P_0.WithCheckBox; + AllowDisableColor = P_0.AllowDisableColor; + } + + [NotPublished] + public override SettingItem GetCopy() + { + return new SettingItemColor(this); + } + + [NotPublished] + public static implicit operator Color(SettingItemColor item) + { + return (Color)item.Value; + } + + [NotPublished] + protected override bool IsValueTypeValid(object value) + { + return value is Color; + } + + [NotPublished] + protected override XElement ValueToXElement() + { + return ValueColor.ToXElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + + [NotPublished] + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + ValueColor = xElement.ToColor(); + } + } + + [NotPublished] + public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + base.FromXElement(element, deserializationInfo); + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + WithCheckBox = xElement.ToBool(); + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + Checked = xElement2.ToBool(); + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + AllowDisableColor = xElement3.ToBool(); + } + } + + [NotPublished] + public override XElement ToXElement() + { + XElement xElement = base.ToXElement(); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Checked)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), WithCheckBox)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AllowDisableColor)); + return xElement; + } + } + /// + /// Typecasts setting as DateTimePicker item + /// + [Serializable] + [DataContract] + public sealed class SettingItemDateTime : SettingItem + { + private const string ?? = "ddMMyyyy HH:mm:ss.ffffff"; + + [CompilerGenerated] + private bool ??; + + private DatePickerFormat ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private DateTime ??; + + public override SettingItemType Type => SettingItemType.DateTime; + + public bool ApplyOnEachInput + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [Bindable("format")] + public DatePickerFormat Format + { + get + { + return ??; + } + set + { + SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public DateTime MinDate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DateTime MaxDate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Value")] + [ProtoMember(1)] + private DateTime ValueDateTime + { + get + { + return (DateTime)Value; + } + set + { + Value = dateTime; + } + } + + public SettingItemDateTime() + { + } + + public SettingItemDateTime(string name, DateTime value = default(DateTime), int sortIndex = 0) + : base(name, value, sortIndex) + { + Format = DatePickerFormat.DateTime; + ApplyOnEachInput = false; + MinDate = DateTime.MinValue; + MaxDate = DateTime.MaxValue; + } + + private SettingItemDateTime(SettingItemDateTime P_0) + : base(P_0) + { + Format = P_0.Format; + ApplyOnEachInput = P_0.ApplyOnEachInput; + MinDate = P_0.MinDate; + MaxDate = P_0.MaxDate; + } + + public override SettingItem GetCopy() + { + return new SettingItemDateTime(this); + } + + public static implicit operator DateTime(SettingItemDateTime item) + { + return (DateTime)item.Value; + } + + protected override bool IsValueTypeValid(object value) + { + return value is DateTime; + } + + protected override XElement ValueToXElement() + { + return new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ValueDateTime.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo.InvariantCulture)); + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement == null) + { + return; + } + if (deserializationInfo.Version < 1.3) + { + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null && xElement2.Value == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + ValueDateTime = xElement.ToDateTime(toUTC: true); + } + else + { + ValueDateTime = xElement.ToDateTime(); + } + } + else + { + ValueDateTime = xElement.ToDateTime(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + } + /// + /// Typecasts setting as NumericUpDown item + /// + [Serializable] + [Published] + [DataContract] + [ProtoContract] + public class SettingItemDouble : SettingItemNumber + { + private int ??; + + public override SettingItemType Type => SettingItemType.Double; + + [Bindable("decimalPlaces")] + public int DecimalPlaces + { + get + { + return ??; + } + set + { + SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + [DataMember(Name = "Value")] + [ProtoMember(1)] + private double ValueDouble + { + get + { + return (double)value; + } + set + { + value = num; + } + } + + public SettingItemDouble() + { + } + + public SettingItemDouble(string name, double value, int sortIndex = 0) + : base(name, value, sortIndex) + { + base.Maximum = 2147483647.0; + base.Minimum = -2147483648.0; + DecimalPlaces = 0; + base.Increment = 1.0; + } + + private protected SettingItemDouble(SettingItemDouble P_0) + : base((SettingItemNumber)P_0) + { + DecimalPlaces = P_0.DecimalPlaces; + } + + [NotPublished] + public override SettingItem GetCopy() + { + return new SettingItemDouble(this); + } + + [NotPublished] + public static implicit operator double(SettingItemDouble item) + { + return (double)item.Value; + } + + [NotPublished] + protected override bool IsValueTypeValid(object value) + { + return value is double; + } + + [NotPublished] + protected override object ValidateValue(object value) + { + value = base.ValidateValue(value); + double num = (double)value; + if (double.IsNaN(num)) + { + num = 0.0; + } + else if (num > base.Maximum) + { + num = base.Maximum; + } + else if (num < base.Minimum) + { + num = base.Minimum; + } + else if (base.Increment != 0.0) + { + num -= (double)((decimal)num % (decimal)base.Increment); + } + return num; + } + + [NotPublished] + protected override XElement ValueToXElement() + { + return new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ValueDouble.ToString(CultureInfo.InvariantCulture)); + } + + [NotPublished] + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + ValueDouble = xElement.ToDouble(); + } + } + + public override bool Equals(SettingItem other) + { + if (!base.Equals(other)) + { + return false; + } + if (!(other is SettingItemDouble settingItemDouble)) + { + return false; + } + return DecimalPlaces == settingItemDouble.DecimalPlaces; + } + + public override int GetHashCode() + { + HashCode hashCode = default(HashCode); + hashCode.Add(base.GetHashCode()); + hashCode.Add(DecimalPlaces); + return hashCode.ToHashCode(); + } + } + public class SettingItemDoubleWithLink : SettingItemDouble + { + private string ??; + + [CompilerGenerated] + private Action ??; + + public override SettingItemType Type => SettingItemType.DoubleWithLink; + + [Bindable("linkText")] + public string LinkText + { + get + { + return ??; + } + set + { + SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public Action LinkAction + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SettingItemDoubleWithLink() + { + } + + public SettingItemDoubleWithLink(string name, double value, Action linkAction, int sortIndex = 0) + : base(name, value, sortIndex) + { + LinkAction = linkAction; + } + + private SettingItemDoubleWithLink(SettingItemDoubleWithLink P_0) + : base(P_0) + { + LinkText = P_0.LinkText; + LinkAction = P_0.LinkAction; + } + + public override SettingItem GetCopy() + { + return new SettingItemDoubleWithLink(this); + } + } + public class SettingItemFibonacciLevelOptions : SettingItem + { + [CompilerGenerated] + private Font ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private decimal ??; + + public override SettingItemType Type => SettingItemType.FibonacciLevelOptions; + + public Font DefaultFont + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int DecimalPlaces + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public decimal Increment + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Value")] + private List ValuelevelOptions + { + get + { + return Value as List; + } + set + { + Value = list; + } + } + + public SettingItemFibonacciLevelOptions() + { + ?(); + } + + public SettingItemFibonacciLevelOptions(string name, List value, int sortIndex = 0) + : base(name, value, sortIndex) + { + ?(); + } + + protected SettingItemFibonacciLevelOptions(SettingItemFibonacciLevelOptions settingItem) + : base(settingItem) + { + ?(); + } + + private void ?() + { + DecimalPlaces = 2; + Increment = 0.01m; + } + + public override SettingItem GetCopy() + { + return new SettingItemFibonacciLevelOptions(this); + } + + protected override bool IsValueTypeValid(object value) + { + return value is List; + } + + protected override XElement ValueToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (FibonacciLevelOptions valuelevelOption in ValuelevelOptions) + { + xElement.Add(valuelevelOption.ToXElement()); + } + return xElement; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + List list = new List(); + foreach (XElement item in element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Elements()) + { + FibonacciLevelOptions fibonacciLevelOptions = CreateFibonaccilevel(); + fibonacciLevelOptions.FromXElement(item, deserializationInfo); + list.Add(fibonacciLevelOptions); + } + Value = list; + } + + protected virtual FibonacciLevelOptions CreateFibonaccilevel() + { + return new FibonacciLevelOptions(); + } + } + [Serializable] + [DataContract] + public class SettingItemFile : SettingItem + { + public string Filter; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private string ??; + + public override SettingItemType Type => SettingItemType.File; + + public bool Checked + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool WithCheckBox + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string DefaultFolder + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Value")] + private string ValueString + { + get + { + return Value as string; + } + set + { + Value = text; + } + } + + public SettingItemFile() + { + } + + public SettingItemFile(string name, string value, string filter, int sortIndex = 0) + : base(name, value, sortIndex) + { + Filter = filter; + } + + private SettingItemFile(SettingItemFile P_0) + : base(P_0) + { + Filter = P_0.Filter; + } + + public override SettingItem GetCopy() + { + return new SettingItemFile(this); + } + + public static implicit operator string(SettingItemFile item) + { + return item.Value as string; + } + + protected override bool IsValueTypeValid(object value) + { + return value is string; + } + + public override XElement ToXElement() + { + XElement xElement = base.ToXElement(); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Checked)); + return xElement; + } + + public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + base.FromXElement(element, deserializationInfo); + Checked = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToBool() ?? false; + } + } + [Serializable] + [DataContract] + [KnownType(typeof(FontStyle))] + [KnownType(typeof(GraphicsUnit))] + public sealed class SettingItemFont : SettingItem + { + public bool UseGeneral; + + public override SettingItemType Type => SettingItemType.Font; + + [DataMember(Name = "Value")] + private Font ValueFont + { + get + { + return Value as Font; + } + set + { + if (font != null) + { + Value = font; + } + } + } + + public SettingItemFont() + { + } + + public SettingItemFont(string name, Font value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemFont(SettingItemFont P_0) + : base(P_0) + { + } + + public override SettingItem GetCopy() + { + return new SettingItemFont(this); + } + + public static implicit operator Font(SettingItemFont item) + { + return item.Value as Font; + } + + protected override bool IsValueTypeValid(object value) + { + if (!(value is Font)) + { + return value == null; + } + return true; + } + + protected override XElement ValueToXElement() + { + return ValueFont.ToXElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + ValueFont = xElement.ToFont(); + } + } + } + [Serializable] + [DataContract] + public sealed class SettingItemIconedAction : SettingItem + { + [CompilerGenerated] + private SettingItemIconedActionType ??; + + public override SettingItemType Type => SettingItemType.IconedAction; + + public SettingItemIconedActionType IconType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SettingItemIconedAction() + { + } + + public SettingItemIconedAction(string name, SettingItemActionDelegate value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemIconedAction(SettingItemIconedAction P_0) + : base(P_0) + { + } + + public override SettingItem GetCopy() + { + return new SettingItemIconedAction(this); + } + + protected override bool IsValueTypeValid(object value) + { + return value is SettingItemActionDelegate; + } + + public static implicit operator SettingItemActionDelegate(SettingItemIconedAction item) + { + return item.Value as SettingItemActionDelegate; + } + } + public enum SettingItemIconedActionType + { + Setting, + Trash + } + /// + /// Typecasts setting as NumericUpDown item + /// + [Serializable] + [Published] + [DataContract] + [ProtoContract] + public sealed class SettingItemInteger : SettingItemNumber + { + public override SettingItemType Type => SettingItemType.Integer; + + [DataMember(Name = "Value")] + [ProtoMember(1)] + private int ValueInt + { + get + { + return (int)value; + } + set + { + value = num; + } + } + + public SettingItemInteger() + { + } + + public SettingItemInteger(string name, int value, int sortIndex = 0) + : base(name, value, sortIndex) + { + base.Maximum = int.MaxValue; + base.Minimum = int.MinValue; + base.Increment = 1; + } + + private SettingItemInteger(SettingItemInteger P_0) + : base((SettingItemNumber)P_0) + { + } + + [NotPublished] + public override SettingItem GetCopy() + { + return new SettingItemInteger(this); + } + + [NotPublished] + public static implicit operator int(SettingItemInteger item) + { + return (int)item.Value; + } + + [NotPublished] + protected override bool IsValueTypeValid(object value) + { + return value is int; + } + + [NotPublished] + protected override object ValidateValue(object value) + { + value = base.ValidateValue(value); + int num = (int)value; + if (num > base.Maximum) + { + num = base.Maximum; + } + else if (num < base.Minimum) + { + num = base.Minimum; + } + else if (base.Increment != 0) + { + num -= num % base.Increment; + } + return num; + } + + [NotPublished] + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + ValueInt = xElement.ToInt(); + } + } + } + public class SettingItemLabel : SettingItem + { + public override SettingItemType Type => SettingItemType.Label; + + [DataMember(Name = "Value")] + private string ValueString + { + get + { + return Value as string; + } + set + { + Value = text; + } + } + + public SettingItemLabel() + { + } + + public SettingItemLabel(string name, string value = null, int sortIndex = 0) + : base(name, value ?? string.Empty, sortIndex) + { + } + + private SettingItemLabel(SettingItemLabel P_0) + : base(P_0) + { + } + + public override SettingItem GetCopy() + { + return new SettingItemLabel(this); + } + + protected override bool IsValueTypeValid(object value) + { + return value is string; + } + } + [Serializable] + [DataContract] + public class SettingItemLineOptions : SettingItem + { + [CompilerGenerated] + private LineStyle[] ??; + + public override SettingItemType Type => SettingItemType.LineOptions; + + public LineStyle[] ExcludedStyles + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Value")] + private LineOptions ValueColor + { + get + { + return (LineOptions)Value; + } + set + { + Value = lineOptions; + } + } + + public SettingItemLineOptions() + { + } + + public SettingItemLineOptions(string name, LineOptions value, int sortIndex = 0) + : base(name, value?.Clone(), sortIndex) + { + } + + private SettingItemLineOptions(SettingItemLineOptions P_0) + : base(P_0) + { + if (P_0.Value is ICloneable cloneable) + { + value = cloneable.Clone() as LineOptions; + } + ExcludedStyles = P_0.ExcludedStyles; + } + + public override SettingItem GetCopy() + { + return new SettingItemLineOptions(this); + } + + protected override bool IsValueTypeValid(object value) + { + return value is LineOptions; + } + + protected override object ValidateValue(object value) + { + LineOptions lineOptions = (LineOptions)value; + LineStyle[] excludedStyles = ExcludedStyles; + if (excludedStyles != null && excludedStyles.Contains(lineOptions.LineStyle)) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return base.ValidateValue(value); + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + LineOptions lineOptions = new LineOptions(); + XElement element2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + lineOptions.FromXElement(element2, deserializationInfo); + ValueColor = lineOptions; + } + } + [Serializable] + [Published] + [DataContract] + [ProtoContract] + public sealed class SettingItemLong : SettingItemNumber + { + public override SettingItemType Type => SettingItemType.Long; + + [DataMember(Name = "Value")] + [ProtoMember(1)] + private long ValueLong + { + get + { + return (long)value; + } + set + { + value = num; + } + } + + public SettingItemLong() + { + } + + public SettingItemLong(string name, long value, int sortIndex = 0) + : base(name, value, sortIndex) + { + base.Maximum = long.MaxValue; + base.Minimum = long.MinValue; + base.Increment = 1L; + } + + private SettingItemLong(SettingItemLong P_0) + : base((SettingItemNumber)P_0) + { + } + + [NotPublished] + public override SettingItem GetCopy() + { + return new SettingItemLong(this); + } + + [NotPublished] + public static implicit operator long(SettingItemLong item) + { + return (long)item.Value; + } + + [NotPublished] + protected override bool IsValueTypeValid(object value) + { + return value is long; + } + + [NotPublished] + protected override object ValidateValue(object value) + { + value = base.ValidateValue(value); + long num = (long)value; + if (num > base.Maximum) + { + num = base.Maximum; + } + else if (num < base.Minimum) + { + num = base.Minimum; + } + else if (base.Increment != 0L) + { + num -= num % base.Increment; + } + return num; + } + + [NotPublished] + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + ValueLong = xElement.ToLong(); + } + } + } + public class SettingItemMinotauroFibonacciLevelOptions : SettingItemFibonacciLevelOptions + { + public override SettingItemType Type => SettingItemType.MinotauroFibonacciLevelOptions; + + protected override FibonacciLevelOptions CreateFibonaccilevel() + { + return new MinotauroFibonacciLevelOptions(); + } + + private SettingItemMinotauroFibonacciLevelOptions(SettingItemFibonacciLevelOptions P_0) + : base(P_0) + { + } + + public override SettingItem GetCopy() + { + return new SettingItemMinotauroFibonacciLevelOptions(this); + } + + public SettingItemMinotauroFibonacciLevelOptions() + { + } + + public SettingItemMinotauroFibonacciLevelOptions(string name, List value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + } + [Serializable] + [KnownType(typeof(SettingItemDouble))] + [KnownType(typeof(SettingItemInteger))] + [KnownType(typeof(SettingItemLong))] + [ProtoInclude(1, typeof(SettingItemDouble))] + [ProtoInclude(2, typeof(SettingItemInteger))] + [ProtoInclude(3, typeof(SettingItemLong))] + [DataContract] + [ProtoContract] + public abstract class SettingItemNumber : SettingItem where T : struct + { + private T ??; + + private T ??; + + private T ??; + + private string ??; + + [CompilerGenerated] + private bool ??; + + [Bindable("maximum")] + public T Maximum + { + get + { + return ??; + } + set + { + SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + [Bindable("minimum")] + public T Minimum + { + get + { + return ??; + } + set + { + SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + [Bindable("increment")] + public T Increment + { + get + { + return ??; + } + set + { + SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + [Bindable("dimension")] + public string Dimension + { + get + { + return ??; + } + set + { + SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public bool UseTradingNumeric + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SettingItemNumber() + { + } + + public SettingItemNumber(string name, T value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + protected SettingItemNumber(SettingItemNumber settingItem) + : base(settingItem) + { + Maximum = settingItem.Maximum; + Minimum = settingItem.Minimum; + Increment = settingItem.Increment; + Dimension = settingItem.Dimension; + UseTradingNumeric = settingItem.UseTradingNumeric; + } + + public override bool Equals(SettingItem other) + { + if (!base.Equals(other)) + { + return false; + } + if (!(other is SettingItemNumber settingItemNumber)) + { + return false; + } + if (EqualityComparer.Default.Equals(Maximum, settingItemNumber.Maximum) && EqualityComparer.Default.Equals(Minimum, settingItemNumber.Minimum) && EqualityComparer.Default.Equals(Increment, settingItemNumber.Increment) && Dimension == settingItemNumber.Dimension) + { + return UseTradingNumeric == settingItemNumber.UseTradingNumeric; + } + return false; + } + + public override int GetHashCode() + { + HashCode hashCode = default(HashCode); + hashCode.Add(base.GetHashCode()); + hashCode.Add(Maximum); + hashCode.Add(Minimum); + hashCode.Add(Increment); + hashCode.Add(Dimension); + hashCode.Add(UseTradingNumeric); + return hashCode.ToHashCode(); + } + } + /// + /// Typecasts setting as AccountLookup item + /// + [Serializable] + [DataContract] + public sealed class SettingItemObject : SettingItem + { + public override SettingItemType Type => SettingItemType.Object; + + public SettingItemObject() + { + } + + public SettingItemObject(string name, object value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemObject(SettingItemObject P_0) + : base(P_0) + { + } + + public override SettingItem GetCopy() + { + return new SettingItemObject(this); + } + + protected override bool IsValueTypeValid(object value) + { + return true; + } + } + [Serializable] + [DataContract] + public class SettingItemOrderRequestParameters : SettingItem + { + public override SettingItemType Type => SettingItemType.OrderRequestParameters; + + [DataMember(Name = "Value")] + private OrderRequestParameters ValueInfo + { + get + { + return Value as OrderRequestParameters; + } + set + { + Value = orderRequestParameters; + } + } + + public SettingItemOrderRequestParameters() + { + } + + public SettingItemOrderRequestParameters(string name, OrderRequestParameters value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemOrderRequestParameters(SettingItemOrderRequestParameters P_0) + : base(P_0) + { + } + + public override SettingItem GetCopy() + { + return new SettingItemOrderRequestParameters(this); + } + + protected override bool IsValueTypeValid(object value) + { + return value is OrderRequestParameters; + } + + protected override XElement ValueToXElement() + { + return ValueInfo.ToXElement(); + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + PlaceOrderRequestParameters placeOrderRequestParameters = new PlaceOrderRequestParameters(); + placeOrderRequestParameters.FromXElement(element, deserializationInfo); + value = placeOrderRequestParameters; + } + } + [Serializable] + [DataContract] + public sealed class SettingItemPairColor : SettingItem + { + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + public override SettingItemType Type => SettingItemType.PairColor; + + public bool Checked + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool WithCheckBox + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool AllowDisableColor1 + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool AllowDisableColor2 + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Value")] + private PairColor ValueColor + { + get + { + return (PairColor)Value; + } + set + { + Value = pairColor; + } + } + + public SettingItemPairColor() + { + } + + public SettingItemPairColor(string name, PairColor value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemPairColor(SettingItemPairColor P_0) + : base(P_0) + { + Checked = P_0.Checked; + WithCheckBox = P_0.WithCheckBox; + AllowDisableColor1 = P_0.AllowDisableColor1; + AllowDisableColor2 = P_0.AllowDisableColor2; + } + + public override SettingItem GetCopy() + { + return new SettingItemPairColor(this); + } + + public static implicit operator PairColor(SettingItemPairColor item) + { + return (PairColor)item.Value; + } + + protected override bool IsValueTypeValid(object value) + { + return value is PairColor; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + value = new PairColor(); + ValueColor.FromXElement(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), deserializationInfo); + } + + public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + base.FromXElement(element, deserializationInfo); + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + WithCheckBox = xElement.ToBool(); + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + Checked = xElement2.ToBool(); + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + AllowDisableColor1 = xElement3.ToBool(); + } + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + AllowDisableColor2 = xElement4.ToBool(); + } + } + + public override XElement ToXElement() + { + XElement xElement = base.ToXElement(); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Checked)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), WithCheckBox)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AllowDisableColor1)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AllowDisableColor2)); + return xElement; + } + } + /// + /// Typecasts setting as Password item + /// + [Serializable] + [DataContract] + public sealed class SettingItemPassword : SettingItem + { + public override SettingItemType Type => SettingItemType.Password; + + [DataMember(Name = "Value")] + private PasswordHolder PasswordHolder + { + get + { + return (PasswordHolder)Value; + } + set + { + Value = passwordHolder; + } + } + + public SettingItemPassword() + { + } + + public SettingItemPassword(string name, PasswordHolder passwordHolder, int sortIndex = 0) + : base(name, passwordHolder, sortIndex) + { + } + + private SettingItemPassword(SettingItemPassword P_0) + : base(P_0) + { + } + + public override SettingItem GetCopy() + { + return new SettingItemPassword(this); + } + + public static implicit operator PasswordHolder(SettingItemPassword item) + { + return (PasswordHolder)item.Value; + } + + protected override bool IsValueTypeValid(object value) + { + return value is PasswordHolder; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + PasswordHolder passwordHolder = new PasswordHolder(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), SavePassword: true, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + passwordHolder.FromXElement(xElement, deserializationInfo); + PasswordHolder = passwordHolder; + } + } + + internal override void ?(object P_0, bool P_1 = false) + { + PasswordHolder passwordHolder = this; + base.?(P_0, P_1); + ((PasswordHolder)Value).RecoverUrl = passwordHolder.RecoverUrl; + } + } + [Serializable] + [DataContract] + public class PasswordHolder : IXElementSerialization, ICloneable + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private bool ?? = true; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private bool ??; + + public string Password + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Password")] + private string EncryptedPassword + { + get + { + if (!SavePassword) + { + return string.Empty; + } + return Encryptor.?(Password); + } + set + { + Password = Encryptor.?(text); + } + } + + [DataMember(Name = "SavePassword")] + public bool SavePassword + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string RecoverUrl + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + public bool FailedToRestorePassword + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = flag; + } + } + + public PasswordHolder(string Password = "", bool SavePassword = true, string recoverUrl = "") + { + this.Password = Password; + this.SavePassword = SavePassword; + RecoverUrl = recoverUrl; + } + + public object Clone() + { + return new PasswordHolder(Password, SavePassword, RecoverUrl); + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), EncryptedPassword)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SavePassword)); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + EncryptedPassword = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; + SavePassword = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); + if (!string.IsNullOrEmpty(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value) && string.IsNullOrEmpty(EncryptedPassword)) + { + FailedToRestorePassword = true; + } + } + } + /// + /// Typecasts setting as Period item + /// + [Serializable] + [Published] + [DataContract] + [ProtoContract] + public sealed class SettingItemPeriod : SettingItem + { + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private BasePeriod[] ??; + + public override SettingItemType Type => SettingItemType.Period; + + public int MultiplierMinimum + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int MultiplierMaximum + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public BasePeriod[] ExcludedPeriods + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Value")] + [ProtoMember(1)] + private Period ValuePeriod + { + get + { + if (value != null) + { + return (Period)value; + } + return default(Period); + } + set + { + value = period; + } + } + + public SettingItemPeriod() + { + } + + public SettingItemPeriod(string name, Period value, int sortIndex = 0) + : base(name, value, sortIndex) + { + MultiplierMinimum = 1; + MultiplierMaximum = int.MaxValue; + } + + private SettingItemPeriod(SettingItemPeriod P_0) + : base(P_0) + { + MultiplierMinimum = P_0.MultiplierMinimum; + MultiplierMaximum = P_0.MultiplierMaximum; + ExcludedPeriods = P_0.ExcludedPeriods; + } + + [NotPublished] + public override SettingItem GetCopy() + { + return new SettingItemPeriod(this); + } + + [NotPublished] + public static implicit operator Period(SettingItemPeriod item) + { + return (Period)item.Value; + } + + [NotPublished] + protected override bool IsValueTypeValid(object value) + { + return value is Period; + } + + [NotPublished] + protected override object ValidateValue(object value) + { + Period period = (Period)value; + if (period.PeriodMultiplier < MultiplierMinimum) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(17, 3); + defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + defaultInterpolatedStringHandler.AppendFormatted(MultiplierMinimum); + throw new ArgumentException(defaultInterpolatedStringHandler.ToStringAndClear()); + } + if (period.PeriodMultiplier > MultiplierMaximum) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(17, 3); + defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + defaultInterpolatedStringHandler.AppendFormatted(MultiplierMaximum); + throw new ArgumentException(defaultInterpolatedStringHandler.ToStringAndClear()); + } + BasePeriod[] excludedPeriods = ExcludedPeriods; + if (excludedPeriods != null && excludedPeriods.Contains(period.BasePeriod)) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return value; + } + + [NotPublished] + protected override XElement ValueToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((IXElementSerialization)Value).ToXElement())); + return xElement; + } + + [NotPublished] + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + if (xElement != null) + { + XElement xElement2 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + Period period = default(Period); + period.FromXElement(xElement2.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()), deserializationInfo); + value = period; + } + } + } + } + public class SettingItemPnlAlertsContainer : SettingItem + { + public override SettingItemType Type => SettingItemType.PnlAlertsContainer; + + [DataMember(Name = "Value")] + [ProtoMember(1)] + private PnlAlertsContainer PnlAlertsContainer + { + get + { + return (PnlAlertsContainer)Value; + } + set + { + Value = pnlAlertsContainer; + } + } + + public SettingItemPnlAlertsContainer() + { + } + + public SettingItemPnlAlertsContainer(string name, PnlAlertsContainer pnLAlertsCollection, int sortIndex = 0) + : base(name, pnLAlertsCollection, sortIndex) + { + } + + public SettingItemPnlAlertsContainer(SettingItemPnlAlertsContainer settingItem) + : base(settingItem) + { + value = ((PnlAlertsContainer)settingItem.Value).Clone(); + } + + public override SettingItem GetCopy() + { + return new SettingItemPnlAlertsContainer(this); + } + + protected override bool IsValueTypeValid(object value) + { + return value is PnlAlertsContainer; + } + + protected override XElement ValueToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + PnlAlertItem[] pnlAlerts = PnlAlertsContainer.PnlAlerts; + foreach (PnlAlertItem pnlAlertItem in pnlAlerts) + { + XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), pnlAlertItem.IsChecked)); + if (pnlAlertItem.Symbol != null) + { + xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), pnlAlertItem.Symbol.CreateInfo().ToXElement())); + } + xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), pnlAlertItem.TargetValue)); + xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), pnlAlertItem.Increment)); + xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), pnlAlertItem.Precision)); + xElement.Add(xElement2); + } + return xElement; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + element = xElement; + } + List list = new List(); + IEnumerable enumerable = element.Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (enumerable != null) + { + foreach (XElement item in enumerable) + { + PnlAlertItem pnlAlertItem = new PnlAlertItem + { + IsChecked = (item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToBool() ?? false), + TargetValue = (item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToDouble() ?? 0.0), + Increment = (item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToDouble() ?? 1.0), + Precision = (item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToInt() ?? 0) + }; + XElement xElement2 = item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + XElement xElement3 = xElement2.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + BusinessObjectInfo businessObjectInfo = new BusinessObjectInfo(); + businessObjectInfo.FromXElement(xElement3, deserializationInfo); + pnlAlertItem.Symbol = Core.Instance.GetSymbol(businessObjectInfo); + } + } + list.Add(pnlAlertItem); + } + } + Value = new PnlAlertsContainer + { + PnlAlerts = list.ToArray() + }; + } + } + public class SettingitemPoints : SettingItem + { + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private Func ??; + + [CompilerGenerated] + private bool ??; + + public override SettingItemType Type => SettingItemType.DrawingPoints; + + public int PointsInitialized + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Func FindVariableTick + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool EnablePriceSelection + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SettingitemPoints() + { + } + + public SettingitemPoints(string name, double[][] Points, int sortIndex = 0) + : base(name, Points, sortIndex) + { + EnablePriceSelection = true; + Value = ?(Points); + } + + private SettingitemPoints(SettingitemPoints P_0) + { + EnablePriceSelection = P_0.EnablePriceSelection; + Value = ?((double[][])P_0.value); + } + + public override SettingItem GetCopy() + { + return new SettingitemPoints(this); + } + + protected override bool IsValueTypeValid(object value) + { + return value is double[][]; + } + + protected override XElement ValueToXElement() + { + double[][] array = (double[][])Value; + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), array.Length)); + XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + double[][] array2 = array; + foreach (double[] array3 in array2) + { + XElement xElement3 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement3.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), array3[0])); + xElement3.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), array3[1])); + xElement2.Add(xElement3); + } + xElement.Add(xElement2); + return xElement; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement? xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + int level = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt(); + double[][] array = InitPoints(level); + int num = 0; + foreach (XElement item in xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Elements()) + { + array[num][0] = item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToDouble(); + array[num][1] = item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToDouble(); + num++; + } + value = array; + } + + protected double[][] InitPoints(int level) + { + double[][] array = new double[level][]; + for (int i = 0; i < array.Length; i++) + { + array[i] = new double[2]; + } + return array; + } + + private double[][] ?(double[][] P_0) + { + double[][] array = InitPoints(P_0.Length); + for (int i = 0; i < P_0.GetLength(0); i++) + { + double[] array2 = P_0[i]; + for (int j = 0; j < array2.Length; j++) + { + array[i][j] = array2[j]; + } + } + return array; + } + } + [Serializable] + [DataContract] + public sealed class SettingItemRadioLocalized : SettingItem + { + [CompilerGenerated] + private new sealed class ? + { + public object ??; + + internal bool ?(SelectItem P_0) + { + return P_0.Value.CompareTo(??) == 0; + } + } + + private List ??; + + public override SettingItemType Type => SettingItemType.RadioLocalized; + + [Bindable("items")] + public List Items + { + get + { + return ??; + } + set + { + SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + [DataMember(Name = "Value")] + private SelectItem SeletedItem + { + get + { + return Value as SelectItem; + } + set + { + Value = selectItem; + } + } + + public SettingItemRadioLocalized() + { + } + + public SettingItemRadioLocalized(string name, SelectItem value, List items, int sortIndex = 0) + : base(name, value, sortIndex) + { + Items = items; + } + + private SettingItemRadioLocalized(SettingItemRadioLocalized P_0) + : base(P_0) + { + Items = P_0.Items; + } + + public override SettingItem GetCopy() + { + return new SettingItemRadioLocalized(this); + } + + public static implicit operator SelectItem(SettingItemRadioLocalized item) + { + return item.Value as SelectItem; + } + + protected override bool IsValueTypeValid(object value) + { + return value is SelectItem; + } + + internal override void ?(object P_0, bool P_1 = false) + { + if (!(P_0 is SelectItem)) + { + SelectItem selectItem = Items?.FirstOrDefault((SelectItem selectItem2) => selectItem2.Value.CompareTo(P_0) == 0); + P_0 = selectItem ?? new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), (IComparable)P_0); + } + base.?(P_0, P_1); + } + + protected override XElement ValueToXElement() + { + string content = string.Empty; + if (SeletedItem != null) + { + if (SeletedItem.Value is int num) + { + content = num.ToString(); + } + else if (SeletedItem.Value != null) + { + content = SeletedItem.Value.ToString(); + } + } + return new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), content); + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + if (int.TryParse(xElement.Value, out var result)) + { + SeletedItem = new SelectItem(string.Empty, result); + } + else + { + SeletedItem = new SelectItem(string.Empty, xElement.Value); + } + } + } + } + public class SettingItemRangeSelector : SettingItem + { + public override SettingItemType Type => SettingItemType.RangeSelector; + + [DataMember(Name = "Value")] + [ProtoMember(29)] + private DateTimeRange ValueSelector + { + get + { + return (DateTimeRange)value; + } + set + { + value = dateTimeRange; + } + } + + public SettingItemRangeSelector() + { + } + + public SettingItemRangeSelector(string name, DateTimeRange value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemRangeSelector(SettingItemRangeSelector P_0) + : base(P_0) + { + } + + public override SettingItem GetCopy() + { + return new SettingItemRangeSelector(this); + } + + protected override bool IsValueTypeValid(object value) + { + return Value is DateTimeRange; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + base.ValueFromXElement(element, deserializationInfo); + DateTimeRange dateTimeRange = new DateTimeRange(); + dateTimeRange.FromXElement(element, deserializationInfo); + ValueSelector = dateTimeRange; + } + } + [Serializable] + [DataContract] + public sealed class SettingItemRss : SettingItem + { + public override SettingItemType Type => SettingItemType.Rss; + + [DataMember(Name = "Value")] + private Rss ValueRss + { + get + { + return Value as Rss; + } + set + { + Value = rss; + } + } + + public SettingItemRss() + { + } + + public SettingItemRss(string name, Rss value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemRss(SettingItemRss P_0) + : base(P_0) + { + } + + public override SettingItem GetCopy() + { + return new SettingItemRss(this); + } + + protected override bool IsValueTypeValid(object value) + { + return value is Rss; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + Rss rss = new Rss(); + rss.FromXElement(element, deserializationInfo); + Value = rss; + } + } + /// + /// Typecasts setting as ComboBox item + /// + [Serializable] + [Published] + [DataContract] + [ProtoContract] + public sealed class SettingItemSelector : SettingItem + { + private IEnumerable ??; + + public override SettingItemType Type => SettingItemType.Selector; + + [Bindable("items")] + public IEnumerable Items + { + get + { + return ??; + } + set + { + SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + [DataMember(Name = "Value")] + [ProtoMember(1)] + private string ValueString + { + get + { + return Value as string; + } + set + { + Value = text; + } + } + + public SettingItemSelector() + { + } + + public SettingItemSelector(string name, string value, IEnumerable items, int sortIndex = 0) + : base(name, value, sortIndex) + { + Items = items; + } + + private SettingItemSelector(SettingItemSelector P_0) + : base(P_0) + { + Items = P_0.Items; + } + + [NotPublished] + public override SettingItem GetCopy() + { + return new SettingItemSelector(this); + } + + [NotPublished] + public static implicit operator string(SettingItemSelector item) + { + return item.Value as string; + } + + [NotPublished] + protected override bool IsValueTypeValid(object value) + { + return value is string; + } + } + [Serializable] + [DataContract] + [ProtoContract] + public sealed class SettingItemSelectorLocalized : SettingItem + { + [CompilerGenerated] + private new sealed class ? + { + public SelectItem ??; + + internal bool ?(SelectItem P_0) + { + IComparable value = P_0.Value; + if (value == null) + { + return false; + } + return value.CompareTo(??.Value) == 0; + } + } + + [CompilerGenerated] + private sealed class ? + { + public object ??; + + internal bool ?(SelectItem P_0) + { + return P_0.Value.CompareTo(??) == 0; + } + } + + [CompilerGenerated] + private sealed class ? + { + public IComparable ??; + + internal bool ?(SelectItem P_0) + { + return P_0.Value.CompareTo(??) == 0; + } + } + + private List ??; + + public override SettingItemType Type => SettingItemType.SelectorLocalized; + + [Bindable("items")] + public List Items + { + get + { + return ??; + } + set + { + SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + private SelectItem SeletedItem + { + get + { + return Value as SelectItem; + } + set + { + Value = selectItem; + } + } + + [DataMember(Name = "Value")] + [ProtoMember(1)] + private string SerializeValue + { + get + { + string result = string.Empty; + if (SeletedItem == null) + { + return result; + } + if (SeletedItem.Value is int || SeletedItem.Value is Enum) + { + result = ((int)(object)SeletedItem.Value).ToString(); + } + else if (SeletedItem.Value != null) + { + result = SeletedItem.Value.ToString(); + } + return result; + } + set + { + if (int.TryParse(s, out var result)) + { + SeletedItem = new SelectItem(string.Empty, result); + } + else + { + SeletedItem = new SelectItem(string.Empty, s); + } + } + } + + public SettingItemSelectorLocalized() + { + } + + public SettingItemSelectorLocalized(string name, SelectItem value, List items, int sortIndex = 0) + : base(name, value, sortIndex) + { + Items = items; + } + + public SettingItemSelectorLocalized(string name, IComparable value, List items, int sortIndex = 0) + : this(name, items?.FirstOrDefault((SelectItem P_0) => P_0.Value.CompareTo(value) == 0), items, sortIndex) + { + } + + private SettingItemSelectorLocalized(SettingItemSelectorLocalized P_0) + : base(P_0) + { + Items = P_0.Items; + } + + public override SettingItem GetCopy() + { + return new SettingItemSelectorLocalized(this); + } + + public static implicit operator SelectItem(SettingItemSelectorLocalized item) + { + return item.Value as SelectItem; + } + + protected override bool IsValueTypeValid(object value) + { + return value is SelectItem; + } + + protected override object ValidateValue(object value) + { + SelectItem ?? = value as SelectItem; + if (?? == null) + { + return Value; + } + if (Items == null || Items.Count == 0) + { + return value; + } + if (Items.Any(delegate(SelectItem P_0) + { + IComparable comparable = P_0.Value; + return comparable != null && comparable.CompareTo(??.Value) == 0; + })) + { + return value; + } + return Value; + } + + internal override void ?(object P_0, bool P_1 = false) + { + if (P_0 is SelectItem selectItem) + { + P_0 = selectItem.Value; + } + SelectItem selectItem2 = Items?.FirstOrDefault((SelectItem selectItem3) => selectItem3.Value.CompareTo(P_0) == 0); + P_0 = selectItem2 ?? new SelectItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), (IComparable)P_0); + base.?(P_0, P_1); + } + + internal override void ?(SettingItem P_0) + { + if (P_0 is SettingItemSelectorLocalized { Items: not null } settingItemSelectorLocalized) + { + Items = settingItemSelectorLocalized.Items; + } + base.?(P_0); + } + + protected override XElement ValueToXElement() + { + return new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SerializeValue); + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + SerializeValue = xElement.Value; + } + } + } + [Serializable] + [DataContract] + [ProtoContract] + public class SettingItemSlider : SettingItem + { + private ulong ??; + + public override SettingItemType Type => SettingItemType.Slider; + + [Bindable("stepsCount")] + public ulong StepsCount + { + get + { + return ??; + } + set + { + SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + [DataMember(Name = "Value")] + [ProtoMember(1)] + private ulong ValueUlong + { + get + { + return (ulong)Value; + } + set + { + Value = num; + } + } + + public SettingItemSlider() + { + } + + public SettingItemSlider(string name, ulong value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemSlider(SettingItemSlider P_0) + : base(P_0) + { + StepsCount = P_0.StepsCount; + } + + [NotPublished] + public static implicit operator ulong(SettingItemSlider item) + { + return (ulong)item.Value; + } + + [NotPublished] + public override SettingItem GetCopy() + { + return new SettingItemSlider(this); + } + + [NotPublished] + protected override bool IsValueTypeValid(object value) + { + return value is ulong; + } + + [NotPublished] + protected override object ValidateValue(object value) + { + value = base.ValidateValue(value); + return Math.Min((ulong)value, StepsCount); + } + } + [Serializable] + [DataContract] + public class SettingItemSound : SettingItem + { + public bool EnableSounds; + + public override SettingItemType Type => SettingItemType.Sound; + + [DataMember(Name = "Value")] + private Dictionary ValuDictionrary + { + get + { + return value as Dictionary; + } + set + { + value = dictionary; + } + } + + public SettingItemSound() + { + } + + public SettingItemSound(string name, Dictionary value, bool enableSounds = true, int sortIndex = 0) + : base(name, value, sortIndex) + { + EnableSounds = enableSounds; + } + + private SettingItemSound(SettingItemSound P_0) + : base(P_0) + { + EnableSounds = P_0.EnableSounds; + } + + public override SettingItem GetCopy() + { + return new SettingItemSound(this); + } + + protected override bool IsValueTypeValid(object value) + { + return value is Dictionary; + } + + protected override XElement ValueToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), EnableSounds)); + foreach (KeyValuePair item in ValuDictionrary) + { + xElement.Add(item.Value.ToXElement()); + } + return xElement; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + EnableSounds = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); + Dictionary dictionary = new Dictionary(); + foreach (XElement item in xElement.Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + SoundItem soundItem = new SoundItem(); + soundItem.FromXElement(item, deserializationInfo); + dictionary[soundItem.Name] = soundItem; + } + ValuDictionrary = dictionary; + } + } + /// + /// Typecasts setting as TextBox item + /// + [Serializable] + [Published] + [DataContract] + [ProtoContract] + public sealed class SettingItemString : SettingItem + { + [CompilerGenerated] + private bool ??; + + public override SettingItemType Type => SettingItemType.String; + + public bool ApplyOnEachInput + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Value")] + [ProtoMember(1)] + private string ValueString + { + get + { + return Value as string; + } + set + { + Value = text; + } + } + + public SettingItemString() + { + } + + public SettingItemString(string name, string value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemString(SettingItemString P_0) + : base(P_0) + { + } + + [NotPublished] + public static implicit operator string(SettingItemString item) + { + return item.Value as string; + } + + [NotPublished] + public override SettingItem GetCopy() + { + return new SettingItemString(this); + } + + [NotPublished] + protected override bool IsValueTypeValid(object value) + { + return value is string; + } + } + /// + /// Typecasts setting as SymbolLookup item + /// + [Serializable] + [DataContract] + public sealed class SettingItemSymbol : SettingItem + { + public override SettingItemType Type => SettingItemType.Symbol; + + [DataMember(Name = "Value")] + private BusinessObjectInfo ValueInfo + { + get + { + return (Value as Symbol)?.CreateInfo() ?? BusinessObjectInfo.Empty; + } + set + { + if (!(businessObjectInfo == BusinessObjectInfo.Empty) && !(businessObjectInfo == SymbolInfo.Empty)) + { + Value = Core.Instance.GetSymbol(businessObjectInfo); + } + } + } + + public SettingItemSymbol() + { + } + + public SettingItemSymbol(string name, Symbol value = null, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemSymbol(SettingItemSymbol P_0) + : base(P_0) + { + } + + public override SettingItem GetCopy() + { + return new SettingItemSymbol(this); + } + + public static implicit operator Symbol(SettingItemSymbol item) + { + return item.Value as Symbol; + } + + protected override bool IsValueTypeValid(object value) + { + return value is Symbol; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + SymbolInfo empty = SymbolInfo.Empty; + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + empty.FromXElement(xElement, deserializationInfo); + ValueInfo = empty; + } + } + + protected override XElement ValueToXElement() + { + return ValueInfo.ToXElement(); + } + } + /// + /// Typecasts setting as TextBox item + /// + [Serializable] + [DataContract] + [ProtoContract] + public sealed class SettingItemTextArea : SettingItem + { + [CompilerGenerated] + private bool ??; + + public override SettingItemType Type => SettingItemType.TextArea; + + public bool ApplyOnEachInput + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Value")] + [ProtoMember(1)] + private string ValueString + { + get + { + return Value as string; + } + set + { + Value = text; + } + } + + public SettingItemTextArea() + { + } + + public SettingItemTextArea(string name, string value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemTextArea(SettingItemTextArea P_0) + : base(P_0) + { + } + + public override SettingItem GetCopy() + { + return new SettingItemTextArea(this); + } + + public static implicit operator string(SettingItemTextArea item) + { + return item.Value as string; + } + + protected override bool IsValueTypeValid(object value) + { + return value is string; + } + } + public class SettingItemTimeFrameConfig : SettingItem + { + public override SettingItemType Type => SettingItemType.TimeFrameConfig; + + [DataMember(Name = "Value")] + private string ValueString + { + get + { + return Value as string; + } + set + { + Value = text; + } + } + + public SettingItemTimeFrameConfig() + { + } + + public SettingItemTimeFrameConfig(string name, TimeFrameConfig value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemTimeFrameConfig(SettingItemTimeFrameConfig P_0) + : base(P_0) + { + } + + public override SettingItem GetCopy() + { + return new SettingItemTimeFrameConfig(this); + } + + protected override bool IsValueTypeValid(object value) + { + return value is TimeFrameConfig; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + TimeFrameConfig timeFrameConfig = new TimeFrameConfig(); + timeFrameConfig.FromXElement(element, deserializationInfo); + Value = timeFrameConfig; + } + } + public class SettingItemTimeInTradeContainer : SettingItem + { + [DataMember(Name = "Value")] + [ProtoMember(1)] + private TimeInTradeContainer TimeInTradeContainer + { + get + { + return (TimeInTradeContainer)Value; + } + set + { + Value = timeInTradeContainer; + } + } + + public override SettingItemType Type => SettingItemType.TimeInTradeContainer; + + public SettingItemTimeInTradeContainer() + { + } + + public SettingItemTimeInTradeContainer(string name, TimeInTradeContainer timeInTradeCollection, int sortIndex = 0) + : base(name, timeInTradeCollection, sortIndex) + { + } + + public SettingItemTimeInTradeContainer(SettingItemTimeInTradeContainer settingItem) + { + value = ((TimeInTradeContainer)settingItem.Value).Clone(); + } + + public override SettingItem GetCopy() + { + return new SettingItemTimeInTradeContainer(this); + } + + protected override bool IsValueTypeValid(object value) + { + return value is TimeInTradeContainer; + } + + protected override XElement ValueToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + TimeInTradeItem[] timeInTradeItems = TimeInTradeContainer.TimeInTradeItems; + foreach (TimeInTradeItem timeInTradeItem in timeInTradeItems) + { + XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), timeInTradeItem.IsChecked)); + if (timeInTradeItem.Symbol != null) + { + xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), timeInTradeItem.Symbol.CreateInfo().ToXElement())); + } + xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), timeInTradeItem.TimeInSeconds)); + xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)timeInTradeItem.PLDirection)); + xElement.Add(xElement2); + } + return xElement; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + element = xElement; + } + List list = new List(); + IEnumerable enumerable = element.Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (enumerable != null) + { + foreach (XElement item in enumerable) + { + TimeInTradeItem timeInTradeItem = new TimeInTradeItem + { + IsChecked = (item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToBool() ?? false), + TimeInSeconds = (item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToInt() ?? 0), + PLDirection = (TimeInTradePlDirection)(item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToInt() ?? 0) + }; + XElement xElement2 = item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + XElement xElement3 = xElement2.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + BusinessObjectInfo businessObjectInfo = new BusinessObjectInfo(); + businessObjectInfo.FromXElement(xElement3, deserializationInfo); + timeInTradeItem.Symbol = Core.Instance.GetSymbol(businessObjectInfo); + } + } + list.Add(timeInTradeItem); + } + } + Value = new TimeInTradeContainer + { + TimeInTradeItems = list.ToArray() + }; + } + } + [Serializable] + [DataContract] + [ProtoContract] + public sealed class SettingItemTimeZone : SettingItem + { + [CompilerGenerated] + private bool ??; + + [DataMember(Name = "Type")] + [ProtoMember(1)] + private TimeZoneType ??; + + [DataMember(Name = "InfoId")] + [ProtoMember(2)] + private string ??; + + [DataMember(Name = "BaseUtcOffset")] + [ProtoMember(3)] + private TimeSpan ??; + + [DataMember(Name = "DisplayName")] + [ProtoMember(4)] + private string ??; + + [DataMember(Name = "StandardDisplayName")] + [ProtoMember(5)] + private string ??; + + public override SettingItemType Type => SettingItemType.TimeZone; + + public bool IsFavorite + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override object Value + { + get + { + if (?? == TimeZoneType.Local) + { + return new TimeZone(??); + } + TimeZoneInfo timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(??); + if (timeZoneInfo == null) + { + timeZoneInfo = TimeZoneInfo.CreateCustomTimeZone(??, ??, ??, ??); + } + return new TimeZone(??, timeZoneInfo); + } + set + { + base.Value = value; + } + } + + public SettingItemTimeZone() + { + } + + public SettingItemTimeZone(string name, TimeZone value, int sortIndex = 0) + : base(name, value, sortIndex) + { + ?? = value.Type; + ?? = value.TimeZoneInfo.Id; + ?? = value.TimeZoneInfo.BaseUtcOffset; + ?? = value.TimeZoneInfo.DisplayName; + ?? = value.TimeZoneInfo.StandardName; + } + + private SettingItemTimeZone(SettingItemTimeZone P_0) + : base(P_0) + { + ?? = P_0.??; + ?? = P_0.??; + ?? = P_0.??; + ?? = P_0.??; + ?? = P_0.??; + } + + public override SettingItem GetCopy() + { + return new SettingItemTimeZone(this); + } + + public static implicit operator TimeZone(SettingItemTimeZone item) + { + return (TimeZone)item.Value; + } + + protected override bool IsValueTypeValid(object value) + { + return value is TimeZone; + } + + protected override XElement ValueToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)??)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ??)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ??)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ??)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ??)); + return xElement; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + ?? = (TimeZoneType)xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt(); + ?? = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; + ?? = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToTimeSpan(); + ?? = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; + ?? = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; + } + } + } + [Serializable] + [DataContract] + public class SettingItemTimeZoneManager : SettingItemList + { + public override SettingItemType Type => SettingItemType.TimeZoneManager; + + public List FavoriteTimeZones + { + get + { + List list = new List(); + foreach (SettingItemTimeZone item in Value as List) + { + if (item.IsFavorite) + { + list.Add((TimeZone)item.Value); + } + } + return list; + } + } + + [DataMember(Name = "Items")] + protected override List Items + { + get + { + List list = new List(); + foreach (SettingItemTimeZone item in Value as List) + { + if (item.IsFavorite) + { + list.Add(item); + } + } + return list; + } + set + { + Value = ?(value); + } + } + + public SettingItemTimeZoneManager() + { + } + + public SettingItemTimeZoneManager(string name, IList items, int sortIndex = 0) + : base(name, new List(), sortIndex) + { + Value = ?(items); + } + + private SettingItemTimeZoneManager(SettingItemTimeZoneManager P_0) + : base(P_0) + { + Value = ?(CopyItems()); + } + + public override SettingItem GetCopy() + { + return new SettingItemTimeZoneManager(this); + } + + protected override bool IsValueTypeValid(object value) + { + return value is IList; + } + + private new List ?(IList P_0) + { + List list = new List(); + Dictionary dictionary = new Dictionary(); + foreach (SettingItem item in P_0) + { + if (item is SettingItemTimeZone settingItemTimeZone) + { + dictionary[((TimeZone)settingItemTimeZone.Value).TimeZoneInfo.Id] = settingItemTimeZone; + } + } + foreach (TimeZoneInfo systemTimeZone in TimeZoneInfo.GetSystemTimeZones()) + { + SettingItemTimeZone settingItemTimeZone2 = new SettingItemTimeZone(systemTimeZone.Id, new TimeZone(TimeZoneType.Specific, systemTimeZone)); + if (dictionary.ContainsKey(systemTimeZone.Id)) + { + settingItemTimeZone2.IsFavorite = true; + } + list.Add(settingItemTimeZone2); + } + return list; + } + + protected override XElement ValueToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + List items = Items; + for (int i = 0; i < items.Count; i++) + { + xElement.Add(items[i].ToXElement()); + } + return xElement; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + List list = new List(); + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + foreach (XElement item in xElement.Elements()) + { + SettingItemTimeZone settingItemTimeZone = new SettingItemTimeZone(); + settingItemTimeZone.FromXElement(item, deserializationInfo); + list.Add(settingItemTimeZone); + } + } + Items = list; + } + } + [Serializable] + public class SelectItem : IEquatable + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private IComparable ??; + + [CompilerGenerated] + private SettingItemSeparatorGroup ??; + + [CompilerGenerated] + private object ??; + + [CompilerGenerated] + private Action ??; + + public string Text + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IComparable Value + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SettingItemSeparatorGroup SeparatorGroup + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public object SelectConfirmation + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Action Action + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SelectItem(string text, IComparable value = null) + { + Text = text; + Value = value ?? Text; + } + + public SelectItem(string text, int value) + { + Text = text; + Value = value; + } + + public SelectItem(string text, string value) + { + Text = text; + Value = value; + } + + public override string ToString() + { + return Text; + } + + public bool Equals(SelectItem other) + { + if (other == null) + { + return false; + } + if (this == other) + { + return true; + } + return object.Equals(Value, other.Value); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + if (this == obj) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((SelectItem)obj); + } + + public override int GetHashCode() + { + if (Value == null) + { + return 0; + } + return Value.GetHashCode(); + } + } + public class SettingItemEventArgs : EventArgs + { + public new static SettingItemEventArgs Empty => new SettingItemEventArgs(); + } + public delegate void SettingItemEventHandler(SettingItem sender, SettingItemEventArgs e); + public class SettingsHolder : Dictionary + { + public SettingsHolder(IList settings) + { + if (settings == null) + { + return; + } + foreach (SettingItem setting in settings) + { + if (!ContainsKey(setting.Name)) + { + Add(setting.Name, setting); + } + } + } + } + public sealed class SymbolMap : IDisposable, IUniqueID, ICustomizable, IConnectionStateDependent + { + [CompilerGenerated] + private sealed class ? + { + public SymbolMap ??; + + public Symbol ??; + + internal void ?() + { + ??.?(??.TradableSymbol); + ??.?? = ??; + ??.?(??.QuotesSymbol); + ??.?(??.TradableSymbol); + } + } + + [CompilerGenerated] + private sealed class ? + { + public SymbolMap ??; + + public bool ??; + + internal void ?() + { + ??.?(??.TradableSymbol); + ??.?? = ??; + ??.?(?? ? ??.QuotesSymbol : ??.TradableSymbol); + ??.?(??.TradableSymbol); + } + } + + [CompilerGenerated] + private sealed class ? + { + public SymbolMap ??; + + public Symbol ??; + + public Symbol ??; + + public Action ??; + + internal void ?() + { + ??.?(??); + ??.?(delegate + { + ??.?(??); + ??.?? = ??; + ??.?(??.QuotesSymbol); + ??.?(??); + }); + ??.?(??); + } + + internal void ?() + { + ??.?(??); + ??.?? = ??; + ??.?(??.QuotesSymbol); + ??.?(??); + } + } + + [CompilerGenerated] + private string ??; + + private Symbol ??; + + private Symbol ??; + + [CompilerGenerated] + private Symbol ??; + + [CompilerGenerated] + private Symbol ??; + + [CompilerGenerated] + private Symbol ??; + + [CompilerGenerated] + private Symbol ??; + + private bool ??; + + private readonly ConnectionStateObserver ??; + + public string UniqueId => Id; + + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public Symbol TradableSymbol + { + get + { + return ??; + } + private set + { + if (?? == symbol) + { + return; + } + Symbol ?? = TradableSymbol; + ??.?(delegate + { + ?(??); + symbol.?(delegate + { + ?(symbol); + ?? = symbol; + ?(QuotesSymbol); + ?(symbol); + }); + ?(??); + }); + } + } + + public Symbol QuotesSymbol + { + get + { + return ??; + } + private set + { + if (?? != symbol) + { + TradableSymbol.?(delegate + { + ?(TradableSymbol); + ?? = symbol; + ?(QuotesSymbol); + ?(TradableSymbol); + }); + } + } + } + + public Symbol TickHistorySymbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = symbol; + } + } + + public Symbol MinuteHistorySymbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = symbol; + } + } + + public Symbol DayHistorySymbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = symbol; + } + } + + public Symbol VolumeAnalysisSymbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = symbol; + } + } + + public bool IsActive + { + get + { + return ??; + } + private set + { + if (?? == flag) + { + return; + } + if (TradableSymbol == null) + { + ?? = flag; + return; + } + TradableSymbol.?(delegate + { + ?(TradableSymbol); + ?? = flag; + ?(flag ? QuotesSymbol : TradableSymbol); + ?(TradableSymbol); + }); + } + } + + public IList Settings + { + get + { + return new List + { + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id), + new SettingItemSymbol(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TradableSymbol), + new SettingItemSymbol(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), QuotesSymbol), + new SettingItemSymbol(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TickHistorySymbol), + new SettingItemSymbol(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MinuteHistorySymbol), + new SettingItemSymbol(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), DayHistorySymbol), + new SettingItemSymbol(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), VolumeAnalysisSymbol), + new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsActive) + }; + } + set + { + Id = value.GetValueOrDefault(Id, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + ?? = value.GetValueOrDefault(??, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + ?? = value.GetValueOrDefault(??, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + TickHistorySymbol = value.GetValueOrDefault(TickHistorySymbol, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + MinuteHistorySymbol = value.GetValueOrDefault(MinuteHistorySymbol, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + DayHistorySymbol = value.GetValueOrDefault(DayHistorySymbol, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + VolumeAnalysisSymbol = value.GetValueOrDefault(VolumeAnalysisSymbol, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + IsActive = value.GetValueOrDefault(IsActive, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (value.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value2)) + { + VolumeAnalysisSymbol = value2; + } + else + { + VolumeAnalysisSymbol = DayHistorySymbol ?? MinuteHistorySymbol ?? TickHistorySymbol ?? QuotesSymbol; + } + } + } + + internal SymbolMap() + { + ?? = new ConnectionStateObserver(this, ConnectionStateObserverPriority.High, ConnectionState.Connected, ConnectionState.Disconnected, ConnectionState.ConnectionLost); + } + + internal SymbolMap(Symbol P_0) + : this() + { + Id = Guid.NewGuid().ToString(); + IsActive = true; + ?? = P_0; + } + + internal bool ?(Period P_0, out Symbol P_1) + { + P_1 = null; + if (P_0.BasePeriod >= BasePeriod.Day) + { + P_1 = DayHistorySymbol; + } + else if (P_0.BasePeriod >= BasePeriod.Minute) + { + P_1 = MinuteHistorySymbol; + } + else + { + P_1 = TickHistorySymbol; + } + return P_1 != null; + } + + internal void ?(SymbolMappingParameters P_0, bool P_1 = true) + { + IsActive = P_0.IsActive; + TradableSymbol = P_0.TradableSymbol; + if (P_1) + { + QuotesSymbol = P_0.QuotesSymbol; + } + else + { + ?? = P_0.QuotesSymbol; + } + TickHistorySymbol = P_0.TickHistorySymbol; + MinuteHistorySymbol = P_0.MinuteHistorySymbol; + DayHistorySymbol = P_0.DayHistorySymbol; + VolumeAnalysisSymbol = P_0.VolumeAnalysisSymbol; + } + + internal void ?() + { + QuotesSymbol = null; + TickHistorySymbol = null; + MinuteHistorySymbol = null; + DayHistorySymbol = null; + VolumeAnalysisSymbol = null; + } + + public SymbolMapState GetState() + { + return new SymbolMapState(this); + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(15, 6); + defaultInterpolatedStringHandler.AppendFormatted(TradableSymbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(QuotesSymbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(TickHistorySymbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(MinuteHistorySymbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(DayHistorySymbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(VolumeAnalysisSymbol); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public void Dispose() + { + ??.Dispose(); + } + + public ConnectionDependency GetConnectionStateDependency() + { + List list = new List { TradableSymbol.ConnectionId }; + ?(QuotesSymbol, list); + ?(TickHistorySymbol, list); + ?(MinuteHistorySymbol, list); + ?(DayHistorySymbol, list); + ?(VolumeAnalysisSymbol, list); + return new ConnectionDependency + { + Behavior = ConnectionDependencyBehavior.PartialDependency, + DependentConnectionsIds = list.ToArray() + }; + } + + public void OnConnectionStateChanged(Connection connection, ConnectionStateChangedEventArgs e) + { + string id = connection.Id; + if (TradableSymbol.ConnectionId == id) + { + TradableSymbol = Core.Instance.GetSymbol(TradableSymbol.CreateInfo()); + } + if (QuotesSymbol?.ConnectionId == id) + { + QuotesSymbol = Core.Instance.GetSymbol(QuotesSymbol.CreateInfo()); + } + if (TickHistorySymbol?.ConnectionId == id) + { + TickHistorySymbol = Core.Instance.GetSymbol(TickHistorySymbol.CreateInfo()); + } + if (MinuteHistorySymbol?.ConnectionId == id) + { + MinuteHistorySymbol = Core.Instance.GetSymbol(MinuteHistorySymbol.CreateInfo()); + } + if (DayHistorySymbol?.ConnectionId == id) + { + DayHistorySymbol = Core.Instance.GetSymbol(DayHistorySymbol.CreateInfo()); + } + if (VolumeAnalysisSymbol?.ConnectionId == id) + { + VolumeAnalysisSymbol = Core.Instance.GetSymbol(VolumeAnalysisSymbol.CreateInfo()); + } + } + + private void ?(Symbol P_0, List P_1) + { + if (P_0 != null) + { + P_1.Add(P_0.ConnectionId); + } + } + + private void ?(Symbol P_0) + { + if (P_0.QuotesSubscribed) + { + P_0.SubscribeAction(SubscribeQuoteType.Quote); + } + if (P_0.Level2Subscribed) + { + P_0.SubscribeAction(SubscribeQuoteType.Level2); + } + if (P_0.LastsSubscribed) + { + P_0.SubscribeAction(SubscribeQuoteType.Last); + } + if (P_0.MarkSubscribed) + { + P_0.SubscribeAction(SubscribeQuoteType.Mark); + } + } + + private void ?(Symbol P_0) + { + if (P_0.QuotesSubscribed) + { + P_0.UnSubscribeAction(SubscribeQuoteType.Quote); + } + if (P_0.Level2Subscribed) + { + P_0.UnSubscribeAction(SubscribeQuoteType.Level2); + } + if (P_0.LastsSubscribed) + { + P_0.UnSubscribeAction(SubscribeQuoteType.Last); + } + if (P_0.MarkSubscribed) + { + P_0.UnSubscribeAction(SubscribeQuoteType.Mark); + } + } + + private void ?(Symbol P_0) + { + if (P_0 != null && TradableSymbol.HasAnySubscription) + { + DayBar dayBar = ?(P_0); + dayBar.FullRefresh = true; + TradableSymbol.?(dayBar); + } + } + + private DayBar ?(Symbol P_0) + { + return ((IMessageBuilder)P_0).BuildMessage(); + } + } + public class SymbolMappingParameters + { + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private Symbol ??; + + [CompilerGenerated] + private Symbol ??; + + [CompilerGenerated] + private Symbol ??; + + [CompilerGenerated] + private Symbol ??; + + [CompilerGenerated] + private Symbol ??; + + [CompilerGenerated] + private Symbol ??; + + public bool IsActive + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Symbol TradableSymbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Symbol QuotesSymbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Symbol TickHistorySymbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Symbol MinuteHistorySymbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Symbol DayHistorySymbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Symbol VolumeAnalysisSymbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SymbolMappingParameters(Symbol tradableSymbol) + { + TradableSymbol = tradableSymbol; + } + + public SymbolMappingParameters(SymbolMap symbolMap) + { + IsActive = symbolMap.IsActive; + TradableSymbol = symbolMap.TradableSymbol; + QuotesSymbol = symbolMap.QuotesSymbol; + TickHistorySymbol = symbolMap.TickHistorySymbol; + MinuteHistorySymbol = symbolMap.MinuteHistorySymbol; + DayHistorySymbol = symbolMap.DayHistorySymbol; + VolumeAnalysisSymbol = symbolMap.VolumeAnalysisSymbol; + } + } + public sealed class SymbolMapState + { + [CompilerGenerated] + private readonly bool ??; + + [CompilerGenerated] + private readonly Symbol ??; + + [CompilerGenerated] + private readonly Symbol ??; + + [CompilerGenerated] + private readonly Symbol ??; + + [CompilerGenerated] + private readonly Symbol ??; + + [CompilerGenerated] + private readonly Symbol ??; + + [CompilerGenerated] + private readonly Symbol ??; + + public bool IsActive + { + [CompilerGenerated] + get + { + return ??; + } + } + + public Symbol TradableSymbol + { + [CompilerGenerated] + get + { + return ??; + } + } + + public Symbol QuotesSymbol + { + [CompilerGenerated] + get + { + return ??; + } + } + + public Symbol TickHistorySymbol + { + [CompilerGenerated] + get + { + return ??; + } + } + + public Symbol MinuteHistorySymbol + { + [CompilerGenerated] + get + { + return ??; + } + } + + public Symbol DayHistorySymbol + { + [CompilerGenerated] + get + { + return ??; + } + } + + public Symbol VolumeAnalysisSymbol + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal SymbolMapState(SymbolMap P_0) + { + ?? = P_0.IsActive; + ?? = P_0.TradableSymbol; + ?? = P_0.QuotesSymbol; + ?? = P_0.TickHistorySymbol; + ?? = P_0.MinuteHistorySymbol; + ?? = P_0.DayHistorySymbol; + ?? = P_0.VolumeAnalysisSymbol; + } + } + public class SymbolsMappingEventArgs : EventArgs + { + [CompilerGenerated] + private SymbolMap ??; + + [CompilerGenerated] + private readonly SymbolMapState ??; + + public SymbolMap SymbolMap + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = symbolMap; + } + } + + public SymbolMapState PreviousState + { + [CompilerGenerated] + get + { + return ??; + } + } + + public SymbolsMappingEventArgs(SymbolMap symbolMap, SymbolMapState previousState = null) + { + SymbolMap = symbolMap; + ?? = previousState; + } + } + public class SymbolsMappingManager : ICustomizable + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + internal Symbol ?(SymbolMapState P_0) + { + return P_0.QuotesSymbol; + } + + internal Symbol ?(SymbolMapState P_0) + { + return P_0.TickHistorySymbol; + } + + internal Symbol ?(SymbolMapState P_0) + { + return P_0.MinuteHistorySymbol; + } + + internal Symbol ?(SymbolMapState P_0) + { + return P_0.DayHistorySymbol; + } + + internal Symbol ?(SymbolMapState P_0) + { + return P_0.VolumeAnalysisSymbol; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + internal bool ?(SymbolMap P_0) + { + return P_0.TradableSymbol.Equals(??); + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + internal bool ?(Symbol P_0) + { + return P_0.Equals(??); + } + } + + [CompilerGenerated] + private EventHandler ??; + + [CompilerGenerated] + private EventHandler ??; + + [CompilerGenerated] + private EventHandler ??; + + [CompilerGenerated] + private EventHandler ??; + + [CompilerGenerated] + private EventHandler ??; + + private readonly Dictionary ??; + + private readonly object ??; + + public IList Settings + { + get + { + List list = new List(); + lock (??) + { + foreach (KeyValuePair item in ??) + { + list.Add(new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), item.Value.Settings)); + } + return list; + } + } + set + { + foreach (SettingItem item in value) + { + if (!(item.Name != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) && item.Value is IList settings) + { + SymbolMap symbolMap = new SymbolMap + { + Settings = settings + }; + lock (??) + { + ??.Add(symbolMap.Id, symbolMap); + } + } + } + } + } + + public SymbolMap[] AllMaps + { + get + { + lock (??) + { + return ??.Values.ToArray(); + } + } + } + + public event EventHandler MapAdded + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + public event EventHandler MapUpdating + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + public event EventHandler MapUpdated + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + public event EventHandler MapDeleting + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + public event EventHandler MapDeleted + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + internal SymbolsMappingManager() + { + ?? = new Dictionary(); + ?? = new object(); + } + + internal void ?() + { + } + + public string AddSymbolMap(SymbolMappingParameters parameters) + { + SymbolMap symbolMap; + lock (??) + { + ?(parameters, null); + symbolMap = new SymbolMap(parameters.TradableSymbol); + ??.Add(symbolMap.Id, symbolMap); + symbolMap.?(parameters); + } + ?(symbolMap); + return symbolMap.Id; + } + + public void UpdateSymbolMap(string symbolMapId, SymbolMappingParameters parameters) + { + if (string.IsNullOrEmpty(symbolMapId)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + SymbolMap symbolMap; + SymbolMapState state; + lock (??) + { + symbolMap = ??[symbolMapId]; + ?(parameters, symbolMapId); + ?(symbolMap); + state = symbolMap.GetState(); + symbolMap.?(parameters, parameters.IsActive && state.IsActive == parameters.IsActive); + } + ?(symbolMap, state); + } + + public void DeleteSymbolMap(string symbolMapId) + { + if (string.IsNullOrEmpty(symbolMapId)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + SymbolMap symbolMap; + lock (??) + { + symbolMap = ??[symbolMapId]; + ?(symbolMap); + symbolMap.?(); + ??.Remove(symbolMapId); + } + symbolMap.Dispose(); + ?(symbolMap); + } + + public void DeleteAllMaps() + { + SymbolMap[] allMaps = AllMaps; + foreach (SymbolMap symbolMap in allMaps) + { + ?(symbolMap); + symbolMap.?(); + lock (??) + { + ??.Remove(symbolMap.Id); + } + ?(symbolMap); + } + } + + public bool TryGetSymbolMapState(Symbol symbol, out SymbolMapState mapState) + { + SymbolMap symbolMap = ?(symbol); + if (symbolMap != null) + { + mapState = new SymbolMapState(symbolMap); + } + else + { + mapState = null; + } + return mapState != null; + } + + public bool TryGetQuotesSymbol(Symbol tradableSymbol, out Symbol quotesSymbol) + { + quotesSymbol = null; + lock (??) + { + SymbolMap symbolMap = ?(tradableSymbol); + if (symbolMap == null || !symbolMap.IsActive) + { + return false; + } + quotesSymbol = symbolMap.QuotesSymbol; + } + return quotesSymbol != null; + } + + public bool TryGetHistorySymbol(Symbol tradableSymbol, Period period, out Symbol historySymbol) + { + lock (??) + { + int num = 0; + Symbol symbol = null; + while (?(tradableSymbol, period, out historySymbol)) + { + symbol = historySymbol; + num++; + if (historySymbol.Id == tradableSymbol.Id) + { + break; + } + tradableSymbol = historySymbol; + } + historySymbol = symbol; + return num > 0; + } + } + + public bool TryGetVolumeAnalysisSymbol(Symbol tradableSymbol, out Symbol volumeAnalysisSymbol) + { + lock (??) + { + int num = 0; + Symbol symbol = null; + while (?(tradableSymbol, out volumeAnalysisSymbol)) + { + symbol = volumeAnalysisSymbol; + num++; + if (volumeAnalysisSymbol.Id == tradableSymbol.Id) + { + break; + } + tradableSymbol = volumeAnalysisSymbol; + } + volumeAnalysisSymbol = symbol; + return num > 0; + } + } + + private bool ?(Symbol P_0, Period P_1, out Symbol P_2) + { + P_2 = null; + SymbolMap symbolMap = ?(P_0); + if (symbolMap == null || !symbolMap.IsActive) + { + return false; + } + return symbolMap.?(P_1, out P_2); + } + + private bool ?(Symbol P_0, out Symbol P_1) + { + P_1 = null; + SymbolMap symbolMap = ?(P_0); + if (symbolMap == null || !symbolMap.IsActive) + { + return false; + } + P_1 = symbolMap.VolumeAnalysisSymbol; + return true; + } + + private SymbolMap ?(Symbol P_0) + { + return ??.Values.SingleOrDefault((SymbolMap symbolMap) => symbolMap.TradableSymbol.Equals(P_0)); + } + + private void ?(SymbolMappingParameters P_0, string P_1 = null) + { + if (P_0 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (P_0.TradableSymbol == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ?(P_0, P_1); + ?(P_0); + } + + private void ?(SymbolMappingParameters P_0, string P_1 = null) + { + SymbolMap symbolMap = ?(P_0.TradableSymbol); + bool num; + if (!string.IsNullOrEmpty(P_1)) + { + if (symbolMap == null) + { + return; + } + num = symbolMap.Id != P_1; + } + else + { + num = symbolMap != null; + } + if (num) + { + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.TradableSymbol.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + private void ?(SymbolMappingParameters P_0) + { + if (P_0.TradableSymbol.Equals(P_0.QuotesSymbol)) + { + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (P_0.TradableSymbol.Equals(P_0.TickHistorySymbol)) + { + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (P_0.TradableSymbol.Equals(P_0.MinuteHistorySymbol)) + { + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (P_0.TradableSymbol.Equals(P_0.DayHistorySymbol)) + { + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (P_0.TradableSymbol.Equals(P_0.VolumeAnalysisSymbol)) + { + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + private void ?(SymbolMappingParameters P_0) + { + ?(P_0.TradableSymbol, P_0.QuotesSymbol, (SymbolMapState symbolMapState) => symbolMapState.QuotesSymbol); + ?(P_0.TradableSymbol, P_0.TickHistorySymbol, (SymbolMapState symbolMapState) => symbolMapState.TickHistorySymbol); + ?(P_0.TradableSymbol, P_0.MinuteHistorySymbol, (SymbolMapState symbolMapState) => symbolMapState.MinuteHistorySymbol); + ?(P_0.TradableSymbol, P_0.DayHistorySymbol, (SymbolMapState symbolMapState) => symbolMapState.DayHistorySymbol); + ?(P_0.TradableSymbol, P_0.VolumeAnalysisSymbol, (SymbolMapState symbolMapState) => symbolMapState.VolumeAnalysisSymbol); + } + + private void ?(Symbol P_0, Symbol P_1, Func P_2) + { + if (P_0.Equals(P_1)) + { + return; + } + Symbol[] array = GetSymbolsChainRecursive(P_1, P_2).ToArray(); + if (!array.Any((Symbol symbol2) => symbol2.Equals(P_0))) + { + return; + } + StringBuilder stringBuilder = new StringBuilder(P_0.Name); + Symbol[] array2 = array; + foreach (Symbol symbol in array2) + { + stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + stringBuilder.Append(symbol.Name); + if (symbol.Equals(P_0)) + { + break; + } + } + string text = stringBuilder.ToString(); + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + + public IEnumerable GetSymbolsChainRecursive(Symbol mappedSymbol, Func getMappedSymbolFromMap) + { + yield return mappedSymbol; + SymbolMap symbolMap = ?(mappedSymbol); + if (symbolMap == null) + { + yield break; + } + Symbol symbol = getMappedSymbolFromMap(symbolMap.GetState()); + if (mappedSymbol.Equals(symbol)) + { + yield break; + } + foreach (Symbol item in GetSymbolsChainRecursive(symbol, getMappedSymbolFromMap)) + { + yield return item; + } + } + + private void ?(SymbolMap P_0) + { + ???.Invoke(this, new SymbolsMappingEventArgs(P_0)); + } + + private void ?(SymbolMap P_0) + { + ???.Invoke(this, new SymbolsMappingEventArgs(P_0)); + } + + private void ?(SymbolMap P_0, SymbolMapState P_1) + { + ???.Invoke(this, new SymbolsMappingEventArgs(P_0, P_1)); + } + + private void ?(SymbolMap P_0) + { + ???.Invoke(this, new SymbolsMappingEventArgs(P_0)); + } + + private void ?(SymbolMap P_0) + { + ???.Invoke(this, new SymbolsMappingEventArgs(P_0)); + } + } + public class AdvancedTradingOperations + { + private class ? + { + [CompilerGenerated] + private readonly Position ??; + + [CompilerGenerated] + private readonly IList ??; + + [CompilerGenerated] + private readonly SlTpHolder ??; + + public Position Position + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = position; + } + } + + public IList Brackets + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = list; + } + } + + public SlTpHolder InitialBracketParameters + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = slTpHolder; + } + } + } + + private class ?(Symbol, Account) : IEquatable + { + [CompilerGenerated] + private readonly Symbol ??; + + [CompilerGenerated] + private readonly Account ??; + + [CompilerGenerated] + protected virtual Type EqualityContract + { + [CompilerGenerated] + get + { + return typeof(?); + } + } + + public Symbol Symbol + { + [CompilerGenerated] + get + { + return P_0; + } + [CompilerGenerated] + init + { + P_0 = symbol; + } + } + + public Account Account + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = account; + } + } + + public ?(Symbol P_0, Account P_1) + { + ?? = P_0; + ?? = P_1; + base..ctor(); + } + + [CompilerGenerated] + public override string ToString() + { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (?(stringBuilder)) + { + stringBuilder.Append(' '); + } + stringBuilder.Append('}'); + return stringBuilder.ToString(); + } + + [CompilerGenerated] + protected virtual bool ?(StringBuilder P_0) + { + RuntimeHelpers.EnsureSufficientExecutionStack(); + P_0.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + P_0.Append(Symbol); + P_0.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + P_0.Append(Account); + return true; + } + + [CompilerGenerated] + public static bool operator !=(?? P_0, ?? P_1) + { + return !(P_0 == P_1); + } + + [CompilerGenerated] + public static bool operator ==(?? P_0, ?? P_1) + { + if ((object)P_0 != P_1) + { + return P_0?.Equals(P_1) ?? false; + } + return true; + } + + [CompilerGenerated] + public override int GetHashCode() + { + return (EqualityComparer.Default.GetHashCode(EqualityContract) * -1521134295 + EqualityComparer.Default.GetHashCode(P_0)) * -1521134295 + EqualityComparer.Default.GetHashCode(??); + } + + [CompilerGenerated] + public override bool Equals(object? obj) + { + return Equals(obj as ?); + } + + [CompilerGenerated] + public virtual bool Equals(?? other) + { + if ((object)this != other) + { + if ((object)other != null && EqualityContract == other.EqualityContract && EqualityComparer.Default.Equals(P_0, other.P_0)) + { + return EqualityComparer.Default.Equals(??, other.??); + } + return false; + } + return true; + } + + [CompilerGenerated] + public virtual ? ?() + { + return new ?(this); + } + + [CompilerGenerated] + protected ?(? original) + { + ?? = original.??; + ?? = original.??; + } + + [CompilerGenerated] + public void ?(out Symbol P_0, out Account P_1) + { + P_0 = Symbol; + P_1 = Account; + } + } + + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + internal Symbol ?(IOrder P_0) + { + return P_0.Symbol; + } + + internal IOrder ?(IOrder P_0) + { + return P_0; + } + + internal Connection ?(IOrder P_0) + { + return P_0.Symbol.Connection; + } + + internal Symbol ?(IOrder P_0) + { + return P_0.Symbol; + } + + internal Account ?(IOrder P_0) + { + return P_0.Account; + } + + internal ? ?(IOrder P_0) + { + return new ?(P_0.Symbol, P_0.Account); + } + + internal string ?(IOrder P_0) + { + return P_0.Id; + } + + internal bool ?(Position P_0) + { + return true; + } + + internal bool ?(Position P_0) + { + return true; + } + + internal bool ?(Position P_0) + { + return true; + } + + internal bool ?(Position P_0) + { + return true; + } + + internal bool ?(OrderType P_0) + { + if (P_0.Behavior == OrderTypeBehavior.Market) + { + return (P_0.Usage & OrderTypeUsage.Order) == OrderTypeUsage.Order; + } + return false; + } + + internal bool ?(Order P_0) + { + OrderTypeBehavior behavior = P_0.OrderType.Behavior; + if ((uint)(behavior - 3) <= 1u) + { + return true; + } + return false; + } + + internal bool ?(OrderType P_0) + { + return P_0.Behavior == OrderTypeBehavior.Stop; + } + + internal bool ?(Order P_0) + { + return string.IsNullOrEmpty(P_0.GroupId); + } + + internal string ?(Order P_0) + { + return P_0.GroupId; + } + + internal bool ?(Order P_0) + { + return string.IsNullOrEmpty(P_0.GroupId); + } + + internal string ?(Order P_0) + { + return P_0.GroupId; + } + + internal double ?(Order P_0) + { + return P_0.GetExecutionPrice(); + } + + internal bool ?(Order P_0) + { + return string.IsNullOrEmpty(P_0.GroupId); + } + + internal Order ?(Order P_0, Order P_1) + { + if (!(P_0.RemainingQuantity > P_1.RemainingQuantity)) + { + return P_1; + } + return P_0; + } + + internal bool ?(Order P_0) + { + return string.IsNullOrEmpty(P_0.GroupId); + } + + internal Order ?(Order P_0, Order P_1) + { + if (!(P_0.RemainingQuantity > P_1.RemainingQuantity)) + { + return P_1; + } + return P_0; + } + + internal double ?(Order P_0) + { + return P_0.GetExecutionPrice(); + } + + internal double ?(Order P_0) + { + return P_0.GetExecutionPrice(); + } + + internal (double, double) ?(Order P_0) + { + return (P_0.GetExecutionPrice(), P_0.RemainingQuantity); + } + + internal string ?(Order P_0) + { + return P_0.Id; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + public Account ??; + + public TimeInForce ??; + + internal bool ?(IOrder P_0) + { + if (??.IsSameAs(P_0.Symbol) && P_0.Account.Equals(??)) + { + return P_0.TimeInForce == ??; + } + return false; + } + } + + [CompilerGenerated] + private sealed class ? + { + public TimeInForce ??; + + internal bool ?(IOrder P_0) + { + return P_0.TimeInForce == ??; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + public OrderTypeBehavior ??; + + internal bool ?(IOrder P_0) + { + if (??.IsSameAs(P_0.Symbol)) + { + return P_0.OrderType.Behavior == ??; + } + return false; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + public Account ??; + + public OrderTypeBehavior ??; + + internal bool ?(IOrder P_0) + { + if (??.IsSameAs(P_0.Symbol) && P_0.Account.Equals(??)) + { + return P_0.OrderType.Behavior == ??; + } + return false; + } + } + + [CompilerGenerated] + private sealed class ? + { + public OrderTypeBehavior ??; + + internal bool ?(IOrder P_0) + { + return P_0.OrderType.Behavior == ??; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Connection ??; + + internal bool ?(IOrder P_0) + { + return P_0.ConnectionId == ??.Id; + } + + internal bool ?(IOrder P_0) + { + return P_0.ConnectionId == ??.Id; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + internal bool ?(IOrder P_0) + { + return ??.IsSameAs(P_0.Symbol); + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + public Account ??; + + internal bool ?(Order P_0) + { + if (P_0.Symbol.Equals(??)) + { + return P_0.Account.Equals(??); + } + return false; + } + + internal bool ?(IOrder P_0) + { + if (??.IsSameAs(P_0.Symbol)) + { + return P_0.Account.Equals(??); + } + return false; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Func ??; + + public Func ??; + + internal bool ?(IOrder P_0) + { + if (?? != null) + { + return ??(P_0); + } + return true; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Account ??; + + internal bool ?(Position P_0) + { + return P_0.Account.Equals(??); + } + } + + [CompilerGenerated] + private sealed class ? + { + public Side ??; + + internal bool ?(Position P_0) + { + return P_0.Side == ??; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + public Side ??; + + internal bool ?(Position P_0) + { + if (??.IsSameAs(P_0.Symbol)) + { + return P_0.Side == ??; + } + return false; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + internal bool ?(Position P_0) + { + return ??.IsSameAs(P_0.Symbol); + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + internal bool ?(Position P_0) + { + return ??.IsSameAs(P_0.Symbol); + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + internal bool ?(Position P_0) + { + return ??.IsSameAs(P_0.Symbol); + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + public Account ??; + + internal bool ?(Position P_0) + { + if (??.IsSameAs(P_0.Symbol)) + { + return P_0.Account.Equals(??); + } + return false; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Func ??; + + internal bool ?(Position P_0) + { + PnLItem pnLItem = P_0.NetPnL ?? P_0.GrossPnL; + if (pnLItem != null && pnLItem.Value > 0.0) + { + if (?? != null) + { + return ??(P_0); + } + return true; + } + return false; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Func ??; + + internal bool ?(Position P_0) + { + PnLItem pnLItem = P_0.NetPnL ?? P_0.GrossPnL; + if (pnLItem != null && pnLItem.Value < 0.0) + { + if (?? != null) + { + return ??(P_0); + } + return true; + } + return false; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Func ??; + + public Func ??; + + internal bool ?(Position P_0) + { + if (?? != null) + { + return ??(P_0); + } + return true; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + internal bool ?(Position P_0) + { + return P_0.Symbol.IsSameAs(??); + } + } + + [CompilerGenerated] + private sealed class ? + { + public Account ??; + + internal bool ?(Position P_0) + { + return P_0.Account.Equals(??); + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + public Account ??; + + internal bool ?(Position P_0) + { + if (P_0.Symbol.IsSameAs(??)) + { + return P_0.Account.Equals(??); + } + return false; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + public Account ??; + + public Func ??; + + public Func ??; + + internal bool ?(Order P_0) + { + if (P_0.Symbol.Equals(??)) + { + return P_0.Account.Equals(??); + } + return false; + } + + internal bool ?(Order P_0) + { + return P_0.Symbol.Equals(??); + } + } + + [CompilerGenerated] + private sealed class ? + { + public Position ??; + + internal bool ?(Order P_0) + { + return P_0.PositionId == ??.Id; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Account ??; + + internal bool ?(IOrder P_0) + { + return P_0.Account.Equals(??); + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + public Account ??; + + public Position ??; + + internal bool ?(Position P_0) + { + if (P_0.ConnectionId == ??.ConnectionId && ??.IsSameAs(P_0.Symbol)) + { + return P_0.Account.Id == ??.Id; + } + return false; + } + + internal bool ?(Order P_0) + { + if (P_0.ConnectionId == ??.ConnectionId && ??.IsSameAs(P_0.Symbol)) + { + return P_0.Account.Id == ??.Id; + } + return false; + } + + internal bool ?(Order P_0) + { + if (P_0.OrderType.Behavior == OrderTypeBehavior.Stop) + { + return P_0.Side != ??.Side; + } + return false; + } + + internal bool ?(Order P_0) + { + if (P_0.OrderType.Behavior == OrderTypeBehavior.Stop) + { + return P_0.Side != ??.Side; + } + return false; + } + } + + [CompilerGenerated] + private sealed class ? + { + public TaskCompletionSource ??; + + internal void ?(OrderHistory P_0) + { + OrderStatus status = P_0.Status; + if ((status == OrderStatus.Opened || status == OrderStatus.Refused) ? true : false) + { + ??.SetResult(P_0); + } + } + + internal void ?() + { + ??.TrySetCanceled(); + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + public Position ??; + + internal bool ?(Order P_0) + { + if (??.IsSameAs(P_0.Symbol) && P_0.Account.Equals(??.Account) && P_0.Side != ??.Side) + { + if (P_0.Side != Side.Buy) + { + return P_0.GetExecutionPrice() < ??.OpenPrice; + } + return P_0.GetExecutionPrice() > ??.OpenPrice; + } + return false; + } + + internal bool ?(Order P_0) + { + if (??.IsSameAs(P_0.Symbol) && P_0.Account.Equals(??.Account) && P_0.Side != ??.Side) + { + if (P_0.Side != Side.Buy) + { + return P_0.GetExecutionPrice() > ??.OpenPrice; + } + return P_0.GetExecutionPrice() < ??.OpenPrice; + } + return false; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Order ??; + + internal bool ?(Order P_0) + { + return P_0.OrderTypeId != ??.OrderTypeId; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Order ??; + + internal bool ?(Order P_0) + { + return P_0.Id != ??.Id; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Order ??; + + internal bool ?(Order P_0) + { + return P_0.Id != ??.Id; + } + } + + [CompilerGenerated] + private sealed class ? + { + public ManualResetEventSlim ??; + + public string ??; + + public PlaceOrderRequestParameters ??; + + internal void ?(Order P_0) + { + if (!??.IsSet) + { + if (!string.IsNullOrEmpty(??) && P_0.Id == ??) + { + ??.Set(); + } + else if (??.IsCorrespondingOrder(P_0)) + { + ??.Set(); + } + } + } + } + + [CompilerGenerated] + private sealed class ? + { + public ManualResetEventSlim ??; + + public ModifyOrderRequestParameters ??; + + internal void ?(Order P_0) + { + if (!??.IsSet && ??.IsCorrespondingOrder(P_0)) + { + ??.Set(); + } + } + } + + [CompilerGenerated] + private sealed class ? + { + public HashSet ??; + + public ManualResetEvent ??; + + internal void ?(Order P_0) + { + ??.Remove(P_0.Id); + if (??.Count == 0) + { + ??.Set(); + } + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + public Side ??; + + internal bool ?(IOrder P_0) + { + if (??.IsSameAs(P_0.Symbol)) + { + return P_0.Side == ??; + } + return false; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + public Account ??; + + public Side ??; + + internal bool ?(IOrder P_0) + { + if (??.IsSameAs(P_0.Symbol) && P_0.Account.Equals(??)) + { + return P_0.Side == ??; + } + return false; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Side ??; + + internal bool ?(IOrder P_0) + { + return P_0.Side == ??; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Symbol ??; + + public TimeInForce ??; + + internal bool ?(IOrder P_0) + { + if (??.IsSameAs(P_0.Symbol)) + { + return P_0.TimeInForce == ??; + } + return false; + } + } + + internal AdvancedTradingOperations() + { + } + + /// + /// Cancel all pending s + /// + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult CancelOrders([CallerMemberName] string sendingSource = null) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + sendingSource); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.None); + return ?(sendingSource, groupTradingOperation); + } + + /// + /// Cancel all pending s + /// + /// s to cancel + /// the name of the initiator of the call (optional) + /// + public AdvancedTradingOperationResult CancelOrders(IOrder[] orders, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(67, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(orders.Length); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.CertainOrders); + foreach (IGrouping item in from P_0 in orders + group P_0 by P_0.Symbol) + { + Symbol key = item.Key; + IOrder[] array = item.ToArray(); + advancedTradingOperationResult.?(?(key, array, sendingSource, groupTradingOperation)); + } + return advancedTradingOperationResult; + } + + /// + /// Cancel all pending s by + /// + /// + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult CancelOrders(Symbol symbol, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(62, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Symbol); + return ?(symbol, Array.Empty(), sendingSource, groupTradingOperation); + } + + /// + /// Cancel all pending s by + /// + /// + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult CancelOrders(Account account, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(63, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(account); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Account); + return ?((IOrder P_0) => P_0.Account.Equals(account), sendingSource, groupTradingOperation); + } + + /// + /// Cancel all pending s by and + /// + /// + /// + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult CancelOrders(Symbol symbol, Account account, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(74, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(account); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.Account); + return ?(symbol, account, sendingSource, groupTradingOperation); + } + + /// + /// Cancel all pending s by and + /// + /// + /// + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult CancelOrders(Symbol symbol, Side side, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(71, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.Side); + return ?((IOrder P_0) => symbol.IsSameAs(P_0.Symbol) && P_0.Side == side, sendingSource, groupTradingOperation); + } + + /// + /// Cancel all pending s by , and + /// + /// + /// + /// + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult CancelOrders(Symbol symbol, Account account, Side side, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(83, 4); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(account); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.Account | GroupTradingOperationFilters.Side); + return ?((IOrder P_0) => symbol.IsSameAs(P_0.Symbol) && P_0.Account.Equals(account) && P_0.Side == side, sendingSource, groupTradingOperation); + } + + /// + /// Cancel all pending s by + /// + /// + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult CancelOrders(Side side, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(60, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Side); + return ?((IOrder P_0) => P_0.Side == side, sendingSource, groupTradingOperation); + } + + /// + /// Cancel all pending s by and + /// + /// + /// + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult CancelOrders(Symbol symbol, TimeInForce timeInForce, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(80, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(timeInForce); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.TimeInForce); + return ?((IOrder P_0) => symbol.IsSameAs(P_0.Symbol) && P_0.TimeInForce == timeInForce, sendingSource, groupTradingOperation); + } + + /// + /// Cancel all pending s by , and + /// + /// + /// + /// + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult CancelOrders(Symbol symbol, Account account, TimeInForce timeInForce, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(92, 4); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(account); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(timeInForce); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.Account | GroupTradingOperationFilters.TimeInForce); + return ?((IOrder P_0) => symbol.IsSameAs(P_0.Symbol) && P_0.Account.Equals(account) && P_0.TimeInForce == timeInForce, sendingSource, groupTradingOperation); + } + + /// + /// Cancel all pending s by + /// + /// + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult CancelOrders(TimeInForce timeInForce, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(69, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(timeInForce); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.TimeInForce); + return ?((IOrder P_0) => P_0.TimeInForce == timeInForce, sendingSource, groupTradingOperation); + } + + /// + /// Cancel all pending s by and + /// + /// + /// + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult CancelOrders(Symbol symbol, OrderTypeBehavior orderTypeBehavior, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(77, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(orderTypeBehavior); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.OrderType); + return ?((IOrder P_0) => symbol.IsSameAs(P_0.Symbol) && P_0.OrderType.Behavior == orderTypeBehavior, sendingSource, groupTradingOperation); + } + + /// + /// Cancel all pending s by , and + /// + /// + /// + /// + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult CancelOrders(Symbol symbol, Account account, OrderTypeBehavior orderTypeBehavior, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(98, 4); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(account); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(orderTypeBehavior); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.Account | GroupTradingOperationFilters.OrderType); + return ?((IOrder P_0) => symbol.IsSameAs(P_0.Symbol) && P_0.Account.Equals(account) && P_0.OrderType.Behavior == orderTypeBehavior, sendingSource, groupTradingOperation); + } + + /// + /// Cancel all pending s by + /// + /// + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult CancelOrders(OrderTypeBehavior orderTypeBehavior, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(75, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(orderTypeBehavior); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.OrderType); + return ?((IOrder P_0) => P_0.OrderType.Behavior == orderTypeBehavior, sendingSource, groupTradingOperation); + } + + private static AdvancedTradingOperationResult ?(string P_0, GroupTradingOperation P_1) + { + Connection[] array = (from order in ?() + select order.Symbol.Connection).Distinct().ToArray(); + AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); + Connection[] array2 = array; + foreach (Connection connection in array2) + { + advancedTradingOperationResult.?(?(connection, P_0, P_1)); + } + return advancedTradingOperationResult; + } + + private static AdvancedTradingOperationResult ?(Connection P_0, string P_1, GroupTradingOperation P_2 = null) + { + bool flag = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Id).Status == TradingOperationStatus.Allowed; + bool flag2 = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Id).Status == TradingOperationStatus.Allowed; + bool flag3 = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Id).Status == TradingOperationStatus.Allowed; + IOrder[] source = (from order in ?() + where order.ConnectionId == P_0.Id + select order).ToArray(); + Symbol[] array = source.Select((IOrder order) => order.Symbol).Distinct().ToArray(); + Account[] array2 = source.Select((IOrder order) => order.Account).Distinct().ToArray(); + if (flag && (!flag2 || array.Length <= array2.Length)) + { + Symbol[] array3 = array; + foreach (Symbol symbol in array3) + { + P_0.SendCustomRequest(new CancelAllOpenOrdersOnSymbolRequest(symbol.ComplexId) + { + ParentOperation = P_2, + SendingSource = P_1 + }); + } + return AdvancedTradingOperationResult.?(); + } + if (flag2 && (!flag || array.Length > array2.Length)) + { + Account[] array4 = array2; + foreach (Account account in array4) + { + P_0.SendCustomRequest(new CancelAllOpenOrdersOnAccountRequest(account.Id) + { + ParentOperation = P_2, + SendingSource = P_1 + }); + } + return AdvancedTradingOperationResult.?(); + } + if (flag3) + { + ?[] array5 = source.Select((IOrder order) => new ?(order.Symbol, order.Account)).Distinct().ToArray(); + foreach (? ? in array5) + { + P_0.SendCustomRequest(new CancelAllOpenOrdersOnSymbolAndAccountRequest(?.Symbol.ComplexId, ?.Account.Id) + { + ParentOperation = P_2, + SendingSource = P_1 + }); + } + return AdvancedTradingOperationResult.?(); + } + if ((object)P_2 == null) + { + P_2 = new GroupTradingOperation(GroupTradingOperationType.CancelOrders, GroupTradingOperationFilters.Connection); + } + return ?((IOrder order) => order.ConnectionId == P_0.Id, P_1, P_2); + } + + private static AdvancedTradingOperationResult ?(Symbol P_0, IOrder[] P_1, string P_2, GroupTradingOperation P_3) + { + if (P_0 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + if (Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0).Status == TradingOperationStatus.Allowed) + { + P_0.Connection.SendCustomRequest(new CancelAllOpenOrdersOnSymbolRequest(P_0.ComplexId, P_1?.Select((IOrder order) => order.Id).ToArray()) + { + ParentOperation = P_3, + SendingSource = P_2 + }); + return AdvancedTradingOperationResult.?(); + } + if (P_1 == null || P_1.Length == 0) + { + return ?((IOrder order) => P_0.IsSameAs(order.Symbol), P_2, P_3); + } + return ?(((IEnumerable)P_1).Contains, P_2, P_3); + } + + private static AdvancedTradingOperationResult ?(Symbol P_0, Account P_1, string P_2, GroupTradingOperation P_3) + { + if (P_0 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + if (P_1 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + if (Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_1, P_0).Status == TradingOperationStatus.Allowed && Core.Instance.Orders.Any((Order order) => order.Symbol.Equals(P_0) && order.Account.Equals(P_1))) + { + P_0.Connection.SendCustomRequest(new CancelAllOpenOrdersOnSymbolAndAccountRequest(P_0.ComplexId, P_1.Id) + { + ParentOperation = P_3, + SendingSource = P_2 + }); + return AdvancedTradingOperationResult.?(); + } + return ?((IOrder order) => P_0.IsSameAs(order.Symbol) && order.Account.Equals(P_1), P_2, P_3); + } + + private static AdvancedTradingOperationResult ?(Func P_0, string P_1, GroupTradingOperation P_2) + { + AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); + foreach (IOrder item in from arg in ?() + where P_0 == null || P_0(arg) + select arg) + { + CancelOrderRequestParameters cancelOrderRequestParameters = new CancelOrderRequestParameters + { + Order = item, + SendingSource = P_1, + ParentOperation = P_2 + }; + item.Symbol.Connection.Limitation?.Wait(cancelOrderRequestParameters.Type, cancelOrderRequestParameters.CancellationToken); + TradingOperationResult tradingOperationResult = Core.Instance.CancelOrder(cancelOrderRequestParameters); + advancedTradingOperationResult.?(cancelOrderRequestParameters, tradingOperationResult); + } + return advancedTradingOperationResult; + } + + private static IEnumerable ?() + { + return Core.Instance.Orders.OfType().Concat(Core.Instance.LocalOrders); + } + + /// + /// Close all s + /// + /// the name of the initiator of the call (optional) + /// List of + public AdvancedTradingOperationResult ClosePositions([CallerMemberName] string sendingSource = null) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + sendingSource); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.None); + return ?(sendingSource, groupTradingOperation); + } + + /// + /// Close all s by + /// + /// + /// the name of the initiator of the call (optional) + /// List of + public AdvancedTradingOperationResult ClosePositions(Symbol symbol, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(64, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.Symbol); + return ?(symbol, sendingSource, groupTradingOperation); + } + + /// + /// Close all s by + /// + /// + /// the name of the initiator of the call (optional) + /// List of + public AdvancedTradingOperationResult ClosePositions(Account account, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(65, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(account); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.Account); + return ?((Position P_0) => P_0.Account.Equals(account), sendingSource, groupTradingOperation); + } + + /// + /// Close all s by and + /// + /// + /// + /// the name of the initiator of the call (optional) + /// List of + public AdvancedTradingOperationResult ClosePositions(Symbol symbol, Account account, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(76, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(account); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.Account); + return ?(symbol, account, sendingSource, groupTradingOperation); + } + + /// + /// Close all s by + /// + /// + /// the name of the initiator of the call (optional) + /// List of + public AdvancedTradingOperationResult ClosePositions(Side side, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(62, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.Side); + return ?((Position P_0) => P_0.Side == side, sendingSource, groupTradingOperation); + } + + /// + /// Close all s by and + /// + /// + /// + /// the name of the initiator of the call (optional) + /// List of + public AdvancedTradingOperationResult ClosePositions(Symbol symbol, Side side, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(73, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.Side); + return ?((Position P_0) => symbol.IsSameAs(P_0.Symbol) && P_0.Side == side, sendingSource, groupTradingOperation); + } + + /// + /// Close all positive s + /// + /// the name of the initiator of the call (optional) + /// List of + public AdvancedTradingOperationResult ClosePositivePositions([CallerMemberName] string sendingSource = null) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + sendingSource); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.None); + return ?((Position P_0) => true, sendingSource, groupTradingOperation); + } + + /// + /// Close all positive s by + /// + /// + /// the name of the initiator of the call (optional) + /// List of + public AdvancedTradingOperationResult ClosePositivePositions(Symbol symbol, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(73, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.Symbol); + return ?((Position P_0) => symbol.IsSameAs(P_0.Symbol), sendingSource, groupTradingOperation); + } + + /// + /// Close all negative s + /// + /// the name of the initiator of the call (optional) + /// List of + public AdvancedTradingOperationResult CloseNegativePositions([CallerMemberName] string sendingSource = null) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + sendingSource); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.None); + return ?((Position P_0) => true, sendingSource, groupTradingOperation); + } + + /// + /// Close all negative s by + /// + /// + /// the name of the initiator of the call (optional) + /// List of + public AdvancedTradingOperationResult CloseNegativePositions(Symbol symbol, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(73, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ClosePositions, GroupTradingOperationFilters.Symbol); + return ?((Position P_0) => symbol.IsSameAs(P_0.Symbol), sendingSource, groupTradingOperation); + } + + private static AdvancedTradingOperationResult ?(Symbol P_0, string P_1, GroupTradingOperation P_2) + { + return ?((Position position) => P_0.IsSameAs(position.Symbol), P_1, P_2); + } + + private static AdvancedTradingOperationResult ?(Symbol P_0, Account P_1, string P_2, GroupTradingOperation P_3) + { + return ?((Position position) => P_0.IsSameAs(position.Symbol) && position.Account.Equals(P_1), P_2, P_3); + } + + private static AdvancedTradingOperationResult ?(string P_0, GroupTradingOperation P_1) + { + return ?((Position position) => true, P_0, P_1); + } + + private static AdvancedTradingOperationResult ?(Func P_0, string P_1, GroupTradingOperation P_2) + { + return ?(delegate(Position position) + { + PnLItem pnLItem = position.NetPnL ?? position.GrossPnL; + return pnLItem != null && pnLItem.Value > 0.0 && (P_0 == null || P_0(position)); + }, P_1, P_2); + } + + private static AdvancedTradingOperationResult ?(Func P_0, string P_1, GroupTradingOperation P_2) + { + return ?(delegate(Position position) + { + PnLItem pnLItem = position.NetPnL ?? position.GrossPnL; + return pnLItem != null && pnLItem.Value < 0.0 && (P_0 == null || P_0(position)); + }, P_1, P_2); + } + + private static AdvancedTradingOperationResult ?(Func P_0, string P_1, GroupTradingOperation P_2) + { + AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); + foreach (Position item in Core.Instance.Positions.Where((Position arg) => P_0 == null || P_0(arg))) + { + ClosePositionRequestParameters closePositionRequestParameters = new ClosePositionRequestParameters + { + Position = item, + CloseQuantity = item.Quantity, + SendingSource = P_1, + ParentOperation = P_2 + }; + TradingOperationResult tradingOperationResult = Core.Instance.ClosePosition(closePositionRequestParameters); + advancedTradingOperationResult.?(closePositionRequestParameters, tradingOperationResult); + } + return advancedTradingOperationResult; + } + + /// + /// Reverse all s + /// + /// the name of the initiator of the call (optional) + /// List of + public AdvancedTradingOperationResult ReversePositions([CallerMemberName] string sendingSource = null) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + sendingSource); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ReversePositions, GroupTradingOperationFilters.None); + return ?((Position P_0) => true, sendingSource, groupTradingOperation); + } + + /// + /// Reverse all s by + /// + /// + /// the name of the initiator of the call (optional) + /// List of + public AdvancedTradingOperationResult ReversePositions(Symbol symbol, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(66, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ReversePositions, GroupTradingOperationFilters.Symbol); + return ?((Position P_0) => P_0.Symbol.IsSameAs(symbol), sendingSource, groupTradingOperation); + } + + /// + /// Reverse all s by + /// + /// + /// the name of the initiator of the call (optional) + /// List of + public AdvancedTradingOperationResult ReversePositions(Account account, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(67, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(account); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ReversePositions, GroupTradingOperationFilters.Account); + return ?((Position P_0) => P_0.Account.Equals(account), sendingSource, groupTradingOperation); + } + + /// + /// Reverse by and + /// + /// + /// + /// the name of the initiator of the call (optional) + /// + public AdvancedTradingOperationResult ReversePosition(Symbol symbol, Account account, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(78, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(account); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.ReversePositions, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.Account); + return ?((Position P_0) => P_0.Symbol.IsSameAs(symbol) && P_0.Account.Equals(account), sendingSource, groupTradingOperation); + } + + private static AdvancedTradingOperationResult ?(Func P_0, string P_1, GroupTradingOperation P_2) + { + AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); + try + { + Position[] positions = Core.Instance.Positions; + foreach (Position position in positions) + { + if ((position.Symbol.NettingType == NettingType.OnePosition || position.Symbol.NettingType == NettingType.Undefined || position.Account.NettingType == NettingType.OnePosition) && (P_0 == null || P_0(position))) + { + OrderType orderType = (Core.Instance.Connections[position.ConnectionId]?.BusinessObjects?.OrderTypes)?.FirstOrDefault((OrderType orderType2) => orderType2.Behavior == OrderTypeBehavior.Market && (orderType2.Usage & OrderTypeUsage.Order) == OrderTypeUsage.Order); + if (orderType != null) + { + PlaceOrderRequestParameters placeOrderRequestParameters = new PlaceOrderRequestParameters + { + Account = position.Account, + Symbol = position.Symbol, + OrderTypeId = orderType.Id, + Quantity = position.Quantity * 2.0, + TimeInForce = TimeInForce.Default, + Side = ((position.Side == Side.Buy) ? Side.Sell : Side.Buy), + SendingSource = P_1, + ParentOperation = P_2 + }; + TradingOperationResult tradingOperationResult = Core.Instance.PlaceOrder(placeOrderRequestParameters); + advancedTradingOperationResult.?(placeOrderRequestParameters, tradingOperationResult); + } + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + return advancedTradingOperationResult; + } + + /// + /// Cancel all s and close all s + /// + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult Flatten([CallerMemberName] string sendingSource = null) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + sendingSource); + AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.Flatten, GroupTradingOperationFilters.None); + advancedTradingOperationResult.?(?(sendingSource, groupTradingOperation)); + ?((Symbol)null, (Account)null); + advancedTradingOperationResult.?(?(sendingSource, groupTradingOperation)); + return advancedTradingOperationResult; + } + + /// + /// Cancel all s and close all s by + /// + /// + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult Flatten(Symbol symbol, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(56, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.Flatten, GroupTradingOperationFilters.Symbol); + advancedTradingOperationResult.?(?(symbol, Array.Empty(), sendingSource, groupTradingOperation)); + ?(symbol); + advancedTradingOperationResult.?(?(symbol, sendingSource, groupTradingOperation)); + return advancedTradingOperationResult; + } + + /// + /// Cancel all s and close all s by and + /// + /// + /// + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult Flatten(Symbol symbol, Account account, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(68, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(account); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); + GroupTradingOperation groupTradingOperation = new GroupTradingOperation(GroupTradingOperationType.Flatten, GroupTradingOperationFilters.Symbol | GroupTradingOperationFilters.Account); + advancedTradingOperationResult.?(?(symbol, account, sendingSource, groupTradingOperation)); + ?(symbol, account); + advancedTradingOperationResult.?(?(symbol, account, sendingSource, groupTradingOperation)); + return advancedTradingOperationResult; + } + + private static void ?(Symbol P_0 = null, Account P_1 = null) + { + try + { + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(5.0)); + while (!cancellationTokenSource.IsCancellationRequested && ((P_0 != null && P_1 != null) ? Core.Instance.Orders.Count((Order order) => order.Symbol.Equals(P_0) && order.Account.Equals(P_1)) : ((P_0 == null) ? Core.Instance.Orders.Length : Core.Instance.Orders.Count((Order order) => order.Symbol.Equals(P_0)))) != 0) + { + Task.Delay(50, cancellationTokenSource.Token).Wait(cancellationTokenSource.Token); + } + if (cancellationTokenSource.IsCancellationRequested) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + /// + /// Modify SL to breakeven price + /// + /// + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult BreakEven(Position position, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(60, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(position); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + return ?(position, 0, null, sendingSource); + } + + /// + /// Modify SL to breakeven price with certain additional offset + /// + /// + /// offset in ticks + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult BreakEven(Position position, int offset, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(71, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(position); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(offset); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + return ?(position, offset, null, sendingSource); + } + + /// + /// Modify SL to breakeven price + /// + /// + /// list of s that will be used for order placing + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult BreakEven(Position position, IList additionalParameters, [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(92, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(position); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(additionalParameters?.Count); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + return ?(position, 0, additionalParameters, sendingSource); + } + + private static AdvancedTradingOperationResult ?(Position P_0, int P_1, IList P_2, string P_3) + { + if (P_0 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (P_0.Symbol.NettingType == NettingType.OnePosition || P_0.Account.NettingType == NettingType.OnePosition) + { + return ?(P_0.Symbol, P_0.Account, P_1, P_2, P_3); + } + double num = ?(P_0, P_1); + double currentPrice = P_0.CurrentPrice; + Order order = Core.Instance.Orders.Where((Order order2) => order2.PositionId == P_0.Id).FirstOrDefault(delegate(Order order2) + { + OrderTypeBehavior behavior = order2.OrderType.Behavior; + return (uint)(behavior - 3) <= 1u; + }); + if (order == null) + { + return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ModifyOrderRequestParameters modifyOrderRequestParameters = new ModifyOrderRequestParameters(order); + if (order.OrderType.Behavior == OrderTypeBehavior.TrailingStop) + { + num = P_0.Symbol.CalculateTicks(currentPrice, num); + modifyOrderRequestParameters.TrailOffset = num; + } + else + { + modifyOrderRequestParameters.TriggerPrice = num; + } + modifyOrderRequestParameters.SendingSource = P_3; + TradingOperationResult tradingOperationResult = Core.Instance.ModifyOrder(modifyOrderRequestParameters); + return new AdvancedTradingOperationResult(modifyOrderRequestParameters, tradingOperationResult); + } + + private static AdvancedTradingOperationResult ?(Symbol P_0, Account P_1, int P_2, IList P_3, string P_4) + { + if (P_0 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + if (P_1 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + if (P_0.NettingType != NettingType.OnePosition && P_1.NettingType != NettingType.OnePosition) + { + return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + OrderType orderType = P_0.Connection.BusinessObjects.OrderTypes.FirstOrDefault((OrderType orderType2) => orderType2.Behavior == OrderTypeBehavior.Stop); + if (orderType == null) + { + return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + Position ?? = Core.Instance.Positions.FirstOrDefault((Position position) => position.ConnectionId == P_0.ConnectionId && P_0.IsSameAs(position.Symbol) && position.Account.Id == P_1.Id); + if (?? == null) + { + return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); + try + { + Order[] array = Core.Instance.Orders.Where((Order order3) => order3.ConnectionId == P_0.ConnectionId && P_0.IsSameAs(order3.Symbol) && order3.Account.Id == P_1.Id).ToArray(); + Order order = array.FirstOrDefault((Order order3) => order3.OrderType.Behavior == OrderTypeBehavior.Stop && order3.Side != ??.Side); + if (order != null && !array.Any((Order order3) => string.IsNullOrEmpty(order3.GroupId)) && (from order3 in array + group order3 by order3.GroupId).Count() == 1) + { + ModifyOrderRequestParameters modifyOrderRequestParameters = new ModifyOrderRequestParameters(order) + { + TriggerPrice = ?(??, P_2), + SendingSource = P_4 + }; + TradingOperationResult tradingOperationResult = Core.Instance.ModifyOrder(modifyOrderRequestParameters); + advancedTradingOperationResult.?(modifyOrderRequestParameters, tradingOperationResult); + } + else if (order != null && array.Count() % 2 == 0 && !array.Any((Order order3) => string.IsNullOrEmpty(order3.GroupId)) && (from order3 in array + group order3 by order3.GroupId).Count() * 2 == array.Count()) + { + Order[] array2 = array.Where((Order order3) => order3.OrderType.Behavior == OrderTypeBehavior.Stop && order3.Side != ??.Side).ToArray(); + for (int num = 0; num < array2.Length; num++) + { + ModifyOrderRequestParameters modifyOrderRequestParameters2 = new ModifyOrderRequestParameters(array2[num]) + { + TriggerPrice = ?(??, P_2), + SendingSource = P_4 + }; + TradingOperationResult tradingOperationResult2 = Core.Instance.ModifyOrder(modifyOrderRequestParameters2); + advancedTradingOperationResult.?(modifyOrderRequestParameters2, tradingOperationResult2); + } + } + else + { + TaskCompletionSource ?? = new TaskCompletionSource(); + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(); + Action value = delegate(OrderHistory orderHistory) + { + OrderStatus status = orderHistory.Status; + if ((status == OrderStatus.Opened || status == OrderStatus.Refused) ? true : false) + { + ??.SetResult(orderHistory); + } + }; + Core.Instance.OrdersHistoryAdded += value; + cancellationTokenSource.CancelAfter(TimeSpan.FromSeconds(5.0)); + try + { + PlaceOrderRequestParameters placeOrderRequestParameters = new PlaceOrderRequestParameters + { + Account = ??.Account, + Symbol = ??.Symbol, + OrderTypeId = orderType.Id, + TriggerPrice = ?(??, P_2), + Side = ((??.Side == Side.Buy) ? Side.Sell : Side.Buy), + Quantity = ??.Quantity, + SendingSource = P_4 + }; + if (P_3 != null) + { + placeOrderRequestParameters.AdditionalParameters = P_3; + } + TradingOperationResult tradingOperationResult3 = Core.Instance.PlaceOrder(placeOrderRequestParameters); + advancedTradingOperationResult.?(placeOrderRequestParameters, tradingOperationResult3); + if (tradingOperationResult3.Status == TradingOperationResultStatus.Failure) + { + return advancedTradingOperationResult; + } + CancellationToken token = cancellationTokenSource.Token; + token.Register(delegate + { + ??.TrySetCanceled(); + }); + OrderHistory result = ??.Task.Result; + if (token.IsCancellationRequested) + { + return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (result.Status == OrderStatus.Refused) + { + return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + Order[] array2 = array; + foreach (Order order2 in array2) + { + CancelOrderRequestParameters cancelOrderRequestParameters = new CancelOrderRequestParameters + { + Order = order2, + SendingSource = P_4 + }; + TradingOperationResult tradingOperationResult4 = Core.Instance.CancelOrder(cancelOrderRequestParameters); + advancedTradingOperationResult.?(cancelOrderRequestParameters, tradingOperationResult4); + } + } + finally + { + Core.Instance.OrdersHistoryAdded -= value; + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + return advancedTradingOperationResult; + } + + private static double ?(Position P_0, int P_1) + { + if (P_0 == null) + { + return double.NaN; + } + double num = P_0.OpenPrice; + decimal num2 = (decimal)P_0.Symbol.RoundPriceToTickSize(P_0.OpenPrice); + if ((decimal)P_0.OpenPrice != num2) + { + decimal num3 = ((!(num2 < (decimal)P_0.OpenPrice)) ? ((P_0.Side == Side.Buy) ? num2 : ((decimal)P_0.Symbol.CalculatePrice((double)num2, -1.0))) : ((P_0.Side == Side.Buy) ? ((decimal)P_0.Symbol.CalculatePrice((double)num2, 1.0)) : num2)); + num = (double)num3; + } + if (P_1 != 0) + { + num = P_0.Symbol.CalculatePrice(num, (P_0.Side == Side.Buy) ? P_1 : (-P_1)); + } + return num; + } + + /// + /// Adjust SL/TP for given + /// + /// + /// + /// the name of the initiator of the call (optional) + public AdvancedTradingOperationResult AdjustSlTp(Position position, CancellationToken cancellationToken = default(CancellationToken), [CallerMemberName] string sendingSource = null) + { + if (position == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + Symbol ?? = position.Symbol; + List list = Core.Instance.Orders.Where((Order P_0) => ??.IsSameAs(P_0.Symbol) && P_0.Account.Equals(position.Account) && P_0.Side != position.Side && ((P_0.Side != Side.Buy) ? (P_0.GetExecutionPrice() < position.OpenPrice) : (P_0.GetExecutionPrice() > position.OpenPrice))).ToList(); + List list2 = Core.Instance.Orders.Where((Order P_0) => ??.IsSameAs(P_0.Symbol) && P_0.Account.Equals(position.Account) && P_0.Side != position.Side && ((P_0.Side != Side.Buy) ? (P_0.GetExecutionPrice() > position.OpenPrice) : (P_0.GetExecutionPrice() < position.OpenPrice))).ToList(); + if (!list.Any() && !list2.Any()) + { + return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(63, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(position); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + AdvancedTradingOperationResult advancedTradingOperationResult = null; + AdvancedTradingOperationResult advancedTradingOperationResult2 = null; + AdvancedTradingOperationResult advancedTradingOperationResult3 = new AdvancedTradingOperationResult(); + try + { + if (list.Any()) + { + advancedTradingOperationResult = ?(new ? + { + Position = position, + Brackets = list + }, cancellationToken, sendingSource); + } + else if (list2.Count > 1) + { + List list3 = list2.OrderBy((Order P_0) => P_0.GetExecutionPrice()).ToList(); + Order ?? = ((position.Side == Side.Buy) ? list3.First() : list3.Last()); + list3.Remove(??); + if (list3.All((Order P_0) => P_0.OrderTypeId != ??.OrderTypeId)) + { + list2.Remove(??); + advancedTradingOperationResult = ?(new ? + { + Position = position, + Brackets = new List { ?? } + }, cancellationToken, sendingSource); + } + } + if (list2.Any()) + { + advancedTradingOperationResult2 = ?(new ? + { + Position = position, + Brackets = list2 + }, cancellationToken, sendingSource); + } + if (advancedTradingOperationResult == null) + { + return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (advancedTradingOperationResult2 == null) + { + return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + advancedTradingOperationResult3.?(advancedTradingOperationResult).?(advancedTradingOperationResult2); + if (!(advancedTradingOperationResult.Value is string orderId) || !(advancedTradingOperationResult2.Value is string orderId2) || Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), position.Account, position.Symbol).Status != TradingOperationStatus.Allowed) + { + return advancedTradingOperationResult3; + } + Order order = null; + Order order2 = null; + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(5.0)); + while ((order == null || order2 == null) && !cancellationTokenSource.IsCancellationRequested) + { + order = Core.Instance.GetOrderById(orderId, position.ConnectionId); + order2 = Core.Instance.GetOrderById(orderId2, position.ConnectionId); + Task.Delay(100, cancellationTokenSource.Token).Wait(cancellationTokenSource.Token); + } + if (order == null || order2 == null) + { + return advancedTradingOperationResult3; + } + Core instance = Core.Instance; + string connectionId = position.ConnectionId; + LinkOCORequestParameters linkOCORequestParameters = new LinkOCORequestParameters(); + int num = 2; + List list4 = new List(num); + CollectionsMarshal.SetCount(list4, num); + Span span = CollectionsMarshal.AsSpan(list4); + int num2 = 0; + span[num2] = order; + num2++; + span[num2] = order2; + linkOCORequestParameters.OrdersToLink = list4; + linkOCORequestParameters.CancellationToken = cancellationToken; + instance.SendCustomRequest(connectionId, linkOCORequestParameters); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + return advancedTradingOperationResult3; + } + + /// + /// Adjust stop loss for given + /// + /// + /// list of s + /// initial stop loss parameters (optional) + /// + /// the name of the initiator of the call (optional) + /// + public AdvancedTradingOperationResult AdjustStopLoss(Position position, IList stops, SlTpHolder initialStopLoss = null, CancellationToken cancellationToken = default(CancellationToken), [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(97, 4); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(position); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(stops.Count); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(initialStopLoss); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + return ?(new ? + { + Position = position, + Brackets = stops, + InitialBracketParameters = initialStopLoss + }, cancellationToken, sendingSource); + } + + /// + /// Adjust take profit for given + /// + /// + /// list of s + /// initial take profit parameters (optional) + /// + /// the name of the initiator of the call (optional) + /// + public AdvancedTradingOperationResult AdjustTakeProfit(Position position, IList takes, SlTpHolder initialTakeProfit, CancellationToken cancellationToken = default(CancellationToken), [CallerMemberName] string sendingSource = null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(101, 4); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(position); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(takes.Count); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(initialTakeProfit); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(sendingSource); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + return ?(new ? + { + Position = position, + Brackets = takes, + InitialBracketParameters = initialTakeProfit + }, cancellationToken, sendingSource); + } + + private static AdvancedTradingOperationResult ?(? P_0, CancellationToken P_1, string P_2) + { + AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); + Position position = P_0.Position; + IList brackets = P_0.Brackets; + SlTpHolder initialBracketParameters = P_0.InitialBracketParameters; + double quantity = position.Quantity; + double num = ?(position, brackets, initialBracketParameters); + List source = brackets.Where((Order order) => string.IsNullOrEmpty(order.GroupId)).ToList(); + if (source.Any()) + { + Order ?? = source.Aggregate((Order order, Order order2) => (!(order.RemainingQuantity > order2.RemainingQuantity)) ? order2 : order); + advancedTradingOperationResult.?(?(brackets.Where((Order order) => order.Id != ??.Id).ToList(), P_1, P_2)); + if (Math.Abs(??.RemainingQuantity - quantity) > double.Epsilon || Math.Abs(??.GetExecutionPrice() - num) > double.Epsilon) + { + ModifyOrderRequestParameters modifyOrderRequestParameters = new ModifyOrderRequestParameters(??) + { + Quantity = quantity, + CancellationToken = P_1, + SendingSource = P_2 + }; + modifyOrderRequestParameters.SetExecutionPrice(num); + TradingOperationResult tradingOperationResult = ?(modifyOrderRequestParameters); + advancedTradingOperationResult.?(modifyOrderRequestParameters, tradingOperationResult); + if (tradingOperationResult.Status != TradingOperationResultStatus.Success) + { + return advancedTradingOperationResult; + } + advancedTradingOperationResult.Value = tradingOperationResult.OrderId; + } + else + { + advancedTradingOperationResult.Value = ??.Id; + } + } + else + { + PlaceOrderRequestParameters placeOrderRequestParameters = new PlaceOrderRequestParameters(brackets.FirstOrDefault()) + { + Quantity = quantity, + CancellationToken = P_1, + GroupId = string.Empty, + SendingSource = P_2 + }; + advancedTradingOperationResult.?(?(brackets, P_1, P_2)); + placeOrderRequestParameters.SetExecutionPrice(num); + TradingOperationResult tradingOperationResult2 = ?(placeOrderRequestParameters); + if (tradingOperationResult2.Status != TradingOperationResultStatus.Success) + { + return advancedTradingOperationResult; + } + advancedTradingOperationResult.?(placeOrderRequestParameters, tradingOperationResult2); + advancedTradingOperationResult.Value = tradingOperationResult2.OrderId; + } + return advancedTradingOperationResult; + } + + private static AdvancedTradingOperationResult ?(? P_0, CancellationToken P_1, string P_2) + { + AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); + Position position = P_0.Position; + IList brackets = P_0.Brackets; + SlTpHolder initialBracketParameters = P_0.InitialBracketParameters; + double quantity = position.Quantity; + double num = ?(position, brackets, initialBracketParameters); + if (double.IsNaN(num)) + { + return AdvancedTradingOperationResult.?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + List source = brackets.Where((Order order) => string.IsNullOrEmpty(order.GroupId)).ToList(); + if (source.Any()) + { + Order ?? = source.Aggregate((Order order, Order order2) => (!(order.RemainingQuantity > order2.RemainingQuantity)) ? order2 : order); + advancedTradingOperationResult.?(?(brackets.Where((Order order) => order.Id != ??.Id).ToList(), P_1, P_2)); + if (Math.Abs(??.RemainingQuantity - quantity) > double.Epsilon || Math.Abs(??.GetExecutionPrice() - num) > double.Epsilon) + { + ModifyOrderRequestParameters modifyOrderRequestParameters = new ModifyOrderRequestParameters(??) + { + Quantity = quantity, + CancellationToken = P_1, + SendingSource = P_2 + }; + modifyOrderRequestParameters.SetExecutionPrice(num); + TradingOperationResult tradingOperationResult = ?(modifyOrderRequestParameters); + advancedTradingOperationResult.?(modifyOrderRequestParameters, tradingOperationResult); + if (tradingOperationResult.Status != TradingOperationResultStatus.Success) + { + return advancedTradingOperationResult; + } + advancedTradingOperationResult.Value = tradingOperationResult.OrderId; + } + else + { + advancedTradingOperationResult.Value = ??.Id; + } + } + else + { + PlaceOrderRequestParameters placeOrderRequestParameters = new PlaceOrderRequestParameters(brackets.FirstOrDefault()) + { + Quantity = quantity, + CancellationToken = P_1, + GroupId = string.Empty, + SendingSource = P_2 + }; + advancedTradingOperationResult.?(?(brackets, P_1, P_2)); + placeOrderRequestParameters.SetExecutionPrice(num); + TradingOperationResult tradingOperationResult2 = ?(placeOrderRequestParameters); + advancedTradingOperationResult.?(placeOrderRequestParameters, tradingOperationResult2); + if (tradingOperationResult2.Status != TradingOperationResultStatus.Success) + { + return advancedTradingOperationResult; + } + advancedTradingOperationResult.Value = tradingOperationResult2.OrderId; + } + return advancedTradingOperationResult; + } + + private static double ?(Position P_0, IEnumerable P_1, SlTpHolder P_2 = null) + { + if (P_2 != null) + { + if (P_2.PriceMeasurement != PriceMeasurement.Absolute) + { + return P_0.Symbol.RoundPriceToTickSize(P_0.Symbol.CalculatePrice(P_0.OpenPrice, (double)((P_0.Side != Side.Buy) ? 1 : (-1)) * P_2.Price)); + } + return P_2.Price; + } + if (P_0.Side != Side.Buy) + { + return P_1.Min((Order order) => order.GetExecutionPrice()); + } + return P_1.Max((Order order) => order.GetExecutionPrice()); + } + + private static double ?(Position P_0, IEnumerable P_1, SlTpHolder P_2 = null) + { + if (P_2 != null) + { + if (P_2.PriceMeasurement != PriceMeasurement.Absolute) + { + return P_0.Symbol.RoundPriceToTickSize(P_0.Symbol.CalculatePrice(P_0.OpenPrice, (double)((P_0.Side == Side.Buy) ? 1 : (-1)) * P_2.Price)); + } + return P_2.Price; + } + return CoreMath.GetWeightedAverage(P_1.Select((Order order) => (order.GetExecutionPrice(), order.RemainingQuantity)), P_0.Symbol); + } + + private static TradingOperationResult ?(PlaceOrderRequestParameters P_0) + { + ManualResetEventSlim ?? = new ManualResetEventSlim(); + string ?? = null; + try + { + Core.Instance.OrderAdded += delegate(Order order) + { + if (!??.IsSet) + { + if (!string.IsNullOrEmpty(??) && order.Id == ??) + { + ??.Set(); + } + else if (P_0.IsCorrespondingOrder(order)) + { + ??.Set(); + } + } + }; + Core.Instance.Connections[P_0.ConnectionId]?.Limitation?.Wait(P_0.Type, P_0.CancellationToken); + TradingOperationResult tradingOperationResult = Core.Instance.PlaceOrder(P_0); + if (tradingOperationResult != null && tradingOperationResult.Status == TradingOperationResultStatus.Failure) + { + return tradingOperationResult; + } + ?? = tradingOperationResult.OrderId; + ??.Wait(TimeSpan.FromSeconds(5.0)); + return tradingOperationResult; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + Core.Instance.OrderAdded -= delegate(Order order) + { + if (!??.IsSet) + { + if (!string.IsNullOrEmpty(??) && order.Id == ??) + { + ??.Set(); + } + else if (P_0.IsCorrespondingOrder(order)) + { + ??.Set(); + } + } + }; + } + return null; + } + + private static TradingOperationResult ?(ModifyOrderRequestParameters P_0) + { + ManualResetEventSlim ?? = new ManualResetEventSlim(); + try + { + Core.Instance.OrderAdded += delegate(Order order) + { + if (!??.IsSet && P_0.IsCorrespondingOrder(order)) + { + ??.Set(); + } + }; + Core.Instance.Connections[P_0.ConnectionId]?.Limitation?.Wait(P_0.Type, P_0.CancellationToken); + TradingOperationResult tradingOperationResult = Core.Instance.ModifyOrder(P_0); + if (tradingOperationResult != null && tradingOperationResult.Status == TradingOperationResultStatus.Failure) + { + return tradingOperationResult; + } + ??.Wait(TimeSpan.FromSeconds(5.0)); + return tradingOperationResult; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + Core.Instance.OrderAdded -= delegate(Order order) + { + if (!??.IsSet && P_0.IsCorrespondingOrder(order)) + { + ??.Set(); + } + }; + } + return null; + } + + private static AdvancedTradingOperationResult ?(IList P_0, CancellationToken P_1, string P_2) + { + if (!P_0.Any()) + { + return AdvancedTradingOperationResult.?(); + } + AdvancedTradingOperationResult advancedTradingOperationResult = new AdvancedTradingOperationResult(); + ManualResetEvent ?? = new ManualResetEvent(initialState: false); + HashSet ?? = new HashSet(P_0.Select((Order order) => order.Id)); + try + { + Core.Instance.OrderRemoved += delegate(Order order) + { + ??.Remove(order.Id); + if (??.Count == 0) + { + ??.Set(); + } + }; + foreach (Order item in P_0) + { + CancelOrderRequestParameters cancelOrderRequestParameters = new CancelOrderRequestParameters + { + Order = item, + CancellationToken = P_1, + SendingSource = P_2 + }; + item.Connection.Limitation?.Wait(cancelOrderRequestParameters.Type, cancelOrderRequestParameters.CancellationToken); + TradingOperationResult tradingOperationResult = Core.Instance.CancelOrder(cancelOrderRequestParameters); + if (tradingOperationResult != null && tradingOperationResult.Status == TradingOperationResultStatus.Failure) + { + ??.Remove(item.Id); + } + advancedTradingOperationResult.?(cancelOrderRequestParameters, tradingOperationResult); + } + if (!??.Any()) + { + ??.Set(); + } + ??.WaitOne(TimeSpan.FromSeconds(5.0)); + return advancedTradingOperationResult; + } + finally + { + Core.Instance.OrderRemoved -= delegate(Order order) + { + ??.Remove(order.Id); + if (??.Count == 0) + { + ??.Set(); + } + }; + } + } + } + public record GroupTradingOperation + { + public GroupTradingOperationType Type + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public GroupTradingOperationFilters Filters + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + [CompilerGenerated] + private readonly GroupTradingOperationType ??; + + [CompilerGenerated] + private readonly GroupTradingOperationFilters ??; + + public GroupTradingOperation(GroupTradingOperationType Type, GroupTradingOperationFilters Filters) + { + ?? = Type; + ?? = Filters; + base..ctor(); + } + + [CompilerGenerated] + public override string ToString() + { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (PrintMembers(stringBuilder)) + { + stringBuilder.Append(' '); + } + stringBuilder.Append('}'); + return stringBuilder.ToString(); + } + + [CompilerGenerated] + protected virtual bool PrintMembers(StringBuilder builder) + { + RuntimeHelpers.EnsureSufficientExecutionStack(); + builder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + builder.Append(Type.ToString()); + builder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + builder.Append(Filters.ToString()); + return true; + } + + [CompilerGenerated] + public void Deconstruct(out GroupTradingOperationType Type, out GroupTradingOperationFilters Filters) + { + Type = this.Type; + Filters = this.Filters; + } + } + [Flags] + public enum GroupTradingOperationFilters + { + None = 0, + Connection = 1, + Symbol = 2, + Account = 4, + Side = 8, + TimeInForce = 0x10, + OrderType = 0x20, + CertainOrders = 0x40 + } + public enum GroupTradingOperationType + { + CancelOrders, + ClosePositions, + ReversePositions, + Flatten + } + public interface ISubTradingOperation + { + GroupTradingOperation ParentOperation { get; } + } + /// + /// The allowed result. + /// + public sealed class AllowedResult + { + [CompilerGenerated] + private TradingOperationStatus ??; + + [CompilerGenerated] + private string ??; + + /// + /// Gets the status. + /// + public TradingOperationStatus Status + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = tradingOperationStatus; + } + } + + /// + /// Gets the reason. + /// + public string Reason + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Get the allowed result. + /// + /// An AllowedResult. + public static AllowedResult GetAllowedResult() + { + return new AllowedResult + { + Status = TradingOperationStatus.Allowed + }; + } + + /// + /// Gets the not allowed result. + /// + /// The reason. + /// An AllowedResult. + public static AllowedResult GetNotAllowedResult(string reason = "") + { + return new AllowedResult + { + Status = TradingOperationStatus.NotAllowed, + Reason = reason + }; + } + } + public static class TradingOperations + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func ??; + + internal bool ?(OrderType P_0) + { + if (P_0.Behavior == OrderTypeBehavior.Limit) + { + return (P_0.Usage & OrderTypeUsage.CloseOrder) == OrderTypeUsage.CloseOrder; + } + return false; + } + + internal bool ?(OrderType P_0) + { + if (P_0.Behavior == OrderTypeBehavior.Stop) + { + return (P_0.Usage & OrderTypeUsage.CloseOrder) == OrderTypeUsage.CloseOrder; + } + return false; + } + + internal bool ?(OrderType P_0) + { + if (P_0.Behavior == OrderTypeBehavior.TrailingStop) + { + return (P_0.Usage & OrderTypeUsage.CloseOrder) == OrderTypeUsage.CloseOrder; + } + return false; + } + } + + public static AllowedResult IsAllowed(TradingOperation operation, TradingOperationParameters parameters) + { + if (parameters == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (Core.Instance.TradingStatus == TradingStatus.Locked) + { + return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + Symbol symbol = parameters.Symbol; + if (symbol != null && symbol.State == BusinessObjectState.Fake) + { + return AllowedResult.GetNotAllowedResult(string.Empty); + } + if (parameters.Account.IsLocked()) + { + return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return operation switch + { + TradingOperation.PlaceOrder => ?(parameters), + TradingOperation.ModifyOrder => ?(parameters), + TradingOperation.CancelOrder => ?(parameters), + TradingOperation.ClosePosition => ?(parameters), + _ => throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + }; + } + + public static AllowedResult IsAllowed(TradingOperation operation, IList parametersList) + { + if (parametersList == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + foreach (TradingOperationParameters parameters in parametersList) + { + AllowedResult allowedResult = IsAllowed(operation, parameters); + if (allowedResult.Status == TradingOperationStatus.NotAllowed) + { + return allowedResult; + } + } + return AllowedResult.GetAllowedResult(); + } + + public static AllowedResult IsOrderTpAllowed(TradingOperationParameters parameters) + { + TradingObject tradingObject = (parameters.Order as TradingObject) ?? parameters.Position; + if (tradingObject == null) + { + return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + AllowedResult allowedResult = AllowedResult.GetAllowedResult(); + OrderType orderType = parameters.Order?.OrderType; + if (orderType != null) + { + allowedResult = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), tradingObject.Account, tradingObject.Symbol, orderType); + if (allowedResult.Status == TradingOperationStatus.NotAllowed) + { + return allowedResult; + } + allowedResult = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), tradingObject.Account, tradingObject.Symbol, orderType); + } + else + { + allowedResult = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), tradingObject.Account, tradingObject.Symbol); + } + if (allowedResult.Status == TradingOperationStatus.NotAllowed) + { + return allowedResult; + } + if ((Core.Instance.Connections[tradingObject.ConnectionId]?.BusinessObjects?.OrderTypes)?.FirstOrDefault((OrderType P_0) => P_0.Behavior == OrderTypeBehavior.Limit && (P_0.Usage & OrderTypeUsage.CloseOrder) == OrderTypeUsage.CloseOrder) == null) + { + return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return AllowedResult.GetAllowedResult(); + } + + public static AllowedResult IsOrderSlAllowed(TradingOperationParameters parameters) + { + TradingObject tradingObject = (parameters.Order as TradingObject) ?? parameters.Position; + if (tradingObject == null) + { + return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + AllowedResult allowedResult = AllowedResult.GetAllowedResult(); + OrderType orderType = parameters.Order?.OrderType; + if (orderType != null) + { + allowedResult = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), tradingObject.Account, tradingObject.Symbol, orderType); + if (allowedResult.Status == TradingOperationStatus.NotAllowed) + { + return allowedResult; + } + allowedResult = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), tradingObject.Account, tradingObject.Symbol, orderType); + } + else + { + allowedResult = Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), tradingObject.Account, tradingObject.Symbol); + } + if (allowedResult.Status == TradingOperationStatus.NotAllowed) + { + return allowedResult; + } + if ((Core.Instance.Connections[tradingObject.ConnectionId]?.BusinessObjects?.OrderTypes)?.FirstOrDefault((OrderType P_0) => P_0.Behavior == OrderTypeBehavior.Stop && (P_0.Usage & OrderTypeUsage.CloseOrder) == OrderTypeUsage.CloseOrder) == null) + { + return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return AllowedResult.GetAllowedResult(); + } + + public static AllowedResult IsOrderSLTrailAllowed(TradingOperationParameters parameters) + { + TradingObject tradingObject = (parameters.Order as TradingObject) ?? parameters.Position; + if (tradingObject == null) + { + return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + AllowedResult allowedResult = AllowedResult.GetAllowedResult(); + OrderType orderType = parameters.Order?.OrderType; + allowedResult = ((orderType == null) ? Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), tradingObject.Account, tradingObject.Symbol) : Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), tradingObject.Account, tradingObject.Symbol, orderType)); + if (allowedResult.Status == TradingOperationStatus.NotAllowed) + { + return allowedResult; + } + if ((Core.Instance.Connections[tradingObject.ConnectionId]?.BusinessObjects?.OrderTypes)?.FirstOrDefault((OrderType P_0) => P_0.Behavior == OrderTypeBehavior.TrailingStop && (P_0.Usage & OrderTypeUsage.CloseOrder) == OrderTypeUsage.CloseOrder) == null) + { + return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return AllowedResult.GetAllowedResult(); + } + + private static AllowedResult ?(TradingOperationParameters P_0) + { + if (P_0.Account != null && P_0.Symbol != null) + { + return Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), P_0.Account, P_0.Symbol); + } + if (P_0.Symbol != null) + { + return Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), P_0.Symbol); + } + return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + + private static AllowedResult ?(TradingOperationParameters P_0) + { + return AllowedResult.GetAllowedResult(); + } + + private static AllowedResult ?(TradingOperationParameters P_0) + { + if (P_0.Order == null || P_0.Order.State == BusinessObjectState.Fake) + { + return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return AllowedResult.GetAllowedResult(); + } + + private static AllowedResult ?(TradingOperationParameters P_0) + { + if (P_0.Position == null || P_0.Position.State == BusinessObjectState.Fake) + { + return AllowedResult.GetNotAllowedResult(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return AllowedResult.GetAllowedResult(); + } + } + /// + /// Defines advanced trading operation respond bundle + /// + public sealed class AdvancedTradingOperationResult + { + [CompilerGenerated] + private AdvancedTradingOperationResultStatus ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private object ??; + + [CompilerGenerated] + private IDictionary ??; + + /// + /// Respond operation state + /// + public AdvancedTradingOperationResultStatus Status + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = advancedTradingOperationResultStatus; + } + } + + /// + /// Respond message + /// + public string Message + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Respond value (optional) + /// + public object Value + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = obj; + } + } + + /// + /// Details of sub-operations + /// + public IDictionary Details + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dictionary; + } + } + + internal AdvancedTradingOperationResult() + { + Status = AdvancedTradingOperationResultStatus.Success; + Details = new Dictionary(); + } + + internal AdvancedTradingOperationResult(RequestParameters P_0, TradingOperationResult P_1) + : this() + { + ?(P_0, P_1); + } + + internal static AdvancedTradingOperationResult ?() + { + return new AdvancedTradingOperationResult(); + } + + internal static AdvancedTradingOperationResult ?(string P_0) + { + return new AdvancedTradingOperationResult + { + Status = AdvancedTradingOperationResultStatus.Failure, + Message = P_0 + }; + } + + internal void ?(RequestParameters P_0, TradingOperationResult P_1) + { + Details.Add(P_0, P_1); + ?(); + } + + internal AdvancedTradingOperationResult ?(AdvancedTradingOperationResult P_0) + { + foreach (var (key, value) in P_0.Details) + { + Details.Add(key, value); + } + ?(); + return this; + } + + private void ?() + { + int num = 0; + string text = null; + foreach (TradingOperationResult value in Details.Values) + { + switch (value.Status) + { + case TradingOperationResultStatus.Success: + num++; + break; + case TradingOperationResultStatus.Failure: + if (text == null) + { + text = value.Message; + } + break; + } + } + if (num == Details.Count) + { + Status = AdvancedTradingOperationResultStatus.Success; + return; + } + Message = text; + Status = ((num > 0) ? AdvancedTradingOperationResultStatus.PartiallySuccess : AdvancedTradingOperationResultStatus.Failure); + } + } + public sealed class BrandingInformationHelpLink + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private bool ??; + + public string Text + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string URL + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool Separator + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + } + public interface IBrandingInformation + { + string ApplicationName { get; } + + string ApplicationID { get; } + + string CopyrightDetails { get; } + + string PrivacePolicyUrl { get; } + + string TermsOfUseUrl { get; } + + string OfficialWebSite { get; } + + string LiveChatUrl { get; } + + string UpdateUrl { get; } + + string PricingPageUrl { get; } + + string AccountDashboardUrl { get; } + + string WelcomeScreenText { get; } + + string HelpCustomURL { get; } + + string GitCustomURL { get; } + + string ReleaseNotesURL { get; } + + BrandingInformationHelpLink[] HelpLinks { get; } + + bool IsGrayLabel { get; } + + /// + /// Get all available custom resources + /// + string[] GetResourceNames(); + + /// + /// Get custom resource stream by name + /// + Stream GetResource(string resourceName); + + /// + /// Check whether specified items was hidden by branding specification + /// + /// + bool IsItemHidden(string itemType, string itemName); + } +} +namespace ? +{ + internal sealed class ? : IBrandingInformation + { + public string ApplicationName => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public string ApplicationID => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public string CopyrightDetails => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public string PrivacePolicyUrl => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public string TermsOfUseUrl => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public string OfficialWebSite => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public string LiveChatUrl => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public string UpdateUrl => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public string PricingPageUrl => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public string AccountDashboardUrl => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public string WelcomeScreenText => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public string HelpCustomURL => null; + + public string GitCustomURL => null; + + public string ReleaseNotesURL => null; + + public BrandingInformationHelpLink[] HelpLinks => null; + + public bool IsGrayLabel => false; + + public string[] GetResourceNames() + { + return null; + } + + public Stream GetResource(string resourceName) + { + return null; + } + + public bool IsItemHidden(string itemType, string itemName) + { + return false; + } + } +} +namespace TradingPlatform.BusinessLayer +{ + /// + /// The assembly loader. + /// + public static class AssemblyLoader + { + private class ? + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private Assembly ??; + + public string AssemblyFolder + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = text; + } + } + + public Assembly Assembly + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = assembly; + } + } + + public ?(string P_0, Assembly P_1) + { + AssemblyFolder = P_0; + Assembly = P_1; + } + } + + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + internal Assembly? ?(object P_0, ResolveEventArgs P_1) + { + try + { + try + { + if (P_1.RequestingAssembly != null && ??.TryGetValue(P_1.Name, out var value) && File.Exists(value)) + { + Assembly assembly = Assembly.Load(File.ReadAllBytes(value)); + if ((object)assembly != null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(74, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_1.Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_1.RequestingAssembly); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + LoggerManager loggers2 = Core.Instance.Loggers; + defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(74, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_1.Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_1.RequestingAssembly); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + loggers2.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + return assembly; + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + if (P_1.RequestingAssembly != null && ??.TryGetValue(P_1.RequestingAssembly.FullName, out var value2)) + { + Assembly assembly2 = AssemblyLoader.?(P_1.Name, value2.AssemblyFolder); + if ((object)assembly2 != null) + { + return assembly2; + } + if (??.TryGetValue(P_1.Name, out var value3)) + { + return value3.Assembly; + } + LoggerManager loggers3 = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(74, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_1.Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_1.RequestingAssembly); + loggers3.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + } + } + catch (Exception ex2) + { + Core.Instance.Loggers.Log(ex2); + } + return null; + } + } + + private static readonly HashSet ??; + + private static readonly Dictionary ??; + + private static readonly Dictionary ??; + + private static Dictionary> ??; + + static AssemblyLoader() + { + ?? = new Dictionary>(); + ?? = new Dictionary(); + ?? = new HashSet + { + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }; + try + { + ?? = new Dictionary(); + string text = Path.Combine(Const.CUSTOM_SCRIPTS_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (File.Exists(text)) + { + XmlDocument xmlDocument = new XmlDocument(); + xmlDocument.Load(text); + foreach (XmlNode childNode in xmlDocument.DocumentElement.ChildNodes) + { + if (childNode.Attributes[3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()] != null && childNode.Attributes[3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()] != null) + { + string value = Path.Combine(Const.CUSTOM_SCRIPTS_PATH, childNode.Attributes[3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()].Value); + ??[childNode.Attributes[3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()].Value] = value; + } + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + AppDomain.CurrentDomain.AssemblyResolve += delegate(object P_0, ResolveEventArgs P_1) + { + try + { + try + { + if (P_1.RequestingAssembly != null && ??.TryGetValue(P_1.Name, out var value2) && File.Exists(value2)) + { + Assembly assembly = Assembly.Load(File.ReadAllBytes(value2)); + if ((object)assembly != null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(74, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_1.Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_1.RequestingAssembly); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + LoggerManager loggers2 = Core.Instance.Loggers; + defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(74, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_1.Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_1.RequestingAssembly); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value2); + loggers2.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + return assembly; + } + } + } + catch (Exception ex2) + { + Core.Instance.Loggers.Log(ex2); + } + if (P_1.RequestingAssembly != null && ??.TryGetValue(P_1.RequestingAssembly.FullName, out var value3)) + { + Assembly assembly2 = ?(P_1.Name, value3.AssemblyFolder); + if ((object)assembly2 != null) + { + return assembly2; + } + if (??.TryGetValue(P_1.Name, out var value4)) + { + return value4.Assembly; + } + LoggerManager loggers3 = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(74, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_1.Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_1.RequestingAssembly); + loggers3.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + } + } + catch (Exception ex3) + { + Core.Instance.Loggers.Log(ex3); + } + return (Assembly?)null; + }; + } + + /// + /// Load types. + /// + /// The folder name. + /// The target type. + /// The assembly name filter. + /// The search option. + /// If true, load in memory. + /// If true, allow loading references. + /// ]]> + public static List LoadTypes(string folderName, Type targetType, string assemblyNameFilter = null, SearchOption searchOption = SearchOption.TopDirectoryOnly, bool loadInMemory = false, bool allowLoadingReferences = false) + { + List list = new List(); + try + { + foreach (string item in Directory.EnumerateFiles(Path.Combine(Const.EXECUTING_FOLDER, folderName), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), searchOption)) + { + string fileName = Path.GetFileName(item); + if (string.IsNullOrEmpty(assemblyNameFilter) || fileName.Contains(assemblyNameFilter)) + { + List list2 = ?(item, targetType, loadInMemory, allowLoadingReferences); + if (list2 != null) + { + list.AddRange(list2); + } + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + return list; + } + + internal static List ?(string P_0, Type P_1, bool P_2 = false, bool P_3 = false) + { + List list = new List(); + try + { + Assembly assembly = (P_2 ? Assembly.Load(File.ReadAllBytes(P_0)) : Assembly.LoadFrom(P_0)); + if (P_3) + { + ??[assembly.FullName] = new ?(Path.GetDirectoryName(P_0), assembly); + } + foreach (Type exportedType in assembly.ExportedTypes) + { + if (!exportedType.IsAbstract && (P_1.IsAssignableFrom(exportedType) || exportedType.GetInterfaces().Contains(P_1))) + { + list.Add(new TypeWrapper(exportedType, P_0)); + } + } + if (P_3 && list.Any()) + { + ?(assembly, P_0); + } + } + catch (BadImageFormatException ex) + { + Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); + } + catch (Exception ex2) + { + Core.Instance.Loggers.Log(ex2); + } + return list; + } + + private static void ?(Assembly P_0, string P_1) + { + AssemblyName[] referencedAssemblies = P_0.GetReferencedAssemblies(); + foreach (AssemblyName assemblyName in referencedAssemblies) + { + if (assemblyName.Name.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) || ??.Contains(assemblyName.Name)) + { + continue; + } + try + { + string path = Path.Combine(Path.GetDirectoryName(P_1), assemblyName.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (File.Exists(path)) + { + Assembly assembly = Assembly.Load(File.ReadAllBytes(path)); + if ((object)assembly != null) + { + ??[assemblyName.FullName] = new ?(Path.GetDirectoryName(P_1), assembly); + ?(assembly, P_1); + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + } + + private static void ?(string P_0) + { + ??[P_0] = new Dictionary(); + foreach (string item in Directory.EnumerateFiles(P_0, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SearchOption.AllDirectories)) + { + try + { + Assembly assembly = Assembly.Load(File.ReadAllBytes(item)); + if ((object)assembly != null) + { + ??[P_0][assembly.FullName] = assembly; + } + } + catch (BadImageFormatException ex) + { + Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); + } + catch (Exception ex2) + { + Core.Instance.Loggers.Log(ex2); + } + } + } + + private static Assembly ?(string P_0, string P_1) + { + if (!??.ContainsKey(P_1)) + { + ?(P_1); + } + if (??.TryGetValue(P_1, out var value) && value.TryGetValue(P_0, out var value2)) + { + return value2; + } + return null; + } + } + public class TypeWrapper + { + [CompilerGenerated] + private Type ??; + + [CompilerGenerated] + private string ??; + + public Type Type + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = type; + } + } + + public string AssemblyLocation + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + internal TypeWrapper(Type P_0, string P_1) + { + Type = P_0; + AssemblyLocation = P_1; + } + + public static implicit operator Type(TypeWrapper typeWrapper) + { + return typeWrapper.Type; + } + + public override string ToString() + { + return Type?.ToString(); + } + } +} +namespace ? +{ + internal enum ? + { + ??, + ??, + ??, + ??, + ??, + ??, + ??, + ??, + ??, + ??, + ??, + ??, + ??, + ??, + ??, + ??, + ??, + ??, + ??, + ?? + } +} +namespace TradingPlatform.BusinessLayer +{ + /// + /// Quote type for subscribtion dictum + /// + public enum SubscribeQuoteType + { + /// + /// Level 1 quote + /// + Quote, + /// + /// Level 2 quote + /// + Level2, + /// + /// Last + /// + Last, + /// + /// Mark price + /// + Mark + } + [DataContract(Name = "HistoryType", Namespace = "TradingPlatform")] + public enum HistoryType + { + [Description("Bid")] + [EnumMember] + Bid, + [Description("Ask")] + [EnumMember] + Ask, + [Description("Midpoint")] + [EnumMember] + Midpoint, + [Description("Last")] + [EnumMember] + Last, + [Description("Bid/Ask")] + [EnumMember] + BidAsk, + [Description("Mark")] + [EnumMember] + Mark + } + public enum Side + { + Buy, + Sell + } + [Flags] + public enum LoggingLevel + { + System = 1, + [Description("Exception")] + Error = 2, + Trading = 4, + Verbose = 8, + Quotes = 0x10, + Painting = 0x20, + Performance = 0x40, + [Description("Loading history")] + LoadingHistory = 0x80 + } + /// + /// Trading operation state + /// + public enum TradingOperationResultStatus + { + Success, + Failure + } + /// + /// Complex trading operation state + /// + public enum AdvancedTradingOperationResultStatus + { + Success, + PartiallySuccess, + Failure + } + public enum NonFixedListDownload + { + Download, + IgnoreDownload + } + [DataContract(Name = "OptionType", Namespace = "TradingPlatform")] + public enum OptionType + { + [EnumMember] + Call, + [EnumMember] + Put + } + [Obfuscation(Exclude = true)] + public enum AggressorFlag + { + [Description("None")] + None, + [Description("Buy")] + Buy, + [Description("Sell")] + Sell, + [Description("Not set")] + NotSet + } + [Obfuscation(Exclude = true)] + public enum TickDirection + { + [Description("Not set")] + NotSet, + [Description("None")] + None, + [Description("Up")] + Up, + [Description("Down")] + Down + } + public enum CloseOrderType + { + [Description("Stop loss")] + StopLoss, + [Description("Take profit")] + TakeProfit + } + public enum TradingStatus + { + Allowed, + Locked, + AllowedFromStrategies + } + public enum TradingOperationStatus + { + Allowed, + NotAllowed + } + public enum TradingOperation + { + PlaceOrder, + ModifyOrder, + CancelOrder, + ClosePosition + } + public enum ValidateState + { + Valid, + NotValid + } + public enum RequestType + { + PlaceOrder, + ModifyOrder, + History, + Symbol, + SearchSymbol, + QuoteSubscribe, + FutureContracts, + OptionSeries, + Strikes, + ClosePosition, + CancelOrder, + Custom, + PnL, + Report, + Connect, + VolumeAnalysis, + VolumeAnalysisByPeriod, + PlaceMultiOrderOrder, + TradesHistory, + OrdersHistory, + ConvertPosition, + TradingSignals + } + public enum ColouringModes + { + [Description("None")] + None, + [Description("Compare to previous")] + Previous, + [Description("By sign")] + Signed + } + [Flags] + public enum NativeModifierKeys + { + None = 0, + Alt = 1, + Shift = 2, + Control = 4 + } + public enum NativeAlignment + { + NotSet, + Left, + Center, + Right + } + public enum NativeKey + { + None = 0, + Cancel = 1, + Back = 2, + Tab = 3, + LineFeed = 4, + Clear = 5, + Return = 6, + Enter = 6, + Pause = 7, + Capital = 8, + CapsLock = 8, + KanaMode = 9, + HangulMode = 9, + JunjaMode = 10, + FinalMode = 11, + HanjaMode = 12, + KanjiMode = 12, + Escape = 13, + ImeConvert = 14, + ImeNonConvert = 15, + ImeAccept = 16, + ImeModeChange = 17, + Space = 18, + Prior = 19, + PageUp = 19, + PageDown = 20, + End = 21, + Home = 22, + Left = 23, + Up = 24, + Right = 25, + Down = 26, + Select = 27, + Print = 28, + Execute = 29, + Snapshot = 30, + PrintScreen = 30, + Insert = 31, + Delete = 32, + Help = 33, + D0 = 34, + D1 = 35, + D2 = 36, + D3 = 37, + D4 = 38, + D5 = 39, + D6 = 40, + D7 = 41, + D8 = 42, + D9 = 43, + A = 44, + B = 45, + C = 46, + D = 47, + E = 48, + F = 49, + G = 50, + H = 51, + I = 52, + J = 53, + K = 54, + L = 55, + M = 56, + N = 57, + O = 58, + P = 59, + Q = 60, + R = 61, + S = 62, + T = 63, + U = 64, + V = 65, + W = 66, + X = 67, + Y = 68, + Z = 69, + LWin = 70, + RWin = 71, + Apps = 72, + Sleep = 73, + NumPad0 = 74, + NumPad1 = 75, + NumPad2 = 76, + NumPad3 = 77, + NumPad4 = 78, + NumPad5 = 79, + NumPad6 = 80, + NumPad7 = 81, + NumPad8 = 82, + NumPad9 = 83, + Multiply = 84, + Add = 85, + Separator = 86, + Subtract = 87, + Decimal = 88, + Divide = 89, + F1 = 90, + F2 = 91, + F3 = 92, + F4 = 93, + F5 = 94, + F6 = 95, + F7 = 96, + F8 = 97, + F9 = 98, + F10 = 99, + F11 = 100, + F12 = 101, + F13 = 102, + F14 = 103, + F15 = 104, + F16 = 105, + F17 = 106, + F18 = 107, + F19 = 108, + F20 = 109, + F21 = 110, + F22 = 111, + F23 = 112, + F24 = 113, + NumLock = 114, + Scroll = 115, + LeftShift = 116, + RightShift = 117, + LeftCtrl = 118, + RightCtrl = 119, + LeftAlt = 120, + RightAlt = 121, + BrowserBack = 122, + BrowserForward = 123, + BrowserRefresh = 124, + BrowserStop = 125, + BrowserSearch = 126, + BrowserFavorites = 127, + BrowserHome = 128, + VolumeMute = 129, + VolumeDown = 130, + VolumeUp = 131, + MediaNextTrack = 132, + MediaPreviousTrack = 133, + MediaStop = 134, + MediaPlayPause = 135, + LaunchMail = 136, + SelectMedia = 137, + LaunchApplication1 = 138, + LaunchApplication2 = 139, + Oem1 = 140, + OemSemicolon = 140, + OemPlus = 141, + OemComma = 142, + OemMinus = 143, + OemPeriod = 144, + Oem2 = 145, + OemQuestion = 145, + Oem3 = 146, + OemTilde = 146, + AbntC1 = 147, + AbntC2 = 148, + Oem4 = 149, + OemOpenBrackets = 149, + Oem5 = 150, + OemPipe = 150, + Oem6 = 151, + OemCloseBrackets = 151, + Oem7 = 152, + OemQuotes = 152, + Oem8 = 153, + Oem102 = 154, + OemBackslash = 154, + ImeProcessed = 155, + System = 156, + OemAttn = 157, + DbeAlphanumeric = 157, + OemFinish = 158, + DbeKatakana = 158, + OemCopy = 159, + DbeHiragana = 159, + OemAuto = 160, + DbeSbcsChar = 160, + OemEnlw = 161, + DbeDbcsChar = 161, + OemBackTab = 162, + DbeRoman = 162, + Attn = 163, + DbeNoRoman = 163, + CrSel = 164, + DbeEnterWordRegisterMode = 164, + ExSel = 165, + DbeEnterImeConfigureMode = 165, + EraseEof = 166, + DbeFlushString = 166, + Play = 167, + DbeCodeInput = 167, + Zoom = 168, + DbeNoCodeInput = 168, + NoName = 169, + DbeDetermineString = 169, + Pa1 = 170, + DbeEnterDialogConversionMode = 170, + OemClear = 171, + DeadCharProcessed = 172 + } + public class NativeKeyEventArgs + { + [CompilerGenerated] + private readonly NativeKey ??; + + [CompilerGenerated] + private readonly NativeModifierKeys ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + public NativeKey Key + { + [CompilerGenerated] + get + { + return ??; + } + } + + public NativeModifierKeys Modifiers + { + [CompilerGenerated] + get + { + return ??; + } + } + + public bool Handled + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool IsRepeated + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public NativeKeyEventArgs(NativeKey key, NativeModifierKeys modifiers) + { + ?? = key; + ?? = modifiers; + } + } + public enum NativeDragDropEffects + { + Scroll = int.MinValue, + All = -2147483645, + None = 0, + Copy = 1, + Move = 2, + Link = 4 + } + public class NativeDragEventArgs + { + [CompilerGenerated] + private NativeDragDropEffects ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private readonly object[] ??; + + [CompilerGenerated] + private object ??; + + [CompilerGenerated] + private readonly Point ??; + + public NativeDragDropEffects Effects + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool Handled + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public object[] Data + { + [CompilerGenerated] + get + { + return ??; + } + } + + public object Source + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Point MousePosition + { + [CompilerGenerated] + get + { + return ??; + } + } + + public NativeDragEventArgs(NativeDragDropEffects effects, object source, object[] data, Point mousePosition) + { + Effects = effects; + Source = source; + ?? = data; + ?? = mousePosition; + } + + public NativeDragEventArgs(object source, object[] data, Point mousePosition) + { + Source = source; + ?? = data; + ?? = mousePosition; + } + } + public enum NativeWindowCaptionButtonType + { + Action, + Maximize, + Minimize, + Close, + FullScreen, + None + } + public enum PositionImpactType + { + Undefined, + Open, + Close + } + [Obfuscation(Exclude = true)] + public enum CorporateActionType + { + Undefined, + Split, + Dividend + } + public enum EntityLifecycle + { + Created, + Changed, + Removed + } + public enum VwapStdCalculationType + { + StandardDeviation, + VWAPVariance + } + public enum VWAPStandardDeviationMode + { + [Description("Single")] + Single, + [Description("Multiple")] + Multiple + } + public enum VwapDataType + { + [Description("Tick")] + Tick, + [Description("Current TF")] + CurrentTF + } + public enum VwapPriceType + { + [Description("Open")] + Open, + [Description("High")] + High, + [Description("Low")] + Low, + [Description("Close")] + Close, + [Description("HL/2")] + HL2, + [Description("HLC/3")] + HLC3, + [Description("OHLC/4")] + OHLC4 + } + public enum HistoryProcessorReversalCalculationType + { + [Description("Previous bar")] + PreviousBar, + [Description("Independent")] + Independent + } +} +namespace ? +{ + internal class ? : IBufferedProcessorValue + { + public ? ??; + + public IConnectionBindedObject ??; + + public ? Key => ??; + + public ?(? P_0, IConnectionBindedObject P_1) + { + ?? = P_0; + ?? = P_1; + } + } +} +namespace TradingPlatform.BusinessLayer +{ + /// + /// The account extensions. + /// + public static class AccountExtensions + { + /// + /// Returns a custom name if available otherwise, returns the name. + /// + /// The account. + public static string GetCurrentName(this Account account) + { + string text = Core.Instance.CustomAccountPropertiesProvider.GetProperty(account, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) as string; + if (!string.IsNullOrEmpty(text)) + { + return text; + } + return account.Name; + } + + /// + /// Returns information about whether the account supports trading operations + /// + /// The account. + public static bool IsLocked(this Account account) + { + return Core.Instance.CustomAccountPropertiesProvider.GetProperty(account, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) as bool? == true; + } + } + /// + /// The aggressor flag calculator extensions. + /// + public static class AggressorFlagCalculatorExtensions + { + /// + /// Collect bid ask. + /// + /// The calculator. + /// The quote. + public static void CollectBidAsk(this IAggressorFlagCalculator calculator, Quote quote) + { + calculator.CollectBidAsk(quote.SymbolId, quote.Time.Ticks, quote.Bid, quote.Ask); + } + + /// + /// Calculate aggressor flag. + /// + /// The calculator. + /// The last. + /// An AggressorFlag. + public static AggressorFlag CalculateAggressorFlag(this IAggressorFlagCalculator calculator, Last last) + { + return calculator.CalculateAggressorFlag(last.SymbolId, last.Time.Ticks, last.Price); + } + } + public static class DateTimeExtensions + { + public static DateTime ToSelectedTimeZone(this DateTime dt) + { + return Core.Instance.TimeUtils.ConvertFromUTCToSelectedTimeZone(dt); + } + + public static DateTime FromSelectedTimeZoneToUtc(this DateTime dt) + { + return Core.Instance.TimeUtils.ConvertFromSelectedTimeZoneToUTC(dt); + } + + public static DateTime TrimSeconds(this DateTime value) + { + return new DateTime(value.Year, value.Month, value.Day, value.Hour, value.Minute, 0, value.Kind); + } + + public static DateTime CeilingTo(this DateTime value, TimeSpan timeSpan) + { + long num = value.Ticks % timeSpan.Ticks; + if (num == 0L) + { + return value; + } + return new DateTime(value.Ticks - num + timeSpan.Ticks, value.Kind); + } + + public static DateTime CeilingTo(this DateTime value, Period period) + { + return value.CeilingTo(TimeSpan.FromTicks(period.Ticks)); + } + + public static DateTime FloorTo(this DateTime value, TimeSpan timeSpan) + { + return new DateTime(value.Ticks - value.Ticks % timeSpan.Ticks, value.Kind); + } + + public static DateTime FloorTo(this DateTime value, Period period) + { + return value.FloorTo(TimeSpan.FromTicks(period.Ticks)); + } + + public static long ToUnixSeconds(this DateTime dateTime) + { + return new DateTimeOffset(dateTime).ToUnixTimeSeconds(); + } + + public static long ToUnixMilliseconds(this DateTime dateTime) + { + return new DateTimeOffset(dateTime).ToUnixTimeMilliseconds(); + } + + public static DateTime SetKind(this DateTime dateTime, DateTimeKind kind) + { + return new DateTime(dateTime.Ticks, kind); + } + + public static int GetWeekOfYear(this DateTime dateTime, DayOfWeek firstWeekDay = DayOfWeek.Monday) + { + return CultureInfo.InvariantCulture.Calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstFullWeek, firstWeekDay); + } + + public static IEnumerable GetDaysOfWeekForCurrMonth(this DateTime date, DayOfWeek dayOfWeek) + { + DateTime dateTime = new DateTime(date.Year, date.Month, 1); + DateTime dateTime2 = dateTime.AddMonths(1); + while (dateTime < dateTime2 && dateTime.DayOfWeek != dayOfWeek) + { + dateTime = dateTime.AddDays(1.0); + } + while (dateTime < dateTime2) + { + yield return dateTime; + dateTime = dateTime.AddDays(7.0); + } + } + } + public static class DateTimeIntervalExtensions + { + public static TimeSpan GetLength(this Interval interval) + { + return TimeSpan.FromTicks(Math.Abs(interval.From.Ticks - interval.To.Ticks)); + } + + public static IEnumerable> Split(this Interval interval, TimeSpan step, bool roundToStep = false) + { + if (step == TimeSpan.Zero || step == Timeout.InfiniteTimeSpan) + { + yield return interval; + yield break; + } + DateTime dateTime; + DateTime to; + if (interval.IsReversal) + { + to = interval.From; + do + { + dateTime = to.Add(-step); + if (roundToStep) + { + dateTime = dateTime.CeilingTo(step); + } + if (dateTime < interval.To) + { + dateTime = interval.To; + } + yield return new Interval(dateTime, to); + to = dateTime; + } + while (dateTime > interval.To); + yield break; + } + dateTime = interval.From; + do + { + to = dateTime.Add(step); + if (roundToStep) + { + to = to.FloorTo(step); + } + if (to > interval.To) + { + to = interval.To; + } + yield return new Interval(dateTime, to); + dateTime = to; + } + while (to.Ticks < interval.To.Ticks); + } + + public static bool Contains(this Interval interval, Period period) + { + DateTime value = interval.From; + DateTime dateTime = interval.To; + if (interval.IsReversal) + { + value = interval.To; + dateTime = interval.From; + } + dateTime = dateTime.AddTicks(1L); + long ticks = value.CeilingTo(period).Ticks; + long ticks2 = dateTime.FloorTo(period).Ticks; + return period.Ticks <= ticks2 - ticks; + } + } + public static class DelegateExtensions + { + public static void InvokeSafely(this Delegate @delegate, params object[] args) + { + if ((object)@delegate == null) + { + return; + } + Delegate[] invocationList = @delegate.GetInvocationList(); + foreach (Delegate obj in invocationList) + { + try + { + obj.DynamicInvoke(args); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + } + } + public static class DoubleExtensions + { + private const string ?? = "#,0.##########"; + + public static string Format(this double value, int precision = 2, bool abbreviate = false) + { + if (double.IsNaN(value)) + { + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); + } + if (abbreviate) + { + return value.?(precision); + } + double num = ((value == -0.0) ? Math.Abs(value) : value); + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(1, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(precision); + return num.ToString(defaultInterpolatedStringHandler.ToStringAndClear()); + } + + private static string ?(this double P_0, int P_1) + { + string value = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); + if (Math.Abs(P_0) >= 1000000000000.0) + { + P_0 /= 1000000000000.0; + value = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + else if (Math.Abs(P_0) >= 1000000000.0) + { + P_0 /= 1000000000.0; + value = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + else if (Math.Abs(P_0) >= 1000000.0) + { + P_0 /= 1000000.0; + value = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + else if (Math.Abs(P_0) >= 1000.0) + { + P_0 /= 1000.0; + value = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler; + if (!string.IsNullOrEmpty(value)) + { + defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(1, 2); + defaultInterpolatedStringHandler.AppendFormatted(P_0.?(1)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(1, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_1); + return P_0.ToString(defaultInterpolatedStringHandler.ToStringAndClear()); + } + + private static double ?(this double P_0, int P_1) + { + double num = Math.Pow(10.0, P_1); + return Math.Truncate(P_0 * num) / num; + } + + public static bool IsNanOrDefault(this double value) + { + if (value != 0.0) + { + return double.IsNaN(value); + } + return true; + } + + public static string FormatPriceWithMaxPrecision(this double price, IFormatProvider formatProvider = null) + { + if (double.IsInfinity(price) || double.IsNaN(price)) + { + price = 0.0; + } + if (formatProvider != null) + { + return price.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), formatProvider); + } + return price.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + + public static string FormatPriceWithMaxPrecision(this double price, int precision) + { + if (double.IsInfinity(price) || double.IsNaN(price)) + { + price = 0.0; + } + string text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + for (int i = 0; i < precision; i++) + { + text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + for (int j = precision; j < 10; j++) + { + text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + return price.ToString(text); + } + + public static double RoundTo(this double value, int degree) + { + decimal num = (decimal)value; + decimal num2 = (decimal)Math.Pow(10.0, degree); + return (double)(num - num % num2); + } + } + public static class EnumExtensions + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + internal string ?(EnumMemberAttribute P_0) + { + return P_0.Value; + } + + internal string ?(DescriptionAttribute P_0) + { + return P_0.Description; + } + } + + public static string GetEnumMember(this Enum value) + { + return value.GetAttributeValueOrDefault((EnumMemberAttribute P_0) => P_0.Value, value.ToString()); + } + + public static string GetDescription(this Enum value) + { + return value.GetAttributeValueOrDefault((DescriptionAttribute P_0) => P_0.Description, value.ToString()); + } + + public static TValue GetAttributeValueOrDefault(this Enum value, Func valueFunc, TValue defaultValue) where TAttribute : Attribute + { + TAttribute attribute = value.GetAttribute(); + if (valueFunc == null || attribute == null) + { + return defaultValue; + } + return valueFunc(attribute); + } + + public static TAttribute GetAttribute(this Enum value) where TAttribute : Attribute + { + return value.GetType().GetField(value.ToString()).GetCustomAttributes(typeof(TAttribute), inherit: false) + .Cast() + .FirstOrDefault(); + } + } + public static class ExceptionExtensions + { + public static string GetMessageRecursive(this Exception exception) + { + return exception?.InnerException?.GetMessageRecursive() ?? exception?.Message ?? string.Empty; + } + + public static string GetFullMessageRecursive(this Exception exception) + { + StringBuilder stringBuilder = new StringBuilder(exception.Message); + if (exception.InnerException != null) + { + StringBuilder stringBuilder2 = stringBuilder; + StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(18, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(exception.InnerException.GetFullMessageRecursive()); + stringBuilder2.Append(ref handler); + } + return stringBuilder.ToString(); + } + + public static IEnumerable GetInnerExceptionsRecursive(this Exception exception) + { + for (Exception ex = exception; ex != null; ex = ex.InnerException) + { + yield return ex; + } + } + } + public static class HistoricalDataExtensions + { + /// + /// Gets the price from historical data + /// + /// + /// + /// + public static double GetPrice(this HistoricalData historicalData, PriceType priceType, int offset = 0) + { + return historicalData[offset, SeekOriginHistory.End][priceType]; + } + + /// + /// Get Bid price + /// + /// Offset value + /// + public static double Bid(this HistoricalData historicalData, int offset = 0) + { + return historicalData.GetPrice(PriceType.Bid, offset); + } + + /// + /// Get Ask price + /// + /// Offset value + /// + public static double Ask(this HistoricalData historicalData, int offset = 0) + { + return historicalData.GetPrice(PriceType.Ask, offset); + } + + /// + /// Get Last price + /// + /// Offset value + /// + public static double Last(this HistoricalData historicalData, int offset = 0) + { + return historicalData.GetPrice(PriceType.Last, offset); + } + + /// + /// Get Open price + /// + /// Offset value + /// + public static double Open(this HistoricalData historicalData, int offset = 0) + { + return historicalData.GetPrice(PriceType.Open, offset); + } + + /// + /// Get High price + /// + /// Offset value + /// + public static double High(this HistoricalData historicalData, int offset = 0) + { + return historicalData.GetPrice(PriceType.High, offset); + } + + /// + /// Get Low price + /// + /// Offset value + /// + public static double Low(this HistoricalData historicalData, int offset = 0) + { + return historicalData.GetPrice(PriceType.Low, offset); + } + + /// + /// Get Close price + /// + /// Offset value + /// + public static double Close(this HistoricalData historicalData, int offset = 0) + { + return historicalData.GetPrice(PriceType.Close, offset); + } + + /// + /// Get Median price + /// + /// Offset value + /// + public static double Median(this HistoricalData historicalData, int offset = 0) + { + return historicalData.GetPrice(PriceType.Median, offset); + } + + /// + /// Get Typical price + /// + /// Offset value + /// + public static double Typical(this HistoricalData historicalData, int offset = 0) + { + return historicalData.GetPrice(PriceType.Typical, offset); + } + + /// + /// Get Weighted price + /// + /// Offset value + /// + public static double Weighted(this HistoricalData historicalData, int offset = 0) + { + return historicalData.GetPrice(PriceType.Weighted, offset); + } + + /// + /// Get Volume + /// + /// Offset value + /// + public static double Volume(this HistoricalData historicalData, int offset = 0) + { + return historicalData.GetPrice(PriceType.Volume, offset); + } + + /// + /// Get Volume in quoting asset + /// + /// Offset value + /// + public static double QuoteAssetVolume(this HistoricalData historicalData, int offset = 0) + { + return historicalData.GetPrice(PriceType.QuoteAssetVolume, offset); + } + + /// + /// Get Ticks + /// + /// Offset value + /// + public static double Ticks(this HistoricalData historicalData, int offset = 0) + { + return historicalData.GetPrice(PriceType.Ticks, offset); + } + + /// + /// Get Open interest + /// + /// Offset value + /// + public static double OpenInterest(this HistoricalData historicalData, int offset = 0) + { + return historicalData.GetPrice(PriceType.OpenInterest, offset); + } + + /// + /// Get Funding rate + /// + /// Offset value + /// + public static double FundingRate(this HistoricalData historicalData, int offset = 0) + { + return historicalData.GetPrice(PriceType.FundingRate, offset); + } + + /// + /// Get Time + /// + /// Offset value + /// + public static DateTime Time(this HistoricalData historicalData, int offset = 0) + { + return new DateTime(historicalData[offset, SeekOriginHistory.End].TicksLeft, DateTimeKind.Utc); + } + } + public static class HistoryItemExtensions + { + public static void ProcessTickDirection(this IList historyItems, CancellationToken cancellationToken) + { + if (historyItems == null || historyItems.Count == 0 || historyItems[0] is HistoryItemBar) + { + return; + } + if (historyItems[0] is HistoryItemTick) + { + double previousPrice = double.NaN; + double previousPrice2 = double.NaN; + TickDirection prevItemTickDirection = TickDirection.NotSet; + TickDirection prevItemTickDirection2 = TickDirection.NotSet; + { + foreach (HistoryItemTick item in historyItems.OfType()) + { + if (cancellationToken.IsCancellationRequested) + { + break; + } + item.BidTickDirection = Symbol.DetermineTickDirection(previousPrice, item.Bid, prevItemTickDirection); + item.AskTickDirection = Symbol.DetermineTickDirection(previousPrice2, item.Ask, prevItemTickDirection2); + previousPrice = item.Bid; + previousPrice2 = item.Ask; + prevItemTickDirection = item.BidTickDirection; + prevItemTickDirection2 = item.AskTickDirection; + } + return; + } + } + double previousPrice3 = double.NaN; + TickDirection prevItemTickDirection3 = TickDirection.NotSet; + foreach (HistoryItemLast item2 in historyItems.OfType()) + { + if (cancellationToken.IsCancellationRequested) + { + break; + } + item2.TickDirection = Symbol.DetermineTickDirection(previousPrice3, item2.Price, prevItemTickDirection3); + previousPrice3 = item2.Price; + prevItemTickDirection3 = item2.TickDirection; + } + } + } + public static class Int32Extensions + { + public static DateTime AsUnixSecondsToDateTime(this int seconds) + { + return DateTimeOffset.FromUnixTimeSeconds(seconds).DateTime; + } + } + public static class Int64Extensions + { + public static DateTime AsUnixSecondsToDateTime(this long seconds) + { + return DateTimeOffset.FromUnixTimeSeconds(seconds).DateTime.SetKind(DateTimeKind.Utc); + } + + public static DateTime AsUnixMillisecondsToDateTime(this long milliseconds) + { + return DateTimeOffset.FromUnixTimeMilliseconds(milliseconds).DateTime.SetKind(DateTimeKind.Utc); + } + } + public static class IntervalExtensions + { + [Serializable] + [CompilerGenerated] + private sealed class ? where ? : IComparable + { + public static readonly ? ?? = new ?(); + + public static Func, ?> ??; + + public static Func ??; + + public static Func, ?> ??; + + public static Func ??; + + internal ? ?(Interval P_0) + { + return P_0.Min; + } + + internal ? ?(? P_0) + { + return P_0; + } + + internal ? ?(Interval P_0) + { + return P_0.Max; + } + + internal ? ?(? P_0) + { + return P_0; + } + } + + /// + /// Combines intersecting intervals + /// + public static IEnumerable> Optimize(this IEnumerable> intervals) where T : IComparable + { + Interval[] source = intervals.ToArray(); + T[] array = (from P_0 in source + select P_0.Min into P_0 + orderby P_0 + select P_0).ToArray(); + T[] array2 = (from P_0 in source + select P_0.Max into P_0 + orderby P_0 + select P_0).ToArray(); + int num = 0; + int num2 = 0; + T val = array.First(); + int num3 = 0; + while (num < array.Length && num2 < array2.Length) + { + T val2 = array[num]; + T val3 = array2[num2]; + if (val2.CompareTo(val3) <= 0) + { + num3++; + num++; + } + else + { + num3--; + num2++; + } + if (num3 == 0) + { + yield return new Interval(val, val3); + val = val2; + } + } + yield return new Interval(val, array2.Last()); + } + } + public static class ListExtensions + { + public static void AddRange(this IList list, IEnumerable items) + { + if (items == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + foreach (T item in items) + { + list.Add(item); + } + } + } + public static class OidcClientOptionsExtensions + { + public static OidcClientOptions GetCopy(this OidcClientOptions oidc) + { + return new OidcClientOptions + { + Authority = oidc.Authority, + ClientId = oidc.ClientId, + ClientSecret = oidc.ClientSecret, + RedirectUri = oidc.RedirectUri, + PostLogoutRedirectUri = oidc.PostLogoutRedirectUri, + Scope = oidc.Scope, + ClockSkew = oidc.ClockSkew, + LoadProfile = oidc.LoadProfile, + ProviderInformation = oidc.ProviderInformation?.GetCopy() + }; + } + + public static ProviderInformation GetCopy(this ProviderInformation providerInformation) + { + return new ProviderInformation + { + IssuerName = providerInformation.IssuerName, + AuthorizeEndpoint = providerInformation.AuthorizeEndpoint, + TokenEndpoint = providerInformation.TokenEndpoint, + EndSessionEndpoint = providerInformation.EndSessionEndpoint, + KeySet = providerInformation.KeySet + }; + } + } + public static class OrderExtensions + { + public static double GetExecutionPrice(this IOrder order) + { + if (order != null) + { + OrderType orderType = order.OrderType; + if (orderType != null) + { + _ = orderType.Behavior; + if (0 == 0) + { + return order.OrderType.Behavior switch + { + OrderTypeBehavior.Unspecified => double.NaN, + OrderTypeBehavior.Market => double.NaN, + OrderTypeBehavior.Limit => order.Price, + OrderTypeBehavior.Stop => order.TriggerPrice, + OrderTypeBehavior.TrailingStop => order.TriggerPrice, + OrderTypeBehavior.StopLimit => order.Price, + _ => throw new ArgumentOutOfRangeException(), + }; + } + } + } + return double.NaN; + } + } + public static class OrderRequestParametersExtensions + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + internal bool ?(SlTpHolder P_0) + { + if (double.IsNaN(P_0.QuantityPercentage)) + { + return double.IsNaN(P_0.Quantity); + } + return false; + } + + internal bool ?(SlTpHolder P_0) + { + return P_0.Quantity == 0.0; + } + } + + public static double GetExecutionPrice(this OrderRequestParameters parameters) + { + if (parameters != null) + { + OrderType orderType = parameters.OrderType; + if (orderType != null) + { + _ = orderType.Behavior; + if (0 == 0) + { + return parameters.OrderType.Behavior switch + { + OrderTypeBehavior.Unspecified => double.NaN, + OrderTypeBehavior.Market => double.NaN, + OrderTypeBehavior.Limit => parameters.Price, + OrderTypeBehavior.Stop => parameters.TriggerPrice, + OrderTypeBehavior.TrailingStop => parameters.TriggerPrice, + OrderTypeBehavior.StopLimit => parameters.Price, + _ => throw new ArgumentOutOfRangeException(), + }; + } + } + } + return double.NaN; + } + + public static void SetExecutionPrice(this OrderRequestParameters parameters, double price) + { + if (parameters == null) + { + return; + } + OrderType orderType = parameters.OrderType; + if (orderType == null) + { + return; + } + _ = orderType.Behavior; + if (0 == 0) + { + switch (parameters.OrderType.Behavior) + { + case OrderTypeBehavior.Limit: + parameters.Price = price; + break; + case OrderTypeBehavior.Stop: + case OrderTypeBehavior.StopLimit: + parameters.TriggerPrice = price; + break; + case OrderTypeBehavior.TrailingStop: + break; + } + } + } + + public static bool IsCorrespondingOrder(this OrderRequestParameters parameters, IOrder order) + { + if (parameters.Symbol.IsSameAs(order.Symbol) && parameters.Account.Equals(order.Account) && parameters.OrderTypeId == order.OrderTypeId && parameters.Side == order.Side && Math.Abs(parameters.Quantity - order.TotalQuantity) < double.Epsilon) + { + return Math.Abs(parameters.OrderType.GetFillPrice(parameters) - order.GetExecutionPrice()) < double.Epsilon; + } + return false; + } + + public static bool TryCorrectBracketsQuantity(this OrderRequestParameters requestParameters, out string error) + { + error = null; + if (!?(requestParameters.Quantity, requestParameters.Symbol.LotStep, requestParameters.StopLossItems, out error)) + { + return false; + } + if (!?(requestParameters.Quantity, requestParameters.Symbol.LotStep, requestParameters.TakeProfitItems, out error)) + { + return false; + } + return true; + } + + private static bool ?(double P_0, double P_1, List P_2, out string P_3) + { + P_3 = null; + if (P_2 == null || P_2.Count == 0 || P_2.All((SlTpHolder slTpHolder) => double.IsNaN(slTpHolder.QuantityPercentage) && double.IsNaN(slTpHolder.Quantity))) + { + return true; + } + double num = 0.0; + foreach (SlTpHolder item in P_2) + { + if (double.IsNaN(item.QuantityPercentage)) + { + num += item.Quantity; + continue; + } + double num2 = (item.Quantity = CoreMath.RoundToIncrement(item.QuantityPercentage / 100.0 * P_0, P_1)); + num += num2; + } + if (num != P_0) + { + if (num < P_0) + { + P_2.Last().Quantity += P_0 - num; + } + else + { + if (!(P_2.Last().Quantity > num - P_0)) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(93, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(num); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + P_3 = defaultInterpolatedStringHandler.ToStringAndClear(); + return false; + } + P_2.Last().Quantity -= num - P_0; + } + } + if (P_2.Any((SlTpHolder slTpHolder) => slTpHolder.Quantity == 0.0)) + { + P_3 = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + return false; + } + return true; + } + } + public static class PeriodExtensions + { + public static Interval FindInterval(this Period period, DateTime dateTime) + { + return period.FindInterval(dateTime.Ticks); + } + + public static Interval FindInterval(this Period period, long dateTimeTicks) + { + long ticks = period.Ticks; + DateTime dateTime = new DateTime(dateTimeTicks - dateTimeTicks % ticks, DateTimeKind.Utc); + DateTime to = dateTime.AddTicks(ticks - 1); + return new Interval(dateTime, to); + } + } + public static class PositionExtensions + { + public static bool IsBreakevenPossible(this Position position) + { + PnLItem pnLItem = position?.NetPnL ?? position?.GrossPnL; + if (pnLItem == null) + { + return true; + } + return pnLItem.Value > 0.0; + } + } + public static class SelectItemExtensions + { + [CompilerGenerated] + private sealed class ? + { + public ? ??; + + internal bool ?(SelectItem P_0) + { + return P_0.Value.Equals(??); + } + } + + public static SelectItem GetItemByValue(this IEnumerable list, TValue value) + { + return list.FirstOrDefault((SelectItem P_0) => P_0.Value.Equals(value)); + } + } + public static class SessionsExtensions + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Comparison ??; + + internal bool ?(ISession P_0) + { + return P_0.IsPrimary; + } + + internal bool ?(ISession P_0) + { + return P_0.ContainsTime(TimeSpan.Zero); + } + + internal bool ?(ISession P_0) + { + return P_0.CloseTime > P_0.OpenTime; + } + + internal int ?(ISession P_0, ISession P_1) + { + return P_0.OpenTime.CompareTo(P_1.OpenTime); + } + } + + [CompilerGenerated] + private sealed class ? + { + public DateTime ??; + + internal bool ?(TimeZoneInfo.AdjustmentRule P_0) + { + return P_0.DateStart < ??.Date; + } + + internal bool ?(TimeZoneInfo.AdjustmentRule P_0) + { + return P_0.DateEnd > ??.Date; + } + + internal bool ?(TimeZoneInfo.AdjustmentRule P_0) + { + return P_0.DateStart < ??.Date; + } + + internal bool ?(TimeZoneInfo.AdjustmentRule P_0) + { + return P_0.DateEnd > ??.Date; + } + } + + [CompilerGenerated] + private sealed class ? + { + public DateTime ??; + + internal bool ?(ISession P_0) + { + return P_0.ContainsDate(??); + } + } + + [CompilerGenerated] + private sealed class ? + { + public DateTime ??; + + public ISessionsContainer ??; + + internal bool ?(ISession P_0) + { + return P_0.ContainsDate(??, ??.TimeZone); + } + + internal bool ?(ISession P_0) + { + return P_0.ContainsDate(??); + } + } + + public static bool ContainsDate(this ISession session, DateTime dateTime) + { + return session.ContainsTime(dateTime.TimeOfDay); + } + + public static bool ContainsDate(this ISession session, long dateTimeTicks) + { + return session.ContainsTime(dateTimeTicks % 864000000000L); + } + + public static bool ContainsTime(this ISession session, TimeSpan time) + { + return session.ContainsTime(time.Ticks); + } + + public static bool ContainsTime(this ISession session, long timeTicks) + { + if (session.OpenTime < session.CloseTime) + { + if (timeTicks < session.OpenTime.Ticks || timeTicks >= session.CloseTime.Ticks) + { + return false; + } + } + else if (timeTicks >= session.CloseTime.Ticks && timeTicks < session.OpenTime.Ticks) + { + return false; + } + return true; + } + + public static bool ContainsDate(this ISession session, DateTime dateTime, TimeZoneInfo timeZone) + { + TimeSpan time = dateTime.TimeOfDay + ?(dateTime, timeZone); + return session.ContainsTime(time); + } + + internal static TimeSpan ?(DateTime P_0, TimeZoneInfo P_1) + { + TimeSpan result = TimeSpan.Zero; + if (P_1 == null) + { + return result; + } + DateTime date = DateTime.UtcNow.Date; + if (!P_1.IsDaylightSavingTime(P_0) && P_1.IsDaylightSavingTime(date)) + { + TimeZoneInfo.AdjustmentRule adjustmentRule = (from adjustmentRule3 in P_1.GetAdjustmentRules() + where adjustmentRule3.DateStart < P_0.Date + where adjustmentRule3.DateEnd > P_0.Date + select adjustmentRule3).FirstOrDefault(); + if (adjustmentRule != null) + { + result = -adjustmentRule.DaylightDelta; + } + } + if (P_1.IsDaylightSavingTime(P_0) && !P_1.IsDaylightSavingTime(date)) + { + TimeZoneInfo.AdjustmentRule adjustmentRule2 = (from adjustmentRule3 in P_1.GetAdjustmentRules() + where adjustmentRule3.DateStart < P_0.Date + where adjustmentRule3.DateEnd > P_0.Date + select adjustmentRule3).FirstOrDefault(); + if (adjustmentRule2 != null) + { + result = adjustmentRule2.DaylightDelta; + } + } + return result; + } + + public static ISession GetSessionForDate(this ISessionsContainer sessionsContainer, DateTime dateTime) + { + ISession[] sessionsForDate = sessionsContainer.GetSessionsForDate(dateTime); + if (!sessionsForDate.Any()) + { + return null; + } + return sessionsForDate.FirstOrDefault((ISession P_0) => P_0.ContainsDate(dateTime)); + } + + public static bool ContainsDate(this ISessionsContainer sessionsContainer, DateTime dateTime) + { + ISession[] sessionsForDate = sessionsContainer.GetSessionsForDate(dateTime); + if (!sessionsForDate.Any()) + { + return false; + } + if (sessionsContainer.TimeZone != null && sessionsContainer.TimeZone.SupportsDaylightSavingTime) + { + return sessionsForDate.Any((ISession P_0) => P_0.ContainsDate(dateTime, sessionsContainer.TimeZone)); + } + return sessionsForDate.Any((ISession P_0) => P_0.ContainsDate(dateTime)); + } + + public static bool ContainsDate(this ISessionsContainer sessionsContainer, long dateTimeTicks) + { + return sessionsContainer.ContainsDate(new DateTime(dateTimeTicks, DateTimeKind.Utc)); + } + + public static long GetSessionOffset(this ISessionsContainer sessionsContainer, TimeZone timezone, bool isWeek, bool applyNegativeSignForInDaySession = true) + { + ISession session = sessionsContainer.?(); + long num = ((session == null) ? (-timezone.TimeZoneInfo.BaseUtcOffset.Ticks) : ((!(session.CloseTime >= session.OpenTime)) ? (-(TimeSpan.FromHours(24.0).Ticks - session.OpenTime.Ticks)) : (((!applyNegativeSignForInDaySession) ? 1 : (-1)) * session.OpenTime.Ticks))); + if (isWeek) + { + num += (long)(new DateTime(1, 1, 1, 0, 0, 0, DateTimeKind.Utc).DayOfWeek - 1) * 864000000000L; + } + return num; + } + + public static long GetSessionOpenTime(this ISessionsContainer sessionsContainer, TimeZone timezone) + { + return sessionsContainer.?()?.OpenTime.Ticks ?? timezone.TimeZoneInfo.BaseUtcOffset.Ticks; + } + + private static ISession ?(this ISessionsContainer P_0) + { + if (P_0 == null) + { + return null; + } + List list = P_0.ActiveSessions?.Where((ISession session) => session.IsPrimary).ToList(); + if (list == null || list.Count == 0) + { + list = P_0.ActiveSessions?.Where((ISession session) => session.ContainsTime(TimeSpan.Zero)).ToList(); + } + if (list == null || list.Count == 0) + { + list = P_0.ActiveSessions?.Where((ISession session) => session.CloseTime > session.OpenTime).ToList(); + } + if (list == null || list.Count == 0) + { + list = P_0.ActiveSessions?.ToList(); + } + list?.Sort((ISession session, ISession session2) => session.OpenTime.CompareTo(session2.OpenTime)); + return list?.FirstOrDefault(); + } + } + public static class SettingItemExtensions + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + internal string ?(SettingItem P_0) + { + return P_0.Name; + } + + internal string ?(SettingItem P_0) + { + return P_0.Name; + } + + internal SettingItem ?(SettingItem P_0) + { + return P_0; + } + + internal string ?(AdditionalInfoItem P_0) + { + return P_0.Id; + } + + internal object ?(AdditionalInfoItem P_0) + { + return P_0.Value; + } + + internal SettingItem ?(SettingItem P_0) + { + return P_0.GetCopy(); + } + } + + [CompilerGenerated] + private sealed class ? + { + public SettingItem ??; + + public object ??; + + internal void ?() + { + ??.Value = ??; + } + } + + public static SettingItem GetItemByName(this IEnumerable list, string name) + { + if (string.IsNullOrEmpty(name)) + { + return null; + } + foreach (SettingItem item in list) + { + if (item != null && item.Name == name) + { + return item; + } + } + return null; + } + + public static SettingItem GetItemByPath(this IEnumerable list, params string[] pathLevels) + { + if (pathLevels == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + IEnumerable list2 = list; + for (int i = 0; i < pathLevels.Length; i++) + { + string name = pathLevels[i]; + SettingItem itemByName = list2.GetItemByName(name); + if (itemByName == null) + { + return null; + } + if (i == pathLevels.Length - 1) + { + return itemByName; + } + list2 = itemByName.Value as IList; + } + return null; + } + + /// + /// Get all settings or particular settings by provided hierarchy path + /// + public static IEnumerable GetItemsByPath(this IEnumerable list, params string[] pathLevels) + { + if (pathLevels == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + IEnumerable enumerable = list; + for (int i = 0; i < pathLevels.Length; i++) + { + string text = pathLevels[i]; + if (string.IsNullOrEmpty(text)) + { + return enumerable; + } + SettingItem itemByName = enumerable.GetItemByName(text); + if (itemByName == null) + { + return null; + } + if (itemByName.Value is IList list2) + { + enumerable = list2; + } + else if (i == pathLevels.Length - 1) + { + return new List { itemByName }; + } + } + return enumerable; + } + + public static bool TryGetItemByName(this IEnumerable items, string name, out SettingItem item) + { + item = items?.GetItemByName(name); + return item != null; + } + + public static void ApplyVisualGroup(this IEnumerable list, SettingItemVisualGroup visualGroup, params string[] pathLevels) + { + if (pathLevels == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + IEnumerable itemsByPath = list.GetItemsByPath(pathLevels); + if (itemsByPath == null) + { + return; + } + foreach (SettingItem item in itemsByPath) + { + if (item.Type == SettingItemType.Group && item.Value is IEnumerable list2) + { + list2.ApplyVisualGroup(visualGroup); + } + else + { + item.VisualGroup = visualGroup; + } + } + } + + public static SettingItem UpdateItemValue(this IEnumerable list, string name, object newValue, bool force = false) + { + SettingItem itemByName = list.GetItemByName(name); + if (itemByName == null) + { + return null; + } + if (itemByName is SettingItemGroup && itemByName.Value is IList list2 && newValue is IList list3) + { + foreach (SettingItem item in list3) + { + list2.UpdateItemValue(item.Name, item.Value); + } + } + else + { + itemByName.?(newValue, force); + } + return itemByName; + } + + public static void UpdateValues(this IEnumerable list, IEnumerable other, bool ignoreValidation = false, params string[] filterNames) + { + if (list == null || other == null) + { + return; + } + Dictionary dictionary = other.DistinctBy((SettingItem P_0) => P_0.Name).ToDictionary((SettingItem P_0) => P_0.Name, (SettingItem P_0) => P_0); + foreach (SettingItem item in list) + { + if ((filterNames.Any() && !filterNames.Contains(item.Name)) || !dictionary.TryGetValue(item.Name, out var value)) + { + continue; + } + if (item.Value is IList list2 && value.Value is IList other2) + { + list2.UpdateValues(other2, ignoreValidation); + continue; + } + try + { + item.?(value.Value, ignoreValidation); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + } + + public static void UpdateValues(this IEnumerable list, AdditionalInfoCollection additionalInfoCollection) + { + if (additionalInfoCollection == null) + { + return; + } + Dictionary dictionary = additionalInfoCollection.ToDictionary((AdditionalInfoItem P_0) => P_0.Id, (AdditionalInfoItem P_0) => P_0.Value); + foreach (SettingItem item in list) + { + try + { + if (dictionary.TryGetValue(item.Name, out var value)) + { + item.?(value); + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + } + + public static bool IsAny(this IEnumerable list, Predicate predicate) + { + foreach (SettingItem item in list) + { + if (predicate(item)) + { + return true; + } + if (item.Value is IList list2 && list2.IsAny(predicate)) + { + return true; + } + } + return false; + } + + public static T GetValueOrDefault(this IEnumerable settings, T defaultValue, params string[] pathLevels) + { + SettingItem itemByPath = settings.GetItemByPath(pathLevels); + if (itemByPath == null) + { + return defaultValue; + } + return itemByPath.GetValue(); + } + + public static T GetVisibleValueOrDefault(this IEnumerable settings, T defaultValue, params string[] pathLevels) + { + SettingItem itemByPath = settings.GetItemByPath(pathLevels); + if (itemByPath == null || !itemByPath.Enabled || !itemByPath.Visible) + { + return defaultValue; + } + return itemByPath.GetValue(); + } + + public static T GetValue(this IEnumerable settings, params string[] pathLevels) + { + SettingItem itemByPath = settings.GetItemByPath(pathLevels); + if (itemByPath == null) + { + return default(T); + } + return itemByPath.GetValue(); + } + + public static T GetVisibleValue(this IEnumerable settings, params string[] pathLevels) + { + SettingItem itemByPath = settings.GetItemByPath(pathLevels); + if (itemByPath == null || !itemByPath.Enabled || !itemByPath.Visible) + { + return default(T); + } + return itemByPath.GetValue(); + } + + public static T GetValue(this SettingItem item) + { + try + { + object value = item.Value; + return (!(value is SelectItem selectItem)) ? ((!(value is PasswordHolder passwordHolder)) ? ((T)item.Value) : ((T)(object)passwordHolder.Password)) : ((!(typeof(T) == typeof(string))) ? ((T)selectItem.Value) : ((T)(object)selectItem.Value?.ToString())); + } + catch + { + return default(T); + } + } + + public static bool TryGetValue(this IEnumerable settings, string name, out T value) + { + value = default(T); + SettingItem itemByName = settings.GetItemByName(name); + if (itemByName == null) + { + return false; + } + value = itemByName.GetValue(); + return true; + } + + public static bool TryGetVisibleValue(this IEnumerable settings, string name, out T value) + { + value = default(T); + SettingItem itemByName = settings.GetItemByName(name); + if (itemByName == null || !itemByName.Enabled || !itemByName.Visible) + { + return false; + } + value = itemByName.GetValue(); + return true; + } + + public static IEnumerable ExpandGroups(this IEnumerable settings) + { + if (settings == null) + { + yield break; + } + foreach (SettingItem setting in settings) + { + if (setting.Value is IEnumerable settings2) + { + foreach (SettingItem item in settings2.ExpandGroups()) + { + yield return item; + } + } + else + { + yield return setting; + } + } + } + + public static SettingItem RestoreGroupsNesting(this SettingItem settingItem) + { + List list = new List(); + ?(settingItem, list); + if (list.Count > 0) + { + (list[0].Value as IList).Add(settingItem); + for (int i = 0; i < list.Count - 1; i++) + { + (list[i + 1].Value as IList).Add(list[i]); + } + return list.Last(); + } + return settingItem; + } + + public static void MergeWith(this IList origin, IList other) + { + if (other == null) + { + return; + } + foreach (SettingItem item in other) + { + SettingItem itemByName = origin.GetItemByName(item.Name); + if (itemByName == null) + { + origin.Add(item); + } + else if ((itemByName as SettingItemGroup)?.Value is IList origin2 && (item as SettingItemGroup)?.Value is IList other2) + { + origin2.MergeWith(other2); + } + else + { + itemByName.?(item); + } + } + } + + public static IEnumerable DeepCopy(this IEnumerable settings) + { + return settings.Select((SettingItem P_0) => P_0.GetCopy()); + } + + public static void SetValueWithReason(this SettingItem settingItem, object value, SettingItemValueChangingReason reason) + { + settingItem.InvokeActionWithReason(reason, delegate + { + settingItem.Value = value; + }); + } + + public static void InvokeActionWithReason(this SettingItem settingItem, SettingItemValueChangingReason reason, Action action) + { + SettingItemValueChangingReason valueChangingReason = settingItem.ValueChangingReason; + try + { + settingItem.ValueChangingReason = reason; + action?.Invoke(); + } + finally + { + settingItem.ValueChangingReason = valueChangingReason; + } + } + + [CompilerGenerated] + internal static void ?(SettingItem P_0, ICollection P_1) + { + if (P_0.Type == SettingItemType.Group) + { + SettingItemGroup item = new SettingItemGroup(P_0.Name, new List()); + P_1.Add(item); + } + if (P_0.Group != null) + { + ?(P_0.Group, P_1); + } + } + } + public static class StrategyExtensions + { + /// + /// Write info log message + /// + public static void LogInfo(this Strategy strategy, string message) + { + strategy.Log(message); + } + + /// + /// Write trading log message + /// + public static void LogTrading(this Strategy strategy, string message) + { + strategy.Log(message, StrategyLoggingLevel.Trading); + } + + /// + /// Write error log message + /// + public static void LogError(this Strategy strategy, string message) + { + strategy.Log(message, StrategyLoggingLevel.Error); + } + } + public static class StrategyMetricExtensions + { + public static void Add(this List metrics, string name, string formattedValue) + { + metrics.Add(new StrategyMetric + { + Name = name, + FormattedValue = formattedValue + }); + } + + public static void Add(this List metrics, string name, object value) + { + metrics.Add(name, value.ToString()); + } + } + public static class StringExtensions + { + public static bool Contains(this string str1, string str2, StringComparison stringComparison) + { + return str1.IndexOf(str2, stringComparison) >= 0; + } + + public static bool TryParseEnum(this string str, Func getAttributeValue, out TEnum enumValue) where TEnum : struct, IConvertible where TAttribute : Attribute + { + if (!typeof(TEnum).IsEnum) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + enumValue = default(TEnum); + FieldInfo[] fields = enumValue.GetType().GetFields(); + foreach (FieldInfo fieldInfo in fields) + { + object[] customAttributes = fieldInfo.GetCustomAttributes(typeof(TAttribute), inherit: false); + if (customAttributes.Length == 0) + { + continue; + } + object[] array = customAttributes; + for (int j = 0; j < array.Length; j++) + { + if (array[j] is TAttribute arg && getAttributeValue(arg) == str) + { + enumValue = (TEnum)fieldInfo.GetValue(null); + return true; + } + } + } + return false; + } + + public static string EncodeFilePathPart(this string fileName) + { + string text = fileName; + char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); + foreach (char value in invalidFileNameChars) + { + text = text.Replace($"{value}", $"{value}"); + } + return text; + } + } + public static class SymbolExtensions + { + public static ISessionsContainer FindSessionsContainer(this Symbol symbol) + { + if (symbol == null) + { + return null; + } + if (Core.Instance.CustomSessions.Assignments.TryGetSessionsContainer(symbol, out var container)) + { + return container; + } + SessionsContainer currentSessionsInfo = symbol.CurrentSessionsInfo; + if (currentSessionsInfo == null) + { + Exchange exchange = symbol.Exchange; + if (exchange == null) + { + return null; + } + currentSessionsInfo = exchange.CurrentSessionsInfo; + } + return currentSessionsInfo; + } + + public static TimeSpan GetHistoryDownloadingStep(this Symbol symbol, HistoryAggregation aggregation) + { + return symbol?.HistoryMetadata?.?(aggregation) ?? new TimeSpan(10, 0, 0, 0); + } + + public static double CalculateValue(this Symbol symbol, Side side, double price, double quantity) + { + if (symbol == null || double.IsNaN(price) || double.IsNaN(quantity)) + { + return double.NaN; + } + return (double)((side == Side.Buy) ? 1 : (-1)) * ((symbol.QuotingType == SymbolQuotingType.LotSize) ? (price * symbol.LotSize * quantity) : (price * (symbol.GetTickCost(price) / symbol.GetTickSize(price)) * quantity)); + } + + public static string GetFormattedPoints(this Symbol symbol, Side side, double closePrice, double openPrice) + { + double num = symbol.CalculatePoints(side, closePrice, openPrice); + if (double.IsNaN(num)) + { + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); + } + int precision = symbol.FindVariableTick(openPrice)?.Precision ?? CoreMath.GetValuePrecision((decimal)symbol.TickSize); + return num.Format(precision); + } + + public static string GetFormattedPoints(this Symbol symbol, double points, string suffix = "points") + { + if (double.IsNaN(points)) + { + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); + } + int valuePrecision = CoreMath.GetValuePrecision((decimal)symbol.TickSize); + return points.Format(valuePrecision) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + suffix; + } + + public static double CalculatePoints(this Symbol symbol, Side side, double closePrice, double openPrice) + { + if (double.IsNaN(closePrice) || double.IsNaN(openPrice)) + { + return double.NaN; + } + decimal num = (decimal)closePrice; + decimal num2 = (decimal)openPrice; + if (side != Side.Buy) + { + return (double)(num2 - num); + } + return (double)(num - num2); + } + + public static HistoricalData GetHistory(this Symbol symbol, Period period, HistoryType historyType, int itemsCount) + { + TimeSpan timeSpan = TimeSpan.FromDays(36500.0); + HistoricalData historicalData = null; + int i = 1; + long num = period.Ticks * itemsCount; + num *= 3; + num = Math.Min(timeSpan.Ticks, num); + DateTime dateTime = Core.Instance.TimeUtils.DateTimeUtcNow.AddTicks(-num); + DateTime dateTime2 = Core.Instance.TimeUtils.DateTimeUtcNow.Add(-timeSpan); + if (period >= Period.MIN1 && period <= Period.DAY1) + { + ISessionsContainer sessionsContainer = symbol.FindSessionsContainer(); + if (sessionsContainer != null) + { + int num2 = 0; + while (!sessionsContainer.ContainsDate(dateTime) && num2 < 5760) + { + dateTime = dateTime.AddTicks(-period.Ticks); + num2++; + } + } + } + int num3 = -1; + for (; historicalData == null || (dateTime > dateTime2 && 10 >= i); i++) + { + if (period.BasePeriod != BasePeriod.Tick) + { + historicalData = symbol.GetHistory(period, historyType, dateTime); + } + else + { + long ticks = ?(symbol.Connection, i); + historicalData = symbol.GetHistory(period, historyType, new DateTime(ticks, DateTimeKind.Utc)); + } + if (historicalData.Count > itemsCount || (num3 != -1 && num3 == historicalData.Count && period.BasePeriod == BasePeriod.Day)) + { + break; + } + if (historicalData.Count > 0) + { + num *= itemsCount / historicalData.Count + 1; + } + if (num >= dateTime.Ticks) + { + break; + } + dateTime = dateTime.AddTicks(-num); + num3 = historicalData.Count; + } + if (historicalData.Count > itemsCount && itemsCount != 0) + { + historicalData.CutItems(historicalData.Count - itemsCount); + } + return historicalData; + } + + public static DeltaCalculationType GetDeltaCalculationTypeForQuotes(this Symbol symbol) + { + if (!Core.Instance.SymbolsMapping.TryGetQuotesSymbol(symbol, out var quotesSymbol)) + { + return symbol.DeltaCalculationType; + } + return quotesSymbol.DeltaCalculationType; + } + + public static DeltaCalculationType GetDeltaCalculationTypeForHistory(this Symbol symbol, Period period) + { + if (!Core.Instance.SymbolsMapping.TryGetHistorySymbol(symbol, period, out var historySymbol)) + { + return symbol.DeltaCalculationType; + } + return historySymbol.DeltaCalculationType; + } + + public static DeltaCalculationType GetDeltaCalculationTypeForVolumeAnalysis(this Symbol symbol) + { + if (!Core.Instance.SymbolsMapping.TryGetVolumeAnalysisSymbol(symbol, out var volumeAnalysisSymbol)) + { + return symbol.DeltaCalculationType; + } + return volumeAnalysisSymbol.DeltaCalculationType; + } + + public static HistoryMetadata GetHistoryMetadata(this Symbol symbol) + { + if (!Core.Instance.SymbolsMapping.TryGetVolumeAnalysisSymbol(symbol, out var volumeAnalysisSymbol)) + { + return symbol.HistoryMetadata; + } + return volumeAnalysisSymbol.HistoryMetadata; + } + + public static bool TryGetTradingSymbolId(this Symbol symbol, out string tradingSymbolId) + { + tradingSymbolId = null; + if (symbol == null) + { + return false; + } + if (symbol.State == BusinessObjectState.Fake) + { + return false; + } + if (symbol.AdditionalInfo == null) + { + return false; + } + if (!symbol.AdditionalInfo.TryGetItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var item)) + { + return false; + } + tradingSymbolId = item.Value as string; + return !string.IsNullOrEmpty(tradingSymbolId); + } + + public static bool IsSameAs(this Symbol symbol, Symbol otherSymbol) + { + if (symbol.Equals(otherSymbol)) + { + return true; + } + if (symbol.TryGetTradingSymbolId(out var tradingSymbolId) && otherSymbol.Id == tradingSymbolId) + { + return true; + } + if (otherSymbol.TryGetTradingSymbolId(out tradingSymbolId) && symbol.Id == tradingSymbolId) + { + return true; + } + return false; + } + + public static Symbol GetTradingSymbol(this Symbol symbol) + { + if (!symbol.TryGetTradingSymbolId(out var tradingSymbolId)) + { + return null; + } + return Core.Instance.GetSymbol(new GetSymbolRequestParameters + { + SymbolId = tradingSymbolId + }, symbol.ConnectionId); + } + + [CompilerGenerated] + internal static long ?(Connection P_0, int P_1) + { + long ticks = P_0.HistoryMetaData.DownloadingStep_Tick.Ticks; + ticks = (long)((double)ticks * Math.Pow(2.0, --P_1)); + return Core.Instance.TimeUtils.DateTimeUtcNow.Ticks - ticks; + } + } + public static class TaskExtensions + { + public static void GetResultWithoutContextCapturing(this Task task) + { + task.ConfigureAwait(continueOnCapturedContext: false).GetAwaiter().GetResult(); + } + + public static T GetResultWithoutContextCapturing(this Task task) + { + return task.ConfigureAwait(continueOnCapturedContext: false).GetAwaiter().GetResult(); + } + } + public static class TimeInForceExtensions + { + public static string Format(this TimeInForce value, DateTime expiration = default(DateTime)) + { + if (expiration == default(DateTime)) + { + return value.ToString(); + } + switch (value) + { + case TimeInForce.GTD: + return value.ToString() + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?() + Core.Instance.TimeUtils.ConvertFromUTCToSelectedTimeZone(expiration).ToShortDateString() + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); + case TimeInForce.GTT: + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 2); + defaultInterpolatedStringHandler.AppendFormatted(value.ToString()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + defaultInterpolatedStringHandler.AppendFormatted(Core.Instance.TimeUtils.ConvertFromUTCToSelectedTimeZone(expiration), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + default: + return value.ToString(); + } + } + } + public static class TradingSignalExtensions + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal DateTime ?(Symbol P_0) + { + return P_0.ExpirationDate; + } + } + + [CompilerGenerated] + private sealed class ? + { + public TradingSignal ??; + + public Func ??; + + public Func ??; + + internal bool ?(Connection P_0) + { + return P_0.VendorName == ??.VendorName; + } + + internal bool ?(Symbol P_0) + { + return P_0.Name == ??.Ticker; + } + + internal bool ?(Connection P_0) + { + if (string.IsNullOrEmpty(??.VendorName) || P_0.VendorName == ??.VendorName) + { + return P_0.??.SymbolTypes.Contains(SymbolType.Futures); + } + return false; + } + + internal bool ?(Symbol P_0) + { + return P_0.Root == ??.Root; + } + } + + public static bool TryFindSymbol(this TradingSignal tradingSignal, out Symbol symbol) + { + symbol = null; + if (!string.IsNullOrEmpty(tradingSignal.Ticker)) + { + SearchSymbolsRequestParameters searchSymbolsRequestParameters = new SearchSymbolsRequestParameters + { + FilterName = tradingSignal.Ticker + }; + IList list = ((!string.IsNullOrEmpty(tradingSignal.VendorName)) ? Core.Instance.Connections.Connected.FirstOrDefault((Connection P_0) => P_0.VendorName == tradingSignal.VendorName)?.?(searchSymbolsRequestParameters) : Core.Instance.SearchSymbols(searchSymbolsRequestParameters)); + if (list == null || !list.Any()) + { + return false; + } + symbol = list.FirstOrDefault((Symbol P_0) => P_0.Name == tradingSignal.Ticker); + } + else if (!string.IsNullOrEmpty(tradingSignal.Root)) + { + foreach (Connection item in Core.Instance.Connections.Connected.Where((Connection P_0) => (string.IsNullOrEmpty(tradingSignal.VendorName) || P_0.VendorName == tradingSignal.VendorName) && P_0.??.SymbolTypes.Contains(SymbolType.Futures))) + { + IList source = item.?(new SearchSymbolsRequestParameters + { + FilterName = tradingSignal.Root, + SymbolTypes = new SymbolType[1] { SymbolType.Futures } + }); + if (!source.Any()) + { + continue; + } + List source2 = source.Where((Symbol P_0) => P_0.Root == tradingSignal.Root).ToList(); + if (source2.Any()) + { + symbol = source2.MinBy((Symbol P_0) => P_0.ExpirationDate); + if (symbol != null) + { + break; + } + } + } + } + if (symbol != null) + { + symbol = Core.Instance.GetSymbol(symbol.CreateInfo()); + } + Symbol symbol2 = symbol; + if (symbol2 != null) + { + return symbol2.State == BusinessObjectState.Normal; + } + return false; + } + } + public static class VolumeAnalysisExtensions + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func, VolumeAnalysisData> ??; + + public static Func ??; + + internal DateTime ?(VolumeAnalysisData P_0) + { + return P_0.TimeLeft; + } + + internal VolumeAnalysisData ?(VolumeAnalysisData P_0) + { + return P_0; + } + + internal VolumeAnalysisData ?(KeyValuePair P_0) + { + return P_0.Value; + } + + internal DateTime ?(VolumeAnalysisData P_0) + { + return P_0.TimeLeft; + } + } + + public static IEnumerable AggregateVolumeAnalysis(this IEnumerable tickItems, Period period, CancellationToken cancellationToken, double minVolumeAnalysisTickSize = double.NaN) + { + if (tickItems == null) + { + yield break; + } + VolumeAnalysisData volumeAnalysisData = null; + Interval interval = default(Interval); + foreach (IVolumeTickData tickItem in tickItems) + { + if (cancellationToken.IsCancellationRequested) + { + yield break; + } + DateTime dateTime = new DateTime(tickItem.Time, DateTimeKind.Utc); + if (!interval.Contains(dateTime)) + { + if (volumeAnalysisData != null) + { + yield return volumeAnalysisData; + } + interval = period.FindInterval(dateTime); + volumeAnalysisData = null; + } + if (volumeAnalysisData == null) + { + volumeAnalysisData = new VolumeAnalysisData + { + TimeLeft = interval.From + }; + } + double num = tickItem.Price; + if (!double.IsNaN(minVolumeAnalysisTickSize)) + { + num = CoreMath.RoundToIncrement(num, minVolumeAnalysisTickSize); + } + volumeAnalysisData.Calculate(num, tickItem.Volume, Symbol.ConvertTickDirection(tickItem.TickDirection)); + } + if (volumeAnalysisData != null) + { + yield return volumeAnalysisData; + } + } + + public static IEnumerable AggregateVolumeAnalysisByAgressor(this IEnumerable tickItems, Period period, CancellationToken cancellationToken, double minVolumeAnalysisTickSize = double.NaN) + { + if (tickItems == null) + { + yield break; + } + VolumeAnalysisData volumeAnalysisData = null; + Interval interval = default(Interval); + foreach (IVolumeTickData tickItem in tickItems) + { + if (cancellationToken.IsCancellationRequested) + { + yield break; + } + DateTime dateTime = new DateTime(tickItem.Time, DateTimeKind.Utc); + if (!interval.Contains(dateTime)) + { + if (volumeAnalysisData != null) + { + yield return volumeAnalysisData; + } + interval = period.FindInterval(dateTime); + volumeAnalysisData = null; + } + if (volumeAnalysisData == null) + { + volumeAnalysisData = new VolumeAnalysisData + { + TimeLeft = interval.From + }; + } + double num = tickItem.Price; + if (!double.IsNaN(minVolumeAnalysisTickSize)) + { + num = CoreMath.RoundToIncrement(num, minVolumeAnalysisTickSize); + } + volumeAnalysisData.Calculate(num, tickItem.Volume, tickItem.AggressorFlag); + } + if (volumeAnalysisData != null) + { + yield return volumeAnalysisData; + } + } + + public static IEnumerable AggregateVolumeAnalysis(this IEnumerable dataItems, Period period, CancellationToken cancellationToken) + { + if (dataItems == null) + { + yield break; + } + VolumeAnalysisData volumeAnalysisData = null; + Interval interval = default(Interval); + foreach (VolumeAnalysisData dataItem in dataItems) + { + if (cancellationToken.IsCancellationRequested) + { + yield break; + } + DateTime timeLeft = dataItem.TimeLeft; + if (!interval.Contains(timeLeft)) + { + if (volumeAnalysisData != null) + { + yield return volumeAnalysisData; + } + interval = period.FindInterval(timeLeft); + volumeAnalysisData = null; + } + if (volumeAnalysisData == null) + { + volumeAnalysisData = new VolumeAnalysisData + { + TimeLeft = interval.From + }; + } + volumeAnalysisData.Combine(dataItem); + } + if (volumeAnalysisData != null) + { + yield return volumeAnalysisData; + } + } + + public static IList Combine(this IEnumerable dataItems, IEnumerable anotherItems) + { + Dictionary dictionary = dataItems.ToDictionary((VolumeAnalysisData P_0) => P_0.TimeLeft, (VolumeAnalysisData P_0) => P_0); + foreach (VolumeAnalysisData anotherItem in anotherItems) + { + if (dictionary.TryGetValue(anotherItem.TimeLeft, out var value)) + { + value.Combine(anotherItem); + } + else + { + dictionary.Add(anotherItem.TimeLeft, anotherItem); + } + } + return (from P_0 in dictionary + select P_0.Value into P_0 + orderby P_0.TimeLeft + select P_0).ToList(); + } + + public static VolumeAnalysisData Collapse(this IEnumerable dataItems) + { + VolumeAnalysisData volumeAnalysisData = new VolumeAnalysisData(); + foreach (VolumeAnalysisData dataItem in dataItems) + { + volumeAnalysisData.Combine(dataItem); + } + return volumeAnalysisData; + } + } + public static class XElementExtensions + { + public static bool ToBool(this XElement element) + { + if (!bool.TryParse(element.Value, out var result)) + { + return false; + } + return result; + } + + public static int ToInt(this XElement element) + { + if (!int.TryParse(element.Value, out var result)) + { + return 0; + } + return result; + } + + public static long ToLong(this XElement element) + { + if (!long.TryParse(element.Value, out var result)) + { + return 0L; + } + return result; + } + + public static double ToDouble(this XElement element) + { + if (!double.TryParse(element.Value, NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) + { + return 0.0; + } + return result; + } + + public static decimal ToDecimal(this XElement element) + { + if (!decimal.TryParse(element.Value, out var result)) + { + return 0m; + } + return result; + } + + public static DateTime ToDateTime(this XElement element, bool toUTC = false) + { + if (DateTime.TryParse(element.Value, out var result)) + { + if (!toUTC) + { + return result; + } + return result.ToUniversalTime(); + } + return default(DateTime); + } + + public static DateTime ToDateTime(this XElement element, string format) + { + if (DateTime.TryParseExact(element.Value, format, CultureInfo.InvariantCulture, DateTimeStyles.None, out var result)) + { + return DateTime.SpecifyKind(result, DateTimeKind.Utc); + } + return default(DateTime); + } + + public static TimeSpan ToTimeSpan(this XElement element) + { + if (!TimeSpan.TryParse(element.Value, out var result)) + { + return default(TimeSpan); + } + return result; + } + + public static Color ToColor(this XElement element) + { + if (string.IsNullOrEmpty(element.Value)) + { + return Color.Empty; + } + int num = element.Value.IndexOf(','); + int num2 = element.Value.IndexOf(',', num + 1); + int num3 = element.Value.IndexOf(',', num2 + 1); + return Color.FromArgb(int.Parse(element.Value.Substring(num3 + 1, element.Value.Length - num3 - 1)), int.Parse(element.Value.Substring(0, num)), int.Parse(element.Value.Substring(num + 1, num2 - num - 1)), int.Parse(element.Value.Substring(num2 + 1, num3 - num2 - 1))); + } + + public static XElement ToXElement(this Color color, string nodeName = "Color") + { + XName? name = nodeName; + string content; + if (!color.IsEmpty) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 4); + defaultInterpolatedStringHandler.AppendFormatted(color.R); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(color.G); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(color.B); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(color.A); + content = defaultInterpolatedStringHandler.ToStringAndClear(); + } + else + { + content = string.Empty; + } + return new XElement(name, content); + } + + public static Font ToFont(this XElement element) + { + if (string.IsNullOrEmpty(element.Value)) + { + return null; + } + int num = element.Value.IndexOf(','); + int num2 = element.Value.IndexOf(',', num + 1); + int num3 = element.Value.IndexOf(',', num2 + 1); + float.TryParse(element.Value.Substring(num + 1, num2 - num - 1), NumberStyles.Float, CultureInfo.InvariantCulture, out var result); + return new Font(element.Value.Substring(0, num), result, (FontStyle)int.Parse(element.Value.Substring(num2 + 1, num3 - num2 - 1)), (GraphicsUnit)int.Parse(element.Value.Substring(num3 + 1, element.Value.Length - num3 - 1))); + } + + public static XElement ToXElement(this Font font, string nodeName = "Font") + { + XName? name = nodeName; + string content; + if (font != null) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 4); + defaultInterpolatedStringHandler.AppendFormatted(font.Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(font.Size.ToString(CultureInfo.InvariantCulture)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted((int)font.Style); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted((int)font.Unit); + content = defaultInterpolatedStringHandler.ToStringAndClear(); + } + else + { + content = string.Empty; + } + return new XElement(name, content); + } + } + public interface IRenamable + { + string Name { get; set; } + + bool IsNameAllowed(string s, ref string error); + } + public class Renamable : IRenamable + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Converter ??; + + internal string ?(string P_0) + { + return P_0.ToLower(); + } + } + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private List ??; + + public bool AllowFileSystemForbiddenSymbols = true; + + [CompilerGenerated] + private string ??; + + public bool AllowEmptyName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public List ExcludeNames + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool IsNameAllowed(string s, ref string error) + { + if (!AllowEmptyName && string.IsNullOrWhiteSpace(s)) + { + error = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + return false; + } + if (ExcludeNames != null && ExcludeNames.ConvertAll((string P_0) => P_0.ToLower()).ToArray().Contains(s.ToLower())) + { + error = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + return false; + } + char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); + if (s.IndexOfAny(invalidFileNameChars) != -1) + { + string text = string.Empty; + string text2 = string.Empty; + char[] array = invalidFileNameChars; + foreach (char c in array) + { + if (char.IsWhiteSpace(c) || char.IsControl(c)) + { + string text3 = text2; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(4, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted((int)c); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + text2 = text3 + defaultInterpolatedStringHandler.ToStringAndClear(); + } + else + { + string text4 = text; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(2, 1); + defaultInterpolatedStringHandler.AppendFormatted(c); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + text = text4 + defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + text2 = text2.Trim(); + text2 = text2.Trim(','); + text += text2; + error = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + text; + return false; + } + error = string.Empty; + return true; + } + } + /// + /// The application logger event. + /// + public class ApplicationLoggerEvent : LoggerEvent + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + public string Message + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string ConnectionName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + } +} +namespace ? +{ + internal class ? + { + [CompilerGenerated] + private LoggingLevel ??; + + [Option('l', "log", Required = false, HelpText = "Set logging level")] + public LoggingLevel LoggingLevel + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = loggingLevel; + } + } + } +} +namespace TradingPlatform.BusinessLayer +{ + public interface ILoggable + { + string Event { get; } + + string Message { get; } + } + public interface ILogger : IDisposable + { + LoggerScope AllowedScopes { get; } + + void Configure(LoggerConfig loggerConfig); + + void Log(string message, DateTime date, LoggingLevel level = LoggingLevel.System, string connection = null); + + void Log(string message, Exception exception, DateTime date, LoggingLevel level = LoggingLevel.Error, string connection = null); + + void Log(Exception exception, DateTime date, LoggingLevel level = LoggingLevel.Error, string connection = null); + + void Log(ILoggable loggable, DateTime date, LoggingLevel level = LoggingLevel.Error, string connection = null); + + List GetHistory(DateTime from, DateTime to); + + void DeleteLogFilesExcept(DateTime from, DateTime to); + } + [Flags] + public enum LoggerScope + { + Hidden = 0, + Application = 1, + General = 2, + LocalCopyTrading = 4 + } + public class LocalCopyTradingLoggerEvent : LoggerEvent + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private PlaceOrderRequestParameters ??; + + public string ConnectionName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public PlaceOrderRequestParameters OrderRequestParameters + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + } + public class Loggable : ILoggable + { + [CompilerGenerated] + private readonly string ??; + + [CompilerGenerated] + private readonly string ??; + + public string Event + { + [CompilerGenerated] + get + { + return ??; + } + } + + public string Message + { + [CompilerGenerated] + get + { + return ??; + } + } + + public Loggable(string @event, string message) + { + ?? = @event; + ?? = message; + } + } + public record LoggerConfig + { + public string LoggerName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string OutputFolderPath + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public LoggerScope Scope + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private LoggerScope ??; + + [CompilerGenerated] + public override string ToString() + { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (PrintMembers(stringBuilder)) + { + stringBuilder.Append(' '); + } + stringBuilder.Append('}'); + return stringBuilder.ToString(); + } + + [CompilerGenerated] + protected virtual bool PrintMembers(StringBuilder builder) + { + RuntimeHelpers.EnsureSufficientExecutionStack(); + builder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + builder.Append((object?)LoggerName); + builder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + builder.Append((object?)OutputFolderPath); + builder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + builder.Append(Scope.ToString()); + return true; + } + } +} +namespace ? +{ + internal class ? : ILogger, IDisposable + { + [CompilerGenerated] + private readonly LoggerScope ??; + + private readonly ICollection ??; + + public LoggerScope AllowedScopes + { + [CompilerGenerated] + get + { + return ??; + } + } + + public ?(ICollection P_0) + { + ?? = new List(); + foreach (ILogger item in P_0) + { + ??.Add(item); + } + } + + public void Configure(LoggerConfig loggerConfig) + { + foreach (ILogger item in ??) + { + try + { + item.Configure(loggerConfig); + } + catch (Exception) + { + } + } + } + + public void Log(string message, DateTime date, LoggingLevel level = LoggingLevel.System, string connection = null) + { + foreach (ILogger item in ??) + { + try + { + item.Log(message, date, level, connection); + } + catch (Exception) + { + } + } + } + + public void Log(string message, Exception exception, DateTime date, LoggingLevel level = LoggingLevel.Error, string connection = null) + { + foreach (ILogger item in ??) + { + try + { + item.Log(message, exception, date, level, connection); + } + catch (Exception) + { + } + } + } + + public void Log(Exception exception, DateTime date, LoggingLevel level = LoggingLevel.Error, string connection = null) + { + foreach (ILogger item in ??) + { + try + { + item.Log(exception, date, level, connection); + } + catch (Exception) + { + } + } + } + + public void Log(ILoggable loggable, DateTime date, LoggingLevel level = LoggingLevel.Error, string connection = null) + { + foreach (ILogger item in ??) + { + try + { + item.Log(loggable, date, level, connection); + } + catch (Exception) + { + } + } + } + + public List GetHistory(DateTime from, DateTime to) + { + List list = new List(); + ILogger logger = ??.FirstOrDefault(); + if (logger != null) + { + list.AddRange(logger.GetHistory(from, to)); + } + return list; + } + + public void DeleteLogFilesExcept(DateTime from, DateTime to) + { + foreach (ILogger item in ??) + { + item.DeleteLogFilesExcept(from, to); + } + } + + public void Dispose() + { + foreach (ILogger item in ??) + { + item.Dispose(); + } + ??.Clear(); + } + } +} +namespace TradingPlatform.BusinessLayer +{ + public class LoggerEvent + { + [CompilerGenerated] + private LoggingLevel ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private string ??; + + public LoggingLevel Type + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DateTime Date + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Event + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + } + public sealed class LoggerManager : BufferedProcessor, IDisposable + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Action ??; + + public static Func ??; + + public static Func ??; + + public static Predicate ??; + + internal void ?(ParserSettings P_0) + { + P_0.IgnoreUnknownArguments = true; + } + + internal bool ?(TypeWrapper P_0) + { + return !P_0.Type.IsAbstract; + } + + internal Type ?(TypeWrapper P_0) + { + return P_0.Type; + } + + internal bool ?(ILogger P_0) + { + return P_0 == null; + } + } + + [CompilerGenerated] + private sealed class ? + { + public LoggerManager ??; + + public string ??; + + public LoggingLevel ??; + + public string ??; + + internal void ?() + { + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + ??.???.Log(??, dateTimeUtcNow, ??, ??); + ApplicationLoggerEvent applicationLoggerEvent = new ApplicationLoggerEvent + { + Date = dateTimeUtcNow, + Type = ??, + Event = ??, + Message = string.Empty, + ConnectionName = ?? + }; + ??.?(applicationLoggerEvent); + ??.?(dateTimeUtcNow, ??, string.Empty); + } + } + + [CompilerGenerated] + private sealed class ? + { + public LoggerManager ??; + + public string ??; + + public Exception ??; + + public LoggingLevel ??; + + public string ??; + + internal void ?() + { + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + ??.???.Log(??, ??, dateTimeUtcNow, ??, ??); + ApplicationLoggerEvent applicationLoggerEvent = new ApplicationLoggerEvent + { + Date = dateTimeUtcNow, + Type = ??, + Event = ??, + Message = GetFormattedErrorMessage(??), + ConnectionName = ?? + }; + ??.?(applicationLoggerEvent); + ??.?(dateTimeUtcNow, ??, ??.Message); + } + } + + [CompilerGenerated] + private sealed class ? + { + public LoggerManager ??; + + public ILoggable ??; + + public LoggingLevel ??; + + public string ??; + + internal void ?() + { + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + ??.??.Log(??, dateTimeUtcNow, ??, ??); + ApplicationLoggerEvent applicationLoggerEvent = new ApplicationLoggerEvent + { + Date = dateTimeUtcNow, + Type = ??, + Event = ??.Event, + Message = ??.Message, + ConnectionName = ?? + }; + ??.?(applicationLoggerEvent); + ??.?(dateTimeUtcNow, ??.Event, ??.Message); + } + } + + [CompilerGenerated] + private sealed class ? + { + public LoggerManager ??; + + public string ??; + + public DateTime ??; + + internal void ?() + { + ??.?(??, ??); + } + } + + [CompilerGenerated] + private sealed class ? + { + public ILogger ??; + + public DateTime ??; + + public DateTime ??; + + internal void ?() + { + ??.DeleteLogFilesExcept(??, ??); + } + } + + private const int ?? = 864000; + + private const int ?? = 600; + + private const string ?? = "Loggers"; + + private int ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private LoggingLevel ??; + + private ILogger ??; + + private readonly List ??; + + private readonly List ??; + + private readonly List ??; + + public bool EnableAutoDeleting + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int AutoDeletePeriod + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Current logging level + /// + public LoggingLevel CurrentLogLevel + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = loggingLevel; + } + } + + public event Action NewLog + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public LoggerManager() + { + AutoDeletePeriod = 30; + EnableAutoDeleting = true; + ?? = 863400; + ?? = new List(); + ?? = new List(); + ?? = new List(); + CurrentLogLevel = LoggingLevel.System | LoggingLevel.Error | LoggingLevel.Trading; + new Parser(delegate(ParserSettings P_0) + { + P_0.IgnoreUnknownArguments = true; + }).ParseArguments(Environment.GetCommandLineArgs()).WithParsed(delegate(? P_0) + { + AddLogLevel(P_0.LoggingLevel); + }).WithNotParsed(delegate(IEnumerable P_0) + { + foreach (Error item in P_0) + { + Log(item.ToString(), LoggingLevel.Error); + } + }); + } + + internal void ?() + { + List list = AssemblyLoader.LoadTypes(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), typeof(ILogger), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SearchOption.AllDirectories); + if (list != null) + { + ??.AddRange(from P_0 in list + where !P_0.Type.IsAbstract + select P_0.Type); + ?? = GetLogger(new LoggerConfig + { + LoggerName = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + OutputFolderPath = Path.Combine(Directory.GetParent(Const.EXECUTING_FOLDER).FullName, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + Scope = LoggerScope.Application + }); + Start(); + Core.Instance.?(?); + } + } + + public void Dispose() + { + Core.Instance.?(?); + Stop(); + if (?? != null) + { + ??.Dispose(); + ?? = null; + } + } + + public ILogger GetLogger(LoggerConfig loggerConfig) + { + List list = new List(); + foreach (Type item in ??) + { + ILogger logger = (ILogger)Activator.CreateInstance(item); + if (logger.AllowedScopes.HasFlag(loggerConfig.Scope)) + { + list.Add(logger); + } + } + ? ? = new ?(list); + ?.Configure(loggerConfig); + ?(?); + return ?; + } + + /// + /// Sets logs with custom messag, logging level, connection name + /// + public void Log(string message, LoggingLevel loggingLevel = LoggingLevel.System, string connectionName = null) + { + if (?(loggingLevel)) + { + Push(delegate + { + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + ???.Log(message, dateTimeUtcNow, loggingLevel, connectionName); + ApplicationLoggerEvent applicationLoggerEvent = new ApplicationLoggerEvent + { + Date = dateTimeUtcNow, + Type = loggingLevel, + Event = message, + Message = string.Empty, + ConnectionName = connectionName + }; + ?(applicationLoggerEvent); + ?(dateTimeUtcNow, message, string.Empty); + }); + } + } + + /// + /// Sets logs with exception and custom message (optional), logging level, connection name + /// + public void Log(Exception ex, string message = null, LoggingLevel loggingLevel = LoggingLevel.Error, string connectionName = null) + { + if (!(ex is ThreadAbortException) && ?(loggingLevel)) + { + Push(delegate + { + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + ???.Log(message, ex, dateTimeUtcNow, loggingLevel, connectionName); + ApplicationLoggerEvent applicationLoggerEvent = new ApplicationLoggerEvent + { + Date = dateTimeUtcNow, + Type = loggingLevel, + Event = message, + Message = GetFormattedErrorMessage(ex), + ConnectionName = connectionName + }; + ?(applicationLoggerEvent); + ?(dateTimeUtcNow, message, ex.Message); + }); + } + } + + /// + /// Sets logs with objects inherited from ILoggable interface,logging level, connection name + /// + public void Log(ILoggable loggable, LoggingLevel loggingLevel = LoggingLevel.System, string connectionName = null) + { + if (loggable == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (?(loggingLevel)) + { + Push(delegate + { + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + ??.Log(loggable, dateTimeUtcNow, loggingLevel, connectionName); + ApplicationLoggerEvent applicationLoggerEvent = new ApplicationLoggerEvent + { + Date = dateTimeUtcNow, + Type = loggingLevel, + Event = loggable.Event, + Message = loggable.Message, + ConnectionName = connectionName + }; + ?(applicationLoggerEvent); + ?(dateTimeUtcNow, loggable.Event, loggable.Message); + }); + } + } + + public void Log(string @event, string message, LoggingLevel loggingLevel = LoggingLevel.System, string connectionName = null) + { + Log(new Loggable(@event, message), loggingLevel, connectionName); + } + + private void ?(ApplicationLoggerEvent P_0) + { + ???.Invoke(P_0); + } + + /// + /// Sets a log level in case of deep debug + /// + public void AddLogLevel(LoggingLevel loggingLevel) + { + CurrentLogLevel |= loggingLevel; + } + + /// + /// Remove a log level if one has not needed already + /// + public void RemoveLogLevel(LoggingLevel loggingLevel) + { + CurrentLogLevel &= ~loggingLevel; + } + + public List GetHistory(DateTime from, DateTime to) + { + List list = new List(); + if (?? != null) + { + list.AddRange(??.GetHistory(from, to).OfType()); + } + return list; + } + + /// + /// Manage files existence in folder. + /// + public void RegisterExternalLogFolder(string path) + { + if (!Directory.Exists(path)) + { + return; + } + if (!??.Contains(path)) + { + ??.Add(path); + } + if (EnableAutoDeleting && ?? < 863400) + { + DateTime ?? = Core.Instance.TimeUtils.DateTimeUtcNow.AddDays(-AutoDeletePeriod); + Push(delegate + { + ?(path, ??); + }); + } + } + + private void ?() + { + if (?? == null || !EnableAutoDeleting) + { + return; + } + Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + DateTime dateTime = dateTimeUtcNow.AddDays(-AutoDeletePeriod); + foreach (ILogger item in ??) + { + item?.DeleteLogFilesExcept(dateTime, dateTimeUtcNow); + } + foreach (string item2 in ??) + { + ?(item2, dateTime); + } + Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + + private void ?(string P_0, DateTime P_1) + { + if (string.IsNullOrEmpty(P_0)) + { + return; + } + try + { + if (!Directory.Exists(P_0)) + { + return; + } + string[] files = Directory.GetFiles(P_0); + foreach (string text in files) + { + FileInfo fileInfo = new FileInfo(text); + if (fileInfo.CreationTimeUtc < P_1 || fileInfo.LastWriteTime < P_1) + { + File.Delete(text); + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + private void ?(ILogger P_0) + { + ??.RemoveAll((ILogger logger) => logger == null); + ??.Add(P_0); + if (EnableAutoDeleting && ?? < 863400) + { + DateTime ?? = Core.Instance.TimeUtils.DateTimeUtcNow; + DateTime ?? = ??.AddDays(-AutoDeletePeriod); + Push(delegate + { + P_0.DeleteLogFilesExcept(??, ??); + }); + } + } + + private void ?() + { + if (?? < 864000) + { + ??++; + return; + } + Push(?); + ?? = 0; + } + + private bool ?(LoggingLevel P_0) + { + if (!CurrentLogLevel.HasFlag(P_0)) + { + return (LoggingLevel.System | LoggingLevel.Error | LoggingLevel.Trading | LoggingLevel.LoadingHistory).HasFlag(P_0); + } + return true; + } + + private void ?(DateTime P_0, string P_1, string P_2) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(4, 1); + defaultInterpolatedStringHandler.AppendFormatted(P_0, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + StringBuilder stringBuilder = new StringBuilder(defaultInterpolatedStringHandler.ToStringAndClear()); + if (!string.IsNullOrEmpty(P_1)) + { + StringBuilder stringBuilder2 = stringBuilder; + StringBuilder stringBuilder3 = stringBuilder2; + StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(9, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(P_1); + stringBuilder3.Append(ref handler); + } + if (!string.IsNullOrEmpty(P_2)) + { + StringBuilder stringBuilder2 = stringBuilder; + StringBuilder stringBuilder4 = stringBuilder2; + StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(11, 1, stringBuilder2); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(P_2); + stringBuilder4.Append(ref handler); + } + } + + protected override void Process(Action subject) + { + subject?.Invoke(); + } + + protected static string GetFormattedErrorMessage(Exception ex) + { + return new StringBuilder().Append(ex.Message).Append(' ').Append(ex.StackTrace) + .Replace(Environment.NewLine, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + .ToString(); + } + + [CompilerGenerated] + private void ?(? P_0) + { + AddLogLevel(P_0.LoggingLevel); + } + + [CompilerGenerated] + private void ?(IEnumerable P_0) + { + foreach (Error item in P_0) + { + Log(item.ToString(), LoggingLevel.Error); + } + } + } + /// + /// ??? ?????????, ??????? ????? ?????????????? ??? ???????? email + /// + public class EmailParameters + { + public string[] address; + + public string subject; + + public string text; + + public string[] fileNames; + + public bool asFile; + + public SendMailCallbackDelegate callBack; + } + public delegate void SendMailCallbackDelegate(EmailSendCompletedResult result); + public class EmailSendCompletedResult + { + public EmailSendCompletedStatus Status; + + public string Message; + + public void SetError(Exception ex) + { + Message = ex.Message; + Status = EmailSendCompletedStatus.Failure; + } + } + public enum EmailSendCompletedStatus + { + Success, + Failure + } + public class MailUtils : ICustomizable + { + [CompilerGenerated] + private sealed class ? + { + public MailUtils ??; + + public EmailParameters ??; + + internal void ?() + { + try + { + ??.?(??); + } + catch (Exception error) + { + if (??.callBack != null) + { + EmailSendCompletedResult emailSendCompletedResult = new EmailSendCompletedResult(); + emailSendCompletedResult.SetError(error); + ??.callBack(emailSendCompletedResult); + } + } + } + } + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private int ??; + + public bool MailUseSSLConnection + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = flag; + } + } + + public string MailLogin + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public string MailPassword + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public int MailSMTPServerTimeout + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public string MailSMTPServer + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public int MailSMTPPort + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public IList Settings + { + get + { + List list = new List(); + list.Add(new SettingItemBoolean(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MailUseSSLConnection) + { + Text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + SortIndex = 10 + }); + if (MailLogin != null) + { + list.Add(new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MailLogin) + { + Text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + SortIndex = 30 + }); + } + if (MailPassword != null) + { + list.Add(new SettingItemPassword(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new PasswordHolder(MailPassword, SavePassword: true, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())) + { + Text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + SortIndex = 40 + }); + } + list.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MailSMTPServerTimeout) + { + Text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + SortIndex = 50, + Minimum = 0, + Maximum = int.MaxValue, + Increment = 1 + }); + if (MailSMTPServer != null) + { + list.Add(new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MailSMTPServer) + { + Text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + SortIndex = 70 + }); + } + list.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MailSMTPPort) + { + Text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + SortIndex = 80, + Minimum = 0, + Maximum = int.MaxValue, + Increment = 1 + }); + return list; + } + set + { + if (value == null) + { + return; + } + foreach (SettingItem value2 in new SettingsHolder(value).Values) + { + string name = value2.Name; + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (!(name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + MailSMTPPort = (int)value2.Value; + } + } + else + { + MailSMTPServer = (string)value2.Value; + } + } + else + { + MailSMTPServerTimeout = (int)value2.Value; + } + } + else + { + MailPassword = (value2.Value as PasswordHolder).Password; + } + } + else + { + MailLogin = (string)value2.Value; + } + } + else + { + MailUseSSLConnection = (bool)value2.Value; + } + } + } + } + + private void ?(EmailParameters P_0) + { + EmailSendCompletedResult emailSendCompletedResult = new EmailSendCompletedResult(); + MailMessage mailMessage = new MailMessage(); + SmtpClient smtpClient = null; + try + { + if (string.IsNullOrEmpty(MailLogin)) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + mailMessage.From = new MailAddress(MailLogin); + mailMessage.Subject = P_0.subject; + if (P_0.address != null) + { + string[] address = P_0.address; + foreach (string addresses in address) + { + mailMessage.To.Add(addresses); + } + } + AlternateView item = AlternateView.CreateAlternateViewFromString(P_0.text, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + string text = P_0.text; + if (text != null) + { + text = text.Replace(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + text = text.Replace(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (P_0.fileNames != null) + { + if (!P_0.asFile) + { + text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + for (int j = 0; j < P_0.fileNames.Length; j++) + { + text = text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + j + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + AlternateView alternateView = AlternateView.CreateAlternateViewFromString(text, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + for (int k = 0; k < P_0.fileNames.Length; k++) + { + if (P_0.fileNames[k] != null) + { + LinkedResource linkedResource = new LinkedResource(P_0.fileNames[k]); + linkedResource.ContentId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + k; + alternateView.LinkedResources.Add(linkedResource); + } + } + mailMessage.AlternateViews.Add(item); + mailMessage.AlternateViews.Add(alternateView); + } + else + { + mailMessage.AlternateViews.Add(item); + string[] address = P_0.fileNames; + foreach (string fileName in address) + { + mailMessage.Attachments.Add(new Attachment(fileName)); + } + } + } + else + { + AlternateView item2 = AlternateView.CreateAlternateViewFromString(text, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + mailMessage.AlternateViews.Add(item); + mailMessage.AlternateViews.Add(item2); + } + smtpClient = new SmtpClient(MailSMTPServer) + { + Credentials = new NetworkCredential(mailMessage.From.Address, MailPassword), + EnableSsl = MailUseSSLConnection, + Port = MailSMTPPort, + Timeout = MailSMTPServerTimeout + }; + smtpClient.Send(mailMessage); + emailSendCompletedResult.Status = EmailSendCompletedStatus.Success; + } + catch (Exception error) + { + emailSendCompletedResult.SetError(error); + } + finally + { + mailMessage?.Dispose(); + smtpClient?.Dispose(); + P_0.callBack?.Invoke(emailSendCompletedResult); + } + } + + /// + /// ???????? ????????? ?? E-mail + /// + public void SendAsync(EmailParameters parameters) + { + Task.Factory.StartNew(delegate + { + try + { + ?(parameters); + } + catch (Exception error) + { + if (parameters.callBack != null) + { + EmailSendCompletedResult emailSendCompletedResult = new EmailSendCompletedResult(); + emailSendCompletedResult.SetError(error); + parameters.callBack(emailSendCompletedResult); + } + } + }); + } + + internal void ?() + { + } + } + [Serializable] + public class PairColor : IXElementSerialization, IEquatable + { + [CompilerGenerated] + private Color ??; + + [CompilerGenerated] + private Color ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + public Color Color1 + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Color Color2 + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Text1 + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Text2 + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public PairColor() + { + } + + public PairColor(Color color1, Color color2, string text1 = null, string text2 = null) + { + Color1 = color1; + Color2 = color2; + Text1 = text1; + Text2 = text2; + } + + public XElement ToXElement() + { + return new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Color1.ToXElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), Color2.ToXElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + Color1 = xElement.ToColor(); + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + Color2 = xElement2.ToColor(); + } + } + + public bool Equals(PairColor other) + { + if (other == null) + { + return false; + } + if (this == other) + { + return true; + } + if (Color1.Equals(other.Color1) && Color2.Equals(other.Color2) && Text1 == other.Text1) + { + return Text2 == other.Text2; + } + return false; + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + if (this == obj) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((PairColor)obj); + } + + public override int GetHashCode() + { + return HashCode.Combine(Color1, Color2, Text1, Text2); + } + } + public class PublishedAttribute : Attribute + { + } + public class NotPublishedAttribute : Attribute + { + } + public static class loc + { + private const string ?? = "CoreLocarizer"; + + public const string HIDDEN = "#hidden#"; + + private static ? ??; + + private static Dictionary ?? = new Dictionary(); + + private static CultureInfo DefaultCultureInfo => CultureInfo.CurrentUICulture; + + private static CultureInfo TerminalCultureInfo => CultureInfo.DefaultThreadCurrentUICulture; + + /// + /// + /// + public static void OnLocaleChanged() + { + foreach (? value in ??.Values) + { + value.?(TerminalCultureInfo); + } + ???.?(TerminalCultureInfo); + } + + private static ? ?(string P_0, string P_1) + { + return new ? + { + DirectoryPath = Path.GetDirectoryName(P_0), + Name = P_1 + }; + } + + /// + /// ?????, ?? ?????? ??? ??????? xgettext.exe + /// + /// + /// + public static string key(string text) + { + return text; + } + + public static string _(string text, string pluginFolderName = null, [CallerFilePath] string callerFilePath = null) + { + if (string.IsNullOrWhiteSpace(text)) + { + return string.Empty; + } + string empty = string.Empty; + string text2 = text; + empty = ((!string.IsNullOrWhiteSpace(pluginFolderName)) ? pluginFolderName : ?(callerFilePath)); + if (!string.IsNullOrWhiteSpace(empty)) + { + if (??.ContainsKey(empty) && ??[empty].Catalog.Translations.ContainsKey(text)) + { + text2 = ??[empty].Catalog.GetString(text); + } + if (!text2.Equals(text)) + { + return text2; + } + } + if (?? != null && ??.Catalog.Translations.ContainsKey(text)) + { + text2 = ??.Catalog.GetString(text); + } + return text2; + } + + /// + /// Check, whether current translation equal to hidden + /// + public static bool IsHidden(string text, string pluginFolderName = null, [CallerFilePath] string callerFilePath = null) + { + try + { + if (string.IsNullOrWhiteSpace(text)) + { + return false; + } + if (text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + return true; + } + string empty = string.Empty; + bool flag = false; + empty = ((!string.IsNullOrWhiteSpace(pluginFolderName)) ? pluginFolderName : ?(callerFilePath)); + if (!string.IsNullOrWhiteSpace(empty)) + { + if (??.ContainsKey(empty) && ??[empty].CatalogEN.Translations.ContainsKey(text)) + { + flag = ??[empty].CatalogEN.GetString(text) == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + if (flag) + { + return flag; + } + } + if (?? != null && ??.CatalogEN.Translations.ContainsKey(text)) + { + flag = ??.CatalogEN.GetString(text) == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + return flag; + } + catch + { + return false; + } + } + + private static string ?(string P_0) + { + if (P_0 == null) + { + return string.Empty; + } + foreach (string item in Path.GetDirectoryName(P_0).Split(Path.DirectorySeparatorChar).Reverse()) + { + if (??.ContainsKey(item)) + { + return item; + } + } + return string.Empty; + } + + /// + /// + /// + /// + public static void UnRegisterPlugin(string pluginName) + { + if (??.ContainsKey(pluginName)) + { + ? ? = ??[pluginName]; + ?.?(); + if (?.AttachedPluginCounter <= 0) + { + ??.Remove(pluginName); + } + } + } + + /// + /// + /// + /// + /// + public static void RegisterPlugin(string pluginName, string location) + { + if (!??.ContainsKey(pluginName)) + { + ? ? = ?(location, pluginName); + ??[pluginName] = new ?(TerminalCultureInfo ?? DefaultCultureInfo, ?); + } + } + + /// + /// + /// + public static void InitializeCoreLocalizer() + { + ? ? = ?(Assembly.GetCallingAssembly().Location, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + ?? = new ?(TerminalCultureInfo ?? DefaultCultureInfo, ?); + } + } +} +namespace ? +{ + internal class ? + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + public string DirectoryPath + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + } + internal class ? + { + private const string ?? = "locale"; + + private ? ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private Catalog ??; + + [CompilerGenerated] + private Catalog ??; + + internal int AttachedPluginCounter + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + internal Catalog Catalog + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = catalog; + } + } + + internal Catalog CatalogEN + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = catalog; + } + } + + internal ?(CultureInfo P_0, ? P_1) + { + Catalog = new Catalog(); + AttachedPluginCounter = 0; + ?? = P_1; + ?(); + ?(P_0); + ?(); + } + + internal void ?(CultureInfo P_0) + { + Catalog = new Catalog(); + if (P_0 != null) + { + string text = ?(??, P_0); + if (File.Exists(text)) + { + MoLoader loader = new MoLoader(text); + Catalog = new Catalog(loader); + } + } + } + + internal void ?() + { + AttachedPluginCounter++; + } + + internal void ?() + { + AttachedPluginCounter--; + } + + private string ?(? P_0, CultureInfo P_1) + { + return Path.Combine(P_0.DirectoryPath, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_1.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + + private void ?() + { + CatalogEN = new Catalog(); + try + { + CultureInfo cultureInfo = CultureInfo.GetCultureInfo(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + string text = ?(??, cultureInfo); + if (File.Exists(text)) + { + MoLoader loader = new MoLoader(text); + CatalogEN = new Catalog(loader); + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + CatalogEN = new Catalog(); + } + } + } +} +namespace TradingPlatform.BusinessLayer +{ + /// + /// Allows to save Symbols into named lists + /// + public class SymbolList : IComparable, ICustomizable, IRenamable + { + [CompilerGenerated] + private sealed class ? + { + public string ??; + + internal bool ?(SymbolList P_0) + { + return P_0.Name == ??; + } + } + + [CompilerGenerated] + private bool ??; + + private string ??; + + [CompilerGenerated] + private string ??; + + private List ??; + + public bool AllowToModify + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = flag; + } + } + + public string Name + { + get + { + return ??; + } + set + { + if (AllowToModify) + { + if (Core.Instance.SymbolList.FirstOrDefault((SymbolList P_0) => P_0.Name == ??) != null) + { + Core.Instance.RenameSymbolList(??, value); + } + else + { + Core.Instance.AddSymbolList(value, Symbols); + } + } + } + } + + public string Group + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IEnumerable Symbols + { + get + { + foreach (BusinessObjectInfo item in ??) + { + yield return new Symbol(item); + } + } + set + { + ??.Clear(); + foreach (Symbol item in value) + { + ??.Add(item.CreateInfo()); + } + } + } + + public IList Settings + { + get + { + List list = new List + { + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name) + }; + foreach (Symbol symbol in Symbols) + { + list.Add(new SettingItemSymbol(symbol.Name, symbol)); + } + return list; + } + set + { + List list = new List(); + foreach (SettingItem item in value) + { + if (item.Type == SettingItemType.Symbol) + { + list.Add(item.Value as Symbol); + } + else if (item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + ?(item.Value as string); + } + } + if (list.Count > 0) + { + Symbols = list; + } + } + } + + public bool IsNameAllowed(string s, ref string error) + { + if (string.IsNullOrWhiteSpace(s)) + { + error = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + return false; + } + if (Name != s && Core.Instance.SymbolList.Any((SymbolList P_0) => P_0.Name == s)) + { + error = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + return false; + } + return true; + } + + public IEnumerable GetRealSymbols() + { + foreach (BusinessObjectInfo item in ??) + { + yield return Core.Instance.GetSymbol(item); + } + } + + internal SymbolList() + { + ?? = new List(); + AllowToModify = true; + } + + public SymbolList(string name, IEnumerable symbols) + : this() + { + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ?(name); + Symbols = symbols ?? throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + + internal SymbolList(IList P_0, bool P_1) + : this() + { + Settings = P_0; + AllowToModify = P_1; + } + + public int CompareTo(object obj) + { + return Name.CompareTo((obj as SymbolList).Name); + } + + internal void ?(string P_0) + { + if (AllowToModify) + { + ?? = P_0; + } + } + + [CompilerGenerated] + private bool ?(SymbolList P_0) + { + return P_0.Name == ??; + } + } + public sealed class TimeUtils + { + public enum TimeFormat + { + Hours12, + Hours24 + } + + public static readonly string[] AvailableDateFormats = new string[12] + { + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }; + + public const long UNIX_START_TIME_TICKS = 621355968000000000L; + + [CompilerGenerated] + private TimeZone ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private ? ??; + + private CultureInfo ??; + + [CompilerGenerated] + private bool ??; + + public DateTime DateTimeUtcNow => DateTime.UtcNow.AddMilliseconds(TimeSynchronizer.ServerTimeOffset); + + public int ServerTimeOffset => TimeSynchronizer?.ServerTimeOffset ?? 0; + + public TimeZone SelectedTimeZone + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DateTime StartTerminalDateTimeUtc + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + internal ? TimeSynchronizer + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = ?; + } + } + + public bool IsSyncFailed => TimeSynchronizer.State == ?.??; + + public string SyncErrorMessage => TimeSynchronizer.LastSyncErrorMessage; + + public CultureInfo CultureInfo + { + get + { + if (!UseUICultureInfo) + { + return ??; + } + return CultureInfo.CurrentCulture; + } + } + + public bool UseUICultureInfo + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string DateFormatPattern + { + get + { + return ??.DateTimeFormat.ShortDatePattern; + } + set + { + if (!string.IsNullOrEmpty(value)) + { + ??.DateTimeFormat.ShortDatePattern = value; + ??.DateTimeFormat.DateSeparator = (value.Contains('.') ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + } + + public TimeFormat TimeHoursFormat + { + get + { + if (!??.DateTimeFormat.ShortTimePattern.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + return TimeFormat.Hours24; + } + return TimeFormat.Hours12; + } + set + { + ??.DateTimeFormat.ShortTimePattern = ((value == TimeFormat.Hours12) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + ??.DateTimeFormat.LongTimePattern = ((value == TimeFormat.Hours12) ? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() : 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public TimeUtils() + { + TimeSynchronizer = new ?(); + SelectedTimeZone = new TimeZone(TimeZoneType.Local); + UseUICultureInfo = true; + ?? = (CultureInfo)CultureInfo.InvariantCulture.Clone(); + DateFormatPattern = AvailableDateFormats[0]; + TimeHoursFormat = TimeFormat.Hours24; + } + + internal void ?() + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + TimeSynchronizer.?(); + StartTerminalDateTimeUtc = DateTimeUtcNow; + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + } + + internal void ?() + { + TimeSynchronizer.Dispose(); + } + + public DateTime ConvertFromUTCToSelectedTimeZone(DateTime dateTime) + { + return ConvertFromUTCToTimeZone(dateTime, SelectedTimeZone); + } + + public TimeSpan ConvertFromUTCToSelectedTimeZone(TimeSpan time) + { + return ConvertFromUTCToTimeZone(time, SelectedTimeZone); + } + + public DateTime ConvertFromSelectedTimeZoneToUTC(DateTime dateTime) + { + return ConvertFromTimeZoneToUTC(dateTime, SelectedTimeZone); + } + + public DateTime ConvertFromUTCToTimeZone(DateTime dateTime, TimeZone timeZone) + { + if (timeZone.TimeZoneInfo != null && dateTime.Kind != DateTimeKind.Local) + { + return TimeZoneInfo.ConvertTimeFromUtc(dateTime, timeZone.TimeZoneInfo); + } + return dateTime; + } + + public TimeSpan ConvertFromUTCToTimeZone(TimeSpan time, TimeZone timeZone) + { + DateTime dateTime = DateTimeUtcNow.Date + time; + if (timeZone.TimeZoneInfo != null && dateTime.Kind != DateTimeKind.Local) + { + return TimeZoneInfo.ConvertTimeFromUtc(dateTime, timeZone.TimeZoneInfo).TimeOfDay; + } + return time; + } + + public DateTime ConvertFromTimeZoneToUTC(DateTime dateTime, TimeZone timeZone) + { + if (dateTime.Kind == DateTimeKind.Utc) + { + return dateTime; + } + if (dateTime.Kind == DateTimeKind.Local) + { + dateTime = DateTime.SpecifyKind(dateTime, DateTimeKind.Unspecified); + } + if (timeZone.TimeZoneInfo != null) + { + return TimeZoneInfo.ConvertTimeToUtc(dateTime, timeZone.TimeZoneInfo); + } + return dateTime; + } + + public string GetFormatedDateTime(DateTime dateTime) + { + return dateTime.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo); + } + + public string GetFormatedDateShortTime(DateTime dateTime) + { + return dateTime.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo); + } + + public string GetFormatedDate(DateTime dateTime) + { + return dateTime.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo); + } + + public string GetFormatedDateTimeWithMilliseconds(DateTime dateTime) + { + string text = CultureInfo.DateTimeFormat.ShortDatePattern + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + CultureInfo.DateTimeFormat.LongTimePattern.Replace(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return dateTime.ToString(text, CultureInfo); + } + + public string GetFormatedShortTime(DateTime dateTime) + { + return dateTime.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo); + } + + public string GetFormatedLongTime(DateTime dateTime) + { + return dateTime.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo); + } + + public string GetFormatedLongTimeWithMilliseconds(DateTime dateTime) + { + string text = CultureInfo.DateTimeFormat.LongTimePattern.Replace(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return dateTime.ToString(text, CultureInfo); + } + + public string GetFormatedLongTime(TimeSpan timeSpan) + { + return GetFormatedLongTime(DateTimeUtcNow.Date + timeSpan); + } + } + public readonly struct TimeZone : IEquatable, IComparable, IComparable + { + [CompilerGenerated] + private readonly TimeZoneInfo ??; + + [CompilerGenerated] + private readonly TimeZoneType ??; + + public TimeZoneInfo TimeZoneInfo + { + [CompilerGenerated] + get + { + return ??; + } + } + + public TimeZoneType Type + { + [CompilerGenerated] + get + { + return ??; + } + } + + public bool IsEmpty + { + get + { + if (Type == TimeZoneType.Specific) + { + return TimeZoneInfo == null; + } + return false; + } + } + + public TimeZone(TimeZoneType type, TimeZoneInfo timeZoneInfo = null) + { + if (type == TimeZoneType.Local && timeZoneInfo != null) + { + throw new ArgumentException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (type == TimeZoneType.Specific && timeZoneInfo == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ?? = type; + ?? = ((type == TimeZoneType.Local) ? TimeZoneInfo.Local : timeZoneInfo); + } + + public static string ShortName(TimeZone timeZone) + { + if (timeZone.Type != TimeZoneType.Local) + { + return ?(timeZone.TimeZoneInfo, false); + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + + public static string Cities(TimeZone timeZone) + { + return ?(timeZone.TimeZoneInfo, true); + } + + private static string ?(TimeZoneInfo P_0, bool P_1) + { + if (P_0 == null) + { + return string.Empty; + } + if (P_0.Id == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + if (P_1) + { + int num = P_0.DisplayName.IndexOf(')') + 1; + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.DisplayName.Substring(num, P_0.DisplayName.Length - num); + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.DisplayName.Substring(1, P_0.DisplayName.IndexOf(')') - 1); + } + + public static bool operator ==(TimeZone timeZone1, TimeZone timeZone2) + { + if (timeZone1.Type == timeZone2.Type) + { + return timeZone1.TimeZoneInfo?.Id == timeZone2.TimeZoneInfo?.Id; + } + return false; + } + + public static bool operator !=(TimeZone timeZone1, TimeZone timeZone2) + { + if (timeZone1.Type == timeZone2.Type) + { + return timeZone1.TimeZoneInfo?.Id != timeZone2.TimeZoneInfo?.Id; + } + return true; + } + + public bool Equals(TimeZone other) + { + if (object.Equals(TimeZoneInfo, other.TimeZoneInfo)) + { + return Type == other.Type; + } + return false; + } + + public override bool Equals(object obj) + { + if (obj is TimeZone other) + { + return Equals(other); + } + return false; + } + + public override int GetHashCode() + { + return (((TimeZoneInfo != null) ? TimeZoneInfo.GetHashCode() : 0) * 397) ^ (int)Type; + } + + public int CompareTo(TimeZone other) + { + if (TimeZoneInfo == null) + { + return 1; + } + if (other.TimeZoneInfo == null) + { + return -1; + } + int num = TimeZoneInfo.BaseUtcOffset.CompareTo(other.TimeZoneInfo.BaseUtcOffset); + if (num != 0) + { + return num; + } + return string.Compare(TimeZoneInfo.Id, other.TimeZoneInfo.Id, StringComparison.Ordinal); + } + + public int CompareTo(object obj) + { + if (!(obj is TimeZone other)) + { + return 0; + } + return CompareTo(other); + } + + public override string ToString() + { + return TimeZoneInfo?.DisplayName; + } + } + public enum TimeZoneType + { + Specific, + Local + } + /// + /// Defines a trading operation respond bundle + /// + public sealed class TradingOperationResult : ILoggable + { + [CompilerGenerated] + private TradingOperationResultStatus ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private long ??; + + /// + /// Respond operation state + /// + public TradingOperationResultStatus Status + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = tradingOperationResultStatus; + } + } + + /// + /// Respond message + /// + public string Message + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Respond order id + /// + public string OrderId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public long RequestId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + string ILoggable.Event => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + string ILoggable.Message => ToString(); + + private TradingOperationResult() + { + } + + public static TradingOperationResult CreateSuccess(long requestId, string orderId = null) + { + return new TradingOperationResult + { + RequestId = requestId, + Status = TradingOperationResultStatus.Success, + OrderId = orderId + }; + } + + public static TradingOperationResult CreateError(long requestId, string message) + { + return new TradingOperationResult + { + RequestId = requestId, + Status = TradingOperationResultStatus.Failure, + Message = message + }; + } + + [NotPublished] + public void SetOrderId(string orderId) + { + OrderId = orderId; + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 3); + defaultInterpolatedStringHandler.AppendFormatted(Status); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted((Status == TradingOperationResultStatus.Success) ? (3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + OrderId) : Message); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(RequestId); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + public delegate TradingOperationResult TradingRequestHandler(TradingRequestParameters requestParameters); + public struct ValidateResult + { + [CompilerGenerated] + private ValidateState ??; + + [CompilerGenerated] + private string ??; + + public ValidateState State + { + [CompilerGenerated] + readonly get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Reason + { + [CompilerGenerated] + readonly get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public static ValidateResult Valid => new ValidateResult + { + State = ValidateState.Valid + }; + + public static ValidateResult NotValid(string reason) + { + return new ValidateResult + { + State = ValidateState.NotValid, + Reason = reason + }; + } + } + /// + /// Provides VA calculation parameters + /// + [Published] + public class VolumeAnalysisCalculationParameters + { + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private DeltaCalculationType ??; + + [CompilerGenerated] + private CumulativeDeltaReset ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private ISessionsContainer ??; + + [CompilerGenerated] + private TimeZone ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + public double FilteredVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool ForceReload + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DeltaCalculationType DeltaCalculationType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public CumulativeDeltaReset CumulativeDeltaReset + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double CustomTickSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int CustomStep + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public ISessionsContainer SessionsContainer + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public TimeZone TimeZone + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool CalculatePriceLevels + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool ForceUsingTickData + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public VolumeAnalysisCalculationParameters() + { + FilteredVolume = 0.0; + ForceReload = false; + DeltaCalculationType = DeltaCalculationType.AggressorFlag; + CustomTickSize = double.NaN; + CustomStep = 1; + CalculatePriceLevels = true; + ForceUsingTickData = false; + } + + internal VolumeAnalysisCalculationParameters(VolumeAnalysisCalculationParameters P_0) + { + FilteredVolume = P_0.FilteredVolume; + ForceReload = P_0.ForceReload; + DeltaCalculationType = P_0.DeltaCalculationType; + CumulativeDeltaReset = P_0.CumulativeDeltaReset; + CustomTickSize = P_0.CustomTickSize; + CustomStep = P_0.CustomStep; + SessionsContainer = P_0.SessionsContainer; + TimeZone = P_0.TimeZone; + CalculatePriceLevels = P_0.CalculatePriceLevels; + ForceUsingTickData = P_0.ForceUsingTickData; + } + } + /// + /// Provides VA calculation request per + /// + [Published] + public class VolumeAnalysisCalculationRequest : VolumeAnalysisCalculationParameters + { + [CompilerGenerated] + private Symbol ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private DateTime ??; + + public Symbol Symbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DateTime From + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DateTime To + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + internal string Marker => Symbol?.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Symbol?.ConnectionId; + + public VolumeAnalysisCalculationRequest() + { + } + + internal VolumeAnalysisCalculationRequest(VolumeAnalysisCalculationRequest P_0) + : base(P_0) + { + Symbol = P_0.Symbol; + From = P_0.From; + To = P_0.To; + } + + internal VolumeAnalysisCalculationRequest(VolumeAnalysisCalculationParameters P_0) + : base(P_0) + { + } + } +} +namespace ? +{ + internal abstract class ? : IVolumeAnalysisCalculationProgress, IDisposable + { + protected enum ? + { + ??, + ??, + ??, + ??, + ??, + ??, + ??, + ?? + } + + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func> ??; + + public static Func ??; + + internal DateTime ?(VolumeAnalysisInterval P_0) + { + return P_0.Interval.From; + } + + internal IEnumerable ?(VolumeAnalysisInterval P_0) + { + return P_0.VolumeAnalysis; + } + + internal long ?(Period P_0) + { + return P_0.Ticks; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Period ??; + + internal bool ?(Period P_0) + { + return P_0.Ticks < ??.Ticks; + } + } + + [CompilerGenerated] + private EventHandler ??; + + [CompilerGenerated] + private EventHandler ??; + + private VolumeAnalysisCalculationState ??; + + [CompilerGenerated] + private int ??; + + private readonly CancellationTokenSource ??; + + protected readonly VolumeAnalysisCalculationRequest ??; + + private Interval ??; + + private Interval ??; + + [CompilerGenerated] + private bool ?? = true; + + private readonly ManualResetEventSlim ??; + + private readonly ConcurrentQueue ??; + + private bool ??; + + private DateTime? ??; + + public VolumeAnalysisCalculationState State + { + get + { + return ??; + } + protected internal set + { + if (volumeAnalysisCalculationState != ??) + { + ?? = volumeAnalysisCalculationState; + ?(); + if (State == VolumeAnalysisCalculationState.Finished) + { + ??.Set(); + } + } + } + } + + public int ProgressPercent => (int)(??.GetLength().Ticks * 100 / CorrectedInterval.GetLength().Ticks); + + public int ProgressBarIndex + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public bool IsAborted => ??.IsCancellationRequested; + + protected CancellationToken CancellationToken => ??.Token; + + protected Interval CorrectedInterval + { + get + { + return ??; + } + private set + { + ?? = interval; + ?? = new Interval(??.To, ??.To); + } + } + + public VolumeAnalysisCalculationParameters CalculationParameters => new VolumeAnalysisCalculationParameters(??); + + protected Symbol Symbol => ??.Symbol; + + protected Connection Connection => Symbol?.Connection; + + protected VolumeAnalysisMetadata VolumeAnalysisMetadata => Symbol?.VolumeAnalysisMetadata; + + protected double PriceStep + { + get + { + double num = Symbol.TickSize; + if (!??.CustomTickSize.IsNanOrDefault()) + { + num = ??.CustomTickSize; + } + if (??.CustomStep > 1) + { + num *= (double)??.CustomStep; + } + return num; + } + } + + public bool AllowByLicense + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = flag; + } + } + + public event EventHandler StateChanged + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + public event EventHandler ProgressChanged + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + protected ?(VolumeAnalysisCalculationRequest P_0) + { + ?? = P_0 ?? throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + CorrectedInterval = new Interval(??.From, ??.To); + ?? = new CancellationTokenSource(); + ?? = VolumeAnalysisCalculationState.None; + ProgressBarIndex = int.MaxValue; + ?? = new ConcurrentQueue(); + ?? = new ManualResetEventSlim(); + } + + internal virtual void ?() + { + if (Symbol == null || Symbol.State == BusinessObjectState.Fake || (Connection == null && Symbol.SymbolType != SymbolType.Synthetic)) + { + State = VolumeAnalysisCalculationState.Finished; + return; + } + try + { + State = VolumeAnalysisCalculationState.Processing; + ?(); + CorrectedInterval = ?(); + if (CorrectedInterval.IsEmpty) + { + State = VolumeAnalysisCalculationState.Finished; + return; + } + if (?(out var ?2)) + { + ?(); + return; + } + bool flag = (((uint)(?2 - 3) <= 1u || ?2 == ?.?.??) ? true : false); + if (flag && Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), ??.Symbol).Status == TradingOperationStatus.NotAllowed) + { + Core.Instance.PushDealTicket(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Symbol?.Connection?.VendorName, DealTicketType.Refuse); + return; + } + foreach (Interval item in CorrectedInterval.Reverse().Split(Symbol?.HistoryMetadata?.DownloadingStep_Tick ?? TimeSpan.FromHours(1.0), roundToStep: true)) + { + int num = 0; + try + { + if (IsAborted) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 1); + defaultInterpolatedStringHandler.AppendFormatted(this); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); + break; + } + HistoricalData history = Symbol.GetHistory(new HistoryRequestParameters + { + Symbol = Symbol, + FromTime = item.From, + ToTime = item.To, + Aggregation = new HistoryAggregationTick((Symbol.VolumeType == SymbolVolumeType.Volume) ? HistoryType.Last : HistoryType.BidAsk), + CancellationToken = CancellationToken, + ForceReload = ??.ForceReload + }); + if (history.Count > 0) + { + IHistoryItem historyItem = history.LastOrDefault(); + if (historyItem != null && (!??.HasValue || ?? < historyItem.TimeLeft)) + { + ?? = historyItem.TimeLeft; + } + num = ?(history, item); + } + else if (!??.HasValue) + { + ?? = CorrectedInterval.From; + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + if (item.To == CorrectedInterval.To) + { + ?? = true; + ?(); + } + ?(item.From, (num != 0) ? num : ProgressBarIndex); + } + } + } + catch (Exception ex2) + { + Core.Instance.Loggers.Log(ex2); + } + finally + { + try + { + if (!??) + { + ?? = true; + ?(); + } + ?(); + } + catch (Exception ex3) + { + Core.Instance.Loggers.Log(ex3); + } + State = VolumeAnalysisCalculationState.Finished; + } + } + + private protected virtual void ?() + { + } + + public void AbortLoading() + { + ???.Cancel(); + } + + public void Wait(CancellationToken token = default(CancellationToken)) + { + WaitHandle.WaitAny(new WaitHandle[3] + { + ??.WaitHandle, + ???.Token.WaitHandle, + token.WaitHandle + }); + } + + public virtual void Dispose() + { + ?(); + ??.Clear(); + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(13, 3); + defaultInterpolatedStringHandler.AppendFormatted(GetType().Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + defaultInterpolatedStringHandler.AppendFormatted(CorrectedInterval); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + protected virtual bool ?(out ? P_0) + { + P_0 = ?.?.??; + VolumeAnalysisMetadata volumeAnalysisMetadata = VolumeAnalysisMetadata; + if (volumeAnalysisMetadata == null || !volumeAnalysisMetadata.IsVolumeAnalysisAvailable) + { + P_0 = ?.?.??; + return false; + } + if (Symbol.VolumeType != SymbolVolumeType.Volume) + { + P_0 = ?.?.??; + return false; + } + if (??.DeltaCalculationType != Symbol.GetDeltaCalculationTypeForVolumeAnalysis()) + { + P_0 = ?.?.??; + return false; + } + if (!??.FilteredVolume.IsNanOrDefault()) + { + P_0 = ?.?.??; + return false; + } + if (??.ForceUsingTickData) + { + P_0 = ?.?.??; + return false; + } + if (!VolumeAnalysisMetadata.TryFindLargestLoadingPeriod(CorrectedInterval, ??.CalculatePriceLevels, out var _)) + { + P_0 = ?.?.??; + return false; + } + return true; + } + + protected abstract void ?(); + + protected void ?(Interval P_0, Period P_1, ? P_2) + { + IDictionary downloadingStepByPeriod = VolumeAnalysisMetadata.GetDownloadingStepByPeriod(??.CalculatePriceLevels); + foreach (Interval item in P_0.Reverse().Split(downloadingStepByPeriod[P_1], roundToStep: true)) + { + int progressBarIndex = ProgressBarIndex; + try + { + if (IsAborted) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 1); + defaultInterpolatedStringHandler.AppendFormatted(this); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); + break; + } + VolumeAnalysisByPeriodRequestParameters volumeAnalysisByPeriodRequestParameters = new VolumeAnalysisByPeriodRequestParameters + { + SymbolId = Symbol.Id, + FromTime = item.From, + ToTime = item.To.AddTicks(-1L), + Period = P_1, + CalculatePriceLevels = ??.CalculatePriceLevels, + CancellationToken = CancellationToken, + MinVolumeAnalysisTickSize = Symbol.MinVolumeAnalysisTickSize, + SessionsContainer = ??.SessionsContainer + }; + List list = new List(); + List parametersForServerRequest = new List(); + VolumeAnalysisStorage volumeAnalysisStorage = Symbol.Connection.VolumeAnalysisStorage; + if (!??.ForceReload && volumeAnalysisStorage != null) + { + IList collection = volumeAnalysisStorage.Load(volumeAnalysisByPeriodRequestParameters, out parametersForServerRequest); + if (IsAborted) + { + LoggerManager loggers2 = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 1); + defaultInterpolatedStringHandler.AppendFormatted(this); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers2.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); + break; + } + list.AddRange(collection); + } + else + { + parametersForServerRequest.Add(volumeAnalysisByPeriodRequestParameters); + } + foreach (VolumeAnalysisByPeriodRequestParameters item2 in parametersForServerRequest) + { + if (IsAborted) + { + LoggerManager loggers3 = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(8, 1); + defaultInterpolatedStringHandler.AppendFormatted(this); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers3.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); + return; + } + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + item2.ForceReload = ??.ForceReload; + if (item2.ToTime.Ticks % 10 == 0L) + { + item2.ToTime = item2.ToTime.AddTicks(-1L); + } + VolumeAnalysisInterval volumeAnalysisInterval = Connection.LoadVolumeAnalysis(item2); + if (volumeAnalysisInterval?.VolumeAnalysis == null) + { + continue; + } + list.Add(volumeAnalysisInterval); + Period period = item2.Period; + TimeSpan timeSpan = period.BasePeriod switch + { + BasePeriod.Month => TimeSpan.FromDays(2.0), + BasePeriod.Year => TimeSpan.FromDays(2.0), + _ => TimeSpan.FromHours(2.0), + }; + VolumeAnalysisData volumeAnalysisData = volumeAnalysisInterval.VolumeAnalysis.LastOrDefault(); + if (volumeAnalysisData != null) + { + DateTime dateTime = period.BasePeriod switch + { + BasePeriod.Month => volumeAnalysisData.TimeLeft.AddMonths(period.PeriodMultiplier), + BasePeriod.Year => volumeAnalysisData.TimeLeft.AddYears(period.PeriodMultiplier), + _ => volumeAnalysisData.TimeLeft.AddTicks(period.Ticks), + }; + if (dateTime > item2.Interval.To && dateTime > dateTimeUtcNow) + { + volumeAnalysisInterval = new VolumeAnalysisInterval + { + Description = volumeAnalysisInterval.Description, + VolumeAnalysis = volumeAnalysisInterval.VolumeAnalysis.Take(volumeAnalysisInterval.VolumeAnalysis.Count - 1).ToList(), + Interval = new Interval(volumeAnalysisInterval.Interval.From, volumeAnalysisData.TimeLeft) + }; + } + else if (volumeAnalysisInterval.Interval.To > dateTimeUtcNow - timeSpan) + { + volumeAnalysisInterval = new VolumeAnalysisInterval + { + Description = volumeAnalysisInterval.Description, + VolumeAnalysis = volumeAnalysisInterval.VolumeAnalysis.ToList(), + Interval = new Interval(volumeAnalysisInterval.Interval.From, dateTime) + }; + } + } + else if (!volumeAnalysisInterval.Interval.IsEmpty) + { + DateTime dateTime2 = item2.Interval.To.FloorTo(new TimeSpan(period.Ticks)); + if (dateTime2 > dateTimeUtcNow - timeSpan) + { + dateTime2 = (dateTimeUtcNow - timeSpan).FloorTo(new TimeSpan(period.Ticks)); + } + if (dateTime2 < item2.Interval.From) + { + dateTime2 = item2.Interval.From; + } + volumeAnalysisInterval = new VolumeAnalysisInterval + { + Description = volumeAnalysisInterval.Description, + VolumeAnalysis = volumeAnalysisInterval.VolumeAnalysis.ToList(), + Interval = new Interval(volumeAnalysisInterval.Interval.From, dateTime2) + }; + } + if (!volumeAnalysisInterval.Interval.IsEmpty) + { + if (volumeAnalysisInterval.Interval.To.Microsecond == 999) + { + volumeAnalysisInterval = new VolumeAnalysisInterval + { + Description = volumeAnalysisInterval.Description, + VolumeAnalysis = volumeAnalysisInterval.VolumeAnalysis, + Interval = new Interval(volumeAnalysisInterval.Interval.From, volumeAnalysisInterval.Interval.To.AddTicks(1L)) + }; + } + _ = volumeAnalysisInterval.Interval.To.Second; + volumeAnalysisStorage?.Save(volumeAnalysisInterval); + } + } + List list2 = list.OrderBy((VolumeAnalysisInterval volumeAnalysisInterval2) => volumeAnalysisInterval2.Interval.From).SelectMany((VolumeAnalysisInterval volumeAnalysisInterval2) => volumeAnalysisInterval2.VolumeAnalysis).ToList(); + if (list2 == null || list2.Count <= 0) + { + continue; + } + VolumeAnalysisData volumeAnalysisData2 = list2.LastOrDefault(); + if (volumeAnalysisData2 != null) + { + DateTime value = (VolumeAnalysisMetadata.BuildUncompletedBars ? volumeAnalysisData2.TimeLeft.AddTicks(P_1.Ticks) : volumeAnalysisData2.TimeLeft); + if (!??.HasValue || ?? < value) + { + ?? = value; + } + } + P_2?.Invoke(list2, item, ref progressBarIndex); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + if (!?? && item.To == CorrectedInterval.To) + { + ?(P_1, item, P_2); + ?? = true; + ?(); + } + ?(item.From, progressBarIndex); + } + } + } + + private void ?(Period P_0, Interval P_1, ? P_2) + { + if (!VolumeAnalysisMetadata.BuildUncompletedBars) + { + return; + } + Period[] array = (from period2 in VolumeAnalysisMetadata.GetAllowedPeriods(??.CalculatePriceLevels) + where period2.Ticks < P_0.Ticks + orderby period2.Ticks descending + select period2).ToArray(); + if (!array.Any()) + { + Interval interval; + if (??.HasValue) + { + interval = new Interval(??.Value, P_1.To); + } + else + { + TimeSpan maxTicksLoadingPeriod = VolumeAnalysisMetadata.MaxTicksLoadingPeriod; + interval = ((!(P_1.GetLength() > maxTicksLoadingPeriod)) ? P_1 : new Interval(P_1.To - maxTicksLoadingPeriod, P_1.To)); + } + HistoricalData history = Symbol.GetHistory(new HistoryRequestParameters + { + Symbol = Symbol, + Interval = interval, + Aggregation = new HistoryAggregationTick((Symbol.VolumeType == SymbolVolumeType.Volume) ? HistoryType.Last : HistoryType.BidAsk), + CancellationToken = CancellationToken, + ForceReload = ??.ForceReload, + HistoryRequestType = HistoryRequestType.BuildUncompleteBarLogic + }); + IHistoryItem historyItem = history.LastOrDefault(); + if (historyItem != null && (!??.HasValue || ?? < historyItem.TimeLeft)) + { + ?? = historyItem.TimeLeft; + } + ?(history, P_1); + return; + } + Period[] array2 = array; + foreach (Period period in array2) + { + DateTime dateTime = (??.HasValue ? ??.Value : ((P_0.BasePeriod == BasePeriod.Tick) ? P_1.From : (((P_1.To - P_1.From).Ticks >= P_0.Ticks) ? P_1.To.AddTicks(-P_0.Ticks) : P_1.From))); + if (dateTime == P_1.To) + { + break; + } + ?(new Interval(dateTime, P_1.To), period, P_2); + } + } + + protected abstract int ?(HistoricalData P_0, Interval P_1); + + protected virtual void ?() + { + if (Symbol != null) + { + if (Symbol.VolumeType == SymbolVolumeType.Volume) + { + Symbol.NewLast += ?; + } + else + { + Symbol.NewQuote += ?; + } + } + } + + protected virtual void ?() + { + if (Symbol != null) + { + if (Symbol.VolumeType == SymbolVolumeType.Volume) + { + Symbol.NewLast -= ?; + } + else + { + Symbol.NewQuote -= ?; + } + } + } + + private void ?(Symbol P_0, MessageQuote P_1) + { + ?(P_1); + } + + protected virtual void ?(MessageQuote P_0) + { + if (!?(P_0)) + { + ?(P_0); + } + } + + protected abstract VolumeAnalysisData ?(long P_0); + + private bool ?(MessageQuote P_0) + { + if (?? && ??.IsEmpty) + { + return false; + } + ??.Enqueue(P_0); + return true; + } + + private void ?() + { + MessageQuote result; + while (??.TryDequeue(out result)) + { + if (result != null) + { + ?(result); + } + } + } + + private void ?(MessageQuote P_0) + { + if (P_0.Time <= (?? ?? CorrectedInterval.To) || !AllowByLicense) + { + return; + } + VolumeAnalysisData volumeAnalysisData = ?(P_0.Time.Ticks); + if (volumeAnalysisData == null) + { + return; + } + lock (volumeAnalysisData) + { + volumeAnalysisData.?(??, P_0); + } + } + + protected virtual Interval ?() + { + DateTime dateTime = ??.From; + DateTime dateTime2 = ??.To; + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + if (dateTime > dateTimeUtcNow) + { + dateTime = dateTimeUtcNow; + } + if (dateTime2 > dateTimeUtcNow) + { + dateTime2 = dateTimeUtcNow; + } + if (Symbol.QuoteDelay != default(TimeSpan) && dateTime2 > dateTimeUtcNow - Symbol.QuoteDelay) + { + dateTime2 = dateTimeUtcNow - Symbol.QuoteDelay; + } + return new Interval(dateTime, dateTime2); + } + + protected void ?(DateTime P_0, int P_1 = int.MaxValue) + { + ?? = new Interval(P_0, ??.To); + ProgressBarIndex = P_1; + ?(); + } + + private void ?() + { + ???.InvokeSafely(this, new VolumeAnalysisTaskEventArgs(this)); + } + + private void ?() + { + ???.InvokeSafely(this, new VolumeAnalysisTaskEventArgs(this)); + } + } + internal delegate void ?(IList P_0, Interval P_1, ref int P_2); + internal class ? : ?, IVolumeAnalysisCalculationTask, IDisposable + { + [Serializable] + [CompilerGenerated] + private new sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + internal Period ?(Period P_0) + { + return P_0; + } + + internal DateTime ?(VolumeAnalysisData P_0) + { + return P_0.TimeLeft; + } + } + + [CompilerGenerated] + private new sealed class ? + { + public long ??; + + public Period ??; + + public ? ??; + + public DateTime ??; + + public DateTime ??; + + public DateTime ??; + + public VolumeAnalysisData ??; + + public Func ??; + + internal bool ?(Period P_0) + { + return P_0.Ticks <= ??; + } + + internal bool ?(Period P_0) + { + return P_0 < ??; + } + + internal void ?(IList P_0, Interval P_1, ref int P_2) + { + if (??.?? == default(DateTime) || ??.?? > ??) + { + ??.?? = ??; + } + if (??.?? == default(DateTime) || ??.?? < ??) + { + ??.?? = ??; + } + if (P_0.Count > 0) + { + ?? = new DateTime(Math.Max(??.Ticks, ((IEnumerable)P_0).Max((Func)?.?.??.?).Ticks + ??.Ticks), DateTimeKind.Utc); + } + if (??.??.SessionsContainer != null && ?? < Period.DAY1) + { + P_0 = P_0.Where((VolumeAnalysisData volumeAnalysisData) => ??.??.SessionsContainer.ContainsDate(volumeAnalysisData.TimeLeft)).ToList(); + } + ??.Combine(P_0.Collapse()); + } + + internal bool ?(VolumeAnalysisData P_0) + { + return ??.??.SessionsContainer.ContainsDate(P_0.TimeLeft); + } + } + + [CompilerGenerated] + private VolumeAnalysisData ??; + + private DateTime ??; + + private DateTime ??; + + public VolumeAnalysisData Result + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = volumeAnalysisData; + } + } + + public IVolumeAnalysisCalculationProgress Progress => this; + + internal ?(VolumeAnalysisCalculationRequest P_0) + : base(P_0) + { + Result = new VolumeAnalysisData(); + } + + public override void Dispose() + { + Result = null; + base.Dispose(); + } + + protected override void ?() + { + try + { + ?(base.CorrectedInterval, Result); + if (base.PriceStep != base.Symbol.TickSize) + { + Result = Result?.CreateAggregatedSnapshot(base.PriceStep); + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + ?(base.CorrectedInterval.From); + } + } + + private void ?(Interval P_0, VolumeAnalysisData P_1, Period P_2 = default(Period)) + { + if (P_0.IsEmpty) + { + return; + } + Period[] allowedPeriods = base.VolumeAnalysisMetadata.GetAllowedPeriods(??.CalculatePriceLevels); + long ?? = (P_0.To - P_0.From).Ticks; + allowedPeriods = allowedPeriods.Where((Period period) => period.Ticks <= ??).ToArray(); + if (P_2 == default(Period)) + { + P_2 = allowedPeriods.Max((Period result) => result); + } + else + { + P_2 = allowedPeriods.FirstOrDefault((Period period) => period < P_2); + } + if (P_2 == default(Period)) + { + HistoricalData history = base.Symbol.GetHistory(new HistoryRequestParameters + { + Symbol = base.Symbol, + Interval = P_0, + Aggregation = new HistoryAggregationTick((base.Symbol.VolumeType == SymbolVolumeType.Volume) ? HistoryType.Last : HistoryType.BidAsk), + CancellationToken = base.CancellationToken, + ForceReload = ??.ForceReload + }); + ?(history, P_0); + return; + } + DateTime ?? = P_0.From; + DateTime ?? = P_0.To; + if (P_2.Ticks - (?? - ??).Ticks != 1) + { + ?? = P_0.From.CeilingTo(P_2); + ?? = P_0.To.FloorTo(P_2); + } + if (??.Ticks + P_2.Ticks == P_0.To.Ticks + 1) + { + ?? = P_0.To; + } + DateTime ?? = ??; + if (!(?? == ??)) + { + ?(new Interval(??, ??), P_2, delegate(IList list, Interval interval, ref int reference) + { + if (?? == default(DateTime) || ?? > ??) + { + ?? = ??; + } + if (?? == default(DateTime) || ?? < ??) + { + ?? = ??; + } + if (list.Count > 0) + { + ?? = new DateTime(Math.Max(??.Ticks, ((IEnumerable)list).Max((Func)?.?.??.?).Ticks + P_2.Ticks), DateTimeKind.Utc); + } + if (??.SessionsContainer != null && P_2 < Period.DAY1) + { + list = list.Where((VolumeAnalysisData volumeAnalysisData) => ??.SessionsContainer.ContainsDate(volumeAnalysisData.TimeLeft)).ToList(); + } + P_1.Combine(list.Collapse()); + }); + } + ?? = ??; + if (P_0.From < ??) + { + ?(new Interval(P_0.From, ??), P_1, P_2); + } + if (?? < P_0.To) + { + ?(new Interval(??, P_0.To), P_1, P_2); + } + } + + protected override int ?(HistoricalData P_0, Interval P_1) + { + Result?.?(??, P_0); + return 0; + } + + protected override void ?() + { + DateTime dateTime = Core.Instance.TimeUtils.DateTimeUtcNow; + if (???.Symbol?.Connection != null) + { + dateTime = ??.Symbol.Connection.ServerTime; + } + if (!(??.To < dateTime)) + { + base.?(); + } + } + + protected override void ?(MessageQuote P_0) + { + if (P_0.Time > ??.To) + { + ?(); + } + else if (!(P_0.Time < ??.From)) + { + base.?(P_0); + } + } + + protected override VolumeAnalysisData ?(long P_0) + { + return Result; + } + } + internal class ? : ? + { + private const int ?? = 1000000; + + private readonly ConcurrentQueue ??; + + private readonly ConcurrentQueue ??; + + internal ?(HistoricalData P_0, VolumeAnalysisCalculationRequest P_1) + : base(P_0, P_1) + { + if (??.Aggregation is HistoryAggregationRenko) + { + ?? = default(Period); + } + ?? = new ConcurrentQueue(); + ?? = new ConcurrentQueue(); + ??.NewHistoryItem += ?; + } + + public override void Dispose() + { + if (?? != null) + { + ??.NewHistoryItem -= ?; + } + base.Dispose(); + } + + private protected override void ?(HistoricalData P_0, int P_1) + { + if (P_0.Count <= P_1 + 1) + { + return; + } + IHistoryItem historyItem = null; + if (??.Any()) + { + IHistoryItem historyItem2 = ??[0, SeekOriginHistory.End]; + if (historyItem2.TryGetData(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var data) && data) + { + historyItem = historyItem2; + historyItem.VolumeAnalysisData = ?(historyItem2, ??.Count - 1); + } + } + foreach (IVolumeTickData item in P_0.Skip(P_1 + 1).OfType()) + { + if (historyItem != null && historyItem.TicksLeft <= item.Time) + { + lock (historyItem.VolumeAnalysisData) + { + historyItem.VolumeAnalysisData.?(??, item); + } + } + ??.Enqueue(item); + } + } + + protected override void ?(MessageQuote P_0) + { + if (!base.AllowByLicense || !(P_0 is IVolumeTickData item)) + { + return; + } + VolumeAnalysisData volumeAnalysisData = ?(P_0.Time.Ticks); + bool data = false; + IHistoryItem historyItem = null; + if (??.Any()) + { + historyItem = ??[0, SeekOriginHistory.End]; + if (historyItem.TimeLeft <= P_0.Time) + { + historyItem.TryGetData(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out data); + } + } + if (volumeAnalysisData == null && historyItem != null && data) + { + volumeAnalysisData = ?(historyItem, ??.Count - 1); + } + if (volumeAnalysisData == null || data) + { + ??.Enqueue(item); + while (??.Count > 1000000) + { + ??.TryDequeue(out var _); + } + if (!data) + { + return; + } + } + if (volumeAnalysisData != null) + { + lock (volumeAnalysisData) + { + volumeAnalysisData.?(??, P_0); + } + ???.?(); + } + } + + private void ?(object P_0, HistoryEventArgs P_1) + { + ?(??); + ?(??); + ???.?(); + } + + private void ?(ConcurrentQueue P_0) + { + IVolumeTickData result; + while (P_0.TryPeek(out result)) + { + VolumeAnalysisData volumeAnalysisData = ?(result.Time); + if (volumeAnalysisData == null) + { + break; + } + P_0.TryDequeue(out result); + lock (volumeAnalysisData) + { + volumeAnalysisData.?(??, result); + } + } + } + } + internal class ? : ? + { + [CompilerGenerated] + private new sealed class ? + { + public ? ??; + + public double ??; + + public Func ??; + + internal void ?(IList P_0, Interval P_1, ref int P_2) + { + if (??.??.SessionsContainer != null && ??.?? < Period.DAY1) + { + P_0 = P_0.Where((VolumeAnalysisData volumeAnalysisData3) => ??.??.SessionsContainer.ContainsDate(volumeAnalysisData3.TimeLeft)).ToList(); + } + int num = ??.?(??.??, P_1); + if (num < 0) + { + return; + } + P_2 = num; + int num2 = 0; + while (num < ??.??.Count && num2 < P_0.Count) + { + IHistoryItem historyItem = ??.??[num, SeekOriginHistory.Begin]; + VolumeAnalysisData volumeAnalysisData = P_0[num2]; + if (volumeAnalysisData.TimeLeft.Ticks > historyItem.TicksRight) + { + num++; + continue; + } + if (volumeAnalysisData.TimeLeft.Ticks + ??.??.Ticks - 1 < historyItem.TicksLeft) + { + num2++; + continue; + } + IHistoryItem historyItem2 = historyItem; + if (historyItem2.VolumeAnalysisData == null) + { + VolumeAnalysisData obj = new VolumeAnalysisData + { + TimeLeft = historyItem.TimeLeft + }; + VolumeAnalysisData volumeAnalysisData2 = obj; + historyItem2.VolumeAnalysisData = obj; + } + if (?? != ??.Symbol.TickSize) + { + historyItem.VolumeAnalysisData.Combine(volumeAnalysisData.CreateAggregatedSnapshot(??)); + } + else + { + historyItem.VolumeAnalysisData.Combine(volumeAnalysisData); + } + num2++; + } + } + + internal bool ?(VolumeAnalysisData P_0) + { + return ??.??.SessionsContainer.ContainsDate(P_0.TimeLeft); + } + } + + protected HistoricalData ??; + + protected Period ??; + + internal ?(HistoricalData P_0, VolumeAnalysisCalculationRequest P_1) + : base(P_1) + { + ?? = P_0; + if (Vendor.TryCorrectPeriodForDirectDownload(base.VolumeAnalysisMetadata?.GetAllowedPeriods(P_1.CalculatePriceLevels), ??.Aggregation.GetPeriod, out var allowedPeriod)) + { + ?? = allowedPeriod; + } + } + + internal override void ?() + { + if (?? == null) + { + base.State = VolumeAnalysisCalculationState.Finished; + } + else + { + base.?(); + } + } + + private protected override void ?() + { + base.?(); + double num = 0.0; + DateTime dateTime = default(DateTime); + if (base.IsAborted) + { + return; + } + for (int i = 0; i < ??.Count; i++) + { + IHistoryItem historyItem = ??[i, SeekOriginHistory.Begin]; + num = ?(dateTime, historyItem.TimeLeft, num); + if (historyItem.VolumeAnalysisData?.Total != null) + { + historyItem.VolumeAnalysisData.Total.?? = num; + num += (double)(decimal)historyItem.VolumeAnalysisData.Total.Delta; + } + dateTime = historyItem.TimeLeft; + } + } + + public override void Dispose() + { + base.Dispose(); + if (?? != null) + { + ??.VolumeAnalysisCalculationProgress = null; + for (int i = 0; i < ??.Count; i++) + { + ??[i, SeekOriginHistory.End].VolumeAnalysisData = null; + } + ?? = null; + } + } + + protected override bool ?(out ?.? P_0) + { + if (?? == default(Period)) + { + P_0 = ?.?.??; + return false; + } + return base.?(out P_0); + } + + protected override void ?() + { + double ?? = base.PriceStep; + ?(base.CorrectedInterval, ??, delegate(IList P_0, Interval P_1, ref int P_2) + { + if (??.SessionsContainer != null && ?? < Period.DAY1) + { + P_0 = P_0.Where((VolumeAnalysisData volumeAnalysisData3) => ??.SessionsContainer.ContainsDate(volumeAnalysisData3.TimeLeft)).ToList(); + } + int num = ?(??, P_1); + if (num >= 0) + { + P_2 = num; + int num2 = 0; + while (num < ??.Count && num2 < P_0.Count) + { + IHistoryItem historyItem = ??[num, SeekOriginHistory.Begin]; + VolumeAnalysisData volumeAnalysisData = P_0[num2]; + if (volumeAnalysisData.TimeLeft.Ticks > historyItem.TicksRight) + { + num++; + } + else if (volumeAnalysisData.TimeLeft.Ticks + ??.Ticks - 1 < historyItem.TicksLeft) + { + num2++; + } + else + { + IHistoryItem historyItem2 = historyItem; + if (historyItem2.VolumeAnalysisData == null) + { + VolumeAnalysisData obj = new VolumeAnalysisData + { + TimeLeft = historyItem.TimeLeft + }; + VolumeAnalysisData volumeAnalysisData2 = obj; + historyItem2.VolumeAnalysisData = obj; + } + if (?? != base.Symbol.TickSize) + { + historyItem.VolumeAnalysisData.Combine(volumeAnalysisData.CreateAggregatedSnapshot(??)); + } + else + { + historyItem.VolumeAnalysisData.Combine(volumeAnalysisData); + } + num2++; + } + } + } + }); + } + + protected override int ?(HistoricalData P_0, Interval P_1) + { + int num = ?(??, P_1); + int i = 0; + if (num < 0) + { + return 0; + } + int result = num; + while (i < P_0.Count && num < ??.Count) + { + IHistoryItem historyItem = ??[num, SeekOriginHistory.Begin]; + if (historyItem.TryGetData(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var data) && data) + { + num++; + continue; + } + DateTime timeLeft = historyItem.TimeLeft; + DateTime dateTime = new DateTime(historyItem.TicksRight, DateTimeKind.Utc); + while (P_0[i, SeekOriginHistory.Begin].TimeLeft < timeLeft) + { + i++; + if (i >= P_0.Count) + { + break; + } + } + for (; i < P_0.Count; i++) + { + IHistoryItem historyItem2 = P_0[i, SeekOriginHistory.Begin]; + if (historyItem2.TimeLeft > dateTime) + { + break; + } + IHistoryItem historyItem3 = historyItem; + if (historyItem3.VolumeAnalysisData == null) + { + VolumeAnalysisData obj = new VolumeAnalysisData + { + TimeLeft = timeLeft + }; + VolumeAnalysisData volumeAnalysisData = obj; + historyItem3.VolumeAnalysisData = obj; + } + historyItem.VolumeAnalysisData.?(??, historyItem2); + } + num++; + } + ?(P_0, i); + return result; + } + + private protected virtual void ?(HistoricalData P_0, int P_1) + { + } + + protected override void ?() + { + if (?? != null) + { + ??.?(?); + } + } + + protected override void ?() + { + if (?? != null) + { + ??.?(?); + } + } + + protected override VolumeAnalysisData ?(long P_0) + { + int num = (int)??.GetIndexByTime(P_0, SeekOriginHistory.Begin); + if (num < 0 || num >= ??.Count) + { + return null; + } + IHistoryItem historyItem = ??[num, SeekOriginHistory.Begin]; + if (historyItem == null) + { + return null; + } + return ?(historyItem, num); + } + + private protected VolumeAnalysisData ?(IHistoryItem P_0, int P_1) + { + if (P_0.VolumeAnalysisData != null) + { + return P_0.VolumeAnalysisData; + } + P_0.VolumeAnalysisData = new VolumeAnalysisData + { + TimeLeft = P_0.TimeLeft + }; + if (P_1 <= 0) + { + return P_0.VolumeAnalysisData; + } + IHistoryItem historyItem = ??[P_1 - 1, SeekOriginHistory.Begin]; + if (historyItem?.VolumeAnalysisData != null) + { + P_0.VolumeAnalysisData.Total.?? = ?(historyItem.TimeLeft, P_0.TimeLeft, historyItem.VolumeAnalysisData.Total.CumulativeDelta); + } + return P_0.VolumeAnalysisData; + } + + private void ?(object P_0, HistoryEventArgs P_1) + { + if (P_1 is ? { MessageQuote: not null } ?2) + { + ?(?2.MessageQuote); + } + } + + protected override void ?(MessageQuote P_0) + { + base.?(P_0); + ???.?(); + } + + protected override Interval ?() + { + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + DateTime dateTime = ??.From; + DateTime dateTime2 = ((??.ToTime == default(DateTime)) ? dateTimeUtcNow : ??.ToTime); + if (dateTime > dateTimeUtcNow) + { + dateTime = dateTimeUtcNow; + } + if (dateTime2 > dateTimeUtcNow) + { + dateTime2 = dateTimeUtcNow; + } + if (base.Symbol.QuoteDelay != default(TimeSpan) && dateTime2 > dateTimeUtcNow - base.Symbol.QuoteDelay) + { + dateTime2 -= base.Symbol.QuoteDelay; + } + return new Interval(dateTime, dateTime2); + } + + private int ?(HistoricalData P_0, Interval P_1) + { + if (P_0 == null || P_0.Count == 0) + { + return -1; + } + if (new Interval(P_0[0, SeekOriginHistory.Begin].TimeLeft, new DateTime(P_0[0, SeekOriginHistory.End].TicksRight, DateTimeKind.Utc)).Intersect(P_1) == Interval.Default) + { + return -1; + } + long num = P_1.From.Ticks; + long num2 = Math.Abs(P_0.Aggregation.GetPeriod.Ticks); + do + { + int num3 = (int)P_0.GetIndexByTime(num, SeekOriginHistory.Begin); + if (num3 >= 0) + { + return num3; + } + num += num2; + } + while (num <= P_1.To.Ticks); + return -1; + } + + private double ?(DateTime P_0, DateTime P_1, double P_2) + { + TimeZoneInfo timeZoneInfo = ??.TimeZone.TimeZoneInfo; + DateTime dateTime = P_0; + DateTime dateTime2 = P_1; + if (timeZoneInfo != null) + { + dateTime = TimeZoneInfo.ConvertTime(P_0, timeZoneInfo); + dateTime2 = TimeZoneInfo.ConvertTime(P_1, timeZoneInfo); + } + return ??.CumulativeDeltaReset switch + { + CumulativeDeltaReset.Never => P_2, + CumulativeDeltaReset.Daily => (dateTime.DayOfWeek != dateTime2.DayOfWeek) ? 0.0 : P_2, + CumulativeDeltaReset.Weekly => (dateTime.GetWeekOfYear() != dateTime2.GetWeekOfYear()) ? 0.0 : P_2, + CumulativeDeltaReset.ByChartSession => ?(??.SessionsContainer, P_0, P_1) ? 0.0 : P_2, + _ => P_2, + }; + } + + private bool ?(ISessionsContainer P_0, DateTime P_1, DateTime P_2) + { + if (P_0 == null) + { + return false; + } + ISession sessionForDate = P_0.GetSessionForDate(P_2); + if (sessionForDate == null) + { + return false; + } + ISession sessionForDate2 = P_0.GetSessionForDate(P_1); + if (sessionForDate2 == null) + { + return true; + } + if (P_1.TimeOfDay <= sessionForDate2.CloseTime && P_1.TimeOfDay < sessionForDate.OpenTime && sessionForDate.OpenTime <= P_2.TimeOfDay && sessionForDate2.CloseTime < P_2.TimeOfDay) + { + return true; + } + return false; + } + } +} +namespace TradingPlatform.BusinessLayer +{ + public class VolumeAnalysisTaskEventArgs : EventArgs + { + [CompilerGenerated] + private readonly VolumeAnalysisCalculationState ??; + + [CompilerGenerated] + private readonly int ??; + + public VolumeAnalysisCalculationState CalculationState + { + [CompilerGenerated] + get + { + return ??; + } + } + + public int ProgressPercent + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal VolumeAnalysisTaskEventArgs(IVolumeAnalysisCalculationProgress P_0) + { + ?? = P_0.State; + ?? = P_0.ProgressPercent; + } + } + [Published] + public class VolumeAnalysisData + { + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private VolumeAnalysisItem ??; + + [CompilerGenerated] + private Dictionary ??; + + [CompilerGenerated] + private EventHandler ??; + + public DateTime TimeLeft + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Summary calculated Volume info + /// + public VolumeAnalysisItem Total + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Volume info for each price + /// + public Dictionary PriceLevels + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Fire in case of price level was added or existing was updated + /// + public event EventHandler ItemUpdated + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + public VolumeAnalysisData() + { + Total = new VolumeAnalysisItem(); + PriceLevels = new Dictionary(); + } + + internal VolumeAnalysisData(VolumeAnalysisData P_0) + { + TimeLeft = P_0.TimeLeft; + Total = new VolumeAnalysisItem(P_0.Total); + PriceLevels = new Dictionary(); + foreach (KeyValuePair priceLevel in P_0.PriceLevels) + { + PriceLevels.Add(priceLevel.Key, new VolumeAnalysisItem(priceLevel.Value)); + } + } + + internal void ?(VolumeAnalysisCalculationRequest P_0, HistoricalData P_1) + { + foreach (object item in P_1) + { + ?(P_0, item); + } + } + + internal void ?(VolumeAnalysisCalculationRequest P_0, MessageQuote P_1) + { + ?(P_0, (object)P_1); + } + + internal void ?(VolumeAnalysisCalculationRequest P_0, IVolumeTickData P_1) + { + ?(P_0, (object)P_1); + } + + internal void ?(VolumeAnalysisCalculationRequest P_0, object P_1) + { + if (!(P_1 is IVolumeTickData { Price: var price, Volume: var volume } volumeTickData)) + { + return; + } + AggressorFlag aggressorFlag = ((P_0.DeltaCalculationType == DeltaCalculationType.TickDirection) ? Symbol.ConvertTickDirection(volumeTickData.TickDirection) : volumeTickData.AggressorFlag); + bool flag = volumeTickData.VolumeTickDataType == VolumeTickDataType.Ticks; + long time = volumeTickData.Time; + if (P_0.SessionsContainer == null || P_0.SessionsContainer.ContainsDate(time)) + { + double num = P_0.Symbol.GetTickSize(price); + if (!P_0.CustomTickSize.IsNanOrDefault()) + { + num = P_0.CustomTickSize; + } + if (P_0.CustomStep > 1) + { + num *= (double)P_0.CustomStep; + } + if (!double.IsNaN(P_0.Symbol.MinVolumeAnalysisTickSize) && num < P_0.Symbol.MinVolumeAnalysisTickSize) + { + num = P_0.Symbol.MinVolumeAnalysisTickSize; + } + double num2 = CoreMath.RoundToIncrement(price, num); + ?(num2, volume, aggressorFlag, flag, P_0.FilteredVolume); + } + } + + private void ?(double P_0, double P_1, AggressorFlag P_2, bool P_3, double P_4) + { + Total.?(P_1, P_2, P_3, P_4); + if (!PriceLevels.TryGetValue(P_0, out var value)) + { + PriceLevels.Add(P_0, value = new VolumeAnalysisItem()); + } + value.?(P_1, P_2, P_3, P_4); + ?(P_0, value); + } + + public void Calculate(double price, double size, AggressorFlag aggressorFlag) + { + ?(price, size, aggressorFlag, false, 0.0); + } + + public VolumeAnalysisData CreateAggregatedSnapshot(double aggregationStep) + { + VolumeAnalysisData volumeAnalysisData = new VolumeAnalysisData(); + try + { + volumeAnalysisData.Total = Total; + foreach (KeyValuePair priceLevel in PriceLevels) + { + double key = CoreMath.RoundToIncrement(priceLevel.Key, aggregationStep); + if (!volumeAnalysisData.PriceLevels.TryGetValue(key, out var value)) + { + volumeAnalysisData.PriceLevels.Add(key, value = new VolumeAnalysisItem()); + } + value.Combine(priceLevel.Value); + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + return volumeAnalysisData; + } + + private void ?(double P_0, VolumeAnalysisItem P_1) + { + ???.Invoke(this, new VolumeAnalysisDataEventArgs(P_0, P_1)); + } + + public void Combine(VolumeAnalysisData data) + { + Total.Combine(data.Total); + foreach (KeyValuePair priceLevel in data.PriceLevels) + { + if (!PriceLevels.TryGetValue(priceLevel.Key, out var value)) + { + value = (PriceLevels[priceLevel.Key] = new VolumeAnalysisItem()); + } + value.Combine(priceLevel.Value); + } + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(15, 2); + defaultInterpolatedStringHandler.AppendFormatted(TimeLeft); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(PriceLevels.Count); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + [Published] + public class VolumeAnalysisDataEventArgs : EventArgs + { + [CompilerGenerated] + private readonly double ??; + + [CompilerGenerated] + private readonly VolumeAnalysisItem ??; + + public double Price + { + [CompilerGenerated] + get + { + return ??; + } + } + + public VolumeAnalysisItem Item + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal VolumeAnalysisDataEventArgs(double P_0, VolumeAnalysisItem P_1) + { + ?? = P_0; + ?? = P_1; + } + } + [Published] + public enum VolumeAnalysisCalculationState + { + None = 0, + Processing = 4, + Finished = 0x10 + } + [Published] + [Obfuscation(ApplyToMembers = true, Exclude = true)] + public enum VolumeAnalysisField + { + Trades, + BuyTrades, + SellTrades, + Volume, + BuyVolume, + SellVolume, + BuySellVolume, + FilteredVolume, + FilteredBuyVolume, + FilteredSellVolume, + MaxOneTradeVolume, + BuyVolumePercent, + SellVolumePercent, + Delta, + DeltaPercent, + CumulativeDelta, + FilteredTotalVolumePercent, + FilteredBuyVolumePercent, + FilteredSellVolumePercent, + MaxOneTradeVolumePercent, + AverageSize, + AverageBuySize, + AverageSellSize, + OpenInterest, + MinDelta, + MaxDelta, + DeltaFinish + } + public enum CumulativeDeltaReset + { + [Description("Full chart range")] + Never, + [Description("Daily")] + Daily, + [Description("Weekly")] + Weekly, + [Description("By chart session")] + ByChartSession + } + /// + /// Represent item with Volume Analysis calculation results + /// + [Published] + public class VolumeAnalysisItem : IVolumeAnalysisItem + { + private const double ?? = double.MaxValue; + + private const double ?? = double.MinValue; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + internal double ??; + + public int Trades + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int BuyTrades + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int SellTrades + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double Volume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double BuyVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double SellVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double FilteredTotalVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public double FilteredBuyVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public double FilteredSellVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public double MaxOneTradeVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double MinDelta + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double MaxDelta + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double BuyVolumePercent + { + get + { + if (!(Volume > 0.0)) + { + return 0.0; + } + return BuyVolume / Volume * 100.0; + } + } + + public double SellVolumePercent + { + get + { + if (!(Volume > 0.0)) + { + return 0.0; + } + return SellVolume / Volume * 100.0; + } + } + + public double Delta => BuyVolume - SellVolume; + + public double DeltaPercent + { + get + { + if (Volume == 0.0) + { + return 0.0; + } + return Delta / Volume * 100.0; + } + } + + public double CumulativeDelta => ?? + Delta; + + public double FilteredTotalVolumePercent + { + get + { + if (!(Volume > 0.0)) + { + return 0.0; + } + return FilteredTotalVolume / Volume * 100.0; + } + } + + public double FilteredBuyVolumePercent + { + get + { + if (!(Volume > 0.0)) + { + return 0.0; + } + return FilteredBuyVolume / Volume * 100.0; + } + } + + public double FilteredSellVolumePercent + { + get + { + if (!(Volume > 0.0)) + { + return 0.0; + } + return FilteredSellVolume / Volume * 100.0; + } + } + + public double MaxOneTradeVolumePercent + { + get + { + if (!(Volume > 0.0)) + { + return 0.0; + } + return MaxOneTradeVolume / Volume * 100.0; + } + } + + public double AverageSize + { + get + { + if (Trades <= 0) + { + return 0.0; + } + return Volume / (double)Trades; + } + } + + public double AverageBuySize + { + get + { + if (BuyTrades <= 0) + { + return 0.0; + } + return BuyVolume / (double)BuyTrades; + } + } + + public double AverageSellSize + { + get + { + if (SellTrades <= 0) + { + return 0.0; + } + return SellVolume / (double)SellTrades; + } + } + + public double DeltaFinish => Delta - ((Math.Abs(MinDelta) > Math.Abs(MaxDelta)) ? MinDelta : MaxDelta); + + public VolumeAnalysisItem() + { + MinDelta = double.MaxValue; + MaxDelta = double.MinValue; + } + + internal VolumeAnalysisItem(VolumeAnalysisItem P_0) + { + Trades = P_0.Trades; + BuyTrades = P_0.BuyTrades; + SellTrades = P_0.SellTrades; + Volume = P_0.Volume; + BuyVolume = P_0.BuyVolume; + SellVolume = P_0.SellVolume; + FilteredTotalVolume = P_0.FilteredTotalVolume; + FilteredBuyVolume = P_0.FilteredBuyVolume; + FilteredSellVolume = P_0.FilteredSellVolume; + MaxOneTradeVolume = P_0.MaxOneTradeVolume; + MinDelta = P_0.MinDelta; + MaxDelta = P_0.MaxDelta; + ?? = P_0.??; + } + + public double GetValue(VolumeAnalysisField field) + { + return field switch + { + VolumeAnalysisField.Trades => Trades, + VolumeAnalysisField.BuyTrades => BuyTrades, + VolumeAnalysisField.SellTrades => SellTrades, + VolumeAnalysisField.Volume => Volume, + VolumeAnalysisField.BuySellVolume => Volume, + VolumeAnalysisField.BuyVolume => BuyVolume, + VolumeAnalysisField.BuyVolumePercent => BuyVolumePercent, + VolumeAnalysisField.SellVolume => SellVolume, + VolumeAnalysisField.SellVolumePercent => SellVolumePercent, + VolumeAnalysisField.Delta => Delta, + VolumeAnalysisField.DeltaPercent => DeltaPercent, + VolumeAnalysisField.CumulativeDelta => CumulativeDelta, + VolumeAnalysisField.AverageSize => AverageSize, + VolumeAnalysisField.AverageBuySize => AverageBuySize, + VolumeAnalysisField.AverageSellSize => AverageSellSize, + VolumeAnalysisField.MaxOneTradeVolume => MaxOneTradeVolume, + VolumeAnalysisField.MaxOneTradeVolumePercent => MaxOneTradeVolumePercent, + VolumeAnalysisField.FilteredVolume => FilteredTotalVolume, + VolumeAnalysisField.FilteredTotalVolumePercent => FilteredTotalVolumePercent, + VolumeAnalysisField.FilteredBuyVolume => FilteredBuyVolume, + VolumeAnalysisField.FilteredBuyVolumePercent => FilteredBuyVolumePercent, + VolumeAnalysisField.FilteredSellVolume => FilteredSellVolume, + VolumeAnalysisField.FilteredSellVolumePercent => FilteredSellVolumePercent, + VolumeAnalysisField.MinDelta => (MinDelta != double.MaxValue) ? MinDelta : 0.0, + VolumeAnalysisField.MaxDelta => (MaxDelta != double.MinValue) ? MaxDelta : 0.0, + VolumeAnalysisField.DeltaFinish => DeltaFinish, + _ => 0.0, + }; + } + + public void Combine(VolumeAnalysisItem item) + { + Trades += item.Trades; + BuyTrades += item.BuyTrades; + SellTrades += item.SellTrades; + Volume += item.Volume; + BuyVolume += item.BuyVolume; + SellVolume += item.SellVolume; + FilteredTotalVolume += item.FilteredTotalVolume; + FilteredBuyVolume += item.FilteredBuyVolume; + FilteredSellVolume += item.FilteredSellVolume; + MaxOneTradeVolume = Math.Max(item.MaxOneTradeVolume, MaxOneTradeVolume); + MinDelta = ((MinDelta == double.MaxValue) ? Math.Min(MinDelta, item.MinDelta) : double.NaN); + MaxDelta = ((MaxDelta == double.MinValue) ? Math.Max(MaxDelta, item.MaxDelta) : double.NaN); + } + + internal void ?(double P_0, AggressorFlag P_1 = AggressorFlag.None, bool P_2 = false, double P_3 = 0.0) + { + Volume += P_0; + BuyVolume += ((P_1 == AggressorFlag.Buy) ? P_0 : 0.0); + SellVolume += ((P_1 == AggressorFlag.Sell) ? P_0 : 0.0); + double delta = Delta; + MinDelta = Math.Min(MinDelta, delta); + MaxDelta = Math.Max(MaxDelta, delta); + if (P_2) + { + return; + } + Trades++; + if (P_0 > MaxOneTradeVolume) + { + MaxOneTradeVolume = P_0; + } + if (P_0 >= P_3) + { + FilteredTotalVolume += P_0; + } + switch (P_1) + { + case AggressorFlag.Buy: + BuyTrades++; + if (P_0 >= P_3) + { + FilteredBuyVolume += P_0; + } + break; + case AggressorFlag.Sell: + SellTrades++; + if (P_0 >= P_3) + { + FilteredSellVolume += P_0; + } + break; + } + } + } + /// + /// Volume Analysis calculations + /// + [Published] + public class VolumeAnalysisManager + { + private const int ?? = 10; + + private const int ?? = 7; + + private int ??; + + private readonly ActionBufferedProcessorWithPriority ??; + + internal VolumeAnalysisManager() + { + ?? = new ActionBufferedProcessorWithPriority(3); + } + + internal void ?() + { + ??.Start(); + } + + internal void ?() + { + ???.Stop(); + } + + /// + /// Calculate volume profile for requested time range + /// + public IVolumeAnalysisCalculationTask CalculateProfile(VolumeAnalysisCalculationRequest request) + { + VolumeAnalysisCalculationRequest volumeAnalysisCalculationRequest = new VolumeAnalysisCalculationRequest(request); + if (Core.Instance.SymbolsMapping.TryGetVolumeAnalysisSymbol(request.Symbol, out var volumeAnalysisSymbol)) + { + volumeAnalysisCalculationRequest.Symbol = volumeAnalysisSymbol; + } + bool num = ?(volumeAnalysisCalculationRequest); + ? ? = new ?(volumeAnalysisCalculationRequest); + if (!num) + { + ?.State = VolumeAnalysisCalculationState.Finished; + return ?; + } + ??.Push(?.?, 1, volumeAnalysisCalculationRequest.Marker); + return ?; + } + + /// + /// Calculate volume profile for each bar in History Data + /// + public IVolumeAnalysisCalculationProgress CalculateProfile(HistoricalData historicalData, VolumeAnalysisCalculationParameters calculationParameters) + { + VolumeAnalysisCalculationRequest volumeAnalysisCalculationRequest = new VolumeAnalysisCalculationRequest(calculationParameters) + { + Symbol = historicalData.Symbol, + From = ((historicalData.Count == 0) ? Core.Instance.TimeUtils.DateTimeUtcNow : historicalData[0, SeekOriginHistory.Begin].TimeLeft), + To = ((historicalData.ToTime == DateTime.MinValue) ? Core.Instance.TimeUtils.DateTimeUtcNow : historicalData.ToTime) + }; + if (Core.Instance.SymbolsMapping.TryGetVolumeAnalysisSymbol(volumeAnalysisCalculationRequest.Symbol, out var volumeAnalysisSymbol)) + { + volumeAnalysisCalculationRequest.Symbol = volumeAnalysisSymbol; + } + bool num = ?(volumeAnalysisCalculationRequest); + ? ? = ((historicalData.Aggregation.BarCreationBehavior == BarCreationBehavior.Deferred) ? new ?(historicalData, volumeAnalysisCalculationRequest) : new ?(historicalData, volumeAnalysisCalculationRequest)); + if (!num) + { + ?.State = VolumeAnalysisCalculationState.Finished; + return ?; + } + historicalData.VolumeAnalysisCalculationProgress = ?; + ??.Push(?.?, 1, volumeAnalysisCalculationRequest.Marker); + return ?; + } + + /// + /// Calculate volume profile for requested time range + /// + public IVolumeAnalysisCalculationTask CalculateProfile(Symbol symbol, DateTime from, DateTime to) + { + return CalculateProfile(new VolumeAnalysisCalculationRequest + { + Symbol = symbol, + From = from, + To = to + }); + } + + /// + /// Calculate volume profile for each bar in History Data + /// + public IVolumeAnalysisCalculationProgress CalculateProfile(HistoricalData historicalData) + { + return CalculateProfile(historicalData, new VolumeAnalysisCalculationParameters()); + } + + private bool ?(VolumeAnalysisCalculationRequest P_0) + { + if (P_0 == null) + { + return false; + } + if ((Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())) == null && Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), P_0.Symbol).Status != TradingOperationStatus.Allowed && Core.Instance.RulesManager.IsAllowed(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0.Symbol).Status != TradingOperationStatus.Allowed && (P_0.Symbol == null || P_0.Symbol.State != BusinessObjectState.Fake)) + { + ??++; + if (?? > 10) + { + Core.Instance.Licences.OnLicenceCheckError(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null); + return false; + } + DateTime dateTime = Core.Instance.TimeUtils.DateTimeUtcNow.AddDays(-7.0); + if (P_0.From < dateTime) + { + P_0.From = dateTime; + Core.Instance.Licences.OnLicenceCheckError(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null); + } + } + return true; + } + } +} +namespace TradingPlatform.BusinessLayer.TimeSync +{ + public enum _Mode + { + SymmetricActive, + SymmetricPassive, + Client, + Server, + Broadcast, + Unknown + } + public enum _Stratum + { + Unspecified, + PrimaryReference, + SecondaryReference, + Reserved + } + /// + /// from: + /// http://www.codeguru.com/csharp/csharp/cs_date_time/timeroutines/article.php/c4207/C-SNTP-Client.htm + /// +++ ???????? ???????, ?????????? ToString(), ????? ?????? ?????. + /// +++ ReceiveTimeout?SendTimeout + /// + /// NTPClient is a C# class designed to connect to time servers on the Internet. + /// The implementation of the protocol is based on the RFC 2030. + /// + /// Public class members: + /// + /// LeapIndicator - Warns of an impending leap second to be inserted/deleted in the last + /// minute of the current day. (See the _LeapIndicator enum) + /// + /// VersionNumber - Version number of the protocol (3 or 4). + /// + /// Mode - Returns mode. (See the _Mode enum) + /// + /// Stratum - Stratum of the clock. (See the _Stratum enum) + /// + /// PollInterval - Maximum interval between successive messages. + /// + /// Precision - Precision of the clock. + /// + /// RootDelay - Round trip time to the primary reference source. + /// + /// RootDispersion - Nominal error relative to the primary reference source. + /// + /// ReferenceTimestamp - The time at which the clock was last set or corrected. + /// + /// OriginateTimestamp - The time at which the request departed the client for the server. + /// + /// ReceiveTimestamp - The time at which the request arrived at the server. + /// + /// Transmit Timestamp - The time at which the reply departed the server for client. + /// + /// RoundTripDelay - The time between the departure of request and arrival of reply. + /// + /// LocalClockOffset - The offset of the local clock relative to the primary reference + /// source. + /// + /// Initialize - Sets up data structure and prepares for connection. + /// + /// Connect - Connects to the time server and populates the data structure. + /// + /// IsResponseValid - Returns true if received data is valid and if comes from + /// a NTP-compliant time server. + /// + /// ToString - Returns a string representation of the object. + /// + /// ----------------------------------------------------------------------------- + /// Structure of the standard NTP header (as described in RFC 2030) + /// 1 2 3 + /// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + /// |LI | VN |Mode | Stratum | Poll | Precision | + /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + /// | Root Delay | + /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + /// | Root Dispersion | + /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + /// | Reference Identifier | + /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + /// | | + /// | Reference Timestamp (64) | + /// | | + /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + /// | | + /// | Originate Timestamp (64) | + /// | | + /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + /// | | + /// | Receive Timestamp (64) | + /// | | + /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + /// | | + /// | Transmit Timestamp (64) | + /// | | + /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + /// | Key Identifier (optional) (32) | + /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + /// | | + /// | | + /// | Message Digest (optional) (128) | + /// | | + /// | | + /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + /// + /// ----------------------------------------------------------------------------- + /// + /// NTP Timestamp Format (as described in RFC 2030) + /// 1 2 3 + /// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + /// | Seconds | + /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + /// | Seconds Fraction (0-padded) | + /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + /// + /// + public class NTPClient : IDisposable + { + private const byte ?? = 48; + + private const byte ?? = 16; + + private const byte ?? = 24; + + private const byte ?? = 32; + + private const byte ?? = 40; + + private byte[] ??; + + public DateTime ReceptionTimestamp; + + private UdpClient ??; + + private readonly string ??; + + public byte VersionNumber => (byte)((??[0] & 0x38) >> 3); + + public _Mode Mode => (byte)(??[0] & 7) switch + { + 1 => _Mode.SymmetricActive, + 2 => _Mode.SymmetricPassive, + 3 => _Mode.Client, + 4 => _Mode.Server, + 5 => _Mode.Broadcast, + _ => _Mode.Unknown, + }; + + public _Stratum Stratum + { + get + { + byte b = ??[1]; + if (b == 0) + { + return _Stratum.Unspecified; + } + if (b == 1) + { + return _Stratum.PrimaryReference; + } + if (b <= 15) + { + return _Stratum.SecondaryReference; + } + return _Stratum.Reserved; + } + } + + public double Precision => 1000.0 * Math.Pow(2.0, (int)??[3]); + + public DateTime ReferenceTimestamp + { + get + { + DateTime dateTime = ?(?(16)); + TimeSpan utcOffset = TimeZoneInfo.Local.GetUtcOffset(DateTime.Now); + return dateTime + utcOffset; + } + } + + public DateTime OriginateTimestamp => ?(?(24)); + + public DateTime ReceiveTimestamp + { + get + { + DateTime dateTime = ?(?(32)); + TimeSpan utcOffset = TimeZoneInfo.Local.GetUtcOffset(DateTime.Now); + return dateTime + utcOffset; + } + } + + public DateTime TransmitTimestamp + { + get + { + DateTime dateTime = ?(?(40)); + TimeSpan utcOffset = TimeZoneInfo.Local.GetUtcOffset(DateTime.Now); + return dateTime + utcOffset; + } + set + { + ?(40, value); + } + } + + public int RoundTripDelay => (int)(ReceiveTimestamp - OriginateTimestamp + (ReceptionTimestamp - TransmitTimestamp)).TotalMilliseconds; + + public int LocalClockOffset => (int)((ReceiveTimestamp - OriginateTimestamp - (ReceptionTimestamp - TransmitTimestamp)).TotalMilliseconds / 2.0); + + private DateTime ?(ulong P_0) + { + TimeSpan timeSpan = TimeSpan.FromMilliseconds(P_0); + return new DateTime(1900, 1, 1) + timeSpan; + } + + private ulong ?(byte P_0) + { + ulong num = 0uL; + ulong num2 = 0uL; + for (int i = 0; i <= 3; i++) + { + num = 256 * num + ??[P_0 + i]; + } + for (int j = 4; j <= 7; j++) + { + num2 = 256 * num2 + ??[P_0 + j]; + } + return num * 1000 + num2 * 1000 / 4294967296L; + } + + private void ?(byte P_0, DateTime P_1) + { + DateTime dateTime = new DateTime(1900, 1, 1, 0, 0, 0); + ulong num = (ulong)(P_1 - dateTime).TotalMilliseconds; + ulong num2 = num / 1000; + ulong num3 = num % 1000 * 4294967296L / 1000; + ulong num4 = num2; + for (int num5 = 3; num5 >= 0; num5--) + { + ??[P_0 + num5] = (byte)(num4 % 256); + num4 /= 256; + } + num4 = num3; + for (int num6 = 7; num6 >= 4; num6--) + { + ??[P_0 + num6] = (byte)(num4 % 256); + num4 /= 256; + } + } + + private void ?() + { + ??[0] = 27; + for (int i = 1; i < 48; i++) + { + ??[i] = 0; + } + TransmitTimestamp = DateTime.Now; + } + + public NTPClient(string host) + { + ?? = new byte[48]; + ?? = host; + } + + /// + /// Connect to the time server + /// + public void Connect() + { + try + { + try + { + if (?? != null) + { + ??.Close(); + } + } + catch + { + } + IPEndPoint remoteEP = new IPEndPoint(Dns.GetHostAddresses(??)[0], 123); + ?? = new UdpClient(); + ??.Connect(remoteEP); + ?(); + Socket client = ??.Client; + int receiveTimeout = (??.Client.SendTimeout = (int)TimeSpan.FromSeconds(5.0).TotalMilliseconds); + client.ReceiveTimeout = receiveTimeout; + ??.Send(??, ??.Length); + ?? = ??.Receive(ref remoteEP); + if (!IsResponseValid()) + { + throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ??); + } + ReceptionTimestamp = DateTime.Now; + } + catch (SocketException ex) + { + throw new Exception(ex.Message); + } + } + + public bool IsResponseValid() + { + if (??.Length < 48 || Mode != _Mode.Server) + { + return false; + } + return true; + } + + public override string ToString() + { + string text = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); + text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + switch (Mode) + { + case _Mode.Unknown: + text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + break; + case _Mode.SymmetricActive: + text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + break; + case _Mode.SymmetricPassive: + text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + break; + case _Mode.Client: + text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + break; + case _Mode.Server: + text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + break; + case _Mode.Broadcast: + text += 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + break; + } + text = text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + TransmitTimestamp; + text = text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + LocalClockOffset + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + return text + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + + public void Dispose() + { + try + { + if (?? != null) + { + ??.Close(); + } + ?? = null; + } + catch + { + } + } + } +} +namespace ? +{ + internal sealed class ? : IDisposable + { + private const int ?? = 1800000; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private ? ??; + + [CompilerGenerated] + private string ??; + + private ReadOnlyCollection ??; + + private Timer ??; + + public int ServerTimeOffset + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = num; + } + } + + public ? State + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = ?2; + } + } + + public string LastSyncErrorMessage + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public ?() + { + State = ?.??; + } + + public void ?() + { + ServerTimeOffset = 0; + ?? = new string[4] + { + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }.AsReadOnly(); + ?? = new Timer(?, null, TimeSpan.FromMilliseconds(-1.0), new TimeSpan(1, 0, 0)); + ?(); + } + + public void Dispose() + { + if (?? != null) + { + ??.Dispose(); + ?? = null; + } + } + + public void ?() + { + bool flag = false; + string text = string.Empty; + try + { + State = ?.??; + foreach (string item in ??) + { + try + { + using NTPClient nTPClient = new NTPClient(item); + nTPClient.Connect(); + if (nTPClient.IsResponseValid()) + { + if (nTPClient.LocalClockOffset <= 1800000) + { + flag = true; + ServerTimeOffset = nTPClient.LocalClockOffset; + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(45, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(ServerTimeOffset); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + break; + } + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + item); + } + } + catch (Exception ex) + { + text = ex.Message; + Core.Instance.Loggers.Log(text, LoggingLevel.Verbose); + } + } + } + finally + { + if (flag) + { + State = ?.??; + LastSyncErrorMessage = string.Empty; + } + else + { + State = ?.??; + LastSyncErrorMessage = text; + } + } + } + + private void ?(object P_0) + { + ?(); + } + } + internal enum ? + { + ??, + ??, + ??, + ?? + } +} +namespace TradingPlatform.BusinessLayer.Options +{ + public sealed class BlackScholesPriceModel : PriceModel + { + public const double START_IV = 1E-05; + + public override PriceModels Type => PriceModels.BlackScholes; + + protected override double NormDist(double x) + { + double num = 0.049867347; + double num2 = 0.0211410061; + double num3 = 0.0032776263; + double num4 = 3.80036E-05; + double num5 = 4.88906E-05; + double num6 = 5.383E-06; + double num7 = Math.Abs(x); + double num8 = 1.0 + num7 * (num + num7 * (num2 + num7 * (num3 + num7 * (num4 + num7 * (num5 + num7 * num6))))); + num8 *= num8; + num8 *= num8; + num8 *= num8; + num8 *= num8; + num8 = 1.0 / (2.0 * num8); + if (x >= 0.0) + { + num8 = 1.0 - num8; + } + return num8; + } + + public override double Delta(Symbol option, double IV, double Int_Rate, double shift) + { + if (option == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (option.Underlier == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return Delta(option.ExpirationDate, option.StrikePrice, option.OptionType, option.Underlier.Last, IV, Int_Rate, shift); + } + + public override double Delta(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift) + { + double num = ((double)OptionMath.CalculateDaysToExpire(ExpirationDate) - shift) / 365.0; + if (num <= 0.0) + { + num = (double)OptionMath.CalculateDaysToExpire(ExpirationDate) / 365.0; + } + double x = (Math.Log(price / StrikePrice) + (Int_Rate + IV * IV / 2.0) * num) / (IV * Math.Sqrt(num)); + Math.Sqrt(num); + if (OptionType == OptionType.Call) + { + return NormDist(x); + } + return NormDist(x) - 1.0; + } + + public override double Gamma(Symbol option, double IV, double int_Rate, double shift) + { + if (option == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (option.Underlier == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return Gamma(option.ExpirationDate, option.StrikePrice, option.OptionType, option.Underlier.Last, IV, int_Rate, shift); + } + + public override double Gamma(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift) + { + double num = ((double)OptionMath.CalculateDaysToExpire(ExpirationDate) - shift) / 365.0; + if (num <= 0.0) + { + num = (double)OptionMath.CalculateDaysToExpire(ExpirationDate) / 365.0; + } + double num2 = (Math.Log(price / StrikePrice) + (Int_Rate + IV * IV / 2.0) * num) / (IV * Math.Sqrt(num)); + Math.Sqrt(num); + return Math.Exp(-1.0 * num2 * num2 / 2.0) / Math.Sqrt(Math.PI * 2.0) / (price * IV * Math.Sqrt(num)); + } + + public override double TheorPrice(Symbol option, double IV, double Int_Rate, double shift) + { + if (option == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (option.Underlier == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return TheorPrice(option.ExpirationDate, option.StrikePrice, option.OptionType, option.Underlier.Last, IV, Int_Rate, shift); + } + + public override double TheorPrice(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift) + { + double num = ((double)OptionMath.CalculateDaysToExpire(ExpirationDate) - shift) / 365.0; + if (num <= 0.0) + { + num = (double)OptionMath.CalculateDaysToExpire(ExpirationDate) / 365.0; + } + double num2 = (Math.Log(price / StrikePrice) + (Int_Rate + IV * IV / 2.0) * num) / (IV * Math.Sqrt(num)); + double num3 = num2 - IV * Math.Sqrt(num); + if (OptionType == OptionType.Call) + { + return price * NormDist(num2) - StrikePrice * Math.Exp(-1.0 * (Int_Rate * num)) * NormDist(num3); + } + return StrikePrice * Math.Exp(-1.0 * (Int_Rate * num)) * NormDist(0.0 - num3) - price * NormDist(0.0 - num2); + } + + public override double IV(Symbol option, OptionPriceType priceType, double Int_Rate, double shift) + { + if (option == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (option.Underlier == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return IV(option.ExpirationDate, option.StrikePrice, option.OptionType, OptionMath.GetOptionLastPrice(option, priceType), option.Underlier.Last, priceType, Int_Rate, shift); + } + + public override double IV(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double optionPrice, double underlierPrice, OptionPriceType priceType, double Int_Rate, double shift) + { + if (double.IsNaN(optionPrice)) + { + return double.NaN; + } + double num = ((double)OptionMath.CalculateDaysToExpire(ExpirationDate) - shift) / 365.0; + if (num <= 0.0) + { + num = (double)OptionMath.CalculateDaysToExpire(ExpirationDate) / 365.0; + } + double num2 = 0.0; + double num3 = 0.0; + double num4 = 1E-05; + if (optionPrice == 0.0 || underlierPrice == 0.0 || StrikePrice == 0.0 || num <= 0.0) + { + return 0.0; + } + if (underlierPrice <= optionPrice) + { + return 0.0; + } + double num5 = 0.1; + if (OptionType == OptionType.Call) + { + while (num2 <= optionPrice) + { + while (true) + { + double num6 = (Math.Log(underlierPrice / StrikePrice) + (Int_Rate + num4 * num4 / 2.0) * num) / (num4 * Math.Sqrt(num)); + double x = num6 - num4 * Math.Sqrt(num); + num2 = underlierPrice * NormDist(num6) - StrikePrice * Math.Exp(-1.0 * (Int_Rate * num)) * NormDist(x); + if (!(num2 > optionPrice) || !(num5 > 1E-05) || !(num4 > 0.0001)) + { + break; + } + num4 -= num5; + num5 *= 0.1; + num4 += num5; + } + if (num2 > optionPrice) + { + return num4; + } + num4 += num5; + if (num4 > 10000.0) + { + return double.NaN; + } + } + return num4; + } + while (num3 <= optionPrice) + { + while (true) + { + double num6 = (Math.Log(underlierPrice / StrikePrice) + (Int_Rate + num4 * num4 / 2.0) * num) / (num4 * Math.Sqrt(num)); + double x = num6 - num4 * Math.Sqrt(num); + num3 = StrikePrice * Math.Exp(-1.0 * (Int_Rate * num)) * NormDist(0.0 - x) - underlierPrice * NormDist(0.0 - num6); + if (!(num3 > optionPrice) || !(num5 > 1E-05) || !(num4 > 0.0001)) + { + break; + } + num4 -= num5; + num5 *= 0.1; + num4 += num5; + } + if (num3 > optionPrice) + { + return num4; + } + num4 += num5; + if (num4 > 10000.0) + { + return double.NaN; + } + } + return num4; + } + + public override double Theta(Symbol option, double IV, double int_Rate, double shift) + { + if (option == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (option.Underlier == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return Theta(option.ExpirationDate, option.StrikePrice, option.OptionType, option.Underlier.Last, IV, int_Rate, shift); + } + + public override double Theta(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double int_Rate, double shift) + { + double num = ((double)OptionMath.CalculateDaysToExpire(ExpirationDate) - shift) / 365.0; + if (num <= 0.0) + { + num = (double)OptionMath.CalculateDaysToExpire(ExpirationDate) / 365.0; + } + double num2 = (Math.Log(price / StrikePrice) + (int_Rate + IV * IV / 2.0) * num) / (IV * Math.Sqrt(num)); + double num3 = num2 - IV * Math.Sqrt(num); + if (OptionType == OptionType.Call) + { + return (-1.0 * (price * (Math.Exp(-1.0 * num2 * num2 / 2.0) / Math.Sqrt(Math.PI * 2.0)) * IV) / (2.0 * Math.Sqrt(num)) - int_Rate * StrikePrice * Math.Exp(-1.0 * (int_Rate * num)) * NormDist(num3)) / 365.0; + } + return (-1.0 * (price * (Math.Exp(-1.0 * num2 * num2 / 2.0) / Math.Sqrt(Math.PI * 2.0)) * IV) / (2.0 * Math.Sqrt(num)) + int_Rate * StrikePrice * Math.Exp(-1.0 * (int_Rate * num)) * NormDist(0.0 - num3)) / 365.0; + } + + public override double Vega(Symbol option, double IV, double int_Rate, double shift) + { + if (option == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (option.Underlier == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return Vega(option.ExpirationDate, option.StrikePrice, option.OptionType, option.Underlier.Last, IV, int_Rate, shift); + } + + public override double Vega(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double int_Rate, double shift) + { + double num = ((double)OptionMath.CalculateDaysToExpire(ExpirationDate) - shift) / 365.0; + if (num <= 0.0) + { + num = (double)OptionMath.CalculateDaysToExpire(ExpirationDate) / 365.0; + } + double num2 = (Math.Log(price / StrikePrice) + (int_Rate + IV * IV / 2.0) * num) / (IV * Math.Sqrt(num)); + Math.Sqrt(num); + return price * Math.Sqrt(num) * (Math.Exp(-1.0 * num2 * num2 / 2.0) / Math.Sqrt(Math.PI * 2.0)) / 100.0; + } + + public override double Rho(Symbol option, double IV, double int_Rate, double shift) + { + if (option == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (option.Underlier == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return Rho(option.ExpirationDate, option.StrikePrice, option.OptionType, option.Underlier.Last, IV, int_Rate, shift); + } + + public override double Rho(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double int_Rate, double shift) + { + double num = StrikePrice; + double num2 = ((double)OptionMath.CalculateDaysToExpire(ExpirationDate) - shift) / 365.0; + if (num2 <= 0.0) + { + num2 = (double)OptionMath.CalculateDaysToExpire(ExpirationDate) / 365.0; + } + double num3 = (Math.Log(price / num) + (int_Rate + IV * IV / 2.0) * num2) / (IV * Math.Sqrt(num2)) - IV * Math.Sqrt(num2); + if (OptionType != OptionType.Call) + { + num *= -1.0; + num3 *= -1.0; + } + return num * num2 * Math.Exp(-1.0 * int_Rate * num2) * NormDist(num3) / 100.0; + } + } + public class NativePriceModel : PriceModel + { + public override PriceModels Type => PriceModels.Native; + + public override bool IsCalculationAllowed(Symbol symbol, OptionPriceType priceType) + { + return true; + } + + public override double IV(Symbol option, OptionPriceType priceType, double Int_Rate, double shift) + { + return option.IV; + } + + public override double Delta(Symbol option, double IV, double Int_Rate, double shift) + { + return option.Delta; + } + + public override double Gamma(Symbol option, double IV, double int_Rate, double shift) + { + return option.Gamma; + } + + public override double Vega(Symbol option, double IV, double int_Rate, double shift) + { + return option.Vega; + } + + public override double Theta(Symbol option, double IV, double int_Rate, double shift) + { + return option.Theta; + } + + public override double Rho(Symbol option, double IV, double int_Rate, double shift) + { + return option.Rho; + } + + protected override double NormDist(double x) + { + return double.NaN; + } + + public override double IV(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double optionPrice, double underlierPrice, OptionPriceType priceType, double Int_Rate, double shift) + { + return double.NaN; + } + + public override double TheorPrice(Symbol option, double IV, double Int_Rate, double shift) + { + return double.NaN; + } + + public override double TheorPrice(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift) + { + return double.NaN; + } + + public override double Delta(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift) + { + return double.NaN; + } + + public override double Vega(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift) + { + return double.NaN; + } + + public override double Gamma(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift) + { + return double.NaN; + } + + public override double Theta(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift) + { + return double.NaN; + } + + public override double Rho(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift) + { + return double.NaN; + } + } + public class OptionMath + { + public static double GetOptionLastPrice(Symbol optSymbol, OptionPriceType optionPriceType) + { + double result = double.NaN; + if (optionPriceType == OptionPriceType.Ask) + { + result = optSymbol.Ask; + } + else if (optionPriceType == OptionPriceType.BidAsk && (!optSymbol.Ask.IsNanOrDefault() || optSymbol.Bid.IsNanOrDefault())) + { + result = (optSymbol.Ask + optSymbol.Bid) / 2.0; + } + else + { + switch (optionPriceType) + { + case OptionPriceType.Bid: + result = optSymbol.Bid; + break; + case OptionPriceType.Last: + result = optSymbol.Last; + break; + } + } + return result; + } + + public static int CalculateDaysToExpire(DateTime expDate) + { + return (int)(expDate - Core.Instance.TimeUtils.DateTimeUtcNow).TotalDays + 1; + } + } + public enum PriceModels + { + BlackScholes, + Binominal, + Native + } + public enum OptionPriceType + { + Ask, + Bid, + BidAsk, + Last + } + public abstract class PriceModel + { + public abstract PriceModels Type { get; } + + public static PriceModel CreateModel(PriceModels type) + { + return type switch + { + PriceModels.BlackScholes => new BlackScholesPriceModel(), + PriceModels.Native => new NativePriceModel(), + _ => null, + }; + } + + public virtual bool IsCalculationAllowed(Symbol symbol, OptionPriceType priceType) + { + if (symbol?.Underlier == null) + { + return false; + } + return priceType switch + { + OptionPriceType.Bid => !symbol.Bid.IsNanOrDefault(), + OptionPriceType.Ask => !symbol.Ask.IsNanOrDefault(), + OptionPriceType.Last => !symbol.Last.IsNanOrDefault(), + _ => true, + }; + } + + protected abstract double NormDist(double x); + + public abstract double IV(Symbol option, OptionPriceType priceType, double Int_Rate, double shift); + + public abstract double IV(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double optionPrice, double underlierPrice, OptionPriceType priceType, double Int_Rate, double shift); + + public abstract double TheorPrice(Symbol option, double IV, double Int_Rate, double shift); + + public abstract double TheorPrice(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift); + + public abstract double Delta(Symbol option, double IV, double Int_Rate, double shift); + + public abstract double Delta(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift); + + public abstract double Vega(Symbol option, double IV, double int_Rate, double shift); + + public abstract double Vega(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift); + + public abstract double Gamma(Symbol option, double IV, double int_Rate, double shift); + + public abstract double Gamma(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift); + + public abstract double Theta(Symbol option, double IV, double int_Rate, double shift); + + public abstract double Theta(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift); + + public abstract double Rho(Symbol option, double IV, double int_Rate, double shift); + + public abstract double Rho(DateTime ExpirationDate, double StrikePrice, OptionType OptionType, double price, double IV, double Int_Rate, double shift); + } +} +namespace TradingPlatform.BusinessLayer.GlobalVariables +{ + /// + /// Variable lifetime + /// + [Obfuscation(ApplyToMembers = true, Exclude = true)] + public enum VariableLifetime + { + /// + /// The variable will be removed on exit + /// + SaveSession, + /// + /// The variable will be written to file + /// + SaveFile + } + /// + /// Global variable entry + /// + [Obsolete("Should be removed at future releases")] + public sealed class GlobalVariable + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private object ??; + + /// + /// Variable name + /// + /// + /// + /// + /// using System; + /// using System.Text; + /// using PTLRuntime.NETScript; + /// + /// namespace GlobalVariablesManager + /// { + /// public class GlobalVariablesManager : NETIndicator + /// { + /// List<GlobalVariable> global_List=new List<GlobalVariable>(); + /// + /// public override void Init() + /// { + /// if(GlobalVariablesManager.Count()>0) + /// { + /// global_List=GlobalVariablesManager.GetGlobalVariablesList(); + /// foreach (var el in global_List) + /// { + /// Print(el.Name); + /// Print(el.Value); + /// } + /// } + /// } + /// } + /// } + /// + /// + /// + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Variable value + /// + /// + /// + /// + /// using System; + /// using System.Text; + /// using PTLRuntime.NETScript; + /// + /// namespace GlobalVariablesManager + /// { + /// public class GlobalVariablesManager : NETIndicator + /// { + /// List<GlobalVariable> global_List=new List<GlobalVariable>(); + /// public override void Init() + /// { + /// if(GlobalVariablesManager.Count()>0) + /// { + /// global_List=GlobalVariablesManager.GetGlobalVariablesList(); + /// foreach (var el in global_List) + /// { + /// Print(el.Name); + /// Print(el.Value); + /// } + /// } + /// } + /// } + /// } + /// + /// + /// + public object Value + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Initializes new variable + /// + /// + /// + /// + /// using System; + /// using System.Text; + /// using PTLRuntime.NETScript; + /// + /// namespace GlobalVariablesManager + /// { + /// public class GlobalVariablesManager : NETIndicator + /// { + /// List<GlobalVariable> global_List=new List<GlobalVariable>(); + /// public override void Init() + /// { + /// if(GlobalVariablesManager.Count()>0) + /// { + /// global_List=GlobalVariablesManager.GetGlobalVariablesList(); + /// foreach (var el in global_List) + /// { + /// //Simplified way to retrieve global variable value + /// el.GlobalVariable("new_global_variable_period", period) + /// + /// //However, to obtain certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. + /// } + /// } + /// } + /// } + /// } + /// + /// + /// + /// Variable name + /// Variable value + public GlobalVariable(string name, object value) + { + Name = name; + Value = value; + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 2); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + defaultInterpolatedStringHandler.AppendFormatted(Value.GetType()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + [Obsolete("Should be removed at future releases")] + public static class GlobalVariablesManager + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal GlobalVariable ?(? P_0) + { + return P_0.Variable; + } + } + + private const string ?? = "GlobalVariables.dat"; + + private const int ?? = 100000; + + private static readonly ConcurrentDictionary ??; + + private static string PathToGlobalVariablesFile => Path.Combine(Const.EXECUTING_FOLDER, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + + static GlobalVariablesManager() + { + ?? = new ConcurrentDictionary(); + ?(); + } + + /// + /// Sets variable value to a global storage + /// + /// + /// + /// + /// using System; + /// using System.Text; + /// using PTLRuntime.NETScript; + /// + /// namespace GlobalVariablesManager + /// { + /// public class GlobalVariablesManager : NETIndicator + /// { + /// GlobalVariablesManager(){ + /// base.ProjectName = "GlobalVariablesManager"; + /// base.Password=GetHashedPassword(ProjectName); + /// } + /// + /// [InputParameter("Period", 0, 1, 9999)] + /// public int period = 5; + /// + /// public override void OnQuote() + /// { + /// //Simplified way to store a global variable + /// + /// GlobalVariablesManager.SetValue("global_variable_period", period, VariableLifetime.SaveSession); + /// + /// //However, to indicate any variable belongs to certain indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. + /// + /// GlobalVariablesManager.SetValue("global_variable_period" +Symbols.Current.Name+period+Password, period, VariableLifetime.SaveSession); + /// } + /// } + /// } + /// + /// + /// + /// Variable name + /// New value + /// Variable lifetime + public static void SetValue(string name, object value, VariableLifetime lifetime = VariableLifetime.SaveSession) + { + if (!?(value)) + { + throw new NonSerializableObjectException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (!??.TryGetValue(name, out var _)) + { + GlobalVariable globalVariable = new GlobalVariable(name, value); + ??.TryAdd(name, new ?(globalVariable)); + } + ??[name].Lifetime = lifetime; + ? ? = ?(value, lifetime == VariableLifetime.SaveFile); + ??[name].Variable.Value = ?.??; + ??[name].ObjectBytes = ?.??; + } + + /// + /// Removes specified variable from global storage + /// + /// + /// + /// + /// using System; + /// using System.Text; + /// using PTLRuntime.NETScript; + /// + /// namespace GlobalVariablesManager + /// { + /// public class GlobalVariablesManager : NETIndicator + /// { + /// public override void Init() + /// { + /// //Simplified way to remove a global variable + /// + /// GlobalVariablesManager.Remove("global_variable_period"); + /// + /// //However, to remove certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. + /// } + /// } + /// } + /// + /// + /// + /// Variable name + public static bool Remove(string name) + { + ? value; + return ??.TryRemove(name, out value); + } + + /// + /// Returns variables' count in global storage + /// + /// + /// + /// + /// using System; + /// using System.Text; + /// using PTLRuntime.NETScript; + /// + /// namespace GlobalVariablesManager + /// { + /// public class GlobalVariablesManager : NETIndicator + /// { + /// public override void Init() + /// { + /// if(GlobalVariablesManager.Count()>0) + /// { + /// Print("Your session obtains "+GlobalVariablesManager.Count()+" global variables"); + /// } + /// } + /// } + /// } + /// + /// + /// + /// + public static int Count() + { + return ??.Count; + } + + /// + /// Removes all variables from global storage + /// + /// + /// + /// + /// using System; + /// using System.Text; + /// using PTLRuntime.NETScript; + /// + /// namespace GlobalVariablesManager + /// { + /// public class GlobalVariablesManager : NETIndicator + /// { + /// public override void Init() + /// { + /// GlobalVariablesManager.RemoveAll(); + /// + /// if(GlobalVariablesManager.Count()==0) + /// { + /// Print("Your session does not have any global variables"); + /// } + /// } + /// } + /// } + /// + /// + /// + public static void RemoveAll() + { + ??.Clear(); + } + + /// + /// Check if variable with specified name exists in global storage + /// + /// + /// + /// + /// using System; + /// using System.Text; + /// using PTLRuntime.NETScript; + /// + /// namespace GlobalVariablesManager + /// { + /// public class GlobalVariablesManager : NETIndicator + /// { + /// public override void Init() + /// { + /// //Simplified way to check an existance of a global variable + /// + /// if(GlobalVariablesManager.Exists("global_variable_period")) + /// Print("Your session has this global variable"); + /// else + /// GlobalVariablesManager.SetValue("global_variable_period"); + /// + /// //However, to obtain certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. + /// } + /// } + /// } + /// + /// + /// + /// Variable name + /// + public static bool Exists(string name) + { + return ??.ContainsKey(name); + } + + /// + /// Returns variable value by name + /// + /// + /// + /// + /// using System; + /// using System.Text; + /// using PTLRuntime.NETScript; + /// + /// namespace GlobalVariablesManager + /// { + /// public class GlobalVariablesManager : NETIndicator + /// { + /// public override void Init() + /// { + /// //Simplified way to retrieve global variable value + /// + /// if(GlobalVariablesManager.Exists("global_variable_period")) + /// //Always perform a type casting before assigning any variable from global storage + /// period = (int)GlobalVariablesManager.GetValue("global_variable_period"); + /// + /// //However, to obtain certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. + /// } + /// } + /// } + /// + /// + /// + /// Variable name + /// Variable value + public static object GetValue(string name) + { + if (!??.TryGetValue(name, out var value)) + { + throw new VariableNotExistsException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), name); + } + return value.Variable.Value; + } + + /// + /// Performs a variable assigning from a global storage if such name exists in a scope + /// + /// + /// + /// + /// using System; + /// using System.Text; + /// using PTLRuntime.NETScript; + /// + /// namespace GlobalVariablesManager + /// { + /// public class GlobalVariablesManager : NETIndicator + /// { + /// public override void Init() + /// { + /// int new_period; + /// + /// //Simplified way to retrieve global variable value + /// + /// if(GlobalVariablesManager.TryGetValue("global_variable_period")) + /// Print("New variable is assigned from globals: " + new_period); + /// if(new_period==period) + /// Print("Matching, no need to re-assign globals: "); + /// else + /// GlobalVariablesManager.SetValue("global_variable_period", period, VariableLifetime.SaveSession); + /// + /// //However, to obtain certain variable, which belongs to indicator/strategy and to avoid unexpected erasing of data the best practice is to provide to a key holder multiple details such as name, params, hashed password etc. Follow SetValue() example. + /// } + /// } + /// } + /// + /// + /// + /// Variable name + /// Variable value + /// True if variable exists + public static bool TryGetValue(string name, out object obj) + { + if (??.TryGetValue(name, out var value)) + { + obj = value.Variable.Value; + return true; + } + obj = null; + return false; + } + + /// + /// Saves all serializable variables to disk + /// + /// + /// + /// + /// using System; + /// using System.Text; + /// using PTLRuntime.NETScript; + /// + /// namespace GlobalVariablesManager + /// { + /// public class GlobalVariablesManager : NETIndicator + /// { + /// Connection myConnection = Connection.CurrentConnection; + /// public override void OnQuote() + /// { + /// if(myConnection.Status==Disconnected) + /// GlobalVariablesManager.Flush(); + /// } + /// } + /// } + /// + /// + /// + public static void Flush() + { + try + { + XmlDocument xmlDocument = new XmlDocument(); + XmlElement xmlElement = xmlDocument.CreateElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (KeyValuePair item in ??) + { + ? value = item.Value; + if (value.Lifetime == VariableLifetime.SaveFile) + { + XmlElement xmlElement2 = xmlDocument.CreateElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xmlElement2.SetAttribute(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value.Variable.Name); + xmlElement2.SetAttribute(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ?(value.ObjectBytes)); + xmlElement2.SetAttribute(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (value.Variable.Value == null).ToString()); + xmlElement.AppendChild(xmlElement2); + } + } + xmlDocument.AppendChild(xmlElement); + using XmlTextWriter xmlTextWriter = new XmlTextWriter(PathToGlobalVariablesFile, Encoding.UTF8); + xmlTextWriter.Formatting = Formatting.Indented; + xmlDocument.WriteContentTo(xmlTextWriter); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + /// + /// Returns all global variables as list + /// + /// + /// + /// + /// using System; + /// using System.Text; + /// using PTLRuntime.NETScript; + /// + /// namespace GlobalVariablesManager + /// { + /// public class GlobalVariablesManager : NETIndicator + /// { + /// List <GlobalVariable>global_List=new List<GlobalVariable>(); + /// public override void Init() + /// { + /// if(GlobalVariablesManager.Count()>0) + /// global_List=GlobalVariablesManager.GetGlobalVariablesList(); + /// + /// foreach (var el in global_List) + /// { + /// Print(el.Name); + /// } + /// } + /// } + /// } + /// + /// + /// + /// Collection of global variables + public static List GetGlobalVariablesList() + { + return ??.Values.Select((? P_0) => P_0.Variable).ToList(); + } + + private static void ?() + { + try + { + if (!File.Exists(PathToGlobalVariablesFile)) + { + return; + } + using XmlReader xmlReader = XmlReader.Create(PathToGlobalVariablesFile); + xmlReader.MoveToContent(); + xmlReader.Read(); + while (!xmlReader.EOF && xmlReader.ReadState == ReadState.Interactive) + { + if (xmlReader.NodeType == XmlNodeType.Element && xmlReader.Name.Equals(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + try + { + if (!(XNode.ReadFrom(xmlReader) is XElement xElement)) + { + continue; + } + string value = xElement.Attribute(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; + string value2 = xElement.Attribute(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; + if (value2 != null && value2.Equals(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + SetValue(value, null, VariableLifetime.SaveFile); + continue; + } + byte[] array = Convert.FromBase64String(xElement.Attribute(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value); + using MemoryStream memoryStream = new MemoryStream(); + memoryStream.Write(array, 0, array.Length); + memoryStream.Position = 0L; + object value3 = new BinaryFormatter().Deserialize(memoryStream); + SetValue(value, value3, VariableLifetime.SaveFile); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + else + { + xmlReader.Read(); + } + } + } + catch (Exception ex2) + { + Core.Instance.Loggers.Log(ex2); + } + } + + private static bool ?(object P_0) + { + if (P_0 == null) + { + return true; + } + if (P_0 is ISerializable) + { + return true; + } + return Attribute.IsDefined(P_0.GetType(), typeof(SerializableAttribute)); + } + + private static ? ?(object P_0, bool P_1) + { + ? ? = new ?(); + if (P_0 == null) + { + return ?; + } + using MemoryStream memoryStream = new MemoryStream(); + BinaryFormatter binaryFormatter = new BinaryFormatter(); + binaryFormatter.Serialize(memoryStream, P_0); + long length = memoryStream.Length; + if (P_1 && length > 100000) + { + throw new TooBigObjectException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + memoryStream.Position = 0L; + byte[] array = new byte[memoryStream.Length]; + memoryStream.Read(array, 0, (int)memoryStream.Length); + memoryStream.Position = 0L; + object ?? = binaryFormatter.Deserialize(memoryStream); + ?.?? = array; + ?.?? = ??; + return ?; + } + + private static string ?(byte[] P_0) + { + return Convert.ToBase64String(P_0, Base64FormattingOptions.None); + } + } +} +namespace ? +{ + internal class ? + { + [CompilerGenerated] + private GlobalVariable ??; + + [CompilerGenerated] + private byte[] ??; + + [CompilerGenerated] + private VariableLifetime ??; + + public GlobalVariable Variable + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = globalVariable; + } + } + + public byte[] ObjectBytes + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = array; + } + } + + public VariableLifetime Lifetime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = variableLifetime; + } + } + + internal ?(GlobalVariable P_0) + { + Variable = P_0; + } + } +} +namespace TradingPlatform.BusinessLayer.GlobalVariables +{ + /// + /// Object is non-serializable + /// + [Serializable] + public class NonSerializableObjectException : Exception + { + public NonSerializableObjectException() + { + } + + public NonSerializableObjectException(string message) + : base(message) + { + } + + public NonSerializableObjectException(string message, Exception inner) + : base(message, inner) + { + } + + protected NonSerializableObjectException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } + } +} +namespace ? +{ + internal class ? + { + internal byte[] ??; + + internal object ??; + + internal ?() + { + ?? = null; + ?? = new byte[0]; + } + } +} +namespace TradingPlatform.BusinessLayer.GlobalVariables +{ + /// + /// Object too big + /// + [Serializable] + public class TooBigObjectException : Exception + { + public TooBigObjectException() + { + } + + public TooBigObjectException(string message) + : base(message) + { + } + + public TooBigObjectException(string message, Exception inner) + : base(message, inner) + { + } + + protected TooBigObjectException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } + } + [Serializable] + public class VariableNotExistsException : Exception + { + [CompilerGenerated] + private string ??; + + public string VariableName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public VariableNotExistsException() + { + } + + public VariableNotExistsException(string message) + : base(message) + { + } + + public VariableNotExistsException(string message, Exception inner) + : base(message, inner) + { + } + + public VariableNotExistsException(string message, string variableName) + : base(message) + { + VariableName = variableName; + } + + protected VariableNotExistsException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } + } +} +namespace TradingPlatform.BusinessLayer.Utils +{ + public class ActionRepeater : IDisposable + { + private class ? : IDisposable + { + private readonly ActionRepeaterCallback ??; + + private readonly CancellationTokenSource ??; + + private int ??; + + private readonly int ??; + + private Task ??; + + public ?(ActionRepeaterCallback P_0, int P_1) + { + ?? = P_0; + ?? = new CancellationTokenSource(); + ?? = 0; + ?? = P_1; + } + + public void ?() + { + try + { + if (??++ >= ?? && ?? == null) + { + ?? = 0; + ?? = Task.Run(delegate + { + ???.Invoke(??.Token); + }, ??.Token).ContinueWith((Task t) => ?? = null); + } + } + catch + { + } + } + + public void Dispose() + { + ??.Cancel(); + } + + [CompilerGenerated] + private void ?() + { + ???.Invoke(??.Token); + } + + [CompilerGenerated] + private Task ?(Task t) + { + return ?? = null; + } + } + + private readonly Timer ??; + + private readonly TimeSpan ??; + + private readonly IDictionary ??; + + private ?[] ??; + + private readonly object ??; + + public ActionRepeater() + { + ?? = new Timer(?); + ?? = TimeSpan.FromSeconds(1.0); + ?? = new Dictionary(); + ?? = Array.Empty(); + ?? = new object(); + } + + public void BeginRepeat(ActionRepeaterCallback callback, TimeSpan period) + { + lock (??) + { + ??.Add(callback, new ?(callback, (int)Math.Max(1L, period.Ticks / ??.Ticks))); + ?? = ??.Values.ToArray(); + if (??.Any()) + { + ??.Change(??, ??); + } + } + } + + public void EndRepeat(ActionRepeaterCallback callback) + { + lock (??) + { + ??.Remove(callback); + ?? = ??.Values.ToArray(); + } + } + + public void Dispose() + { + lock (??) + { + ?[] array = ??; + for (int i = 0; i < array.Length; i++) + { + array[i].Dispose(); + } + } + ??.Change(-1, -1); + ??.Dispose(); + } + + private void ?(object P_0) + { + ?[] array = ??; + for (int i = 0; i < array.Length; i++) + { + array[i].?(); + } + } + } + public delegate void ActionRepeaterCallback(CancellationToken cancellation); + /// + /// The action wrapper. + /// + public class ActionWrapper : IXElementSerialization + { + [CompilerGenerated] + private List ??; + + /// + /// Gets or Sets the items. + /// + public List Items + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Initializes a new instance of the class. + /// + public ActionWrapper() + { + Items = new List(); + } + + /// + /// Froms the X element. + /// + /// The element. + /// The deserialization info. + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + foreach (XElement item2 in element.Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (Serializer.DeserializeNode(item2, deserializationInfo) is SettingItem item) + { + Items.Add(item); + } + } + } + + /// + /// Tos the X element. + /// + /// A XElement. + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (SettingItem item in Items) + { + xElement.Add(item.ToXElement()); + } + return xElement; + } + } + /// + /// The aggressor flag calculator. + /// + public class AggressorFlagCalculator : IAggressorFlagCalculator, IDisposable + { + private const int ?? = 1000; + + private ConcurrentDictionary ??; + + /// + /// Initializes a new instance of the class. + /// + public AggressorFlagCalculator() + { + ?? = new ConcurrentDictionary(); + } + + /// + /// Collect bid ask. + /// + /// The symbol. + /// The time ticks. + /// The bid. + /// The ask. + public void CollectBidAsk(string symbol, long timeTicks, double bid, double ask) + { + try + { + if (?? != null && (??.TryGetValue(symbol, out var value) || ??.TryAdd(symbol, value = new AggressorFlagCalculatorItem(1000)))) + { + value.CollectBidAsk(timeTicks, bid, ask); + } + } + catch (Exception exception) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + exception.GetMessageRecursive()); + } + } + + /// + /// Calculate aggressor flag. + /// + /// The symbol. + /// The time ticks. + /// The last. + /// An AggressorFlag. + public AggressorFlag CalculateAggressorFlag(string symbol, long timeTicks, double last) + { + try + { + if (?? == null || !??.TryGetValue(symbol, out var value)) + { + return AggressorFlag.NotSet; + } + return value.CalculateAggressorFlag(timeTicks, last); + } + catch (Exception exception) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + exception.GetMessageRecursive()); + } + return AggressorFlag.NotSet; + } + + /// + /// + /// + public void Dispose() + { + ICollection values = ??.Values; + ?? = null; + foreach (AggressorFlagCalculatorItem item in values) + { + item.Dispose(); + } + } + + /// + /// Calculate aggressor flag. + /// + /// The previous bid. + /// The previous ask. + /// The last. + /// An AggressorFlag. + public static AggressorFlag CalculateAggressorFlag(double previousBid, double previousAsk, double last) + { + if (last >= previousAsk) + { + return AggressorFlag.Buy; + } + if (last <= previousBid) + { + return AggressorFlag.Sell; + } + return AggressorFlag.None; + } + } + public class AggressorFlagCalculatorItem : IDisposable + { + private class ? + { + [CompilerGenerated] + private long ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + public long TimeTicks + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = num; + } + } + + public double Bid + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = num; + } + } + + public double Ask + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = num; + } + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(4, 3); + defaultInterpolatedStringHandler.AppendFormatted(TimeTicks); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Bid); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Ask); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + + private readonly int ??; + + private ?[] ??; + + private volatile int ??; + + private volatile int ??; + + public AggressorFlagCalculatorItem(int cacheCapacity) + { + ?? = cacheCapacity; + ?? = new ?[cacheCapacity]; + for (int i = 0; i < cacheCapacity; i++) + { + ??[i] = new ?(); + } + ?? = -1; + ?? = -1; + } + + public void CollectBidAsk(long timeTicks, double bid, double ask) + { + int num = Math.Abs(Interlocked.Increment(ref ??) % ??); + ?[] array = ??; + ? ? = ((array != null) ? array[num] : null); + if (? != null) + { + ?.TimeTicks = timeTicks; + ?.Bid = bid; + ?.Ask = ask; + Interlocked.Increment(ref ??); + } + } + + public AggressorFlag CalculateAggressorFlag(long timeTicks, double last) + { + int num = Math.Abs(?? % ??); + int num2 = num; + do + { + ?[] array = ??; + ? ? = ((array != null) ? array[num2] : null); + if (? == null || ?.TimeTicks == 0L) + { + break; + } + if (?.TimeTicks <= timeTicks) + { + return AggressorFlagCalculator.CalculateAggressorFlag(?.Bid, ?.Ask, last); + } + num2--; + if (num2 < 0) + { + num2 = ?? - 1; + } + } + while (num2 != num); + return AggressorFlag.NotSet; + } + + public void Dispose() + { + ?? = null; + } + } + public interface IAggressorFlagCalculator : IDisposable + { + void CollectBidAsk(string symbol, long timeTicks, double bid, double ask); + + AggressorFlag CalculateAggressorFlag(string symbol, long timeTicks, double last); + } + /// + /// The alert. + /// + public class Alert + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private string ??; + + /// + /// Gets or Sets the text. + /// + public string Text + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the symbol name. + /// + public string SymbolName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the connection name. + /// + public string ConnectionName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the action on confirm. + /// + public Action ActionOnConfirm + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the name. + /// + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + } + /// + /// The alert data. + /// + [DataContract(Name = "Alert", Namespace = "TradingPlatform")] + public class AlertData : IXElementSerialization + { + /// + /// The name. + /// + [DataMember(Name = "Name")] + public string Name; + + [CompilerGenerated] + private List ??; + + [CompilerGenerated] + private List ??; + + [CompilerGenerated] + private List ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private Hashtable ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private object ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ?? = true; + + [CompilerGenerated] + private int ?? = 1; + + [CompilerGenerated] + private int ?? = 1; + + private const string ?? = "ddMMyyyy HH:mm:ss.ffffff"; + + /// + /// Gets or Sets the columns. + /// + public List Columns + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the groups. + /// + public List Groups + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the actions. + /// + public List Actions + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets a value indicating whether enabled. + /// + [DataMember(Name = "Enabled")] + public bool Enabled + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the table dictionary. + /// + public Hashtable TableDictionary + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets a value indicating whether coloring is alert. + /// + [DataMember(Name = "IsColoringAlert")] + public bool IsColoringAlert + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets a value indicating whether filter alert. + /// + [DataMember(Name = "FilterAlert")] + public bool FilterAlert + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets a value indicating whether search alert. + /// + [DataMember(Name = "SearchAlert")] + public bool SearchAlert + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets a value indicating whether to remove. + /// + public bool ToRemove + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the ID. + /// + public string ID + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the command sender. + /// + public object CommandSender + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets a value indicating whether need confirm trading. + /// + public bool NeedConfirmTrading + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Expiration time + /// + public DateTime ExpiryTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool Expire + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool RepeatAlertActions + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int RepeatMaxCount + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int RepeatPeriodMinutes + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Initializes a new instance of the class. + /// + public AlertData() + { + Columns = new List(); + Groups = new List(); + Actions = new List(); + NeedConfirmTrading = true; + } + + /// + /// To the XML element. + /// + /// A XElement. + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Enabled)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsColoringAlert)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), FilterAlert)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), NeedConfirmTrading)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Expire)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExpiryTime.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo.InvariantCulture))); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), RepeatAlertActions)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), RepeatMaxCount)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), RepeatPeriodMinutes)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SearchAlert)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ID)); + XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (ConditionGroup group in Groups) + { + xElement2.Add(group.ToXElement()); + } + xElement.Add(xElement2); + XElement xElement3 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (ActionWrapper action in Actions) + { + xElement3.Add(action.ToXElement()); + } + xElement.Add(xElement3); + return xElement; + } + + /// + /// From the XML element. + /// + /// The element. + /// The deserialization info. + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + Name = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString(); + Enabled = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); + IsColoringAlert = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); + FilterAlert = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); + XElement xElement2 = xElement?.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + NeedConfirmTrading = xElement2.ToBool(); + } + XElement xElement3 = xElement?.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + Expire = xElement3.ToBool(); + } + XElement xElement4 = xElement?.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + ExpiryTime = xElement4.ToDateTime(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + XElement xElement5 = xElement?.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement5 != null) + { + RepeatAlertActions = xElement5.ToBool(); + } + XElement xElement6 = xElement?.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement6 != null) + { + RepeatMaxCount = xElement6.ToInt(); + } + XElement xElement7 = xElement?.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement7 != null) + { + RepeatPeriodMinutes = xElement7.ToInt(); + } + SearchAlert = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); + ID = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString(); + List list = new List(); + foreach (XElement item in xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + ConditionGroup conditionGroup = new ConditionGroup(); + conditionGroup.FromXElement(item, deserializationInfo); + list.Add(conditionGroup); + } + Groups = list; + List list2 = new List(); + foreach (XElement item2 in xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + ActionWrapper actionWrapper = new ActionWrapper(); + actionWrapper.FromXElement(item2, deserializationInfo); + list2.Add(actionWrapper); + } + Actions = list2; + } + } + /// + /// The arbitrage symbol. + /// + [Serializable] + public class ArbitrageSymbol : IXElementSerialization, IComparable + { + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private readonly Guid ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private Symbol ??; + + [CompilerGenerated] + private Account ??; + + [CompilerGenerated] + private double ??; + + /// + /// Gets or Sets the index. + /// + public int Index + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets the unique ID. + /// + public Guid UniqueID + { + [CompilerGenerated] + get + { + return ??; + } + } + + /// + /// Gets the symbol id. + /// + public string SymbolId + { + get + { + if (Symbol == null) + { + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + return Symbol.ConnectionId + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Symbol.Id; + } + } + + /// + /// Gets or Sets a value indicating whether is selected. + /// + public bool IsSelected + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the symbol. + /// + public Symbol Symbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the account. + /// + public Account Account + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Gets or Sets the commission. + /// + public double Commission + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Initializes a new instance of the class. + /// + public ArbitrageSymbol() + { + ?? = Guid.NewGuid(); + } + + /// + /// Compare to. + /// + /// The other. + /// An int. + public int CompareTo(ArbitrageSymbol other) + { + return Index.CompareTo(other.Index); + } + + /// + /// Froms the X element. + /// + /// The element. + /// The deserialization info. + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.XPathSelectElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + BusinessObjectInfo businessObjectInfo = new BusinessObjectInfo(); + businessObjectInfo.FromXElement(xElement, deserializationInfo); + Symbol = Core.Instance.GetSymbol(businessObjectInfo); + } + XElement xElement2 = element.XPathSelectElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + BusinessObjectInfo businessObjectInfo2 = new BusinessObjectInfo(); + businessObjectInfo2.FromXElement(xElement2, deserializationInfo); + Account = Core.Instance.GetAccount(businessObjectInfo2); + } + IsSelected = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); + Commission = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToDouble(); + } + + /// + /// Tos the X element. + /// + /// A XElement. + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsSelected)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Symbol?.CreateInfo().ToXElement())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Account?.CreateInfo().ToXElement())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Commission)); + return xElement; + } + } + /// + /// The action buffered processor. + /// + public class ActionBufferedProcessor : BufferedProcessor + { + protected override void Process(Action subject) + { + try + { + subject(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + } + /// + /// The action buffered processor with priority. + /// + public class ActionBufferedProcessorWithPriority : BufferedProcessorWithPriority + { + /// + /// Initializes a new instance of the class. + /// + /// The threads count. + public ActionBufferedProcessorWithPriority(int threadsCount = 1) + : base(threadsCount) + { + } + + protected override void Process(Action action) + { + action?.Invoke(); + } + } + /// + /// The buffered processor. + /// + /// + public abstract class BufferedProcessor + { + [CompilerGenerated] + private sealed class ? + { + public T ??; + + public Task ??; + + public BufferedProcessor ??; + + internal void ?() + { + try + { + ??.State = BufferedProcessorState.ProcessSubject; + ??.Process(??); + } + catch (Exception ex) + { + ??.?(ex.InnerException ?? ex); + } + finally + { + ??.State = BufferedProcessorState.Started; + } + } + + internal void ?(Task P_0) + { + ??.??.Remove(??.Id); + ??.??.Set(); + } + } + + [StructLayout(LayoutKind.Auto)] + [CompilerGenerated] + private struct ? + { + public BufferedProcessor ??; + + public CancellationToken? ??; + } + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private BufferedProcessorState ??; + + protected int ProcessTreadsCount; + + private CancellationTokenSource ??; + + private readonly Queue ??; + + private readonly object ??; + + private readonly ManualResetEventSlim ??; + + private readonly HashSet ??; + + /// + /// Gets the state. + /// + public BufferedProcessorState State + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = bufferedProcessorState; + } + } + + /// + /// Gets the queue depth. + /// + public int QueueDepth => ??.Count; + + public event Action ExceptionOccurred + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + protected BufferedProcessor() + { + ProcessTreadsCount = 1; + ?? = new Queue(); + ?? = new object(); + ?? = new ManualResetEventSlim(initialState: false); + ?? = new HashSet(); + State = BufferedProcessorState.Created; + } + + /// + /// + /// + public virtual void Start() + { + ?? = new CancellationTokenSource(); + if (ProcessTreadsCount == 1) + { + Task.Factory.StartNew(?, ??.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default); + } + else + { + Task.Factory.StartNew(?, ??.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default); + } + State = BufferedProcessorState.Started; + } + + /// + /// + /// + public virtual void Stop() + { + lock (??) + { + ???.Cancel(); + Clear(); + ??.Set(); + State = BufferedProcessorState.Stopped; + } + } + + /// + /// + /// + /// The subject. + public virtual void Push(T subject) + { + lock (??) + { + ??.Enqueue(subject); + ??.Set(); + } + } + + private void ?() + { + CancellationToken token = ??.Token; + while (true) + { + try + { + if (token.IsCancellationRequested) + { + break; + } + ??.Wait(token); + if (token.IsCancellationRequested) + { + break; + } + while (??.Count > 0) + { + if (token.IsCancellationRequested) + { + return; + } + try + { + T val = default(T); + lock (??) + { + State = BufferedProcessorState.ProcessSubject; + val = ??.Dequeue(); + } + Process(val); + } + catch (Exception ex) + { + ?(ex.InnerException ?? ex); + } + finally + { + State = BufferedProcessorState.Started; + } + } + } + catch (Exception ex2) + { + ?(ex2.InnerException ?? ex2); + } + finally + { + lock (??) + { + if (??.Count == 0) + { + ??.Reset(); + } + } + } + } + } + + private void ?() + { + CancellationToken token = ??.Token; + while (true) + { + try + { + if (token.IsCancellationRequested) + { + break; + } + ??.Wait(token); + if (token.IsCancellationRequested) + { + break; + } + while (??.Count > 0 && ??.Count < ProcessTreadsCount) + { + if (token.IsCancellationRequested) + { + return; + } + T ?? = default(T); + lock (??) + { + ?? = ??.Dequeue(); + } + Task ?? = Task.Factory.StartNew(delegate + { + try + { + State = BufferedProcessorState.ProcessSubject; + Process(??); + } + catch (Exception ex2) + { + ?(ex2.InnerException ?? ex2); + } + finally + { + State = BufferedProcessorState.Started; + } + }); + ??.ContinueWith(delegate + { + ??.Remove(??.Id); + ??.Set(); + }); + if (??.Status != TaskStatus.RanToCompletion && ??.Status != TaskStatus.Canceled && ??.Status != TaskStatus.Faulted) + { + ??.Add(??.Id); + } + } + } + catch (Exception ex) + { + ?(ex.InnerException ?? ex); + } + finally + { + ??.Reset(); + } + } + } + + private void ?(Exception P_0) + { + ???.Invoke(P_0); + } + + [Obfuscation(Exclude = false)] + protected abstract void Process(T P_0); + + protected internal virtual void Clear() + { + ???.Clear(); + } + + /// + /// Wait all messages process. + /// + /// The external token. + public void WaitAllMessagesProcess(CancellationToken? externalToken = null) + { + ? ? = default(?); + ?.?? = this; + ?.?? = externalToken; + if (?(ref ?)) + { + return; + } + do + { + lock (??) + { + if (QueueDepth <= 0 && State != BufferedProcessorState.ProcessSubject) + { + break; + } + } + } + while (!?(ref ?)); + } + + [CompilerGenerated] + private bool ?(ref ? P_0) + { + return ???.IsCancellationRequested ?? P_0.???.IsCancellationRequested ?? true; + } + } + /// + /// The buffered processor state. + /// + public enum BufferedProcessorState + { + Created, + Started, + ProcessSubject, + Stopped + } + public abstract class BufferedProcessorWithPriority + { + [CompilerGenerated] + private sealed class ? + { + public QueueObj ??; + + public Task ??; + + public BufferedProcessorWithPriority ??; + + internal void ?() + { + string name = Thread.CurrentThread.Name; + try + { + Thread.CurrentThread.Name = ??.??; + ??.ProcessMessageNow = true; + ??.Process(??.Value); + ??.ProcessMessageNow = false; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ex.Message, LoggingLevel.Verbose); + } + finally + { + Thread.CurrentThread.Name = name; + } + } + + internal void ?(Task P_0) + { + lock (??.??) + { + ??.??.Remove(??.Marker); + } + ??.??.Remove(??.Id); + ??.??.Set(); + } + } + + private readonly TasksHolder ??; + + private readonly object ??; + + private readonly ManualResetEvent ??; + + private CancellationTokenSource ??; + + protected int ProcessTreadsCount; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + private readonly HashSet ??; + + private readonly HashSet ??; + + private readonly string ??; + + internal bool Started + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = flag; + } + } + + internal bool ProcessMessageNow + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = flag; + } + } + + protected BufferedProcessorWithPriority(int threadsCount = 1) + { + ?? = Guid.NewGuid().ToShortString(); + ProcessTreadsCount = threadsCount; + ?? = new TasksHolder(2); + ?? = new object(); + ?? = new ManualResetEvent(initialState: false); + ?? = new HashSet(); + ?? = new HashSet(); + } + + public void Start() + { + ?? = new CancellationTokenSource(); + Task.Factory.StartNew(?, ??.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default); + Started = true; + } + + public virtual void Stop() + { + lock (??) + { + ???.Cancel(); + Clear(); + ??.Set(); + Started = false; + } + } + + protected virtual void Clear() + { + ???.?(); + } + + private void ?() + { + while (true) + { + try + { + ??.WaitOne(); + ??.Reset(); + CancellationTokenSource cancellationTokenSource = ??; + if (cancellationTokenSource != null && cancellationTokenSource.IsCancellationRequested) + { + break; + } + while (??.Count > 0 && ??.Count < ProcessTreadsCount) + { + CancellationTokenSource cancellationTokenSource2 = ??; + if (cancellationTokenSource2 != null && cancellationTokenSource2.IsCancellationRequested) + { + return; + } + QueueObj ?? = null; + lock (??) + { + ?? = ??.Dequeue(??); + if (?? == null) + { + break; + } + ??.Add(??.Marker); + goto IL_00ba; + } + IL_00ba: + Task ?? = Task.Factory.StartNew(delegate + { + string name = Thread.CurrentThread.Name; + try + { + Thread.CurrentThread.Name = ??; + ProcessMessageNow = true; + Process(??.Value); + ProcessMessageNow = false; + } + catch (Exception ex2) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ex2.Message, LoggingLevel.Verbose); + } + finally + { + Thread.CurrentThread.Name = name; + } + }); + ??.ContinueWith(delegate + { + lock (??) + { + ??.Remove(??.Marker); + } + ??.Remove(??.Id); + ??.Set(); + }); + if (??.Status != TaskStatus.RanToCompletion && ??.Status != TaskStatus.Canceled && ??.Status != TaskStatus.Faulted) + { + ??.Add(??.Id); + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ex.Message, LoggingLevel.Verbose); + } + } + } + + public void Push(T subject, int priority, string marker) + { + if (Thread.CurrentThread.Name == ??) + { + try + { + Process(subject); + return; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ex.Message, LoggingLevel.Verbose); + return; + } + } + lock (??) + { + ??.Enqueue(subject, priority, marker); + } + ??.Set(); + } + + [Obfuscation(Exclude = false)] + protected abstract void Process(T P_0); + } +} +namespace ? +{ + internal class ? where ? : IBufferedProcessorValue + { + private readonly Dictionary>> ??; + + private readonly object ??; + + public ?() + { + ?? = new Dictionary>>(); + ?? = new object(); + } + + public void ?(Action P_0, params ?[] messagesTypes) + { + if (P_0 == null) + { + return; + } + lock (??) + { + foreach (? key in messagesTypes) + { + if (??.TryGetValue(key, out var value)) + { + List> value2 = new List>(value) { P_0 }; + ??[key] = value2; + } + else + { + ??.Add(key, new List> { P_0 }); + } + } + } + } + + public void ?(Action P_0, params ?[] messagesTypes) + { + if (P_0 == null) + { + return; + } + lock (??) + { + if (messagesTypes.Length == 0) + { + foreach (KeyValuePair>> item in ??) + { + item.Value.Remove(P_0); + } + return; + } + foreach (? key in messagesTypes) + { + if (??.TryGetValue(key, out var value)) + { + List> list = new List>(value); + list.Remove(P_0); + ??[key] = list; + } + } + } + } + + public void ?(? P_0) + { + List> value; + lock (??) + { + ??.TryGetValue(P_0.Key, out value); + } + if (value == null) + { + return; + } + foreach (Action item in value) + { + try + { + item(P_0); + } + catch + { + } + } + } + } +} +namespace TradingPlatform.BusinessLayer.Utils +{ + public interface IBufferedProcessorValue + { + TKey Key { get; } + } + public class QueueObj + { + public readonly T Value; + + public readonly string Marker; + + public QueueObj(T value, string marker) + { + Value = value; + Marker = marker; + } + } + public class TasksHolder + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func>, int> ??; + + internal int ?(List> P_0) + { + return P_0.Count; + } + } + + private readonly List>[] ??; + + public int Count => ??.Sum((List> P_0) => P_0.Count); + + /// + /// + /// + public TasksHolder(int prioritiesCount) + { + ?? = new List>[prioritiesCount]; + for (int i = 0; i < ??.Length; i++) + { + ??[i] = new List>(); + } + } + + public void Enqueue(TTask task, int priority, string marker) + { + if (priority >= ??.Length) + { + throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + QueueObj item = new QueueObj(task, marker); + lock (??) + { + ??[priority].Add(item); + } + } + + public QueueObj Dequeue(HashSet markersAtWork) + { + QueueObj queueObj = null; + lock (??) + { + List>[] array = ??; + foreach (List> list in array) + { + foreach (QueueObj item in list) + { + if (!markersAtWork.Contains(item.Marker)) + { + queueObj = item; + list.Remove(item); + break; + } + } + if (queueObj != null) + { + break; + } + } + } + return queueObj; + } + + internal void ?() + { + for (int i = 0; i < ??.Length; i++) + { + ??[i].Clear(); + } + } + } + public class TimeFrameConfig : IXElementSerialization, ICloneable + { + public List TFList; + + [CompilerGenerated] + private HistoryAggregation ??; + + /// + /// ?????????, ?? ???? ????????????????? ?? ???????? ??? "TimeFrameScreen". + /// ??????? ??????????? ????????? ?????. + /// + public HistoryAggregation DefaultAggregation + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public TimeFrameConfig() + { + TFList = new List(); + } + + public void AddTF(HistoryAggregation info) + { + TFList.Add(info.ToString()); + } + + public bool IsAllowed(HistoryAggregation otherTf) + { + if (TFList.Count == 0 || otherTf == null) + { + return true; + } + string item = otherTf.ToString(); + return TFList.Contains(item); + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (string tF in TFList) + { + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), tF)); + } + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + TFList = new List(); + foreach (XElement item in element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Elements()) + { + string text = item.Value.ToString(); + if (text.StartsWith(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) && text.EndsWith(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) && text != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + text = text.Replace(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + TFList.Add(text); + } + } + + public object Clone() + { + return new TimeFrameConfig + { + TFList = new List(TFList), + DefaultAggregation = ((DefaultAggregation == null) ? null : ((HistoryAggregation)DefaultAggregation.Clone())) + }; + } + } + public class ClusterCustomColoringLevel : IXElementSerialization, IEquatable + { + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private Color ??; + + [CompilerGenerated] + private Color ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + public bool IsChecked + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double Value + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Color LeftColor + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Color RightColor + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string LeftColorLabel + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string RightColorLabel + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsChecked)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Value)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LeftColor.ToArgb())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), RightColor.ToArgb())); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + Value = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToDouble(); + IsChecked = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); + LeftColor = Color.FromArgb(xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt()); + RightColor = Color.FromArgb(xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt()); + } + } + + public void UpdateLevel(ClusterCustomColoringLevel level) + { + IsChecked = level.IsChecked; + Value = level.Value; + LeftColor = level.LeftColor; + RightColor = level.RightColor; + if (!string.IsNullOrEmpty(level.LeftColorLabel)) + { + LeftColorLabel = level.LeftColorLabel; + } + if (!string.IsNullOrEmpty(level.RightColorLabel)) + { + RightColorLabel = level.RightColorLabel; + } + } + + public bool Equals(ClusterCustomColoringLevel other) + { + if (other == null) + { + return false; + } + if (this == other) + { + return true; + } + if (IsChecked == other.IsChecked && Value.Equals(other.Value) && LeftColor.Equals(other.LeftColor) && RightColor.Equals(other.RightColor) && LeftColorLabel == other.LeftColorLabel) + { + return RightColorLabel == other.RightColorLabel; + } + return false; + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + if (this == obj) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((ClusterCustomColoringLevel)obj); + } + + public override int GetHashCode() + { + return HashCode.Combine(IsChecked, Value, LeftColor, RightColor, LeftColorLabel, RightColorLabel); + } + } + public sealed class ColorStyleWidth : IXElementSerialization, ICloneable + { + public Color Color; + + public LineStyle Style; + + public int Width; + + public bool DisableColor; + + public bool DisableStyle; + + public bool DisableWidth; + + public bool CheckBoxVisible; + + public bool Checked; + + public bool AllLineStyles; + + public ColorStyleWidth() + { + Width = 1; + Checked = true; + } + + public ColorStyleWidth(Color color, LineStyle Style, int Width) + : this() + { + Color = color; + this.Style = Style; + this.Width = Width; + } + + public void ApplyFromClone(ColorStyleWidth clone) + { + Color = Color.FromArgb(clone.Color.ToArgb()); + Style = clone.Style; + Width = clone.Width; + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Color.ToArgb())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)Style)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Width)); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + Color = Color.FromArgb(xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt()); + Style = (LineStyle)xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt(); + Width = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt(); + } + + public object Clone() + { + return new ColorStyleWidth + { + AllLineStyles = AllLineStyles, + CheckBoxVisible = CheckBoxVisible, + Checked = Checked, + Color = Color, + DisableColor = DisableColor, + DisableStyle = DisableStyle, + DisableWidth = DisableWidth, + Style = Style, + Width = Width + }; + } + } + public class ColumnBaseInformation : IComparable, IXElementSerialization + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private TableBaseType ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private bool ??; + + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public TableBaseType Type + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = tableBaseType; + } + } + + public string HeaderText + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public bool IsIndicatorColumn + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = flag; + } + } + + public ColumnBaseInformation() + { + } + + public ColumnBaseInformation(string name, TableBaseType type, string headerText, bool isIndicatorColumn) + { + Name = name; + Type = type; + HeaderText = headerText; + IsIndicatorColumn = isIndicatorColumn; + } + + public int CompareTo(object obj) + { + return Name.CompareTo(obj); + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Type.ToString())); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + Name = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString(); + Type = (TableBaseType)Enum.Parse(typeof(TableBaseType), xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString()); + } + } + public class ConditionGroup : IXElementSerialization + { + [CompilerGenerated] + private List ?? = new List(); + + public List ConditionItems + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + List list = new List(); + foreach (XElement item in element.Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + ConditionItem conditionItem = new ConditionItem(); + conditionItem.FromXElement(item, deserializationInfo); + list.Add(conditionItem); + } + ConditionItems = list; + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (ConditionItem conditionItem in ConditionItems) + { + xElement.Add(conditionItem.ToXElement()); + } + return xElement; + } + } + public class ConditionItem : IXElementSerialization + { + [CompilerGenerated] + private ColumnBaseInformation ??; + + [CompilerGenerated] + private TableConditionType ??; + + [CompilerGenerated] + private object ??; + + [CompilerGenerated] + private ColumnBaseInformation ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private int ??; + + public ColumnBaseInformation Column + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public TableConditionType ConditionType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public object ConditionValue + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public ColumnBaseInformation Column2 + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int Column1Offset + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int Column2Offset + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + ColumnBaseInformation columnBaseInformation = new ColumnBaseInformation(); + columnBaseInformation.FromXElement(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), deserializationInfo); + Column = columnBaseInformation; + ConditionType = (TableConditionType)Enum.Parse(typeof(TableConditionType), element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString()); + ConditionValue = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString(); + if (element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) != null) + { + Column1Offset = int.Parse(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString()); + } + if (element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) != null) + { + Column2Offset = int.Parse(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString()); + } + if (element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) != null) + { + ColumnBaseInformation columnBaseInformation2 = new ColumnBaseInformation(); + columnBaseInformation2.FromXElement(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), deserializationInfo); + Column2 = columnBaseInformation2; + } + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Column.ToXElement())); + if (Column2 != null) + { + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Column2.ToXElement())); + } + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ConditionType.ToString())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ConditionValue?.ToString())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Column1Offset.ToString())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Column2Offset.ToString())); + return xElement; + } + } + public static class Const + { + public const double DOUBLE_UNDEFINED = double.NaN; + + public const string SETTINGS_FOLDER_NAME = "Settings"; + + public const string SCRIPTS_FOLDER_NAME = "Scripts"; + + public const string INDICATORS_FOLDER_NAME = "Indicators"; + + public const string STRATEGIES_FOLDER_NAME = "Strategies"; + + public const string PLACE_ORDER_STRATEGIES_FOLDER_NAME = "PlaceOrderStrategies"; + + public const string SCRIPTS_DATA_FOLDER_NAME = "ScriptsData"; + + public const string MEDIA_FOLDER_NAME = "Media"; + + public const string MESSENGERS_FOLDER_NAME = "Messengers"; + + private const string ?? = "History"; + + internal const string ?? = "history.db"; + + private const string ?? = "VolumeAnalysis"; + + internal const string ?? = "volume-analysis.db"; + + private const string ?? = "UserTradesCache"; + + public const string USER_TRADES_STORAGE_FILE_NAME = "user-trades.db"; + + public const string ORDERS_HISTORY_STORAGE_FILE_NAME = "orders-history.db"; + + public static readonly string EXECUTING_FOLDER; + + public static readonly string PLUGINS_FOLDER; + + public static readonly string HISTORY_PATH; + + public static readonly string VOLUME_ANALYSIS_PATH; + + public static readonly string USER_TRADES_CACHE_PATH; + + public static readonly string LOGS_FOLDER_PATH; + + public static readonly string CUSTOM_SCRIPTS_PATH; + + public static readonly string SCRIPTS_DATA_PATH; + + public static readonly string DEFAULT_INDICATORS_RELATIVE_PATH; + + public static readonly string CUSTOM_INDICATORS_PATH; + + public static readonly string DEFAULT_STRATEGIES_RELATIVE_PATH; + + public static readonly string CUSTOM_STRATEGIES_PATH; + + public static readonly string DEFAULT_PLACE_ORDER_STRATEGIES_RELATIVE_PATH; + + public static readonly string CUSTOM_PLACE_ORDER_STRATEGIES_PATH; + + public static readonly string CUSTOM_PLUGINS_PATH; + + public static readonly string CUSTOM_VENDORS_PATH; + + public static readonly string CUSTOM_BIN_PATH; + + public static readonly string TEMP_PATH; + + public static readonly string MEDIA_PATH; + + public static readonly string MESSENGERS_PATH; + + public const string PLUGINS_FOLDER_NAME = "plug-ins"; + + public const string VENDORS_FOLDER_NAME = "Vendors"; + + public const string BIN_FOLDER_NAME = "bin"; + + public const string NOT_AVAILABLE_STRING = "N/A"; + + public const string CONSOLE_SCREEN_STRING = "*console#"; + + public const string TEMP_STRING = "Temp"; + + public const string LOGS_FOLDER_NAME = "Logs"; + + static Const() + { + EXECUTING_FOLDER = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + PLUGINS_FOLDER = Path.Combine(EXECUTING_FOLDER, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + HISTORY_PATH = Path.Combine(EXECUTING_FOLDER, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + VOLUME_ANALYSIS_PATH = Path.Combine(EXECUTING_FOLDER, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + USER_TRADES_CACHE_PATH = Path.Combine(EXECUTING_FOLDER, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + LOGS_FOLDER_PATH = Path.Combine(EXECUTING_FOLDER, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + CUSTOM_SCRIPTS_PATH = Path.Combine(EXECUTING_FOLDER, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + SCRIPTS_DATA_PATH = Path.Combine(CUSTOM_SCRIPTS_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + DEFAULT_INDICATORS_RELATIVE_PATH = Path.Combine(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + CUSTOM_INDICATORS_PATH = Path.Combine(CUSTOM_SCRIPTS_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + DEFAULT_STRATEGIES_RELATIVE_PATH = Path.Combine(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + CUSTOM_STRATEGIES_PATH = Path.Combine(CUSTOM_SCRIPTS_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + DEFAULT_STRATEGIES_RELATIVE_PATH = Path.Combine(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + CUSTOM_STRATEGIES_PATH = Path.Combine(CUSTOM_SCRIPTS_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + DEFAULT_PLACE_ORDER_STRATEGIES_RELATIVE_PATH = Path.Combine(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + CUSTOM_PLACE_ORDER_STRATEGIES_PATH = Path.Combine(CUSTOM_SCRIPTS_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + CUSTOM_PLUGINS_PATH = Path.Combine(CUSTOM_SCRIPTS_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + CUSTOM_VENDORS_PATH = Path.Combine(CUSTOM_SCRIPTS_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + CUSTOM_BIN_PATH = Path.Combine(CUSTOM_SCRIPTS_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + TEMP_PATH = Path.Combine(EXECUTING_FOLDER, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + MEDIA_PATH = Path.Combine(EXECUTING_FOLDER, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + MESSENGERS_PATH = Path.Combine(MEDIA_PATH, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + public static class CoreMath + { + public static int GetValuePrecision(decimal value) + { + value = Math.Abs(value); + decimal num = value - (decimal)(long)value; + int num2 = 0; + if (num != 0m) + { + num2 = 1; + while (true) + { + decimal num3 = num * (decimal)Math.Pow(10.0, num2); + if (!(num3 - (decimal)(long)num3 > 0m)) + { + break; + } + num2++; + } + } + return num2; + } + + public static double RoundToIncrement(double value, double increment) + { + if (increment <= 0.0 || double.IsNaN(value)) + { + return value; + } + return (double)((decimal)(long)Math.Round((decimal)value / (decimal)increment, MidpointRounding.AwayFromZero) * (decimal)increment); + } + + public static double FloorToIncrement(double value, double increment) + { + if (increment <= 0.0 || double.IsNaN(value)) + { + return value; + } + return (double)((decimal)(long)Math.Floor((decimal)value / (decimal)increment) * (decimal)increment); + } + + public static double ProcessNaN(double value, double defaultValue = 0.0) + { + if (!double.IsNaN(value)) + { + return value; + } + return defaultValue; + } + + public static double GetWeightedAverage(IEnumerable<(double, double)> array, Symbol symbol = null) + { + double num = 0.0; + double num2 = 0.0; + foreach (var item3 in array) + { + double item = item3.Item1; + double item2 = item3.Item2; + num += item * item2; + num2 += item2; + } + if (num2 == 0.0) + { + return double.NaN; + } + double num3 = num / num2; + return symbol?.RoundPriceToTickSize(num3) ?? num3; + } + } + public class CrossRateCache : IDisposable + { + private readonly struct ? : IEquatable + { + private readonly string ??; + + private readonly string ??; + + public ?(string P_0, string P_1) + { + ?? = P_0; + ?? = P_1; + } + + public bool Equals(? other) + { + if (?? == other.??) + { + return ?? == other.??; + } + return false; + } + + public override bool Equals(object obj) + { + if (obj is ? other) + { + return Equals(other); + } + return false; + } + + public override int GetHashCode() + { + return (((?? != null) ? ??.GetHashCode() : 0) * 397) ^ ((?? != null) ? ??.GetHashCode() : 0); + } + + public override string ToString() + { + return ?? + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ??; + } + } + + private readonly Dictionary ??; + + public CrossRateCache() + { + ?? = new Dictionary(); + } + + public void ProcessPrice(string baseAsset, string quoteAsset, double price) + { + if (!double.IsNaN(price)) + { + ? key = new ?(baseAsset, quoteAsset); + ??[key] = price; + if (price != 0.0) + { + key = new ?(quoteAsset, baseAsset); + ??[key] = 1.0 / price; + } + } + } + + public bool TryGetCrossRate(string fromAsset, string toAsset, out double crossRate) + { + if (fromAsset == toAsset) + { + crossRate = 1.0; + return true; + } + ? key = new ?(fromAsset, toAsset); + if (??.TryGetValue(key, out crossRate)) + { + return !double.IsNaN(crossRate); + } + return false; + } + + public void Dispose() + { + ??.Clear(); + } + } + public sealed class DateTimeRange : IXElementSerialization, IComparable + { + private const string ?? = "RangeSelector"; + + [CompilerGenerated] + private Period ??; + + [CompilerGenerated] + private Period? ??; + + [CompilerGenerated] + private DateTimeRangeType ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private Connection ??; + + public Period Period + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = period; + } + } + + public Period? EndOffset + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = period; + } + } + + public DateTimeRangeType RangeType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTimeRangeType; + } + } + + public DateTime From + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + public DateTime To + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + public Connection TimeSourceConnection + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DateTimeRange() + { + } + + public DateTimeRange(Period period) + : this() + { + SetRange(period); + } + + public DateTimeRange(Period period, DateTimeRangeType dateTimeRangeType) + : this() + { + SetRange(period, dateTimeRangeType); + } + + public DateTimeRange(Period period, Period endOffset, DateTimeRangeType dateTimeRangeType) + : this() + { + ?(period, endOffset, dateTimeRangeType); + } + + public DateTimeRange(DateTime from, DateTime to) + : this() + { + SetRange(from, to); + } + + public DateTimeRange(DateTimeRange original) + : this() + { + RangeType = original.RangeType; + Period = original.Period; + EndOffset = original.EndOffset; + From = original.From; + To = original.To; + Update(); + } + + public void SetRange(Period period) + { + if (RangeType == DateTimeRangeType.Custom) + { + throw new ArgumentException(); + } + Period = period; + Update(); + } + + public void SetRange(Period period, DateTimeRangeType rangeType) + { + if (rangeType == DateTimeRangeType.Custom) + { + throw new ArgumentException(); + } + RangeType = rangeType; + Period = period; + Update(); + } + + private void ?(Period P_0, Period P_1, DateTimeRangeType P_2) + { + if (P_2 == DateTimeRangeType.Custom) + { + throw new ArgumentException(); + } + RangeType = P_2; + Period = P_0; + EndOffset = P_1; + Update(); + } + + public void SetRange(DateTime from, DateTime to) + { + if (!?(from, to)) + { + throw new ArgumentOutOfRangeException(); + } + From = from; + To = to; + RangeType = DateTimeRangeType.Custom; + } + + public void Update() + { + if (RangeType != DateTimeRangeType.Custom) + { + (DateTime from, DateTime to) tuple = ?(Period, EndOffset, RangeType, TimeSourceConnection); + DateTime item = tuple.from; + DateTime item2 = tuple.to; + From = item; + To = item2; + } + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + XElement xElement2 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + RangeType = (DateTimeRangeType)xElement2.ToInt(); + } + XElement xElement3 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + if (xElement3 != null) + { + Period period = default(Period); + period.FromXElement(xElement3, deserializationInfo); + Period = period; + } + XElement xElement4 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + XElement xElement5 = xElement4.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + if (xElement5 != null) + { + Period value = default(Period); + value.FromXElement(xElement5, deserializationInfo); + EndOffset = value; + } + } + if (RangeType != DateTimeRangeType.Custom) + { + Update(); + return; + } + XElement xElement6 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement6 != null) + { + From = xElement6.ToDateTime(toUTC: true); + } + XElement xElement7 = xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement7 != null) + { + To = xElement7.ToDateTime(toUTC: true); + } + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)RangeType)); + xElement.Add(Period.ToXElement()); + if (EndOffset.HasValue) + { + XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement2.Add(EndOffset.Value.ToXElement()); + xElement.Add(xElement2); + } + if (RangeType == DateTimeRangeType.Custom) + { + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), From)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), To)); + } + return xElement; + } + + private static (DateTime from, DateTime to) ?(Period P_0, Period? P_1, DateTimeRangeType P_2, Connection P_3) + { + return ?(P_0, P_1, P_2, DayOfWeek.Monday, P_3); + } + + private static (DateTime from, DateTime to) ?(Period P_0, Period? P_1, DateTimeRangeType P_2, DayOfWeek P_3, Connection P_4) + { + DateTime dateTime = Core.Instance.TimeUtils.DateTimeUtcNow; + if (P_4 != null) + { + dateTime = P_4.ServerTime; + } + DateTime item = dateTime; + DateTime item2 = dateTime; + switch (P_2) + { + case DateTimeRangeType.FixedStart: + switch (P_0.BasePeriod) + { + case BasePeriod.Tick: + item = item.AddTicks(P_0.PeriodMultiplier); + break; + case BasePeriod.Second: + { + double num = dateTime.TimeOfDay.TotalSeconds % (double)P_0.PeriodMultiplier; + item = dateTime.AddSeconds(0.0 - num); + item2 = item.AddTicks(P_0.Ticks); + break; + } + case BasePeriod.Minute: + { + dateTime = dateTime.TrimSeconds(); + double num3 = dateTime.TimeOfDay.TotalMinutes % (double)P_0.PeriodMultiplier; + item = dateTime.AddMinutes(0.0 - num3); + item2 = item.AddTicks(P_0.Ticks); + break; + } + case BasePeriod.Hour: + { + dateTime = dateTime.TrimSeconds(); + double num2 = dateTime.TimeOfDay.TotalHours % (double)P_0.PeriodMultiplier; + item = dateTime.AddHours(0.0 - num2); + item2 = item.AddTicks(P_0.Ticks); + break; + } + case BasePeriod.Day: + item = dateTime.TrimSeconds().Date.AddDays(-(P_0.PeriodMultiplier - 1)); + item2 = item.AddDays(P_0.PeriodMultiplier); + break; + case BasePeriod.Week: + { + DateTime dateTime2 = dateTime.TrimSeconds(); + while (dateTime2.DayOfWeek != P_3) + { + dateTime2 = dateTime2.AddDays(-1.0); + } + item = dateTime2.Date; + item2 = item.AddDays(7 * P_0.PeriodMultiplier); + break; + } + case BasePeriod.Month: + item = new DateTime(dateTime.Year, dateTime.Month, 1, 0, 0, 0, DateTimeKind.Utc).AddMonths(-(P_0.PeriodMultiplier - 1)); + item2 = item.AddMonths(P_0.PeriodMultiplier); + break; + case BasePeriod.Year: + item = new DateTime(dateTime.Year, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddYears(-(P_0.PeriodMultiplier - 1)); + item2 = item.AddYears(P_0.PeriodMultiplier); + break; + } + break; + case DateTimeRangeType.Slide: + item = dateTime.AddTicks(-P_0.Ticks); + break; + } + if (P_1.HasValue) + { + item = item.AddTicks(-P_1.Value.Ticks); + item2 = item2.AddTicks(-P_1.Value.Ticks); + } + return (from: item, to: item2); + } + + private bool ?(DateTime P_0, DateTime P_1) + { + return P_1.Ticks >= P_0.Ticks; + } + + public string ToShortDateString() + { + return Core.Instance.TimeUtils.GetFormatedDate(From.ToSelectedTimeZone()) + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Core.Instance.TimeUtils.GetFormatedDate(To.ToSelectedTimeZone()); + } + + [NotPublished] + public static bool operator ==(DateTimeRange dateTimeRange1, DateTimeRange dateTimeRange2) + { + return dateTimeRange1.Equals(dateTimeRange2); + } + + [NotPublished] + public static bool operator !=(DateTimeRange dateTimeRange1, DateTimeRange dateTimeRange2) + { + return !dateTimeRange1.Equals(dateTimeRange2); + } + + public int CompareTo(object obj) + { + if (!(obj is DateTimeRange dateTimeRange)) + { + return 0; + } + int num = RangeType.CompareTo(dateTimeRange.RangeType); + if (num != 0) + { + return num; + } + if (RangeType == DateTimeRangeType.Custom) + { + num = From.CompareTo(dateTimeRange.From); + if (num != 0) + { + return num; + } + num = To.CompareTo(dateTimeRange.To); + if (num != 0) + { + return num; + } + } + else + { + num = Period.CompareTo(dateTimeRange.Period); + if (num != 0) + { + return num; + } + } + return 0; + } + + public override bool Equals(object obj) + { + if (!(obj is DateTimeRange dateTimeRange)) + { + return false; + } + bool flag = RangeType == dateTimeRange.RangeType; + if (!flag) + { + return flag; + } + if (RangeType == DateTimeRangeType.Custom) + { + flag = From == dateTimeRange.From; + if (!flag) + { + return flag; + } + flag = To == dateTimeRange.To; + if (!flag) + { + return flag; + } + } + else + { + flag = Period == dateTimeRange.Period; + if (!flag) + { + return flag; + } + flag = EndOffset == dateTimeRange.EndOffset; + if (!flag) + { + return flag; + } + } + return true; + } + + public override int GetHashCode() + { + int hashCode = RangeType.GetHashCode(); + if (RangeType == DateTimeRangeType.Custom) + { + return hashCode ^ (From.GetHashCode() ^ To.GetHashCode()); + } + if (EndOffset.HasValue) + { + return hashCode ^ (Period.GetHashCode() ^ (EndOffset.GetHashCode() * 397)); + } + return hashCode ^ Period.GetHashCode(); + } + } + public enum DateTimeRangeType + { + Slide, + FixedStart, + Custom + } + public class DealTicketLimiter + { + private readonly TimeSpan ??; + + private readonly object ??; + + private bool ??; + + public DealTicketLimiter(TimeSpan delay) + { + ?? = delay; + ?? = new object(); + ?? = true; + } + + public bool AllowDealTicket(TimeSpan? currentDelay = null) + { + lock (??) + { + if (!??) + { + return false; + } + ?? = false; + Task.Delay(currentDelay ?? ??).ContinueWith((Task P_0) => ?? = true); + return true; + } + } + + [CompilerGenerated] + private bool ?(Task P_0) + { + return ?? = true; + } + } + public class EntityLifecycleEventArgs : EventArgs + { + [CompilerGenerated] + private readonly EntityLifecycle ??; + + public EntityLifecycle Lifecycle + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + } + public class FibonacciLevelOptions : ICloneable, IXElementSerialization + { + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private Color ??; + + [CompilerGenerated] + private Font ??; + + [CompilerGenerated] + private ColorStyleWidth ??; + + [CompilerGenerated] + private int[] ??; + + public double Level + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool IsEnabled + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool UseCustom + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Color CaptionFontColor + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Font CaptionFont + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public ColorStyleWidth Line + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int[] screenPoints + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public FibonacciLevelOptions() + { + UseCustom = false; + screenPoints = new int[4]; + } + + public FibonacciLevelOptions(double level) + : this() + { + Level = level; + } + + public virtual FibonacciLevelOptions Clone() + { + return new FibonacciLevelOptions + { + UseCustom = UseCustom, + IsEnabled = IsEnabled, + Line = (Line.Clone() as ColorStyleWidth), + CaptionFontColor = CaptionFontColor, + CaptionFont = CaptionFont, + Level = Level + }; + } + + private object ?() + { + return Clone(); + } + + object ICloneable.Clone() + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(); + } + + public virtual XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Level)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), UseCustom)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsEnabled)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CaptionFontColor.ToArgb())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CaptionFont.FontFamily.Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CaptionFont.Size)); + xElement.Add(Line.ToXElement()); + int[] array = screenPoints; + foreach (int num in array) + { + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), num)); + } + return xElement; + } + + public virtual void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + Level = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToDouble(); + UseCustom = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); + IsEnabled = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); + CaptionFontColor = Color.FromArgb(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt()); + CaptionFont = new Font(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString(), (float)element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToDouble(), GraphicsUnit.Pixel); + Line = new ColorStyleWidth(); + Line.FromXElement(element, deserializationInfo); + List list = new List(); + foreach (XElement item in element.Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + list.Add(item.ToInt()); + } + screenPoints = list.ToArray(); + } + } + public class FormatSettings + { + [CompilerGenerated] + private bool ??; + + public bool DisplayQuantityInLots + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + } + public static class GlobalSettings + { + [CompilerGenerated] + private static bool ??; + + public static bool AbbreviateCryptoPrices + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + } + public abstract class HistoryItemBarCreator + { + protected Period targetPeriod; + + [CompilerGenerated] + private Period ??; + + public Period HistoryPeriod + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + protected HistoryItemBarCreator(Period targetPeriod) + { + this.targetPeriod = targetPeriod; + } + + protected virtual DateTime FindNearestDateTimeFromUnixStartTime(DateTime targetDateTime, long sessionOffset) + { + long num = 621355968000000000L; + long num2 = (targetDateTime.Ticks - (num + sessionOffset)) / targetPeriod.Ticks; + return new DateTime(num + sessionOffset + num2 * targetPeriod.Ticks, targetDateTime.Kind); + } + + public static HistoryItemBarCreator CreateHistoryAggregator(Period targetPeriod) + { + return targetPeriod.BasePeriod switch + { + BasePeriod.Second => new ?(targetPeriod), + BasePeriod.Minute => new ?(targetPeriod), + BasePeriod.Hour => new ?(targetPeriod), + BasePeriod.Day => new ?(targetPeriod), + BasePeriod.Week => new ?(targetPeriod), + BasePeriod.Month => new ?(targetPeriod), + BasePeriod.Year => new ?(targetPeriod), + _ => null, + }; + } + + public abstract void FindBarBorders(DateTime dateTime, long sessionOffset, out long leftBorder, out long rightBorder); + } +} +namespace ? +{ + internal sealed class ? : HistoryItemBarCreator + { + public ?(Period P_0) + : base(P_0) + { + } + + public override void FindBarBorders(DateTime dateTime, long sessionOffset, out long leftBorder, out long rightBorder) + { + DateTime dateTime2 = dateTime; + if (base.HistoryPeriod.BasePeriod == BasePeriod.Day) + { + if (targetPeriod.PeriodMultiplier > 1) + { + long num = dateTime.TimeOfDay.Ticks - 864000000000L; + dateTime2 = dateTime.AddTicks(-num); + dateTime2 = FindNearestDateTimeFromUnixStartTime(dateTime2, sessionOffset).AddTicks(num); + } + } + else if (targetPeriod.PeriodMultiplier > 1) + { + dateTime2 = FindNearestDateTimeFromUnixStartTime(dateTime, sessionOffset); + } + DateTime dateTime3 = dateTime2.AddDays(targetPeriod.PeriodMultiplier); + leftBorder = dateTime2.Ticks; + rightBorder = dateTime3.Ticks - 1; + } + } + internal sealed class ? : HistoryItemBarCreator + { + public ?(Period P_0) + : base(P_0) + { + } + + public override void FindBarBorders(DateTime dateTime, long sessionOffset, out long leftBorder, out long rightBorder) + { + DateTime dateTime2 = ((targetPeriod.PeriodMultiplier == 1 && sessionOffset == 0L) ? new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour, 0, 0, dateTime.Kind) : FindNearestDateTimeFromUnixStartTime(dateTime, sessionOffset)); + DateTime dateTime3 = dateTime2.AddHours(targetPeriod.PeriodMultiplier); + leftBorder = dateTime2.Ticks; + rightBorder = dateTime3.Ticks - 1; + } + } + internal sealed class ? : HistoryItemBarCreator + { + public ?(Period P_0) + : base(P_0) + { + } + + public override void FindBarBorders(DateTime dateTime, long sessionOffset, out long leftBorder, out long rightBorder) + { + DateTime dateTime2 = ((targetPeriod.PeriodMultiplier == 1 && sessionOffset == 0L) ? new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour, dateTime.Minute, 0, dateTime.Kind) : FindNearestDateTimeFromUnixStartTime(dateTime, sessionOffset)); + DateTime dateTime3 = dateTime2.AddMinutes(targetPeriod.PeriodMultiplier); + leftBorder = dateTime2.Ticks; + rightBorder = dateTime3.Ticks - 1; + } + } + internal sealed class ? : HistoryItemBarCreator + { + public ?(Period P_0) + : base(P_0) + { + } + + public override void FindBarBorders(DateTime dateTime, long sessionOffset, out long leftBorder, out long rightBorder) + { + DateTime dateTime3; + if (base.HistoryPeriod.BasePeriod != BasePeriod.Month) + { + DateTime dateTime2 = dateTime.AddHours(12.0); + while (dateTime2.Day > 1) + { + dateTime2 = dateTime2.AddDays(-1.0); + } + dateTime3 = dateTime2.AddHours(-12.0); + } + else + { + long num = (dateTime.Day - 1) * 864000000000L + dateTime.TimeOfDay.Ticks; + DateTime targetDateTime = dateTime.AddTicks(-num); + dateTime3 = FindNearestDateTimeFromUnixStartTime(targetDateTime, sessionOffset).AddTicks(num); + } + DateTime dateTime4 = dateTime3; + dateTime4 = dateTime4.AddMonths(targetPeriod.PeriodMultiplier); + leftBorder = dateTime3.Ticks; + rightBorder = dateTime4.Ticks - 1; + } + + protected override DateTime FindNearestDateTimeFromUnixStartTime(DateTime targetDateTime, long sessionOffset) + { + DateTime dateTime = new DateTime(621355968000000000L, DateTimeKind.Utc); + while (dateTime <= targetDateTime) + { + dateTime = dateTime.AddMonths(targetPeriod.PeriodMultiplier); + } + return dateTime.AddMonths(-targetPeriod.PeriodMultiplier); + } + } + internal sealed class ? : HistoryItemBarCreator + { + public ?(Period P_0) + : base(P_0) + { + } + + public override void FindBarBorders(DateTime dateTime, long sessionOffset, out long leftBorder, out long rightBorder) + { + DateTime dateTime2 = ((targetPeriod.PeriodMultiplier == 1) ? new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour, dateTime.Minute, dateTime.Second, dateTime.Kind) : FindNearestDateTimeFromUnixStartTime(dateTime, sessionOffset)); + DateTime dateTime3 = dateTime2.AddSeconds(targetPeriod.PeriodMultiplier); + leftBorder = dateTime2.Ticks; + rightBorder = dateTime3.Ticks - 1; + } + } + internal sealed class ? : HistoryItemBarCreator + { + public ?(Period P_0) + : base(P_0) + { + } + + public override void FindBarBorders(DateTime dateTime, long sessionOffset, out long leftBorder, out long rightBorder) + { + DateTime dateTime3; + if (base.HistoryPeriod.BasePeriod != BasePeriod.Week) + { + DateTime dateTime2 = dateTime.AddHours(12.0); + while (dateTime2.DayOfWeek != DayOfWeek.Monday) + { + dateTime2 = dateTime2.AddDays(-1.0); + } + dateTime3 = dateTime2.AddHours(-12.0); + } + else + { + dateTime3 = FindNearestDateTimeFromUnixStartTime(dateTime, sessionOffset).AddTicks(dateTime.TimeOfDay.Ticks); + } + DateTime dateTime4 = dateTime3.AddDays(targetPeriod.PeriodMultiplier * 7); + leftBorder = dateTime3.Ticks; + rightBorder = dateTime4.Ticks - 1; + } + + protected override DateTime FindNearestDateTimeFromUnixStartTime(DateTime targetDateTime, long sessionOffset) + { + DateTime dateTime = new DateTime(621355968000000000L, DateTimeKind.Utc); + dateTime = dateTime.AddDays(-((int)(dateTime.DayOfWeek + 6) % 7)); + long num = (targetDateTime.Ticks - (dateTime.Ticks + sessionOffset)) / targetPeriod.Ticks; + return new DateTime(dateTime.Ticks + sessionOffset + num * targetPeriod.Ticks, targetDateTime.Kind); + } + } + internal sealed class ? : HistoryItemBarCreator + { + public ?(Period P_0) + : base(P_0) + { + } + + public override void FindBarBorders(DateTime dateTime, long sessionOffset, out long leftBorder, out long rightBorder) + { + DateTime dateTime2 = dateTime.AddHours(12.0); + while (dateTime2.Month > 1) + { + dateTime2 = dateTime2.AddMonths(-1); + } + while (dateTime2.Day > 1) + { + dateTime2 = dateTime2.AddDays(-1.0); + } + DateTime dateTime3 = dateTime2.AddHours(-12.0); + DateTime dateTime4 = dateTime3; + for (int i = 0; i < targetPeriod.PeriodMultiplier; i++) + { + dateTime4 = dateTime4.AddDays(DateTime.IsLeapYear(dateTime2.Year) ? 366 : 365); + } + leftBorder = dateTime3.Ticks; + rightBorder = dateTime4.Ticks - 1; + } + } +} +namespace TradingPlatform.BusinessLayer.Utils +{ + public static class HistoryStepsCalculator + { + public static List> GetSteps(DateTime from, DateTime to, BasePeriod basePeriod, int multiplier, ISessionsContainer sessionsContainer, TimeZone timezone) + { + List> list = new List>(); + try + { + long sessionOffset = sessionsContainer.GetSessionOffset(timezone, basePeriod == BasePeriod.Week, applyNegativeSignForInDaySession: false); + long num = Period.TicksInBasePeriod(basePeriod) * multiplier; + long num2 = from.Ticks / num * num + sessionOffset; + long num3; + for (num3 = (to.Ticks / num + 1) * num + sessionOffset; num3 < to.Ticks; num3 += num) + { + } + if (num3 > to.Ticks) + { + while (num3 - num > to.Ticks) + { + num3 -= num; + } + } + while (num2 > from.Ticks) + { + num2 -= num; + } + if (num2 < from.Ticks) + { + for (; num2 + num < from.Ticks; num2 += num) + { + } + } + switch (basePeriod) + { + case BasePeriod.Month: + num2 = new DateTime(from.Year, from.Month, 1, 0, 0, 0, DateTimeKind.Utc).AddTicks(sessionOffset).Ticks; + num3 = new DateTime(to.Year, to.Month, 1, 0, 0, 0, DateTimeKind.Utc).AddMonths(1).AddTicks(sessionOffset).Ticks; + break; + case BasePeriod.Year: + num2 = new DateTime(from.Year, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddTicks(sessionOffset).Ticks; + num3 = new DateTime(to.Year, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddYears(1).AddTicks(sessionOffset).Ticks; + break; + } + DateTime date = new DateTime(num2, DateTimeKind.Utc); + while (date.Ticks < num3) + { + Interval item = GetNextStep(date, basePeriod, multiplier); + date = item.To; + if (sessionsContainer != null) + { + TimeSpan timeSpan = SessionsExtensions.?(item.From, sessionsContainer.TimeZone); + if (timeSpan != TimeSpan.Zero) + { + item = new Interval(item.From - timeSpan, item.To - timeSpan); + } + } + list.Add(item); + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + return list; + } + + public static Interval GetNextStep(DateTime date, BasePeriod basePeriod, int multiplier) + { + long value = Period.TicksInBasePeriod(basePeriod) * multiplier; + DateTime dateTime = date; + DateTime to = basePeriod switch + { + BasePeriod.Month => AddMonths(dateTime, multiplier), + BasePeriod.Year => dateTime.AddYears(multiplier), + _ => date.AddTicks(value), + }; + return new Interval(dateTime, to); + } + + /// + /// https://stackoverflow.com/questions/3060381/datetime-addmonths-adding-only-month-not-days + /// ????????: + /// (29 Feb).AddMonth(1) = 29 March + /// + public static DateTime AddMonths(DateTime date, int monthsCount) + { + if (date.Day != DateTime.DaysInMonth(date.Year, date.Month)) + { + return date.AddMonths(monthsCount); + } + return date.AddDays(1.0).AddMonths(monthsCount).AddDays(-1.0); + } + } + public readonly struct Interval : IEquatable> where T : IComparable + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func, bool> ??; + + public static Func, T> ??; + + public static Func, T> ??; + + internal bool ?(Interval P_0) + { + return !P_0.IsEmpty; + } + + internal T ?(Interval P_0) + { + return P_0.Min; + } + + internal T ?(Interval P_0) + { + return P_0.Max; + } + } + + [CompilerGenerated] + private readonly T ??; + + [CompilerGenerated] + private readonly T ??; + + public T From + { + [CompilerGenerated] + get + { + return ??; + } + } + + public T To + { + [CompilerGenerated] + get + { + return ??; + } + } + + public T Min + { + get + { + if (!IsReversal) + { + return From; + } + return To; + } + } + + public T Max + { + get + { + if (!IsReversal) + { + return To; + } + return From; + } + } + + public bool IsReversal => From.CompareTo(To) > 0; + + public bool IsEmpty => From.CompareTo(To) == 0; + + public static Interval Default => new Interval(default(T), default(T)); + + public Interval(T from, T to) + { + ?? = from; + ?? = to; + } + + public Interval Reverse() + { + return new Interval(To, From); + } + + public bool Contains(T value) + { + ref T reference = ref value; + T val = default(T); + if (val == null) + { + val = reference; + reference = ref val; + } + T min = Min; + if (reference.CompareTo(min) < 0) + { + return false; + } + ref T reference2 = ref value; + val = default(T); + if (val == null) + { + val = reference2; + reference2 = ref val; + } + T max = Max; + if (reference2.CompareTo(max) > 0) + { + return false; + } + return true; + } + + public Interval Intersect(Interval other) + { + T val = default(T); + T to = default(T); + if (Contains(other.Min)) + { + val = other.Min; + to = (Contains(other.Max) ? other.Max : Max); + } + else if (Contains(other.Max)) + { + val = Min; + to = other.Max; + } + else if (other.Contains(Min) && other.Contains(Max)) + { + return this; + } + return new Interval(val, to); + } + + public IEnumerable> Subtract(IEnumerable> intervals) + { + if (IsEmpty) + { + yield break; + } + if (!intervals.Any()) + { + yield return this; + yield break; + } + Interval interval = this; + Interval[] array = (from P_0 in intervals.Select(((Interval)interval).Intersect) + where !P_0.IsEmpty + orderby P_0.Min, P_0.Max descending + select P_0).ToArray(); + T val = Min; + Interval[] array2 = array; + T val2; + for (int num = 0; num < array2.Length; num++) + { + Interval interval2 = array2[num]; + if (interval2 == this) + { + yield break; + } + ref T reference = ref val; + val2 = default(T); + if (val2 == null) + { + val2 = reference; + reference = ref val2; + } + T max = Max; + if (reference.CompareTo(max) == 0) + { + yield break; + } + ref T reference2 = ref val; + val2 = default(T); + if (val2 == null) + { + val2 = reference2; + reference2 = ref val2; + } + T max2 = interval2.Max; + if (reference2.CompareTo(max2) > 0) + { + continue; + } + ref T reference3 = ref val; + val2 = default(T); + if (val2 == null) + { + val2 = reference3; + reference3 = ref val2; + } + T min = interval2.Min; + if (reference3.CompareTo(min) >= 0) + { + ref T reference4 = ref val; + val2 = default(T); + if (val2 == null) + { + val2 = reference4; + reference4 = ref val2; + } + T max3 = interval2.Max; + if (reference4.CompareTo(max3) < 0) + { + val = interval2.Max; + continue; + } + } + Interval interval3 = new Interval(val, interval2.Min); + val = interval2.Max; + yield return interval3; + } + ref T reference5 = ref val; + val2 = default(T); + if (val2 == null) + { + val2 = reference5; + reference5 = ref val2; + } + T max4 = Max; + if (reference5.CompareTo(max4) != 0) + { + yield return new Interval(val, Max); + } + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(13, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(From, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(To, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public bool Equals(Interval other) + { + if (EqualityComparer.Default.Equals(From, other.From)) + { + return EqualityComparer.Default.Equals(To, other.To); + } + return false; + } + + public override bool Equals(object obj) + { + if (obj is Interval other) + { + return Equals(other); + } + return false; + } + + public override int GetHashCode() + { + return HashCode.Combine(EqualityComparer.Default.GetHashCode(From), EqualityComparer.Default.GetHashCode(To)); + } + + public static bool operator ==(Interval left, Interval right) + { + return left.Equals(right); + } + + public static bool operator !=(Interval left, Interval right) + { + return !left.Equals(right); + } + } + public class LimitedCollection : ICollection, IEnumerable, IEnumerable + { + public const int DEFAULT_CAPACITY = 100; + + private readonly IList ??; + + [CompilerGenerated] + private readonly int ??; + + public int Capacity + { + [CompilerGenerated] + get + { + return ??; + } + } + + public bool IsFull => Count == Capacity; + + public int Count => ??.Count; + + bool ICollection.IsReadOnly => false; + + public LimitedCollection(int capacity = 100) + { + ?? = new List(capacity); + ?? = capacity; + } + + public void Add(T item) + { + lock (??) + { + if (IsFull) + { + ??.Remove(??[0]); + } + ??.Add(item); + } + } + + public void Clear() + { + ??.Clear(); + } + + public bool Contains(T item) + { + return ??.Contains(item); + } + + public bool Remove(T item) + { + return ??.Remove(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + ??.CopyTo(array, arrayIndex); + } + + public IEnumerator GetEnumerator() + { + lock (??) + { + return new List(??).GetEnumerator(); + } + } + + private IEnumerator ?() + { + return GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(); + } + } + [Serializable] + public class LineOptions : IXElementSerialization, ICloneable, IEquatable + { + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ?? = true; + + [CompilerGenerated] + private bool ?? = true; + + [CompilerGenerated] + private bool ?? = true; + + [CompilerGenerated] + private Font ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private int ?? = 10; + + [CompilerGenerated] + private Color ??; + + [CompilerGenerated] + private LineStyle ??; + + public bool Enabled + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool WithCheckBox + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool WithNumeric + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool WithColor + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Font Font + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int Width + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int MaximumWidth + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Color Color + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public LineStyle LineStyle + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Enabled)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), WithCheckBox)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), WithNumeric)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), WithColor)); + xElement.Add(Font.ToXElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Width)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MaximumWidth)); + xElement.Add(Color.ToXElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)LineStyle)); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + Enabled = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); + WithCheckBox = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); + WithNumeric = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); + WithColor = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); + Font = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToFont(); + Width = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt(); + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + MaximumWidth = xElement.ToInt(); + } + Color = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToColor(); + LineStyle = (LineStyle)element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt(); + } + + public object Clone() + { + LineOptions lineOptions = new LineOptions + { + Color = Color, + Enabled = Enabled, + LineStyle = LineStyle, + Width = Width, + WithCheckBox = WithCheckBox, + WithColor = WithColor, + WithNumeric = WithNumeric, + MaximumWidth = MaximumWidth + }; + if (Font != null) + { + lineOptions.Font = (Font)Font.Clone(); + } + return lineOptions; + } + + public bool Equals(LineOptions other) + { + if (other == null) + { + return false; + } + if (this == other) + { + return true; + } + if (Enabled == other.Enabled && WithCheckBox == other.WithCheckBox && WithNumeric == other.WithNumeric && WithColor == other.WithColor && object.Equals(Font, other.Font) && Width == other.Width && MaximumWidth == other.MaximumWidth && Color.Equals(other.Color)) + { + return LineStyle == other.LineStyle; + } + return false; + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + if (this == obj) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((LineOptions)obj); + } + + public override int GetHashCode() + { + HashCode hashCode = default(HashCode); + hashCode.Add(Enabled); + hashCode.Add(WithCheckBox); + hashCode.Add(WithNumeric); + hashCode.Add(WithColor); + hashCode.Add(Font); + hashCode.Add(Width); + hashCode.Add(MaximumWidth); + hashCode.Add(Color); + hashCode.Add((int)LineStyle); + return hashCode.ToHashCode(); + } + } +} +namespace ? +{ + internal class ? : IEnumerable, IEnumerable + { + private readonly Dictionary ??; + + private readonly List ??; + + private readonly Dictionary ??; + + private readonly Dictionary ??; + + public virtual int Count => ??.Count; + + public virtual ? this[? P_0] + { + get + { + if (P_0 != null && ?? != null && ??.ContainsKey(P_0)) + { + return ??[P_0]; + } + return default(?); + } + set + { + if (!??.ContainsKey(val)) + { + this.?(val, val2); + return; + } + ??[val] = val2; + ??[??[val]] = val2; + } + } + + public virtual ICollection Keys => ??.Keys; + + public virtual ICollection Values => ??.Values; + + public ?() + { + ?? = new Dictionary(); + ?? = new List(); + ?? = new Dictionary(); + ?? = new Dictionary(); + } + + public static ? ?() + { + return new ?(); + } + + private void ?(int P_0) + { + while (P_0 <= ??.Count) + { + ? val = ??[P_0]; + ??[P_0 - 1] = val; + ??[val] = P_0 - 1; + P_0++; + } + ??.Remove(P_0 - 1); + } + + private int ?(? P_0, ? P_1) + { + ??.Add(P_0, P_1); + ??.Add(P_1); + int num = ??.Count - 1; + ??.Add(P_0, num); + ??.Add(num, P_0); + return num; + } + + private void ?(int P_0) + { + ??.RemoveAt(P_0); + ? key = ??[P_0]; + ??.Remove(key); + ??.Remove(key); + ??.Remove(P_0); + ?(P_0 + 1); + } + + public virtual ? ?(int P_0) + { + return ??[P_0]; + } + + public virtual ?[] ?() + { + ?[] array = new ?[??.Count]; + int num = 0; + foreach (? value in ??.Values) + { + array[num++] = value; + } + return array; + } + + public virtual int ?(? P_0, ? P_1) + { + return this.?(P_0, P_1); + } + + public virtual void ?(? P_0) + { + if (??.ContainsKey(P_0)) + { + ??.Remove(P_0); + int num = ??[P_0]; + ??.RemoveAt(num); + ??.Remove(P_0); + ??.Remove(num); + ?(num + 1); + } + } + + public virtual void ?(int P_0) + { + ?(P_0); + } + + public virtual void ?(int P_0, int P_1) + { + ??.RemoveRange(P_0, P_1); + for (int i = P_0; i < P_0 + P_1; i++) + { + ? key = ??[i]; + ??.Remove(key); + ??.Remove(key); + ??.Remove(i); + } + while (P_0 < ??.Count) + { + ? val = ??[P_0 + P_1]; + if (val != null) + { + ??[P_0] = val; + ??[val] = P_0; + } + P_0++; + } + for (int j = ??.Count; j < ??.Count + P_1; j++) + { + ??.Remove(j); + } + } + + public virtual void ?(? P_0) + { + ?(??.IndexOf(P_0)); + } + + public virtual ? ?(int P_0) + { + return ??[P_0]; + } + + public virtual void ?() + { + ??.Clear(); + ??.Clear(); + ??.Clear(); + ??.Clear(); + } + + public virtual bool ?(? P_0) + { + return ??.ContainsKey(P_0); + } + + public virtual bool ?(? P_0) + { + return ??.ContainsValue(P_0); + } + + public virtual IEnumerator GetEnumerator() + { + return ??.GetEnumerator(); + } + + private IEnumerator ?() + { + return GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(); + } + + public virtual bool ?(? P_0, out ? P_1) + { + return ??.TryGetValue(P_0, out P_1); + } + } + internal class ? : ? + { + private readonly object ??; + + public override int Count + { + get + { + lock (??) + { + return base.Count; + } + } + } + + public override ? this[? P_0] + { + get + { + lock (??) + { + return base[P_0]; + } + } + set + { + lock (??) + { + base[val] = val2; + } + } + } + + public override ICollection Keys + { + get + { + lock (??) + { + return base.Keys; + } + } + } + + public override ICollection Values + { + get + { + lock (??) + { + return base.Values; + } + } + } + + public ?() + { + ?? = new object(); + } + + public override ? ?(int P_0) + { + lock (??) + { + return base.?(P_0); + } + } + + public override ?[] ?() + { + lock (??) + { + return base.?(); + } + } + + public override int ?(? P_0, ? P_1) + { + lock (??) + { + return base.?(P_0, P_1); + } + } + + public override void ?(? P_0) + { + lock (??) + { + base.?(P_0); + } + } + + public override void ?(int P_0) + { + lock (??) + { + base.?(P_0); + } + } + + public override void ?(int P_0, int P_1) + { + lock (??) + { + base.?(P_0, P_1); + } + } + + public override void ?(? P_0) + { + lock (??) + { + base.?(P_0); + } + } + + public override ? ?(int P_0) + { + lock (??) + { + return base.?(P_0); + } + } + + public override void ?() + { + lock (??) + { + base.?(); + } + } + + public override bool ?(? P_0) + { + lock (??) + { + return base.?(P_0); + } + } + + public override bool ?(? P_0) + { + lock (??) + { + return base.?(P_0); + } + } + + public override IEnumerator GetEnumerator() + { + lock (??) + { + return base.GetEnumerator(); + } + } + + public override bool ?(? P_0, out ? P_1) + { + lock (??) + { + return base.?(P_0, out P_1); + } + } + } +} +namespace TradingPlatform.BusinessLayer.Utils +{ + public class Map : IEnumerable>, IEnumerable + { + private readonly Dictionary ??; + + private readonly Dictionary ??; + + public Map() + { + ?? = new Dictionary(); + ?? = new Dictionary(); + } + + public void Add(T1 item1, T2 item2) + { + ??.Add(item1, item2); + ??.Add(item2, item1); + } + + public void Remove(T1 item1, T2 item2) + { + ??.Remove(item1); + ??.Remove(item2); + } + + public void Clear() + { + ??.Clear(); + ??.Clear(); + } + + public bool TryGetDirect(T1 key, out T2 value) + { + return ??.TryGetValue(key, out value); + } + + public bool TryGetReverse(T2 key, out T1 value) + { + return ??.TryGetValue(key, out value); + } + + public bool ContainsDirect(T1 key) + { + return ??.ContainsKey(key); + } + + public bool ContainsReverse(T2 key) + { + return ??.ContainsKey(key); + } + + public IEnumerator> GetEnumerator() + { + return ??.GetEnumerator(); + } + + private IEnumerator ?() + { + return ((IEnumerable)??).GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(); + } + } + public class MinotauroFibonacciLevelOptions : FibonacciLevelOptions + { + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private Color ??; + + [CompilerGenerated] + private Color ??; + + [CompilerGenerated] + private string ??; + + public bool ShowExtension + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool ShowExtensionLine + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool ShowBaseLevel + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string BaseLevelText + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double ExtensionLevel + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Color ExtensionBackColor + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Color ExtensionBorderColor + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string ExtensionLabel + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public MinotauroFibonacciLevelOptions(double level) + : base(level) + { + ShowBaseLevel = true; + ShowExtensionLine = true; + } + + public MinotauroFibonacciLevelOptions() + { + ShowExtensionLine = true; + } + + public override FibonacciLevelOptions Clone() + { + return new MinotauroFibonacciLevelOptions + { + UseCustom = base.UseCustom, + Line = base.Line, + CaptionFontColor = base.CaptionFontColor, + CaptionFont = base.CaptionFont, + Level = base.Level, + ShowExtension = ShowExtension, + ShowExtensionLine = ShowExtensionLine, + ShowBaseLevel = ShowBaseLevel, + ExtensionLevel = ExtensionLevel, + ExtensionBackColor = ExtensionBackColor, + ExtensionBorderColor = ExtensionBorderColor, + ExtensionLabel = ExtensionLabel, + BaseLevelText = BaseLevelText + }; + } + + public override XElement ToXElement() + { + XElement xElement = base.ToXElement(); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ShowExtension)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ShowExtensionLine)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ShowBaseLevel)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExtensionLevel)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExtensionBackColor.ToArgb())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExtensionBorderColor.ToArgb())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExtensionLabel)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), BaseLevelText)); + return xElement; + } + + public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + base.FromXElement(element, deserializationInfo); + ShowExtension = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); + ShowExtensionLine = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); + ShowBaseLevel = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); + ExtensionLevel = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToDouble(); + ExtensionBackColor = Color.FromArgb(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt()); + ExtensionBorderColor = Color.FromArgb(element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt()); + ExtensionLabel = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString(); + BaseLevelText = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString(); + } + } + public class DotNetNaturalSortComparer : IComparer + { + private readonly StringComparison ??; + + private readonly IComparer ??; + + private const byte ?? = 0; + + private const byte ?? = 1; + + private const byte ?? = 2; + + private const byte ?? = 3; + + public DotNetNaturalSortComparer(StringComparison stringComparison) + { + ?? = stringComparison; + } + + public DotNetNaturalSortComparer(IComparer stringComparer) + { + ?? = stringComparer; + } + + public int Compare(string str1, string str2) + { + if (str1 == str2) + { + return 0; + } + if (str1 == null) + { + return -1; + } + if (str2 == null) + { + return 1; + } + int length = str1.Length; + int length2 = str2.Length; + int num = 0; + int num2 = 0; + int num12; + while (true) + { + int i = num; + byte b = 0; + for (; i < length; i++) + { + byte b2 = ?(str1[i]); + if (b == 0) + { + b = b2; + } + else if (b != b2) + { + break; + } + } + int j = num2; + byte b3 = 0; + for (; j < length2; j++) + { + byte b4 = ?(str2[j]); + if (b3 == 0) + { + b3 = b4; + } + else if (b3 != b4) + { + break; + } + } + int num3 = b.CompareTo(b3); + if (num3 != 0) + { + return num3; + } + if (b == 0) + { + return 0; + } + int num4 = i - num; + int num5 = j - num2; + if (b == 2) + { + int num6 = Math.Max(num4, num5); + int num7 = num6 - num4; + int num8 = num6 - num5; + for (int k = 0; k < num6; k++) + { + char c = ((k < num7) ? '0' : str1[num + k - num7]); + char value = ((k < num8) ? '0' : str2[num2 + k - num8]); + int num9 = c.CompareTo(value); + if (num9 != 0) + { + return num9; + } + } + int num10 = num7.CompareTo(num8); + if (num10 != 0) + { + return num10; + } + } + else if (?? != null) + { + string x = str1.Substring(num, num4); + string y = str2.Substring(num2, num5); + int num11 = ??.Compare(x, y); + if (num11 != 0) + { + return num11; + } + } + else + { + int length3 = Math.Min(num4, num5); + num12 = string.Compare(str1, num, str2, num2, length3, ??); + if (num12 == 0) + { + num12 = num4 - num5; + } + if (num12 != 0) + { + break; + } + } + num = i; + num2 = j; + } + return num12; + } + + private static byte ?(char P_0) + { + if (P_0 < 'a') + { + if (P_0 < 'A') + { + if (P_0 < '0' || P_0 > '9') + { + return 1; + } + return 2; + } + if (P_0 > 'Z') + { + return 1; + } + return 3; + } + if (P_0 > 'z') + { + if (P_0 >= '\u0080') + { + if (!char.IsLetter(P_0)) + { + return 1; + } + return 3; + } + return 1; + } + return 3; + } + } + public class PerformedRequestEventArgs : RequestEventArgs + { + [CompilerGenerated] + private readonly object ??; + + public object RequestResult + { + [CompilerGenerated] + get + { + return ??; + } + } + + public PerformedRequestEventArgs(RequestParameters requestParameters, object requestResult) + : base(requestParameters) + { + ?? = requestResult; + } + } + public class PnlAlertsContainer + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal PnlAlertItem ?(PnlAlertItem P_0) + { + return new PnlAlertItem(P_0); + } + } + + [CompilerGenerated] + private PnlAlertItem[] ??; + + public Action OnAlertEnabilityChanged; + + public PnlAlertItem[] PnlAlerts + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public PnlAlertsContainer() + { + PnlAlerts = new PnlAlertItem[0]; + } + + public PnlAlertsContainer Clone() + { + PnlAlertsContainer pnlAlertsContainer = new PnlAlertsContainer(); + if (PnlAlerts.Length != 0) + { + pnlAlertsContainer.PnlAlerts = PnlAlerts.Select((PnlAlertItem P_0) => new PnlAlertItem(P_0)).ToArray(); + } + return pnlAlertsContainer; + } + } + public class PnlAlertItem : ITriggerItem, IEquatable + { + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private Symbol ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private int ??; + + public bool IsChecked + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Symbol Symbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double TargetValue + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double Increment + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int Precision + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public PnlAlertItem() + { + IsChecked = false; + TargetValue = 1.0; + Increment = 1.0; + Precision = 1; + } + + public PnlAlertItem(PnlAlertItem source) + { + IsChecked = source.IsChecked; + Symbol = source.Symbol; + TargetValue = source.TargetValue; + Increment = source.Increment; + Precision = source.Precision; + } + + public bool Equals(PnlAlertItem other) + { + if (other == null) + { + return false; + } + if (other == this) + { + return true; + } + if (Symbol.Equals(other.Symbol)) + { + return TargetValue.Equals(other.TargetValue); + } + return false; + } + } + public class TimeInTradeContainer + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal TimeInTradeItem ?(TimeInTradeItem P_0) + { + return new TimeInTradeItem(P_0); + } + } + + [CompilerGenerated] + private TimeInTradeItem[] ??; + + public Action OnItemEnabilityChanged; + + public TimeInTradeItem[] TimeInTradeItems + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public TimeInTradeContainer() + { + TimeInTradeItems = new TimeInTradeItem[0]; + } + + public TimeInTradeContainer Clone() + { + TimeInTradeContainer timeInTradeContainer = new TimeInTradeContainer(); + if (TimeInTradeItems.Length != 0) + { + timeInTradeContainer.TimeInTradeItems = TimeInTradeItems.Select((TimeInTradeItem P_0) => new TimeInTradeItem(P_0)).ToArray(); + } + return timeInTradeContainer; + } + } + public class TimeInTradeItem : ITriggerItem, IEquatable + { + private bool ??; + + [CompilerGenerated] + private Symbol ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private TimeInTradePlDirection ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private bool ??; + + public bool IsChecked + { + get + { + return ??; + } + set + { + NeedTimeResetToNow = value; + ?? = value; + } + } + + public Symbol Symbol + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int TimeInSeconds + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public TimeInTradePlDirection PLDirection + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DateTime ActivatedTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + public bool NeedTimeResetToNow + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public TimeInTradeItem() + { + } + + public TimeInTradeItem(TimeInTradeItem source) + : this() + { + IsChecked = source.IsChecked; + Symbol = source.Symbol; + TimeInSeconds = source.TimeInSeconds; + PLDirection = source.PLDirection; + ActivatedTime = source.ActivatedTime; + } + + public bool Equals(TimeInTradeItem other) + { + if (other == null) + { + return false; + } + if (other == this) + { + return true; + } + if (IsChecked == other.IsChecked && Symbol.Equals(other.Symbol) && TimeInSeconds.Equals(other.TimeInSeconds)) + { + return PLDirection.Equals(other.PLDirection); + } + return false; + } + + public override bool Equals(object obj) + { + return Equals(obj as TimeInTradeItem); + } + + public void ResetTriggerTime(bool toNow = false) + { + ActivatedTime = (toNow ? Core.Instance.TimeUtils.DateTimeUtcNow : default(DateTime)); + NeedTimeResetToNow = false; + } + } + public interface ITriggerItem + { + bool IsChecked { get; } + + Symbol Symbol { get; } + } + public enum TimeInTradePlDirection + { + [EnumMember(Value = "Any")] + Any, + [EnumMember(Value = "Positive")] + Positive, + [EnumMember(Value = "Negative")] + Negative + } + public class RequestEventArgs : EventArgs + { + [CompilerGenerated] + private readonly RequestParameters ??; + + public RequestParameters RequestParameters + { + [CompilerGenerated] + get + { + return ??; + } + } + + public RequestEventArgs(RequestParameters requestParameters) + { + ?? = requestParameters; + } + } + public class Rss : List, ICloneable, IXElementSerialization + { + public object Clone() + { + Rss rss = new Rss(); + using Enumerator enumerator = GetEnumerator(); + while (enumerator.MoveNext()) + { + RssItem current = enumerator.Current; + rss.Add(current.Clone() as RssItem); + } + return rss; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement == null) + { + if (element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + Add(new RssItem + { + Name = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + Url = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }); + Add(new RssItem + { + Name = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + Url = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }); + Add(new RssItem + { + Name = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + Url = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }); + } + return; + } + foreach (XElement item in xElement?.Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + Add(new RssItem + { + Active = item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(), + Name = item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value, + Url = item.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value + }); + } + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + using Enumerator enumerator = GetEnumerator(); + while (enumerator.MoveNext()) + { + RssItem current = enumerator.Current; + XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(xElement2); + xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), current.Active)); + xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), current.Name)); + xElement2.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), current.Url)); + } + return xElement; + } + } + [DataContract(Name = "RssItem", Namespace = "TradingPlatform")] + public class RssItem : ICloneable + { + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private string ??; + + private string ??; + + [CompilerGenerated] + private bool ??; + + [DataMember(Name = "Active")] + public bool Active + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Name")] + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Url")] + public string Url + { + get + { + return ??; + } + set + { + if (!(?? == value)) + { + ?? = value; + Subscribed = false; + } + } + } + + public bool Subscribed + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public object Clone() + { + return new RssItem + { + Active = Active, + Name = Name, + Url = Url, + Subscribed = Subscribed + }; + } + } + public class SubscriptionsCache : IDisposable + { + private class ? : IDisposable + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func, bool> ??; + + public static Func, string> ??; + + internal bool ?(KeyValuePair P_0) + { + return P_0.Value > 0; + } + + internal string ?(KeyValuePair P_0) + { + return P_0.Key; + } + } + + private readonly IDictionary ??; + + private readonly object ??; + + public ?() + { + ?? = new Dictionary(); + ?? = new object(); + } + + public bool ?(string P_0) + { + lock (??) + { + ?(P_0); + ??[P_0]++; + return ??[P_0] == 1; + } + } + + public bool ?(string P_0) + { + lock (??) + { + ?(P_0); + ??[P_0] = Math.Max(0, ??[P_0] - 1); + return ??[P_0] == 0; + } + } + + public bool ?(string P_0) + { + lock (??) + { + if (!??.ContainsKey(P_0)) + { + return false; + } + return ??[P_0] > 0; + } + } + + public string[] ?() + { + lock (??) + { + return (from P_0 in ?? + where P_0.Value > 0 + select P_0.Key).ToArray(); + } + } + + private void ?(string P_0) + { + if (!??.ContainsKey(P_0)) + { + ??[P_0] = 0; + } + } + + public void Dispose() + { + lock (??) + { + ??.Clear(); + } + } + } + + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func> ??; + + internal IEnumerable ?(? P_0) + { + return P_0.?(); + } + } + + [CompilerGenerated] + private sealed class ? + { + public string ??; + + internal bool ?(? P_0) + { + return P_0.?(??); + } + } + + private readonly IDictionary ??; + + public SubscriptionsCache() + { + ?? = new Dictionary(); + foreach (SubscribeQuoteType value in Enum.GetValues(typeof(SubscribeQuoteType))) + { + ??[value] = new ?(); + } + } + + public bool AddSubscription(SubscribeQuoteType subscribeQuoteType, string symbolId) + { + return ??[subscribeQuoteType].?(symbolId); + } + + public bool RemoveSubscription(SubscribeQuoteType subscribeQuoteType, string symbolId) + { + return ??[subscribeQuoteType].?(symbolId); + } + + public bool IsSubscribed(SubscribeQuoteType subscribeQuoteType, string symbolId) + { + return ??[subscribeQuoteType].?(symbolId); + } + + public bool HasAnySubscription(string symbolId) + { + return ??.Values.Any((? P_0) => P_0.?(symbolId)); + } + + public string[] FindSubscribedSymbols(SubscribeQuoteType subscribeQuoteType) + { + return ??[subscribeQuoteType].?(); + } + + public string[] FindAllSubscribedSymbols() + { + return ??.Values.SelectMany((? P_0) => P_0.?()).Distinct().ToArray(); + } + + public void Dispose() + { + foreach (? value in ??.Values) + { + value.Dispose(); + } + } + } + public enum TableBaseType + { + Numeric, + String, + Date + } + public enum TableConditionType + { + [Description("=")] + Equal, + [Description("!=")] + NonEqual, + [Description("Contains")] + Present, + [Description("Not contains")] + NotPresent, + [Description(">")] + More, + [Description(">=")] + MoreEqual, + [Description("<")] + Less, + [Description("<=")] + LessEqual, + [Description("Cross")] + Cross, + [Description("Cross Above")] + CrossAbove, + [Description("Cross Below")] + CrossBelow + } + public class UpdatableDataSource + { + private T ??; + + private DateTime ??; + + private readonly Func ??; + + private readonly TimeSpan ??; + + private readonly object ??; + + public UpdatableDataSource(Func updateFunc, TimeSpan expirationPeriod) + { + ?? = updateFunc; + ?? = expirationPeriod; + ?? = new object(); + } + + public bool TryGetData(out T value, CancellationToken cancellation) + { + ?(cancellation); + return TryGetData(out value); + } + + public bool TryGetData(out T value) + { + value = ??; + return !EqualityComparer.Default.Equals(value, default(T)); + } + + private void ?(CancellationToken P_0) + { + if (?? == null) + { + return; + } + lock (??) + { + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + if (dateTimeUtcNow - ?? < ??) + { + return; + } + try + { + ?? = ??(P_0); + } + catch + { + } + finally + { + ?? = dateTimeUtcNow; + } + } + } + } + public class VolumeAnalysisParameters + { + [CompilerGenerated] + private VolumeAnalysisPluginType ??; + + [CompilerGenerated] + private object ??; + + [CompilerGenerated] + private object ??; + + [CompilerGenerated] + private SymbolVolumeType ??; + + public Action RefreshChart; + + [CompilerGenerated] + private ISessionsContainer ??; + + [CompilerGenerated] + private TimeZone ??; + + public VolumeAnalysisPluginType Type + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public object Parameter + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public object Chart + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SymbolVolumeType SymbolVolumeType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public ISessionsContainer SessionsContainer + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public TimeZone CurrentTimezone + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + } + public enum VolumeAnalysisPluginType + { + Cluster, + TimeStatistics, + TimeHistogram, + LeftProfile, + RightProfile, + StepProfile, + PowerTrades, + VWAP, + VIPAnalysis + } +} +namespace TradingPlatform.BusinessLayer.Utils.UserTradesLocalStorage +{ + public class UsersTradesStorage : DataStorage + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func, bool> ??; + + public static Func ??; + + public static Func ??; + + internal bool ?(Interval P_0) + { + return !P_0.IsEmpty; + } + + internal string ?(MessageTrade P_0) + { + return P_0.TradeId; + } + + internal MessageTrade ?(MessageTrade P_0) + { + return P_0; + } + } + + [CompilerGenerated] + private sealed class ? + { + public UsersTradesStorage ??; + + public UserTradesInterval ??; + + internal void ?() + { + ??.??.Save(??); + } + } + + [CompilerGenerated] + private sealed class ? + { + public Interval ??; + + internal Interval ?(Interval P_0) + { + return P_0.Intersect(??); + } + } + + [CompilerGenerated] + private sealed class ? + { + public Trade ??; + + public UsersTradesStorage ??; + + internal void ?() + { + DateTime dateTime = ??.DateTime.AddTicks(1L); + if (??.DateTime <= ??.??) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(74, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(??.Id); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(??.DateTime.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo.InvariantCulture)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(??.??.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo.InvariantCulture)); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); + Interval interval = new Interval(??.DateTime.AddTicks(-1L), ??.DateTime.AddTicks(1L)); + UserTradesInterval userTradesInterval = ??.??.Load(interval); + Dictionary dictionary = userTradesInterval.Trades.ToDictionary(UsersTradesStorage.?.??.?, UsersTradesStorage.?.??.?); + MessageTrade messageTrade = ??.BuildMessage(); + dictionary[messageTrade.TradeId] = messageTrade; + LoggerManager loggers2 = Core.Instance.Loggers; + defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(72, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(userTradesInterval.Trades.Count()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(dictionary.Count); + loggers2.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); + ??.??.Save(new UserTradesInterval + { + Trades = dictionary.Values, + Interval = interval + }); + } + else + { + ??.??.Save(new UserTradesInterval + { + Trades = new MessageTrade[1] { ??.BuildMessage() }, + Interval = new Interval(??.??, dateTime) + }); + ??.?? = dateTime; + } + } + } + + private static readonly Type ??; + + private readonly IUserTradesLocalStorage ??; + + private readonly string ??; + + private DateTime ??; + + public bool IsRealtimeCollectingAllowed => !string.IsNullOrEmpty(??); + + static UsersTradesStorage() + { + try + { + ?? = AssemblyLoader.LoadTypes(Path.Combine(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), typeof(IUserTradesLocalStorage), null, SearchOption.AllDirectories)?.FirstOrDefault(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + public UsersTradesStorage(IUserTradesLocalStorage storage, string localFilePath, string connectionId) + : base(storage, localFilePath) + { + ?? = storage; + ?? = connectionId; + ?? = Core.Instance.TimeUtils.DateTimeUtcNow; + if (IsRealtimeCollectingAllowed) + { + Core.Instance.TradeAdded += ?; + } + } + + public override void Dispose() + { + Core.Instance.TradeAdded -= ?; + base.Dispose(); + } + + public static UsersTradesStorage Create(string connectionString, string connectionId) + { + if (?? == null) + { + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + IUserTradesLocalStorage obj = Activator.CreateInstance(??) as IUserTradesLocalStorage; + if (obj == null) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(30, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(??); + throw new InvalidOperationException(defaultInterpolatedStringHandler.ToStringAndClear()); + } + string directoryName = Path.GetDirectoryName(connectionString); + if (!Directory.Exists(directoryName)) + { + Directory.CreateDirectory(directoryName); + } + return new UsersTradesStorage(obj, connectionString, connectionId); + } + + public void Save(UserTradesInterval historyInterval) + { + CheckDisposed(); + PushAction(delegate + { + ??.Save(historyInterval); + }); + } + + public IList Load(Interval requestParameters, out List> historyParametersForServerRequest) + { + CheckDisposed(); + List list = new List(); + historyParametersForServerRequest = new List>(); + UsersTradesStorageInfo info = ??.GetInfo(); + if (!info.StoredIntervals.Any()) + { + historyParametersForServerRequest.Add(requestParameters); + return list; + } + Interval ?? = requestParameters; + Interval[] collection = ??.Subtract(info.StoredIntervals).ToArray(); + historyParametersForServerRequest.AddRange(collection); + Interval[] array = (from P_0 in info.StoredIntervals + select P_0.Intersect(??) into P_0 + where !P_0.IsEmpty + select P_0).ToArray(); + foreach (Interval interval in array) + { + UserTradesInterval item = ??.Load(interval); + list.Add(item); + } + return list; + } + + private void ?(Trade P_0) + { + if (P_0.ConnectionId != ??) + { + return; + } + PushAction(delegate + { + DateTime to = P_0.DateTime.AddTicks(1L); + if (P_0.DateTime <= ??) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(74, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.Id); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.DateTime.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo.InvariantCulture)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(??.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo.InvariantCulture)); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); + Interval interval = new Interval(P_0.DateTime.AddTicks(-1L), P_0.DateTime.AddTicks(1L)); + UserTradesInterval userTradesInterval = ??.Load(interval); + Dictionary dictionary = userTradesInterval.Trades.ToDictionary(UsersTradesStorage.?.??.?, UsersTradesStorage.?.??.?); + MessageTrade messageTrade = P_0.BuildMessage(); + dictionary[messageTrade.TradeId] = messageTrade; + LoggerManager loggers2 = Core.Instance.Loggers; + defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(72, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(userTradesInterval.Trades.Count()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(dictionary.Count); + loggers2.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); + ??.Save(new UserTradesInterval + { + Trades = dictionary.Values, + Interval = interval + }); + } + else + { + ??.Save(new UserTradesInterval + { + Trades = new MessageTrade[1] { P_0.BuildMessage() }, + Interval = new Interval(??, to) + }); + ?? = to; + } + }); + } + } + public class UsersTradesStorageInfo + { + [CompilerGenerated] + private List> ??; + + public List> StoredIntervals + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public UsersTradesStorageInfo() + { + StoredIntervals = new List>(); + } + } +} +namespace TradingPlatform.BusinessLayer.Utils.UpdatesProvider +{ + public class DifferenceObserver + { + [CompilerGenerated] + private ApplyDifferencePredicate ??; + + private readonly IDictionary> ??; + + public ApplyDifferencePredicate ApplyDifferencePredicate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DifferenceObserver() + { + ?? = new Dictionary>(); + } + + public void RegisterType(Type type, params string[] propertyNamesToObserve) + { + List list = new List(); + ??[type] = list; + PropertyInfo[] properties = type.GetProperties(); + foreach (PropertyInfo propertyInfo in properties) + { + if (propertyInfo.CanRead && propertyInfo.CanWrite && (propertyNamesToObserve.Length == 0 || propertyNamesToObserve.Contains(propertyInfo.Name))) + { + list.Add(propertyInfo); + } + } + } + + public IEnumerable GetDifference(T entity1, T entity2, bool updateEntity1 = false) + { + Type typeFromHandle = typeof(T); + if (!??.TryGetValue(typeFromHandle, out var value)) + { + yield break; + } + foreach (PropertyInfo item in value) + { + object? value2 = item.GetValue(entity1); + object value3 = item.GetValue(entity2); + if (!object.Equals(value2, value3)) + { + if (updateEntity1 && (ApplyDifferencePredicate?.Invoke(item.Name, value3) ?? true)) + { + item.SetValue(entity1, value3); + } + yield return item.Name; + } + } + } + + public void UpdateEntity(T entity1, T entity2) + { + Type typeFromHandle = typeof(T); + if (!??.TryGetValue(typeFromHandle, out var value)) + { + return; + } + foreach (PropertyInfo item in value) + { + object? value2 = item.GetValue(entity1); + object value3 = item.GetValue(entity2); + if (!object.Equals(value2, value3)) + { + ApplyDifferencePredicate applyDifferencePredicate = ApplyDifferencePredicate; + if (applyDifferencePredicate == null || applyDifferencePredicate(item.Name, value3)) + { + item.SetValue(entity1, value3); + } + } + } + } + } + public delegate bool ApplyDifferencePredicate(string propertyName, object propertyValue); + public class UpdatesProvider + { + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + private IDictionary ??; + + private readonly object ??; + + private readonly DifferenceObserver ??; + + [CompilerGenerated] + private bool ??; + + public TValue[] Items + { + get + { + lock (??) + { + return ??.Values.ToArray(); + } + } + } + + public bool UpdateItem + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public ApplyDifferencePredicate ApplyDifferencePredicate + { + get + { + return ??.ApplyDifferencePredicate; + } + set + { + ??.ApplyDifferencePredicate = value; + } + } + + public event Action ItemAdded + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public event Action ItemUpdated + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public event Action ItemRemoved + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public UpdatesProvider(IDictionary items, params string[] propertyNamesToObserve) + { + ?? = new Dictionary(items); + ?? = new object(); + ?? = new DifferenceObserver(); + ??.RegisterType(typeof(TValue), propertyNamesToObserve); + UpdateItem = true; + } + + public void ProcessItems(IDictionary newCache) + { + newCache = new Dictionary(newCache); + lock (??) + { + IEnumerable enumerable = newCache.Keys.Except(??.Keys); + IEnumerable enumerable2 = ??.Keys.Except(newCache.Keys); + IEnumerable enumerable3 = ??.Keys.Intersect(newCache.Keys); + foreach (TKey item in enumerable) + { + ?(newCache[item]); + } + foreach (TKey item2 in enumerable2) + { + ?(??[item2]); + } + foreach (TKey item3 in enumerable3) + { + TValue entity = ??[item3]; + TValue val = newCache[item3]; + if (??.GetDifference(entity, val, UpdateItem).ToArray().Any()) + { + ?(val); + } + } + ?? = newCache; + } + } + + public void ProcessNewItem(TKey key, TValue newItem) + { + Action action = null; + lock (??) + { + if (??.TryGetValue(key, out var value)) + { + if (!??.GetDifference(value, newItem, UpdateItem).Any()) + { + return; + } + action = ?; + } + else + { + action = ?; + } + ??[key] = newItem; + } + action(newItem); + } + + public void RemoveItem(TKey key, TValue item) + { + lock (??) + { + if (!??.ContainsKey(key)) + { + return; + } + ??.Remove(key); + } + ?(item); + } + + public bool TryGetValue(TKey key, out TValue value) + { + lock (??) + { + return ??.TryGetValue(key, out value); + } + } + + private void ?(TValue P_0) + { + try + { + ???.Invoke(P_0); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + private void ?(TValue P_0) + { + try + { + ???.Invoke(P_0); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + private void ?(TValue P_0) + { + try + { + ???.Invoke(P_0); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + } +} +namespace TradingPlatform.BusinessLayer.Utils.TradingProtection +{ + public class TradingProtector : ICustomizable + { + [CompilerGenerated] + private bool ??; + + private Period ??; + + private int ??; + + private readonly ConcurrentQueue ??; + + private TimeSpan ??; + + public bool Enabled + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Period Period + { + get + { + return ??; + } + set + { + ?? = value; + ?? = ??.Duration; + } + } + + public int Limit + { + get + { + return ??; + } + set + { + ?? = Math.Max(0, value); + } + } + + public IList Settings + { + get + { + SettingItemRelationVisibility relation = new SettingItemRelationVisibility(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), true); + List list = new List(); + list.Add(new SettingItemBooleanSwitcher(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Enabled) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + SortIndex = 5 + }); + list.Add(new SettingItemPeriod(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Period) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + SortIndex = 10, + ExcludedPeriods = new BasePeriod[1], + Relation = relation + }); + list.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Limit) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + Minimum = 0, + SortIndex = 20, + Relation = relation + }); + return list; + } + set + { + Period = value.GetValueOrDefault(Period, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + Limit = value.GetValueOrDefault(Limit, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + Enabled = value.GetValueOrDefault(Enabled, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + Period = value.GetValueOrDefault(Period, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + Limit = value.GetValueOrDefault(Limit, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + internal TradingProtector() + { + Enabled = true; + Period = Period.SECOND1; + Limit = 10; + ?? = new ConcurrentQueue(); + } + + public bool IsOperationAllowed() + { + if (!Enabled) + { + return true; + } + bool num = ??.Count < Limit; + if (num) + { + ??.Enqueue(Core.Instance.TimeUtils.DateTimeUtcNow); + } + return num; + } + + internal void ?() + { + if (Enabled && ??.Ticks > 0) + { + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + DateTime result; + while (??.TryPeek(out result) && dateTimeUtcNow - result > ??) + { + ??.TryDequeue(out var _); + } + } + } + } +} +namespace TradingPlatform.BusinessLayer.Utils.TaskSchedulers +{ + public class DegreeOfParallelismTaskScheduler : TaskScheduler, IDisposable + { + [CompilerGenerated] + private readonly int ??; + + private List ??; + + private readonly object ??; + + private int ??; + + public sealed override int MaximumConcurrencyLevel + { + [CompilerGenerated] + get + { + return ??; + } + } + + public DegreeOfParallelismTaskScheduler(int maxDegreeOfParallelism) + { + if (maxDegreeOfParallelism < 1) + { + throw new ArgumentOutOfRangeException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ?? = maxDegreeOfParallelism; + ?? = new List(); + ?? = new object(); + ?? = 0; + } + + protected sealed override void QueueTask(Task task) + { + lock (??) + { + if (?? == null) + { + return; + } + ??.Add(task); + if (?? >= MaximumConcurrencyLevel) + { + return; + } + ??++; + } + ThreadPool.UnsafeQueueUserWorkItem(delegate + { + try + { + Task task2; + while (?(out task2)) + { + try + { + if (task2 != null) + { + TryExecuteTask(task2); + } + } + catch + { + } + } + } + finally + { + ??--; + } + }, null); + } + + protected sealed override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) + { + if (taskWasPreviouslyQueued) + { + if (TryDequeue(task)) + { + return TryExecuteTask(task); + } + return false; + } + return TryExecuteTask(task); + } + + protected sealed override bool TryDequeue(Task task) + { + lock (??) + { + return ???.Remove(task) ?? false; + } + } + + protected sealed override IEnumerable GetScheduledTasks() + { + return ???.ToArray(); + } + + public void Dispose() + { + lock (??) + { + ?? = null; + } + } + + [CompilerGenerated] + private bool ?(out Task P_0) + { + P_0 = null; + lock (??) + { + if (?? == null || ??.Count == 0) + { + return false; + } + P_0 = ??[0]; + ??.RemoveAt(0); + return true; + } + } + + [CompilerGenerated] + private void ?(object? P_0) + { + try + { + Task task; + while (?(out task)) + { + try + { + if (task != null) + { + TryExecuteTask(task); + } + } + catch + { + } + } + } + finally + { + ??--; + } + } + } +} +namespace TradingPlatform.BusinessLayer.Utils.Sounds +{ + public static class Sound + { + private static class ? + { + public const string ?? = "connectionFinished.wav"; + + public const string ?? = "connectionLost.wav"; + + public const string ?? = "orderFilled.wav"; + + public const string ?? = "orderRejected.wav"; + + public const string ?? = "PositionClosed.wav"; + + public const string ?? = "DefaultAlert.wav"; + + public const string ?? = "OrderCreated.wav"; + + public const string ?? = "Update.wav"; + } + + public static string ConnectionFinished; + + public static string ConnectionLost; + + public static string OrderCreatedCancelledReplaced; + + public static string OrderFilled; + + public static string OrderRejected; + + public static string PositionClosed; + + public static string DefaultAlert; + + public static string UpdateAvailable; + + [CompilerGenerated] + private static readonly Dictionary ??; + + public static Dictionary Defaults + { + [CompilerGenerated] + get + { + return ??; + } + } + + static Sound() + { + ConnectionFinished = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + ConnectionLost = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + OrderCreatedCancelledReplaced = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + OrderFilled = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + OrderRejected = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + PositionClosed = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + DefaultAlert = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + UpdateAvailable = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + ?? = new Dictionary + { + [ConnectionFinished] = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + [ConnectionLost] = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + [OrderCreatedCancelledReplaced] = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + [OrderFilled] = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + [OrderRejected] = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + [PositionClosed] = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + [DefaultAlert] = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + [UpdateAvailable] = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }; + } + } + public class SoundItem : IXElementSerialization + { + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + public bool Enabled + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public string CurrentPath + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SoundItem() + { + } + + public SoundItem(string name) + { + Enabled = true; + Name = name; + CurrentPath = Sound.Defaults[name]; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + Enabled = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToBool(); + Name = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; + CurrentPath = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Enabled)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CurrentPath)); + return xElement; + } + } +} +namespace TradingPlatform.BusinessLayer.Utils.Storage +{ + public interface IOrdersHistoryLocalStorage : ILocalStorage + { + void Save(OrdersHistoryInterval interval); + + OrdersHistoryInterval Load(Interval interval); + + void Delete(Interval interval); + + OrdersHistoryStorageInfo GetInfo(); + } + public class OrdersHistoryInterval + { + [CompilerGenerated] + private Interval ??; + + [CompilerGenerated] + private IEnumerable ??; + + public Interval Interval + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IEnumerable OrdersHistory + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + } + public sealed class OrdersHistoryStorage : DataStorage + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func, bool> ??; + + internal bool ?(Interval P_0) + { + return !P_0.IsEmpty; + } + } + + [CompilerGenerated] + private sealed class ? + { + public OrdersHistoryStorage ??; + + public OrdersHistoryInterval ??; + + internal void ?() + { + ??.??.Save(??); + } + } + + [CompilerGenerated] + private sealed class ? + { + public Interval ??; + + internal Interval ?(Interval P_0) + { + return P_0.Intersect(??); + } + } + + private static readonly Type ??; + + private readonly IOrdersHistoryLocalStorage ??; + + static OrdersHistoryStorage() + { + try + { + ?? = AssemblyLoader.LoadTypes(Path.Combine(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), typeof(IOrdersHistoryLocalStorage), null, SearchOption.AllDirectories)?.FirstOrDefault(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + public OrdersHistoryStorage(IOrdersHistoryLocalStorage storage, string localFilePath, string connectionId) + : base(storage, localFilePath) + { + ?? = storage; + } + + public static OrdersHistoryStorage Create(string connectionString, string connectionId) + { + if (?? == null) + { + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + IOrdersHistoryLocalStorage obj = Activator.CreateInstance(??) as IOrdersHistoryLocalStorage; + if (obj == null) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(30, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(??); + throw new InvalidOperationException(defaultInterpolatedStringHandler.ToStringAndClear()); + } + string directoryName = Path.GetDirectoryName(connectionString); + if (!Directory.Exists(directoryName)) + { + Directory.CreateDirectory(directoryName); + } + return new OrdersHistoryStorage(obj, connectionString, connectionId); + } + + public void Save(OrdersHistoryInterval historyInterval) + { + CheckDisposed(); + PushAction(delegate + { + ??.Save(historyInterval); + }); + } + + public IList Load(Interval requestParameters, out List> historyParametersForServerRequest) + { + CheckDisposed(); + List list = new List(); + historyParametersForServerRequest = new List>(); + OrdersHistoryStorageInfo info = ??.GetInfo(); + if (!info.StoredIntervals.Any()) + { + historyParametersForServerRequest.Add(requestParameters); + return list; + } + Interval ?? = requestParameters; + Interval[] collection = ??.Subtract(info.StoredIntervals).ToArray(); + historyParametersForServerRequest.AddRange(collection); + Interval[] array = (from P_0 in info.StoredIntervals + select P_0.Intersect(??) into P_0 + where !P_0.IsEmpty + select P_0).ToArray(); + foreach (Interval interval in array) + { + OrdersHistoryInterval item = ??.Load(interval); + list.Add(item); + } + return list; + } + } + public sealed class OrdersHistoryStorageInfo + { + [CompilerGenerated] + private List> ??; + + public List> StoredIntervals + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public OrdersHistoryStorageInfo() + { + StoredIntervals = new List>(); + } + } + public abstract class DataStorage : ActionBufferedProcessor, IDisposable + { + [CompilerGenerated] + private sealed class ? + { + public DataStorage ??; + + public Action ??; + + internal void ?() + { + if (!??.??) + { + ???.Invoke(); + } + } + } + + [CompilerGenerated] + private sealed class ? + { + public DataStorage ??; + + public Action ??; + + public ManualResetEventSlim ??; + + internal void ?() + { + try + { + if (!??.??) + { + ???.Invoke(); + } + } + finally + { + ??.Set(); + } + } + } + + private readonly ILocalStorage ??; + + private readonly List ??; + + private readonly object ??; + + private bool ??; + + protected DataStorage(ILocalStorage storage, string localFilePath) + { + ?? = storage ?? throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + ??.Connect(localFilePath); + ?? = new List(); + ?? = new object(); + Start(); + } + + public virtual void Dispose() + { + CheckDisposed(); + ?? = true; + try + { + Clear(); + WaitAllMessagesProcess(); + Stop(); + ??.Disconnect(); + lock (??) + { + foreach (ManualResetEventSlim item in ??) + { + item.Set(); + } + ??.Clear(); + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + protected void CheckDisposed() + { + if (!??) + { + return; + } + throw new ObjectDisposedException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + + protected void PushAction(Action action) + { + Push(delegate + { + if (!??) + { + action?.Invoke(); + } + }); + } + + protected void WaitForAction(Action action) + { + ManualResetEventSlim ?? = new ManualResetEventSlim(initialState: false); + lock (??) + { + ??.Add(??); + } + Push(delegate + { + try + { + if (!??) + { + action?.Invoke(); + } + } + finally + { + ??.Set(); + } + }); + ??.Wait(); + lock (??) + { + ??.Remove(??); + } + } + } + public interface ILocalStorage + { + void Connect(string connectionString); + + void Disconnect(); + } + public interface IUserTradesLocalStorage : ILocalStorage + { + void Save(UserTradesInterval interval); + + UserTradesInterval Load(Interval interval); + + void Delete(Interval interval); + + UsersTradesStorageInfo GetInfo(); + } + public class UserTradesInterval + { + [CompilerGenerated] + private Interval ??; + + [CompilerGenerated] + private IEnumerable ??; + + public Interval Interval + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IEnumerable Trades + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + } +} +namespace TradingPlatform.BusinessLayer.Utils.Storage.InMemory +{ + public class QuotesInMemoryStorage where TQuote : MessageQuote + { + [CompilerGenerated] + private sealed class ? + { + public Interval ??; + + internal bool ?(TQuote P_0) + { + return ??.Contains(P_0.Time); + } + } + + [CompilerGenerated] + private readonly int ??; + + private readonly List ??; + + private readonly TimeSpan ??; + + private const int ?? = 1000; + + private int ??; + + public int MaxCapacity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public QuotesInMemoryStorage(TimeSpan desiredDepth) + { + ?? = new List(); + ?? = desiredDepth; + MaxCapacity = 100000; + } + + public void Put(TQuote item) + { + try + { + if (??++ >= 1000) + { + ?? = 0; + ?(item); + } + ??.Add(item); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + private TQuote[] ?() + { + try + { + return ??.ToArray(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + return null; + } + + public bool TryGet(Interval interval, out TQuote[] items, out Interval remainingInterval) + { + remainingInterval = Interval.Default; + items = Array.Empty(); + TQuote[] array = ?(); + TQuote val = ((array != null) ? array.FirstOrDefault() : null); + if (val == null) + { + return false; + } + if (interval.To <= val.Time) + { + return false; + } + items = array.Where((TQuote P_0) => interval.Contains(P_0.Time)).ToArray(); + if (interval.From < val.Time) + { + remainingInterval = new Interval(interval.From, val.Time); + } + return true; + } + + private void ?(TQuote P_0) + { + if (??.Count <= 1) + { + return; + } + int num = 0; + foreach (TQuote item in ??) + { + if (P_0.Time - item.Time > ??) + { + num++; + continue; + } + break; + } + num--; + if (num >= 1) + { + num = Math.Max(??.Count - MaxCapacity, num); + ??.RemoveRange(0, num); + } + } + } +} +namespace TradingPlatform.BusinessLayer.Utils.Limitation +{ + public class Limiter : IDisposable + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal ? ?(Limit P_0) + { + return new ?(P_0); + } + } + + [CompilerGenerated] + private sealed class ? + { + public RequestType ??; + + internal bool ?(? P_0) + { + return P_0.?(??); + } + } + + private readonly ?[] ??; + + private readonly Timer ??; + + public Limiter(LimitationMetadata metadata) + { + ?? = metadata.Limits.Select((Limit P_0) => new ?(P_0)).ToArray(); + ?? = new Timer(?, null, TimeSpan.FromMilliseconds(100.0), TimeSpan.FromMilliseconds(100.0)); + } + + public void Wait(RequestType requestType, CancellationToken cancellationToken) + { + ?[] array = ??.Where((? P_0) => P_0.?(requestType)).ToArray(); + for (int num = 0; num < array.Length; num++) + { + array[num].?(cancellationToken); + } + } + + public void Dispose() + { + ??.Change(-1, -1); + ??.Dispose(); + } + + private void ?(object P_0) + { + ?[] array = ??; + for (int i = 0; i < array.Length; i++) + { + array[i].?(); + } + } + } +} +namespace ? +{ + internal class ? + { + private readonly ? ??; + + private readonly HashSet ??; + + public ?(Limit P_0) + { + ? obj; + if (P_0.Interval != LimitInterval.FloatingWindow) + { + ? ?2 = new ?(P_0.Period, P_0.Value); + obj = ?2; + } + else + { + ? ?2 = new ?(P_0.Period, P_0.Value); + obj = ?2; + } + ?? = obj; + HashSet hashSet = new HashSet(); + RequestType[] requestTypes = P_0.RequestTypes; + foreach (RequestType item in requestTypes) + { + hashSet.Add(item); + } + ?? = hashSet; + } + + public void ?(CancellationToken P_0) + { + ??.?(P_0); + } + + public void ?() + { + ??.?(); + } + + public bool ?(RequestType P_0) + { + return ??.Contains(P_0); + } + } + internal class ? : ? + { + private readonly Period ??; + + private readonly int ??; + + private DateTime ??; + + private readonly ManualResetEvent ??; + + private int ??; + + public ?(Period P_0, int P_1) + { + ?? = P_0; + ?? = P_1; + ?(); + ?? = new ManualResetEvent(initialState: false); + } + + public void ?(CancellationToken P_0) + { + if (?? < Interlocked.Increment(ref ??)) + { + ??.Reset(); + WaitHandle.WaitAny(new WaitHandle[2] { ??, P_0.WaitHandle }); + if (!P_0.IsCancellationRequested) + { + ?(P_0); + } + } + } + + public void ?() + { + if (!(Core.Instance.TimeUtils.DateTimeUtcNow < ??)) + { + ?(); + ?? = 0; + ??.Set(); + } + } + + private void ?() + { + ?? = Core.Instance.TimeUtils.DateTimeUtcNow.CeilingTo(??); + } + } + internal class ? : ? + { + private class ? + { + [CompilerGenerated] + private readonly DateTime ??; + + private readonly ManualResetEventSlim ??; + + public DateTime ExpirationTime + { + [CompilerGenerated] + get + { + return ??; + } + } + + public ?(DateTime P_0) + { + ?? = P_0; + ?? = new ManualResetEventSlim(); + } + + public void ?() + { + ??.Set(); + } + + public void ?(CancellationToken P_0) + { + ??.Wait(P_0); + } + } + + private readonly Period ??; + + private readonly int ??; + + private readonly Queue ??; + + private readonly object ??; + + public ?(Period P_0, int P_1) + { + ?? = P_0; + ?? = P_1; + ?? = new Queue(); + ?? = new object(); + } + + public void ?(CancellationToken P_0) + { + ? result; + lock (??) + { + if (??.Count < ??) + { + ??.Enqueue(new ?(Core.Instance.TimeUtils.DateTimeUtcNow + ??.Duration)); + return; + } + ??.TryPeek(out result); + } + if (result != null) + { + result.?(P_0); + if (!P_0.IsCancellationRequested) + { + ?(P_0); + } + } + } + + public void ?() + { + lock (??) + { + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + ? result; + while (??.Count > 0 && ??.TryPeek(out result) && !(result.ExpirationTime > dateTimeUtcNow)) + { + ??.Dequeue(); + result.?(); + } + } + } + } + internal interface ? + { + void ?(CancellationToken P_0); + + void ?(); + } +} +namespace TradingPlatform.BusinessLayer.Utils.Extensions +{ + public static class GuidExtensions + { + public static string ToShortString(this Guid guid) + { + return Regex.Replace(Convert.ToBase64String(guid.ToByteArray()), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + } + public static class RulesManagerExtensions + { + public static bool IsAllowedBySymbol(this RulesManager rulesManager, Symbol symbol, string ruleName) + { + if (symbol != null) + { + if (rulesManager.IsAllowed(ruleName, symbol).Status != TradingOperationStatus.Allowed) + { + if (symbol != null) + { + return symbol.State == BusinessObjectState.Fake; + } + return false; + } + return true; + } + return false; + } + } + public static class TimeSpanExtensions + { + public static string ToReadable(this TimeSpan timespan) + { + if (timespan.Ticks <= 0) + { + return null; + } + if (timespan.Days > 365) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(3, 2); + defaultInterpolatedStringHandler.AppendFormatted(timespan.Days / 365); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(timespan.Days % 365); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + if (timespan.Days > 0) + { + return timespan.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (timespan.Hours > 0) + { + return timespan.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (timespan.Minutes > 0) + { + return timespan.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return timespan.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + + public static string ToReadableLong(this TimeSpan timespan) + { + if (timespan.Ticks <= 0) + { + return null; + } + StringBuilder stringBuilder = new StringBuilder(); + if (timespan.Days > 365) + { + StringBuilder stringBuilder2 = stringBuilder; + StringBuilder stringBuilder3 = stringBuilder2; + StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(4, 2, stringBuilder2); + handler.AppendFormatted(timespan.Days / 365); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + handler.AppendFormatted(timespan.Days % 365); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + stringBuilder3.Append(ref handler); + } + if (timespan.Days > 0 && timespan.Days < 365) + { + StringBuilder stringBuilder2 = stringBuilder; + StringBuilder stringBuilder4 = stringBuilder2; + StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(2, 1, stringBuilder2); + handler.AppendFormatted(timespan.Days); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + stringBuilder4.Append(ref handler); + } + if (timespan.Hours > 0) + { + StringBuilder stringBuilder2 = stringBuilder; + StringBuilder stringBuilder5 = stringBuilder2; + StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(2, 1, stringBuilder2); + handler.AppendFormatted(timespan.Hours); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + stringBuilder5.Append(ref handler); + } + if (timespan.Minutes > 0) + { + StringBuilder stringBuilder2 = stringBuilder; + StringBuilder stringBuilder6 = stringBuilder2; + StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(2, 1, stringBuilder2); + handler.AppendFormatted(timespan.Minutes); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + stringBuilder6.Append(ref handler); + } + if (timespan.Seconds > 0) + { + StringBuilder stringBuilder2 = stringBuilder; + StringBuilder stringBuilder7 = stringBuilder2; + StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(1, 1, stringBuilder2); + handler.AppendFormatted(timespan.Seconds); + handler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + stringBuilder7.Append(ref handler); + } + return stringBuilder.ToString(); + } + + public static TimeSpan ConvertTimeZone(this TimeSpan timeSpan, TimeZoneInfo sourceTimeZone, TimeZoneInfo destinationTimeZone) + { + return TimeZoneInfo.ConvertTime(new DateTime(DateTime.UtcNow.Date.Ticks + timeSpan.Ticks, DateTimeKind.Unspecified), sourceTimeZone, destinationTimeZone).TimeOfDay; + } + } +} +namespace TradingPlatform.BusinessLayer.Utils.EqualityComparers +{ + public class BusinessObjectEqualityComparer : IEqualityComparer + { + public bool Equals(BusinessObject x, BusinessObject y) + { + if (x == y) + { + return true; + } + if (x == null) + { + return false; + } + if (y == null) + { + return false; + } + if (x.GetType() != y.GetType()) + { + return false; + } + if (x.ConnectionId == y.ConnectionId && x.State == y.State) + { + return x.UniqueId == y.UniqueId; + } + return false; + } + + public int GetHashCode(BusinessObject obj) + { + return (int)(((uint)(((obj.ConnectionId != null) ? obj.ConnectionId.GetHashCode() : 0) * 397) ^ (uint)obj.State) * 397) ^ ((obj.UniqueId != null) ? obj.UniqueId.GetHashCode() : 0); + } + } + public class ListEqualityComparer : IEqualityComparer> + { + private readonly IEqualityComparer ??; + + public ListEqualityComparer(IEqualityComparer itemEqualityComparer) + { + ?? = itemEqualityComparer; + } + + public bool Equals(IList x, IList y) + { + if (x == y) + { + return true; + } + if (x == null) + { + return false; + } + if (y == null) + { + return false; + } + if (x.GetType() != y.GetType()) + { + return false; + } + if (x.Count != y.Count) + { + return false; + } + for (int i = 0; i < x.Count; i++) + { + TItem x2 = x[i]; + TItem y2 = y[i]; + if (!??.Equals(x2, y2)) + { + return false; + } + } + return true; + } + + public int GetHashCode(IList list) + { + int num = list.Count.GetHashCode(); + foreach (TItem item in list) + { + num = (num * 397) ^ ??.GetHashCode(item); + } + return num; + } + } + public class PropertyInfoEqualityComparer : IEqualityComparer + { + public bool Equals(PropertyInfo x, PropertyInfo y) + { + if ((object)x == y) + { + return true; + } + if ((object)x == null) + { + return false; + } + if ((object)y == null) + { + return false; + } + if (x.GetType() != y.GetType()) + { + return false; + } + return object.Equals(x.Name, y.Name); + } + + public int GetHashCode(PropertyInfo obj) + { + return obj.Name.GetHashCode(); + } + } + public class SettingItemNameEqualityComparer : IEqualityComparer + { + public bool Equals(SettingItem x, SettingItem y) + { + if (x == y) + { + return true; + } + if (x == null) + { + return false; + } + if (y == null) + { + return false; + } + if (x.GetType() != y.GetType()) + { + return false; + } + return x.Name == y.Name; + } + + public int GetHashCode(SettingItem obj) + { + if (obj.Name == null) + { + return 0; + } + return obj.Name.GetHashCode(); + } + } + public class UniqueIdEqualityComparer : IEqualityComparer + { + public bool Equals(IUniqueID x, IUniqueID y) + { + if (x == y) + { + return true; + } + if (x == null) + { + return false; + } + if (y == null) + { + return false; + } + if (x.GetType() != y.GetType()) + { + return false; + } + return x.UniqueId == y.UniqueId; + } + + public int GetHashCode(IUniqueID obj) + { + if (obj.UniqueId == null) + { + return 0; + } + return obj.UniqueId.GetHashCode(); + } + } +} +namespace TradingPlatform.BusinessLayer.Utils.Comparers +{ + public class TimeInForceComparer : IComparer + { + public int Compare(TimeInForce x, TimeInForce y) + { + return ?(x) - ?(y); + } + + private static int ?(TimeInForce P_0) + { + return P_0 switch + { + TimeInForce.GTC => 0, + TimeInForce.Day => 1, + _ => 10, + }; + } + } +} +namespace TradingPlatform.BusinessLayer.Settings.OTP +{ + public class OTPHolder : IXElementSerialization, ICloneable + { + [CompilerGenerated] + private string ??; + + public Action Callback; + + public string OTPValue + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public void RequestOTP(string title, string text) + { + Core.Instance.RequestOTP(this, title, text); + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OTPValue)); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + OTPValue = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; + } + + public object Clone() + { + return new OTPHolder + { + OTPValue = OTPValue + }; + } + } + [Serializable] + [DataContract] + public sealed class SettingItemOTP : SettingItem + { + public override SettingItemType Type => SettingItemType.OTP; + + [DataMember(Name = "Value")] + [ProtoMember(1, IsRequired = true)] + private OTPHolder ValueOTPHolder + { + get + { + return (OTPHolder)value; + } + set + { + value = oTPHolder; + } + } + + public SettingItemOTP() + { + } + + public SettingItemOTP(string name, OTPHolder value, int sortIndex = 0) + : base(name, value, sortIndex) + { + } + + private SettingItemOTP(SettingItemOTP P_0) + : base(P_0) + { + } + + [NotPublished] + public override SettingItem GetCopy() + { + return new SettingItemOTP(this); + } + + [NotPublished] + public static implicit operator OTPHolder(SettingItemOTP item) + { + return (OTPHolder)item.Value; + } + + [NotPublished] + protected override bool IsValueTypeValid(object value) + { + return value is OTPHolder; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + OTPHolder oTPHolder = new OTPHolder(); + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + oTPHolder.FromXElement(xElement, deserializationInfo); + ValueOTPHolder = oTPHolder; + } + } + } +} +namespace TradingPlatform.BusinessLayer.Settings.Condition +{ + public sealed class ConditionData : IXElementSerialization + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal ConditionSet ?(ConditionSet P_0) + { + return new ConditionSet(P_0); + } + } + + [CompilerGenerated] + private List ??; + + /// + /// Gets or Sets the groups. + /// + public List ConditionGroups + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public ConditionData() + { + ConditionGroups = new List(); + } + + public ConditionData(ConditionData conditions) + { + ConditionGroups = conditions.ConditionGroups.Select((ConditionSet P_0) => new ConditionSet(P_0)).ToList(); + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (ConditionSet conditionGroup in ConditionGroups) + { + xElement2.Add(conditionGroup.ToXElement()); + } + xElement.Add(xElement2); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement? xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + List list = new List(); + foreach (XElement item in xElement.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Elements()) + { + ConditionSet conditionSet = new ConditionSet(); + conditionSet.FromXElement(item, deserializationInfo); + list.Add(conditionSet); + } + ConditionGroups = list; + } + } + public sealed class ConditionItem : IXElementSerialization + { + [CompilerGenerated] + private ConditionOperandBase ??; + + [CompilerGenerated] + private ConditionOperandBase ??; + + [CompilerGenerated] + private TableConditionType ??; + + public ConditionOperandBase Operand1 + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public ConditionOperandBase Operand2 + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public TableConditionType ConditionType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public ConditionItem() + { + } + + public ConditionItem(ConditionItem conditionItem) + { + ConditionType = conditionItem.ConditionType; + Operand1 = conditionItem.Operand1?.Clone() as ConditionOperandBase; + Operand2 = conditionItem.Operand2?.Clone() as ConditionOperandBase; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + ConditionType = (TableConditionType)Enum.Parse(typeof(TableConditionType), element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value.ToString()); + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + XElement element2 = xElement.Elements().FirstOrDefault(); + Operand1 = ConditionOperandBase.CreateFromXml(element2, deserializationInfo); + Operand1.FromXElement(element2, deserializationInfo); + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + XElement element3 = xElement2.Elements().FirstOrDefault(); + Operand2 = ConditionOperandBase.CreateFromXml(element3, deserializationInfo); + Operand2.FromXElement(element3, deserializationInfo); + } + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ConditionType.ToString())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Operand1.ToXElement())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Operand2.ToXElement())); + return xElement; + } + } + public sealed class ConditionSet : IXElementSerialization + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal ConditionItem ?(ConditionItem P_0) + { + return new ConditionItem(P_0); + } + } + + [CompilerGenerated] + private List ??; + + public List ConditionItems + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public ConditionSet() + { + ConditionItems = new List(); + } + + public ConditionSet(ConditionSet conditionSet) + { + ConditionItems = conditionSet.ConditionItems.Select((ConditionItem P_0) => new ConditionItem(P_0)).ToList(); + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + List list = new List(); + foreach (XElement item in element.Elements(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + ConditionItem conditionItem = new ConditionItem(); + conditionItem.FromXElement(item, deserializationInfo); + list.Add(conditionItem); + } + ConditionItems = list; + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (ConditionItem conditionItem in ConditionItems) + { + xElement.Add(conditionItem.ToXElement()); + } + return xElement; + } + } + public abstract class ConditionOperandBase : IXElementSerialization, IComparable, ICloneable + { + protected const string XML_TYPE = "Type"; + + public abstract string Name { get; } + + public abstract ConditionOperandBaseType ValueType { get; } + + public static ConditionOperandBase CreateFromXml(XElement element, DeserializationInfo deserializationInfo) + { + string text = element?.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value; + if (text != null) + { + switch (text.Length) + { + case 19: + switch (text[14]) + { + case 't': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new OperandCustomString(); + case 'y': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new OperandCustomSymbol(); + } + break; + case 21: + switch (text[7]) + { + case 'C': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new OperandCustomSelector(); + case 'O': + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new OperandObjectProperty(); + } + break; + case 17: + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new OperandCustomDate(); + case 20: + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new OperandCustomAccount(); + case 29: + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return new OperandObjectPropertySelector(); + } + } + return null; + } + + public abstract object Clone(); + + public int CompareTo(object obj) + { + return Name.CompareTo((obj as ConditionOperandBase)?.Name); + } + + public abstract void FromXElement(XElement element, DeserializationInfo deserializationInfo); + + public abstract XElement ToXElement(); + } + public sealed class OperandCustomString : ConditionOperandBase + { + [CompilerGenerated] + private string ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override ConditionOperandBaseType ValueType => ConditionOperandBaseType.String; + + public string Value + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public OperandCustomString() + { + } + + public OperandCustomString(OperandCustomString operandCustomString) + { + Value = operandCustomString.Value; + } + + public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + Value = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.Value ?? string.Empty; + } + + public override XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Value)); + return xElement; + } + + public override object Clone() + { + return new OperandCustomString(this); + } + } + public sealed class OperandCustomDate : ConditionOperandBase + { + private const string ?? = "ddMMyyyy HH:mm:ss.ffffff"; + + [CompilerGenerated] + private DateTime ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override ConditionOperandBaseType ValueType => ConditionOperandBaseType.Date; + + public DateTime Value + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public OperandCustomDate() + { + } + + public OperandCustomDate(OperandCustomDate operandCustomDate) + { + Value = operandCustomDate.Value; + } + + public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + Value = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())?.ToDateTime(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? default(DateTime); + } + + public override XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Value.ToString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CultureInfo.InvariantCulture))); + return xElement; + } + + public override object Clone() + { + return new OperandCustomDate(this); + } + } + public sealed class OperandObjectProperty : ConditionOperandBase + { + private string ??; + + private ConditionOperandBaseType ??; + + public override string Name => ??; + + public override ConditionOperandBaseType ValueType => ??; + + public OperandObjectProperty() + { + } + + public OperandObjectProperty(string name, ConditionOperandBaseType valueType) + { + ?? = name; + ?? = valueType; + } + + public OperandObjectProperty(OperandObjectProperty operandCustomDate) + { + ?? = operandCustomDate.Name; + ?? = operandCustomDate.ValueType; + } + + public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + ?? = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; + ?? = (ConditionOperandBaseType)element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).ToInt(); + } + + public override XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)ValueType)); + return xElement; + } + + public override object Clone() + { + return new OperandObjectProperty(this); + } + } + public sealed class OperandCustomSymbol : ConditionOperandBase + { + [CompilerGenerated] + private Symbol ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override ConditionOperandBaseType ValueType => ConditionOperandBaseType.Symbol; + + public Symbol Value + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public OperandCustomSymbol() + { + } + + public OperandCustomSymbol(OperandCustomSymbol operandCustomDate) + { + Value = operandCustomDate.Value; + } + + public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + SymbolInfo empty = SymbolInfo.Empty; + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + empty.FromXElement(xElement, deserializationInfo); + if (!(empty == BusinessObjectInfo.Empty) && !(empty == SymbolInfo.Empty)) + { + Value = Core.Instance.GetSymbol(empty); + } + } + } + + public override XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); + xElement.Add((Value?.CreateInfo() ?? BusinessObjectInfo.Empty).ToXElement()); + return xElement; + } + + public override object Clone() + { + return new OperandCustomSymbol(this); + } + } + public sealed class OperandCustomAccount : ConditionOperandBase + { + [CompilerGenerated] + private Account ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override ConditionOperandBaseType ValueType => ConditionOperandBaseType.Account; + + public Account Value + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public OperandCustomAccount() + { + } + + public OperandCustomAccount(OperandCustomAccount operandCustomDate) + { + Value = operandCustomDate.Value; + } + + public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + SymbolInfo empty = SymbolInfo.Empty; + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + empty.FromXElement(xElement, deserializationInfo); + if (!(empty == BusinessObjectInfo.Empty) && !(empty == SymbolInfo.Empty)) + { + Value = Core.Instance.GetAccount(empty); + } + } + } + + public override XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); + xElement.Add((Value?.CreateInfo() ?? BusinessObjectInfo.Empty).ToXElement()); + return xElement; + } + + public override object Clone() + { + return new OperandCustomAccount(this); + } + } + public sealed class OperandCustomSelector : ConditionOperandBase + { + [CompilerGenerated] + private SelectItem ??; + + public override string Name => 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public override ConditionOperandBaseType ValueType => ConditionOperandBaseType.Selector; + + public SelectItem SelectedItem + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public OperandCustomSelector() + { + } + + public OperandCustomSelector(OperandCustomSelector operandCustomSelector) + { + SelectedItem = operandCustomSelector.SelectedItem; + } + + public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + string value = xElement.Value; + if (int.TryParse(value, out var result)) + { + SelectedItem = new SelectItem(string.Empty, result); + } + else + { + SelectedItem = new SelectItem(string.Empty, value); + } + } + } + + public override XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); + string content = string.Empty; + if (SelectedItem == null) + { + content = string.Empty; + } + else if (SelectedItem.Value is int || SelectedItem.Value is Enum) + { + content = ((int)(object)SelectedItem.Value).ToString(); + } + else if (SelectedItem.Value != null) + { + content = SelectedItem.Value.ToString(); + } + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), content)); + return xElement; + } + + public override object Clone() + { + return new OperandCustomSelector(this); + } + } + public sealed class OperandObjectPropertySelector : ConditionOperandBase + { + private string ??; + + public List Items; + + public override string Name => ??; + + public override ConditionOperandBaseType ValueType => ConditionOperandBaseType.Selector; + + public OperandObjectPropertySelector() + { + } + + public OperandObjectPropertySelector(string name, List items) + { + ?? = name; + Items = items; + } + + public OperandObjectPropertySelector(OperandObjectPropertySelector operandCustomDate) + { + ?? = operandCustomDate.Name; + Items = operandCustomDate.Items; + } + + public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + ?? = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value; + } + + public override XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GetType().Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); + return xElement; + } + + public override object Clone() + { + return new OperandObjectPropertySelector(this); + } + } + public enum ConditionOperandBaseType + { + Numeric, + Date, + String, + Symbol, + Account, + Selector + } + [Serializable] + [DataContract] + public sealed class SettingItemCondition : SettingItem + { + [CompilerGenerated] + private List ??; + + public override SettingItemType Type => SettingItemType.Condition; + + public List AvailableOperands + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Value")] + private ConditionData ValueConditionData + { + get + { + return Value as ConditionData; + } + set + { + Value = conditionData; + } + } + + public SettingItemCondition() + { + } + + public SettingItemCondition(string name, object value, List operands, int sortIndex = 0) + : base(name, value, sortIndex) + { + AvailableOperands = operands; + } + + private SettingItemCondition(SettingItemCondition P_0) + : base(P_0) + { + AvailableOperands = new List(P_0.AvailableOperands); + } + + public override SettingItem GetCopy() + { + return new SettingItemCondition(this); + } + + protected override bool IsValueTypeValid(object value) + { + return value is ConditionData; + } + + protected override void ValueFromXElement(XElement element, DeserializationInfo deserializationInfo) + { + ConditionData conditionData = new ConditionData(); + conditionData.FromXElement(element, deserializationInfo); + value = conditionData; + } + } +} +namespace TradingPlatform.BusinessLayer.Settings.Comparers +{ + public class SettingItemNameComparer : IEqualityComparer + { + public bool Equals(SettingItem x, SettingItem y) + { + if (x == y) + { + return true; + } + if (x == null) + { + return false; + } + if (y == null) + { + return false; + } + if (x.GetType() != y.GetType()) + { + return false; + } + return string.Equals(x.Name, y.Name, StringComparison.InvariantCulture); + } + + public int GetHashCode(SettingItem obj) + { + if (obj.Name == null) + { + return 0; + } + return StringComparer.InvariantCulture.GetHashCode(obj.Name); + } + } +} +namespace TradingPlatform.BusinessLayer.Native +{ + /// + /// Specifies constants that define which mouse button was pressed. + /// + [Flags] + public enum NativeMouseButtons + { + /// + /// No mouse button was pressed. + /// + None = 0, + /// + /// The left mouse button was pressed. + /// + Left = 0x100000, + /// + /// The right mouse button was pressed. + /// + Right = 0x200000, + /// + /// The middle mouse button was pressed. + /// + Middle = 0x400000, + /// + /// The first XButton was pressed. + /// + XButton1 = 0x800000, + /// + /// The second XButton was pressed. + /// + XButton2 = 0x1000000 + } + public class NativeMouseEventArgs + { + [CompilerGenerated] + private readonly NativeMouseButtons ??; + + [CompilerGenerated] + private readonly int ??; + + [CompilerGenerated] + private readonly int ??; + + [CompilerGenerated] + private readonly int ??; + + [CompilerGenerated] + private readonly int ??; + + [CompilerGenerated] + private bool ??; + + public NativeMouseButtons Button + { + [CompilerGenerated] + get + { + return ??; + } + } + + public int Clicks + { + [CompilerGenerated] + get + { + return ??; + } + } + + public int X + { + [CompilerGenerated] + get + { + return ??; + } + } + + public int Y + { + [CompilerGenerated] + get + { + return ??; + } + } + + public int Delta + { + [CompilerGenerated] + get + { + return ??; + } + } + + public Point Location => new Point(X, Y); + + /// + /// Gets or sets a value indicating whether the event was handled. + /// true to bypass the control's default handling; otherwise, false to also pass the event along to the default control handler. + /// + public bool Handled + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public NativeMouseEventArgs(NativeMouseButtons button, int clicks, int x, int y, int delta) + { + ?? = x; + ?? = y; + ?? = clicks; + ?? = button; + ?? = delta; + } + } +} +namespace TradingPlatform.BusinessLayer.Modules +{ + public abstract class OrderPlacingStrategy : ExecutionEntity + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + internal bool ?(SettingItem P_0) + { + return P_0.VisibilityMode != VisibilityMode.Hidden; + } + + internal string ?(SettingItem P_0) + { + return P_0.ToString(); + } + } + + [CompilerGenerated] + private sealed class ? + { + public DateTime ??; + + public DateTime ??; + + internal bool ?(LoggerEvent P_0) + { + return P_0.Date > ??; + } + + internal bool ?(LoggerEvent P_0) + { + return P_0.Date < ??; + } + } + + private OrderPlacingStrategyState ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + public readonly DateTime CreationTime; + + private readonly List ??; + + [CompilerGenerated] + private PlaceOrderRequestParameters ??; + + public OrderPlacingStrategyState State + { + get + { + return ??; + } + private set + { + ?? = orderPlacingStrategyState; + ???.Invoke(??); + } + } + + public PlaceOrderRequestParameters LastPlaceRequest + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public event Action StateChanged + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + /// + /// Event occurred when write a new log + /// + public event Action NewLog + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public OrderPlacingStrategy() + { + CreationTime = Core.Instance.TimeUtils.DateTimeUtcNow; + ?? = new List(); + } + + public TradingOperationResult PlaceOrder(PlaceOrderRequestParameters placeOrderRequest) + { + if (State != OrderPlacingStrategyState.Ready) + { + return TradingOperationResult.CreateError(placeOrderRequest.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + try + { + State = OrderPlacingStrategyState.Processing; + LastPlaceRequest = placeOrderRequest; + Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + OnPlaceOrder(placeOrderRequest.Clone() as PlaceOrderRequestParameters); + } + catch (TaskCanceledException) + { + } + catch (OperationCanceledException) + { + } + catch (AggregateException ex3) when (ex3.InnerException is TaskCanceledException) + { + } + catch (Exception exception) + { + Exception ex4 = exception.GetInnerExceptionsRecursive().Last(); + string text = base.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ex4.Message; + Log(text, StrategyLoggingLevel.Error); + State = OrderPlacingStrategyState.Error; + placeOrderRequest.Symbol.ConnectionCache.Push(MessageDealTicket.CreateRefuseDealTicket(text)); + return TradingOperationResult.CreateError(placeOrderRequest.RequestId, text); + } + finally + { + if (State == OrderPlacingStrategyState.Processing) + { + State = OrderPlacingStrategyState.Finished; + Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + return TradingOperationResult.CreateSuccess(placeOrderRequest.RequestId); + } + + public void Cancel() + { + if (State != OrderPlacingStrategyState.Processing) + { + return; + } + try + { + State = OrderPlacingStrategyState.Cancelling; + OnCancel(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + State = OrderPlacingStrategyState.Cancelled; + } + } + + public void Remove() + { + Core.Instance.OrderPlacingStrategies.?(this); + } + + public override void Dispose() + { + if (State == OrderPlacingStrategyState.Processing) + { + Cancel(); + } + ??.Clear(); + base.Dispose(); + } + + public virtual string FormatParameters() + { + return string.Join(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), from P_0 in Settings + where P_0.VisibilityMode != VisibilityMode.Hidden + select P_0.ToString()); + } + + /// + /// Get logs from the strategy for specified date range + /// + /// + /// + /// + public LoggerEvent[] GetLogs(DateTime from, DateTime to) + { + return (from P_0 in ?? + where P_0.Date > @from + where P_0.Date < to + select P_0).ToArray(); + } + + protected abstract void OnPlaceOrder(PlaceOrderRequestParameters placeOrderRequest); + + protected abstract void OnCancel(); + + /// + /// Write log message + /// + /// + /// + protected void Log(string message, StrategyLoggingLevel level = StrategyLoggingLevel.Info) + { + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + LoggingLevel type = LoggingLevel.System; + switch (level) + { + case StrategyLoggingLevel.Trading: + type = LoggingLevel.Trading; + break; + case StrategyLoggingLevel.Error: + type = LoggingLevel.Error; + break; + } + LoggerEvent loggerEvent = new LoggerEvent + { + Date = dateTimeUtcNow, + Event = message, + Type = type + }; + ??.Add(loggerEvent); + ???.Invoke(loggerEvent); + } + } + public enum OrderPlacingStrategyState + { + Ready, + Processing, + Finished, + Cancelling, + Cancelled, + Error + } +} +namespace TradingPlatform.BusinessLayer.Modules.PlaceOrderStrategies +{ + public sealed class OrderPlacingStrategyInfo : ScriptInfo, IComparable + { + [CompilerGenerated] + private string ??; + + public string ObsoleteText + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + internal OrderPlacingStrategyInfo(ConstructorInfo P_0, ScriptCreationType P_1, string P_2, string P_3) + : base(P_0, P_1, P_2, P_3) + { + } + + protected override void Initialize(string relativePath, string assemblyName) + { + using OrderPlacingStrategy orderPlacingStrategy = ctor.Invoke(null) as OrderPlacingStrategy; + base.Name = orderPlacingStrategy.Name; + base.Description = orderPlacingStrategy.Description; + base.Version = orderPlacingStrategy.Version; + base.Settings = orderPlacingStrategy.Settings as List; + base.Key = new ScriptKey(base.ScriptCreationType, relativePath, assemblyName, base.Name); + if (orderPlacingStrategy.GetType().GetCustomAttributes(typeof(ObsoleteAttribute), inherit: true).FirstOrDefault() is ObsoleteAttribute obsoleteAttribute) + { + ObsoleteText = obsoleteAttribute.Message; + } + } + + internal OrderPlacingStrategy ?() + { + OrderPlacingStrategy orderPlacingStrategy = ctor?.Invoke(null) as OrderPlacingStrategy; + if (orderPlacingStrategy != null) + { + orderPlacingStrategy.Key = base.Key; + } + return orderPlacingStrategy; + } + + public int CompareTo(object obj) + { + if (!(obj is OrderPlacingStrategyInfo orderPlacingStrategyInfo)) + { + return 0; + } + return string.Compare(base.Key.ToString(), orderPlacingStrategyInfo.Key.ToString(), StringComparison.Ordinal); + } + } +} +namespace TradingPlatform.BusinessLayer.LocalOrders +{ + public class LocalOrder : BindableEntity, IOrder, ITradingObject, IUniqueID, IDisposable + { + public class OrderTypeRules + { + private readonly IDictionary ??; + + private ? ??; + + internal OrderTypeRules() + { + ?? = new Dictionary(); + } + + public void SetRule(string ruleName, T value) + { + ? ? = new ?(ruleName, value); + ??[ruleName] = ?; + ?(?); + } + + internal void ?(? P_0) + { + ?? = P_0; + foreach (Rule value in ??.Values) + { + ?(value); + } + } + + private void ?(Rule P_0) + { + if (?? != null) + { + if (??.Rules.?(P_0.Name)) + { + ??.Rules[P_0.Name] = P_0; + } + else + { + ??.Rules.?(P_0.Name, P_0); + } + } + } + } + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private readonly Account ??; + + private readonly Symbol ??; + + [CompilerGenerated] + private readonly Side ??; + + private readonly OrderType ??; + + [CompilerGenerated] + private TimeInForce ??; + + [CompilerGenerated] + private readonly string ??; + + [CompilerGenerated] + private OrderStatus ??; + + [CompilerGenerated] + private DateTime ??; + + private double ??; + + private double ??; + + private double ??; + + private double ??; + + private string ??; + + [CompilerGenerated] + private AdditionalInfoCollection ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private readonly OrderTypeRules ??; + + public string UniqueId => Id; + + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + public Account Account + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public Symbol Symbol + { + get + { + return ??; + } + init + { + ?? = value; + if (OrderType != null) + { + OrderType.ConnectionId = Symbol.ConnectionId; + } + } + } + + public Side Side + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public OrderType OrderType + { + get + { + return ??; + } + init + { + ?? = value; + if (OrderType != null) + { + OrderType.ConnectionId = Symbol?.ConnectionId; + Rules.?(OrderType); + } + } + } + + public string OrderTypeId => OrderType?.Id; + + public TimeInForce TimeInForce + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string GroupId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public OrderStatus Status + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = orderStatus; + } + } + + public DateTime LastUpdateTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + public double TotalQuantity + { + get + { + return ??; + } + set + { + SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public double Price + { + get + { + return ??; + } + set + { + SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public double TriggerPrice + { + get + { + return ??; + } + set + { + SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public double TrailOffset + { + get + { + return ??; + } + set + { + SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public string Comment + { + get + { + return ??; + } + set + { + SetValue(ref ??, value, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public string PositionId => null; + + public SlTpHolder StopLoss => null; + + public SlTpHolder TakeProfit => null; + + public SlTpHolder[] StopLossItems => Array.Empty(); + + public SlTpHolder[] TakeProfitItems => Array.Empty(); + + public string ConnectionId => Symbol?.ConnectionId; + + public DateTime ExpirationTime => default(DateTime); + + public BusinessObjectState State => BusinessObjectState.Normal; + + public double RemainingQuantity => TotalQuantity; + + public double FilledQuantity => 0.0; + + public string OriginalStatus => null; + + public double AverageFillPrice => double.NaN; + + public AdditionalInfoCollection AdditionalInfo + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public OrderTypeRules Rules + { + [CompilerGenerated] + get + { + return ??; + } + } + + public event Action Updated + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public LocalOrder() + { + ?? = new OrderTypeRules(); + base.PropertyChanged += ?; + } + + public void Dispose() + { + base.PropertyChanged -= ?; + } + + private void ?(object P_0, PropertyChangedEventArgs P_1) + { + LastUpdateTime = Core.Instance.TimeUtils.DateTimeUtcNow; + ?(); + } + + public override string ToString() + { + double price = (double.IsNaN(TriggerPrice) ? Price : TriggerPrice); + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 7); + defaultInterpolatedStringHandler.AppendFormatted(Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderType.Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(TimeInForce.Format(ExpirationTime)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Symbol.FormatQuantity(TotalQuantity)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Symbol); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Symbol.FormatPrice(price)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Account); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + internal void ?(ModifyOrderRequestParameters P_0) + { + TimeInForce = P_0.TimeInForce; + ?? = P_0.Quantity; + ?? = P_0.Price; + ?? = P_0.TriggerPrice; + ?? = P_0.TrailOffset; + ?? = P_0.Comment; + AdditionalInfo?.?(P_0.AdditionalParameters); + ?(); + } + + private void ?() + { + ???.Invoke(this); + } + } + public class LocalOrderEventArgs : EntityLifecycleEventArgs + { + [CompilerGenerated] + private readonly LocalOrder ??; + + public LocalOrder LocalOrder + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + } + public class LocalOrdersManager : IDisposable, IEnumerable, IEnumerable + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func, string> ??; + + internal string ?(KeyValuePair P_0) + { + return P_0.Key; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Connection ??; + + internal bool ?(KeyValuePair P_0) + { + return P_0.Value.ConnectionId == ??.Id; + } + } + + private readonly IDictionary ??; + + private readonly object ??; + + [CompilerGenerated] + private EventHandler ??; + + public event EventHandler Updated + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + public LocalOrdersManager() + { + ?? = new Dictionary(); + ?? = new object(); + } + + public void Initialize() + { + Core.Instance.Connections.ConnectionStateChanged += ?; + } + + public string AddOrder(LocalOrder localOrder) + { + localOrder.Id = Guid.NewGuid().ToShortString(); + lock (??) + { + ??.Add(localOrder.Id, localOrder); + } + localOrder.Updated += ?; + ?(localOrder, EntityLifecycle.Created); + return localOrder.Id; + } + + public bool RemoveOrder(string orderId) + { + LocalOrder value; + lock (??) + { + if (??.TryGetValue(orderId, out value)) + { + ??.Remove(orderId); + } + } + if (value == null) + { + return false; + } + value.Updated -= ?; + value.Dispose(); + ?(value, EntityLifecycle.Removed); + return true; + } + + public bool TryHandleTradingOperationRequest(TradingRequestParameters requestParameters, out TradingOperationResult result) + { + result = null; + if (!(requestParameters is ModifyOrderRequestParameters modifyOrderRequestParameters)) + { + if (requestParameters is CancelOrderRequestParameters cancelOrderRequestParameters) + { + return ?(cancelOrderRequestParameters, out result); + } + return false; + } + return ?(modifyOrderRequestParameters, out result); + } + + private bool ?(ModifyOrderRequestParameters P_0, out TradingOperationResult P_1) + { + P_1 = null; + if (!?(P_0.OrderId, out var localOrder)) + { + return false; + } + localOrder.?(P_0); + P_1 = TradingOperationResult.CreateSuccess(P_0.RequestId); + return true; + } + + private bool ?(CancelOrderRequestParameters P_0, out TradingOperationResult P_1) + { + bool flag = RemoveOrder(P_0.OrderId); + P_1 = (flag ? TradingOperationResult.CreateSuccess(P_0.RequestId) : TradingOperationResult.CreateError(P_0.RequestId, string.Empty)); + return flag; + } + + public void Dispose() + { + Core.Instance.Connections.ConnectionStateChanged -= ?; + lock (??) + { + foreach (LocalOrder value in ??.Values) + { + value.Updated -= ?; + } + ??.Clear(); + } + } + + private void ?(object P_0, ConnectionStateChangedEventArgs P_1) + { + if (P_1.NewState != ConnectionState.Disconnected && P_1.NewState != ConnectionState.ConnectionLost) + { + return; + } + Connection ?? = P_0 as Connection; + if (?? == null) + { + return; + } + List list; + lock (??) + { + list = (from keyValuePair in ?? + where keyValuePair.Value.ConnectionId == ??.Id + select keyValuePair.Key).ToList(); + } + foreach (string item in list) + { + RemoveOrder(item); + } + } + + private bool ?(string P_0, out LocalOrder P_1) + { + P_1 = null; + lock (??) + { + ??.TryGetValue(P_0, out P_1); + } + return P_1 != null; + } + + private void ?(IOrder P_0) + { + if (P_0 is LocalOrder localOrder) + { + ?(localOrder, EntityLifecycle.Changed); + } + } + + private void ?(LocalOrder P_0, EntityLifecycle P_1) + { + ???.InvokeSafely(this, new LocalOrderEventArgs + { + LocalOrder = P_0, + Lifecycle = P_1 + }); + } + + public IEnumerator GetEnumerator() + { + lock (??) + { + return ??.Values.GetEnumerator(); + } + } + + private IEnumerator ?() + { + return GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + //ILSpy generated this explicit interface implementation from .override directive in ? + return this.?(); + } + } +} +namespace TradingPlatform.BusinessLayer.Licence +{ + public sealed class LicenceItem + { + [CompilerGenerated] + private readonly string ??; + + [CompilerGenerated] + private readonly string ??; + + [CompilerGenerated] + private readonly DateTime ??; + + [CompilerGenerated] + private readonly DateTime ??; + + public string LicenceKey + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public string Value + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public DateTime StartDate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public DateTime EndDate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + } +} +namespace ? +{ + internal sealed class ? : JsonConverter + { + private const string ?? = "StartDateTicks"; + + private const string ?? = "EndDateTicks"; + + public override LicenceItem Read(ref Utf8JsonReader reader, Type type, JsonSerializerOptions options) + { + string text = null; + string licenceKey = string.Empty; + string value = null; + DateTime startDate = default(DateTime); + DateTime endDate = default(DateTime); + while (reader.Read()) + { + JsonTokenType tokenType = reader.TokenType; + switch (tokenType) + { + case JsonTokenType.EndObject: + return new LicenceItem + { + LicenceKey = licenceKey, + Value = value, + StartDate = startDate, + EndDate = endDate + }; + case JsonTokenType.PropertyName: + text = reader.GetString(); + break; + case JsonTokenType.String: + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + value = reader.GetString(); + } + } + else + { + licenceKey = reader.GetString(); + } + break; + case JsonTokenType.Number: + if (!(text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + if (text == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + endDate = new DateTime(reader.GetInt64(), DateTimeKind.Utc); + } + } + else + { + startDate = new DateTime(reader.GetInt64(), DateTimeKind.Utc); + } + break; + default: + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(20, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(tokenType); + throw new ArgumentOutOfRangeException(defaultInterpolatedStringHandler.ToStringAndClear()); + } + case JsonTokenType.None: + case JsonTokenType.StartObject: + case JsonTokenType.StartArray: + case JsonTokenType.EndArray: + case JsonTokenType.Comment: + case JsonTokenType.True: + case JsonTokenType.False: + case JsonTokenType.Null: + break; + } + } + return null; + } + + public override void Write(Utf8JsonWriter writer, LicenceItem value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value.LicenceKey); + writer.WriteString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value.LicenceKey); + writer.WriteNumber(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value.StartDate.Ticks); + writer.WriteNumber(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value.EndDate.Ticks); + writer.WriteEndObject(); + } + } +} +namespace TradingPlatform.BusinessLayer.Licence +{ + /// + /// Constants for licence keys + /// + public static class CoreLicenceKeys + { + public const string BASIC_PACKAGE = "BASIC_PACKAGE"; + + public const string PREMIUM_PACKAGE = "PREMIUM_PACKAGE"; + + public const string PREMIUM_PLUS_PACKAGE = "PREMIUM_PLUS_PACKAGE"; + + public const string ALL_IN_ONE_PACKAGE = "ALLINONE_PACKAGE"; + + public const string CRYPTO_PACKAGE = "CRYPTO_PACKAGE"; + + public const string CRYPTO_INDIA_PACKAGE = "CRYPTO_INDIA_PACKAGE"; + + public const string VOLUMEANALYSIS_PACKAGE = "VOLUMEANALYSIS_PACKAGE"; + + public const string POWERTRADES_PACKAGE = "POWERTRADES_PACKAGE"; + + public const string DOMSURFACE_PACKAGE = "DOMSURFACE_PACKAGE"; + + public const string ORDERFLOW_PACKAGE = "ORDERFLOW_PACKAGE"; + + public const string TPOCHART_PACKAGE = "TPOCHART_PACKAGE"; + + public const string MULTI_ASSET_PACKAGE = "MULTI_ASSET_PACKAGE"; + + public const string OPTIONS_PACKAGE = "OPTIONS_PACKAGE"; + + public const string CUSTOMER = "CUSTOMER"; + + public const string PROP_LICENSE = "PROP_LICENSE"; + + public const string MIRROR_TRADING = "MIRROR_TRADING"; + + public const string TRADING_SIGNAL_PACKAGE = "TRADING_SIGNAL_PACKAGE"; + + public const string EXTENDED_HISTOR?_PACKAGE = "EXTENDED_HISTOR?_PACKAGE "; + + public const string QUANTOWER_LITE = "QUANTOWER_LITE"; + + public const string QUANTOWER_ADVANCED_EQUITY = "QUANTOWER_ADVANCED_EQUITY"; + + public const string QUANTOWER_ADVANCED_INDICES = "QUANTOWER_ADVANCED_INDICES"; + + public const string QUANTOWER_ADVANCED_COMMODITY = "QUANTOWER_ADVANCED_COMMODITY"; + + public const string QUANTOWER_ADVANCED_EQUITY_COMMODITIES = "QUANTOWER_ADVANCED_EQUITY_COMMODITIES"; + + public const string TRUEDATA_NSECD_PACKAGE = "TRUEDATA_NSECD_PACKAGE"; + + public const string TRUEDATA_NSECM_PACKAGE = "TRUEDATA_NSECM_PACKAGE"; + + public const string TRUEDATA_NSEFO_PACKAGE = "TRUEDATA_NSEFO_PACKAGE"; + + public const string TRUEDATA_MCX_PACKAGE = "TRUEDATA_MCX_PACKAGE"; + + public const string TRUEDATA_VELOCITY = "TRUEDATA_VELOCITY"; + + public const string CEDROMARKETDATA_PACKAGE = "CEDROMARKETDATA_PACKAGE"; + + public static string GetRuleDescription(string ruleId) + { + if (ruleId != null) + { + switch (ruleId.Length) + { + case 14: + { + char c = ruleId[0]; + if (c != 'C') + { + switch (c) + { + case 'M': + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 'Q': + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + break; + } + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + goto IL_0363; + } + case 20: + { + char c = ruleId[0]; + if (c != 'C') + { + if (c != 'P' || !(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + goto IL_0363; + } + case 19: + switch (ruleId[0]) + { + case 'M': + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 'P': + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + break; + case 15: + switch (ruleId[0]) + { + case 'P': + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 'O': + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + break; + case 16: + switch (ruleId[0]) + { + case 'A': + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 'T': + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + break; + case 22: + switch (ruleId[0]) + { + case 'V': + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 'T': + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + break; + case 17: + switch (ruleId[0]) + { + case 'O': + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 'T': + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + break; + case 13: + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 18: + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 8: + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 12: + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 25: + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 26: + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 28: + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 37: + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 23: + { + if (!(ruleId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + IL_0363: + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + } + return ruleId; + } + } + /// + /// User licences info store + /// + public sealed class LicencesManager : IDisposable, ICustomizable + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func ??; + + internal bool ?(LicenceItem P_0) + { + return P_0.LicenceKey != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + + internal string ?(LicenceItem P_0) + { + return P_0.LicenceKey; + } + + internal bool ?(LicenceItem P_0) + { + return P_0.EndDate >= Core.Instance.TimeUtils.DateTimeUtcNow; + } + } + + private const string ?? = "https://gateway.accounts.quantower.com/"; + + private const string ?? = "refresh_token"; + + [CompilerGenerated] + private EventHandler ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + private ConnectionState ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private UserInfo ??; + + [CompilerGenerated] + private string ??; + + private IDictionary ??; + + private HttpClient ??; + + private HttpClient ??; + + private Timer ??; + + private string ??; + + private string ??; + + private string ??; + + private string ??; + + private LicenceItem ??; + + private LicenceItem ??; + + private LicenceItem ??; + + private LicenceItem ??; + + private LicenceItem ??; + + private LicenceItem ??; + + private LicenceItem ??; + + private LicenceItem ??; + + private LicenceItem ??; + + /// + /// Current state of connection to licence server + /// + public ConnectionState State + { + get + { + return ??; + } + private set + { + if (?? != connectionState) + { + LicenseManagerEventArgs e = new LicenseManagerEventArgs(??, connectionState); + ?? = connectionState; + ???.InvokeSafely(this, e); + } + } + } + + public string LastErrorText + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + /// + /// Current connected user info + /// + public UserInfo CurrentUser + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = userInfo; + } + } + + public string AccessToken + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public IList Settings + { + get + { + return new List + { + new SettingItemPassword(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new PasswordHolder(??, SavePassword: true, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())) + }; + } + set + { + foreach (SettingItem item in value) + { + if (!(item.Name == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + continue; + } + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + if (!string.IsNullOrEmpty(?? = (item.Value as PasswordHolder)?.Password)) + { + Task.Factory.StartNew(delegate + { + if (State == ConnectionState.Disconnected && !string.IsNullOrEmpty(??)) + { + State = ConnectionState.Connecting; + ?(); + } + }).Wait(); + } + else if (item.Value is PasswordHolder { FailedToRestorePassword: not false }) + { + LastErrorText = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Error); + State = ConnectionState.Disconnected; + } + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + } + } + } + + /// + /// All active licences that user have + /// + public IEnumerable AllLicenceItems => ??.Values; + + public event EventHandler StateChanged + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + public event Action LicenceRulesUpdated + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + public event Action LicenceCheckError + { + [CompilerGenerated] + add + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Combine(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + [CompilerGenerated] + remove + { + Action action = ??; + Action action2; + do + { + action2 = action; + Action value2 = (Action)Delegate.Remove(action2, value); + action = Interlocked.CompareExchange(ref ??, value2, action2); + } + while ((object)action != action2); + } + } + + internal LicencesManager() + { + ?? = ConnectionState.Disconnected; + ?? = new LicenceItem + { + LicenceKey = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), + StartDate = DateTime.UtcNow.AddDays(-10.0), + EndDate = DateTime.UtcNow.AddYears(100) + }; + ?? = new LicenceItem + { + LicenceKey = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + StartDate = DateTime.UtcNow.AddDays(-10.0), + EndDate = DateTime.UtcNow.AddYears(100) + }; + ?? = new LicenceItem + { + LicenceKey = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + StartDate = DateTime.UtcNow.AddDays(-10.0), + EndDate = DateTime.UtcNow.AddYears(100) + }; + ?? = new LicenceItem + { + LicenceKey = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + StartDate = DateTime.UtcNow.AddDays(-10.0), + EndDate = DateTime.UtcNow.AddYears(100) + }; + ?? = new LicenceItem + { + LicenceKey = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + StartDate = DateTime.UtcNow.AddDays(-10.0), + EndDate = DateTime.UtcNow.AddYears(100) + }; + ?? = new LicenceItem + { + LicenceKey = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + StartDate = DateTime.UtcNow.AddDays(-10.0), + EndDate = DateTime.UtcNow.AddYears(100) + }; + ?? = new LicenceItem + { + LicenceKey = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + StartDate = DateTime.UtcNow.AddDays(-10.0), + EndDate = DateTime.UtcNow.AddYears(100) + }; + ?? = new LicenceItem + { + LicenceKey = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + StartDate = DateTime.UtcNow.AddDays(-10.0), + EndDate = DateTime.UtcNow.AddYears(100) + }; + ?? = new LicenceItem + { + LicenceKey = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + StartDate = DateTime.UtcNow.AddDays(-10.0), + EndDate = DateTime.UtcNow.AddYears(100) + }; + } + + internal void ?() + { + ?? = new ReadOnlyDictionary(new Dictionary()); + ?? = new HttpClient(new HttpClientHandler + { + ServerCertificateCustomValidationCallback = ? + }); + ?? = new HttpClient(new HttpClientHandler + { + ServerCertificateCustomValidationCallback = ? + }); + } + + public void Dispose() + { + ?(); + if (?? != null) + { + ??.Dispose(); + ?? = null; + } + if (?? != null) + { + ??.Dispose(); + ?? = null; + } + } + + public void ConnectToAuthServer() + { + if (State != ConnectionState.Disconnected) + { + return; + } + LastErrorText = null; + try + { + ?? = ?(); + if (string.IsNullOrEmpty(??)) + { + throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + AccessToken = string.Empty; + ?? = string.Empty; + ?? = string.Empty; + OidcClient oidcClient = ?(); + LoginRequest request = new LoginRequest + { + BrowserDisplayMode = DisplayMode.Visible, + BrowserTimeout = 300 + }; + LoginResult result = oidcClient.LoginAsync(request).Result; + State = ConnectionState.Connecting; + AccessToken = result.AccessToken; + ?? = result.RefreshToken; + ?? = result.IdentityToken; + if (result.IsError) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + result.Error, LoggingLevel.Error); + State = ConnectionState.Disconnected; + return; + } + UserInfoResult result2 = oidcClient.GetUserInfoAsync(AccessToken).Result; + if (result2.IsError) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + result2.Error, LoggingLevel.Error); + } + else + { + CurrentUser = new UserInfo(result2.Claims); + } + ?? = ?(); + if (string.IsNullOrEmpty(??)) + { + throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ?(); + ?(); + State = ConnectionState.Connected; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + LastErrorText = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ex.Message; + State = ConnectionState.Disconnected; + } + } + + public void Disconnect() + { + if (State != ConnectionState.Connected) + { + return; + } + State = ConnectionState.Disconnecting; + try + { + OidcClient oidcClient = ?(); + LogoutRequest request = new LogoutRequest + { + IdTokenHint = ?? + }; + oidcClient.LogoutAsync(request).Wait(); + ?(); + ?? = null; + LastErrorText = null; + State = ConnectionState.Disconnected; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + State = ConnectionState.Disconnected; + } + } + + /// + /// Check that user have licence + /// + public LicenceItem GetLicenceRuleItem(string itemKey) + { + if (Encryptor.UnicDeviceId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || Encryptor.UnicDeviceId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || Encryptor.UnicDeviceId == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + return ??; + } + ??.TryGetValue(itemKey, out var value); + return value; + } + + public void OnLicenceCheckError(string errorText, string licenceItemKey) + { + ??.InvokeSafely(errorText, licenceItemKey); + } + + private void ?() + { + if (?? == null) + { + ?? = new Timer(?); + ??.Change(TimeSpan.Zero, TimeSpan.FromMinutes(2.0)); + } + } + + private void ?(object P_0) + { + try + { + ?(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + private void ?() + { + ImmutableDictionary immutableDictionary = (from P_0 in ?() + where P_0.LicenceKey != 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + select P_0).ToImmutableDictionary((LicenceItem P_0) => P_0.LicenceKey); + if (?(??, immutableDictionary)) + { + ?? = new ReadOnlyDictionary(immutableDictionary); + ???.Invoke(); + } + } + + private void ?() + { + LastErrorText = null; + try + { + AccessToken = string.Empty; + ?? = string.Empty; + ?? = ?(); + OidcClient oidcClient = ?(); + RefreshTokenResult result = oidcClient.RefreshTokenAsync(??).Result; + if (result.IsError) + { + LastErrorText = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + result.Error, LoggingLevel.Error); + ?(); + State = ConnectionState.Disconnected; + return; + } + AccessToken = result.AccessToken; + ?? = result.RefreshToken; + ?? = result.IdentityToken; + UserInfoResult result2 = oidcClient.GetUserInfoAsync(AccessToken).Result; + if (result2.IsError) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + result2.Error, LoggingLevel.Error); + } + else + { + CurrentUser = new UserInfo(result2.Claims); + } + ?? = ?(); + ?(); + ?(); + State = ConnectionState.Connected; + } + catch (Exception ex) + { + WebException ex2 = ex.GetInnerExceptionsRecursive().OfType().FirstOrDefault(); + if (ex2 != null && ex2.Status == WebExceptionStatus.ConnectFailure) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + else + { + ?(); + } + LastErrorText = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ex.Message; + Core.Instance.Loggers.Log(ex); + State = ConnectionState.Disconnected; + } + } + + private string ?() + { + try + { + UriBuilder uriBuilder = new UriBuilder(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + Path = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }; + if (Dns.GetHostAddresses(uriBuilder.Host).Contains(IPAddress.Loopback)) + { + throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + HttpResponseMessage result = ??.GetAsync(uriBuilder.Uri).Result; + if (result.IsSuccessStatusCode) + { + ? result2 = result.Content.ReadFromJsonAsync>().Result; + if (result2.IsSuccess) + { + return result2.Value; + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); + } + return null; + } + + private string ?() + { + try + { + UriBuilder uriBuilder = new UriBuilder(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + Path = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }; + if (Dns.GetHostAddresses(uriBuilder.Host).Contains(IPAddress.Loopback)) + { + throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + HttpResponseMessage result = ??.GetAsync(uriBuilder.Uri).Result; + if (result.IsSuccessStatusCode) + { + ?> result2 = result.Content.ReadFromJsonAsync>>().Result; + if (!result2.IsSuccess) + { + return null; + } + if (!result2.Value.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value)) + { + return null; + } + return value; + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, null, LoggingLevel.Verbose); + } + return null; + } + + private IEnumerable ?() + { + try + { + UriBuilder uriBuilder = new UriBuilder(??) + { + Path = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }; + if (Dns.GetHostAddresses(uriBuilder.Host).Contains(IPAddress.Loopback)) + { + throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ??.SetBearerToken(AccessToken); + HttpResponseMessage result = ??.GetAsync(uriBuilder.Uri).Result; + if (result.IsSuccessStatusCode) + { + JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions(); + jsonSerializerOptions.Converters.Add(new ?()); + return result.Content.ReadFromJsonAsync(jsonSerializerOptions).Result; + } + if (result.StatusCode == HttpStatusCode.Unauthorized) + { + UriBuilder uriBuilder2 = new UriBuilder(??) + { + Path = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }; + HttpResponseMessage result2 = ??.GetAsync(uriBuilder2.Uri).Result; + if (!result2.IsSuccessStatusCode) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(17, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(result2.StatusCode); + throw new Exception(defaultInterpolatedStringHandler.ToStringAndClear()); + } + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (State == ConnectionState.Connected) + { + ?(); + ?(); + } + } + else if (result.StatusCode == HttpStatusCode.NotFound) + { + throw new Exception(HttpStatusCode.NotFound.ToString()); + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ex.Message, LoggingLevel.Error); + } + return ???.Values.Where((LicenceItem P_0) => P_0.EndDate >= Core.Instance.TimeUtils.DateTimeUtcNow).ToArray() ?? Array.Empty(); + } + + private void ?() + { + AccessToken = null; + CurrentUser = null; + ?? = new ReadOnlyDictionary(new Dictionary()); + ???.Invoke(); + ?(); + } + + private void ?() + { + if (?? != null) + { + ??.Dispose(); + ?? = null; + } + } + + private OidcClient ?() + { + int value = 55650; + try + { + value = TcpIpHelper.GetRandomUnusedPort; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(31, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); + defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(17, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(value); + string text = defaultInterpolatedStringHandler.ToStringAndClear(); + string[] value2 = new string[5] + { + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }; + return new OidcClient(new OidcClientOptions + { + Authority = ??, + ClientId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + ClientSecret = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + RedirectUri = text, + PostLogoutRedirectUri = text, + Scope = string.Join(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), value2), + Browser = new ?(false, value) + { + ?? = Core.Instance.OAuthBrowserCreator + }, + ClockSkew = TimeSpan.FromMinutes(5.0) + (Core.Instance.TimeUtils.DateTimeUtcNow - DateTime.UtcNow).Duration() + }); + } + + private bool ?(HttpRequestMessage P_0, X509Certificate2 P_1, X509Chain P_2, SslPolicyErrors P_3) + { + if (P_1.Issuer == P_1.Subject) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + return false; + } + return P_3 == SslPolicyErrors.None; + } + + private static bool ?(IDictionary P_0, IDictionary P_1) + { + if (P_0.Count != P_1.Count) + { + return true; + } + foreach (string key in P_0.Keys) + { + if (!P_0.TryGetValue(key, out var value)) + { + return true; + } + if (!P_1.TryGetValue(key, out var value2)) + { + return true; + } + if (value.StartDate != value2.StartDate) + { + return true; + } + if (value.EndDate != value2.EndDate) + { + return true; + } + if (value.Value != value2.Value) + { + return true; + } + } + return false; + } + + [CompilerGenerated] + private void ?() + { + if (State == ConnectionState.Disconnected && !string.IsNullOrEmpty(??)) + { + State = ConnectionState.Connecting; + ?(); + } + } + } + public class LicenseManagerEventArgs : EventArgs + { + [CompilerGenerated] + private readonly ConnectionState ??; + + [CompilerGenerated] + private readonly ConnectionState ??; + + public ConnectionState PreviousState + { + [CompilerGenerated] + get + { + return ??; + } + } + + public ConnectionState NewState + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal LicenseManagerEventArgs(ConnectionState P_0, ConnectionState P_1) + { + ?? = P_0; + ?? = P_1; + } + } +} +namespace ? +{ + internal class ? + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private ? ??; + + [JsonPropertyName("ErrorText")] + public string ErrorText + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = text; + } + } + + [JsonPropertyName("isSuccess")] + public bool IsSuccess + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = flag; + } + } + + [JsonPropertyName("value")] + public ? Value + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = val; + } + } + } +} +namespace TradingPlatform.BusinessLayer.Licence +{ + public interface IOAuthBrowserControl + { + event Action BrowserClosed; + + event Action Navigated; + + void ShowBrowser(string url, bool allowOpenNewWindow); + + void CloseBrowser(); + } + public interface IOAuthBrowserCreator + { + IOAuthBrowserControl CreateBrowser(bool showBrowserWindow); + } + public abstract class LoopbackBase : IDisposable + { + protected readonly TaskCompletionSource taskSource; + + public LoopbackBase() + { + taskSource = new TaskCompletionSource(); + } + + public abstract Task WaitForCallbackAsync(CancellationToken token); + + public void CancelWaiting() + { + if (taskSource.TrySetCanceled()) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + } + } + + public virtual void Dispose() + { + } + } + /// + /// The loopback http listener without kestrel. + /// + public sealed class LoopbackHttpListenerWithoutKestrel : LoopbackBase, IDisposable + { + [CompilerGenerated] + private sealed class ? + { + public LoopbackHttpListenerWithoutKestrel ??; + + public CancellationToken ??; + + internal void ?() + { + ??.?(); + } + + internal void ?() + { + Task.Delay(TimeSpan.FromMinutes(30.0), ??).Wait(??); + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + ??.taskSource.SetException(new TimeoutException()); + } + } + + private readonly HttpListener ??; + + /// + /// Initializes a new instance of the class. + /// + /// The port. + public LoopbackHttpListenerWithoutKestrel(int port) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(18, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(port); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + string text = defaultInterpolatedStringHandler.ToStringAndClear(); + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + text, LoggingLevel.Verbose); + ?? = new HttpListener(); + ??.Prefixes.Add(text); + ??.Start(); + } + + /// + /// Dispose + /// + public override void Dispose() + { + Task.Run(async delegate + { + await Task.Delay(500); + ??.Stop(); + ??.Close(); + }); + } + + private void ?(string P_0, HttpListenerResponse P_1) + { + using Stream stream = P_1.OutputStream; + try + { + P_1.StatusCode = 200; + P_1.ContentType = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + string s = string.Format(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + byte[] bytes = Encoding.UTF8.GetBytes(s); + P_1.ContentLength64 = bytes.Length; + stream.WriteAsync(bytes, 0, bytes.Length); + taskSource.TrySetResult(P_0); + } + catch + { + P_1.StatusCode = 400; + } + } + + private void ?() + { + try + { + HttpListenerContext context = ??.GetContext(); + if (context.Request.HttpMethod == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() || context.Request.HttpMethod == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + string query = context.Request.Url.Query; + NameValueCollection nameValueCollection = HttpUtility.ParseQueryString(query); + if (nameValueCollection.AllKeys.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + _ = nameValueCollection[3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()]; + } + ?(query, context.Response); + } + else if (context.Request.HttpMethod == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + if (context.Request.ContentType.Equals(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), StringComparison.OrdinalIgnoreCase)) + { + using (StreamReader streamReader = new StreamReader(context.Request.InputStream, Encoding.UTF8)) + { + string text = streamReader.ReadToEnd(); + ?(text, context.Response); + return; + } + } + context.Response.StatusCode = 415; + } + else + { + context.Response.StatusCode = 405; + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + /// + /// Wait for callback asynchronously. + /// + /// The token. + /// ]]> + public override Task WaitForCallbackAsync(CancellationToken token) + { + token.Register(base.CancelWaiting); + Task.Factory.StartNew(delegate + { + ?(); + }, token); + Task.Factory.StartNew(delegate + { + Task.Delay(TimeSpan.FromMinutes(30.0), token).Wait(token); + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + taskSource.SetException(new TimeoutException()); + }, token); + return taskSource.Task; + } + + [CompilerGenerated] + private async Task? ?() + { + await Task.Delay(500); + ??.Stop(); + ??.Close(); + } + } + public sealed class LoopbackRedirects : LoopbackBase, IDisposable + { + [CompilerGenerated] + private sealed class ? + { + public CancellationToken ??; + + public LoopbackRedirects ??; + + internal void ?() + { + Task.Delay(TimeSpan.FromMinutes(30.0), ??).Wait(??); + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + ??.taskSource.SetException(new TimeoutException()); + } + } + + private readonly IOAuthBrowserControl ??; + + public LoopbackRedirects(IOAuthBrowserControl browserControl) + { + ?? = browserControl; + ??.Navigated += ?; + } + + public override void Dispose() + { + if (?? != null) + { + ??.Navigated -= ?; + } + } + + private void ?(string P_0) + { + try + { + string query = new Uri(P_0).Query; + NameValueCollection nameValueCollection = HttpUtility.ParseQueryString(query); + if (nameValueCollection.AllKeys.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + _ = nameValueCollection[3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()]; + taskSource.TrySetResult(query); + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + public override Task WaitForCallbackAsync(CancellationToken token) + { + token.Register(base.CancelWaiting); + Task.Factory.StartNew(delegate + { + Task.Delay(TimeSpan.FromMinutes(30.0), token).Wait(token); + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + taskSource.SetException(new TimeoutException()); + }, token); + return taskSource.Task; + } + } +} +namespace ? +{ + internal class ? : IdentityModel.OidcClient.Browser.IBrowser + { + [CompilerGenerated] + private sealed class ? + { + public LoopbackBase ??; + + internal void ?() + { + ???.CancelWaiting(); + } + } + + internal IOAuthBrowserCreator ??; + + private readonly int ??; + + private readonly bool ??; + + public ?(bool P_0, int? P_1 = null) + { + ?? = P_0; + if (!P_1.HasValue) + { + ?? = TcpIpHelper.GetRandomUnusedPort; + } + else + { + ?? = P_1.Value; + } + } + + public async Task InvokeAsync(BrowserOptions options, CancellationToken cancellationToken = default(CancellationToken)) + { + IOAuthBrowserControl iOAuthBrowserControl = ?(options.StartUrl); + LoopbackBase ?? = null; + if (options.EndUrl.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + ?? = new LoopbackHttpListenerWithoutKestrel(??); + } + else + { + ?? = new LoopbackRedirects(iOAuthBrowserControl); + } + if (iOAuthBrowserControl != null) + { + iOAuthBrowserControl.BrowserClosed += delegate + { + ???.CancelWaiting(); + }; + } + try + { + string text = await ??.WaitForCallbackAsync(cancellationToken); + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + text, LoggingLevel.Verbose); + if (string.IsNullOrWhiteSpace(text)) + { + return new BrowserResult + { + ResultType = BrowserResultType.UnknownError, + Error = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + }; + } + return new BrowserResult + { + Response = text, + ResultType = BrowserResultType.Success + }; + } + catch (TimeoutException ex) + { + return new BrowserResult + { + ResultType = BrowserResultType.Timeout, + Error = ex.Message + }; + } + catch (TaskCanceledException ex2) + { + return new BrowserResult + { + ResultType = BrowserResultType.UserCancel, + Error = ex2.Message + }; + } + catch (Exception ex3) + { + return new BrowserResult + { + ResultType = BrowserResultType.UnknownError, + Error = ex3.Message + }; + } + finally + { + iOAuthBrowserControl?.CloseBrowser(); + ??.Dispose(); + } + } + + private IOAuthBrowserControl ?(string P_0) + { + if (?? == null) + { + ?(P_0); + return null; + } + IOAuthBrowserControl iOAuthBrowserControl = ??.CreateBrowser(!P_0.Contains(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())); + iOAuthBrowserControl.ShowBrowser(P_0, ??); + return iOAuthBrowserControl; + } + + private static void ?(string P_0) + { + try + { + Process.Start(P_0); + } + catch + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + P_0 = P_0.Replace(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + Process.Start(new ProcessStartInfo(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0) + { + CreateNoWindow = true + }); + return; + } + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + Process.Start(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0); + return; + } + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + Process.Start(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), P_0); + return; + } + throw; + } + } + } +} +namespace TradingPlatform.BusinessLayer.Licence +{ + public static class TcpIpHelper + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + internal bool ?(TcpConnectionInformation P_0) + { + return P_0.State != TcpState.Closed; + } + + internal int ?(TcpConnectionInformation P_0) + { + return P_0.LocalEndPoint.Port; + } + + internal int ?(IPEndPoint P_0) + { + return P_0.Port; + } + + internal int ?(IPEndPoint P_0) + { + return P_0.Port; + } + } + + private static readonly Random ??; + + public static int GetRandomUnusedPort + { + get + { + IPGlobalProperties iPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties(); + IEnumerable first = from P_0 in iPGlobalProperties.GetActiveTcpConnections() + where P_0.State != TcpState.Closed + select P_0.LocalEndPoint.Port; + IPEndPoint[] activeTcpListeners = iPGlobalProperties.GetActiveTcpListeners(); + first = first.Union(activeTcpListeners.Select((IPEndPoint P_0) => P_0.Port)); + IPEndPoint[] activeUdpListeners = iPGlobalProperties.GetActiveUdpListeners(); + first = first.Union(activeUdpListeners.Select((IPEndPoint P_0) => P_0.Port)); + int num = 49152; + int num2 = 65535; + int[] array = Enumerable.Range(num, num2 - num + 1).Except(first).ToArray(); + if (!array.Any()) + { + throw new ApplicationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + int num3 = ??.Next(0, array.Length - 1); + return array[num3]; + } + } + + static TcpIpHelper() + { + ?? = new Random(); + } + } + public class UserInfo + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + public string Email + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + public string UserId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + public UserInfo(IEnumerable claims) + { + foreach (Claim claim in claims) + { + if (claim.Type == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + UserId = claim.Value; + } + if (claim.Type == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + Name = claim.Value; + } + if (claim.Type == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + Email = claim.Value; + } + } + } + } +} +namespace TradingPlatform.BusinessLayer.DataBinding +{ + [AttributeUsage(AttributeTargets.Property)] + public class BindableAttribute : Attribute + { + [CompilerGenerated] + private readonly string ??; + + public string Alias + { + [CompilerGenerated] + get + { + return ??; + } + } + + public BindableAttribute(string alias) + { + ?? = alias; + } + } + public abstract class BindableEntity : IBindableEntity, INotifyPropertyChanged + { + [CompilerGenerated] + private sealed class ? + { + public BindableEntity ??; + + public string ??; + + internal void ?(object? _, NotifyCollectionChangedEventArgs P_1) + { + ??.?(??, P_1); + } + } + + public const string SYMBOL = "symbol"; + + public const string ACCOUNT = "account"; + + public const string ACCOUNTS = "accounts"; + + public const string ORDER_TYPE = "orderType"; + + public const string SIDE = "side"; + + public const string QUANTITY = "quantity"; + + public const string PRICE = "price"; + + public const string TRIGGER_PRICE = "triggerPrice"; + + public const string CONNECTION_ID = "connectionId"; + + public const string CONNECTIONS = "connections"; + + public const string CONNECTION = "connection"; + + public const string EXCHANGES = "exchanges"; + + public const string EXCHANGE = "exchange"; + + public const string CONTAINERS = "containers"; + + public const string CONTAINER = "container"; + + public const string VISIBLE = "visible"; + + public const string ENABLED = "enabled"; + + public const string CHECKED = "checked"; + + public const string HIDDEN = "hidden"; + + public const string ERROR = "error"; + + public const string WARNING = "warning"; + + public const string ORDER = "order"; + + public const string POSITION = "position"; + + public const string GROSS_PNL = "grossPnl"; + + public const string FEE = "fee"; + + public const string NET_PNL = "netPnl"; + + public const string STOP_LOSS = "stopLoss"; + + public const string TAKE_PROFIT = "takeProfit"; + + public const string BRACKET = "bracket"; + + public const string IS_TRAILING = "isTrailing"; + + public const string IS_TRAILING_ALLOWED = "isTrailingAllowed"; + + public const string TICKS = "ticks"; + + public const string PERIOD = "period"; + + public const string SELECTED_ITEM = "selectedItem"; + + public const string ITEMS = "items"; + + public const string SETTINGS = "settings"; + + public const string COMMAND = "command"; + + public const string CANCEL_COMMAND = "cancelCommand"; + + public const string CLOSE_COMMAND = "closeCommand"; + + public const string ADD_COMMAND = "addCommand"; + + public const string EDIT_COMMAND = "editCommand"; + + public const string DELETE_COMMAND = "deleteCommand"; + + public const string SELECT_COMMAND = "selectCommand"; + + public const string SAVE_COMMAND = "saveCommand"; + + public const string CLEAR_COMMAND = "clearAllCommand"; + + public const string APPLY_COMMAND = "applyCommand"; + + public const string DISCARD_COMMAND = "discardCommand"; + + public const string CHANGED_COMMAND = "changedCommand"; + + public const string VALUE = "value"; + + public const string TEXT = "text"; + + public const string LABEL = "label"; + + public const string TOOLTIP = "tooltip"; + + public const string MAXIMUM = "maximum"; + + public const string MINIMUM = "minimum"; + + public const string INCREMENT = "increment"; + + public const string DECIMAL_PLACES = "decimalPlaces"; + + public const string DIMENSION = "dimension"; + + public const string LINK_TEXT = "linkText"; + + public const string STEPS_COUNT = "stepsCount"; + + public const string CURRENT_STEP = "currentStep"; + + public const string WIDTH = "width"; + + public const string IS_SLIM_MODE_ENABLED = "isSlimModeEnabled"; + + public const string COLOR = "color"; + + public const string FOREGROUND_COLOR = "foregroundColor"; + + public const string BACKGROUND_COLOR = "backgroundColor"; + + public const string FORMAT = "format"; + + public const string INDEX = "index"; + + public const string SHOW = "show"; + + public const string SHOW_TOOLBAR = "showToolbar"; + + public const string IS_ACTIVE = "isActive"; + + public const string MULTIPLIER = "multiplier"; + + public const string NAME = "name"; + + public const string DESCRIPTION = "description"; + + public const string FROM = "from"; + + public const string TO = "to"; + + public const string TYPE = "type"; + + public const string START = "start"; + + public const string END = "end"; + + public const string DAY = "day"; + + public const string TIMEZONE = "timeZone"; + + public const string IS_VALID = "isValid"; + + public const string DATE = "date"; + + public const string DIRECTION = "direction"; + + public const string PROGRESS = "progress"; + + public const string COUNT = "count"; + + public const string IS_ALLOWED = "isAllowed"; + + public const string IS_LOADING = "isLoading"; + + public const string FILTRATION = "filtration"; + + public const string COLUMNS = "columns"; + + public const string ROWS = "rows"; + + private static readonly BusinessObjectEqualityComparer ?? = new BusinessObjectEqualityComparer(); + + private static readonly ListEqualityComparer ?? = new ListEqualityComparer(EqualityComparer.Default); + + private static readonly ListEqualityComparer ?? = new ListEqualityComparer(EqualityComparer.Default); + + private static readonly UniqueIdEqualityComparer ?? = new UniqueIdEqualityComparer(); + + private readonly Lazy> ?? = new Lazy>(); + + [CompilerGenerated] + private PropertyChangedEventHandler ??; + + public event PropertyChangedEventHandler PropertyChanged + { + [CompilerGenerated] + add + { + PropertyChangedEventHandler propertyChangedEventHandler = ??; + PropertyChangedEventHandler propertyChangedEventHandler2; + do + { + propertyChangedEventHandler2 = propertyChangedEventHandler; + PropertyChangedEventHandler value2 = (PropertyChangedEventHandler)Delegate.Combine(propertyChangedEventHandler2, value); + propertyChangedEventHandler = Interlocked.CompareExchange(ref ??, value2, propertyChangedEventHandler2); + } + while ((object)propertyChangedEventHandler != propertyChangedEventHandler2); + } + [CompilerGenerated] + remove + { + PropertyChangedEventHandler propertyChangedEventHandler = ??; + PropertyChangedEventHandler propertyChangedEventHandler2; + do + { + propertyChangedEventHandler2 = propertyChangedEventHandler; + PropertyChangedEventHandler value2 = (PropertyChangedEventHandler)Delegate.Remove(propertyChangedEventHandler2, value); + propertyChangedEventHandler = Interlocked.CompareExchange(ref ??, value2, propertyChangedEventHandler2); + } + while ((object)propertyChangedEventHandler != propertyChangedEventHandler2); + } + } + + protected bool SetValue(ref T storage, T value, IEqualityComparer comparer = null, [CallerMemberName] string propertyName = null) + { + if (IsValueEquals(storage, value, comparer)) + { + return false; + } + ?(storage, propertyName); + storage = value; + OnPropertyChanged(propertyName); + ?(storage, propertyName); + return true; + } + + protected bool IsValueEquals(T oldValue, T newValue, IEqualityComparer comparer = null) + { + if (comparer != null) + { + return comparer.Equals(oldValue, newValue); + } + T val = ((oldValue != null) ? oldValue : newValue); + return (val is Symbol) ? ??.Equals(oldValue as BusinessObject, newValue as BusinessObject) : ((val is IUniqueID) ? ??.Equals(oldValue as IUniqueID, newValue as IUniqueID) : ((val is IList) ? ??.Equals(oldValue as IList, newValue as IList) : ((!(val is IList)) ? EqualityComparer.Default.Equals(oldValue, newValue) : ??.Equals(oldValue as IList, newValue as IList)))); + } + + private void ?(? P_0, string P_1) + { + if (P_0 is INotifyCollectionChanged notifyCollectionChanged && P_1 != null && ??.Value.TryRemove(P_1, out var value)) + { + notifyCollectionChanged.CollectionChanged -= value; + } + } + + private void ?(? P_0, string P_1) + { + if (P_0 is INotifyCollectionChanged notifyCollectionChanged && P_1 != null) + { + NotifyCollectionChangedEventHandler value = delegate(object? _, NotifyCollectionChangedEventArgs e) + { + this.?(P_1, e); + }; + if (??.Value.TryAdd(P_1, value)) + { + notifyCollectionChanged.CollectionChanged += value; + } + } + } + + protected void OnPropertyChanged(string propertyName) + { + ?(new PropertyChangedEventArgs(propertyName)); + } + + private void ?(string P_0, NotifyCollectionChangedEventArgs P_1) + { + ?(new CollectionChangedEventArgs(P_0, P_1)); + } + + private void ?(PropertyChangedEventArgs P_0) + { + ???.InvokeSafely(this, P_0); + } + } + public class Binding : IDisposable + { + internal class ? + { + [CompilerGenerated] + private sealed class ? + { + public List ??; + + internal List ?(Type _) + { + return ??; + } + + internal List ?(Type _, List P_1) + { + return ??; + } + } + + [CompilerGenerated] + private readonly IBindableEntity ??; + + [CompilerGenerated] + private readonly string ??; + + [CompilerGenerated] + private readonly Type ??; + + private readonly PropertyInfo ??; + + private static readonly ConcurrentDictionary> ??; + + private static readonly PropertyInfoEqualityComparer ??; + + public IBindableEntity Entity + { + [CompilerGenerated] + get + { + return ??; + } + } + + public string PropertyName + { + [CompilerGenerated] + get + { + return ??; + } + } + + public Type PropertyType + { + [CompilerGenerated] + get + { + return ??; + } + } + + static ?() + { + ?? = new ConcurrentDictionary>(); + ?? = new PropertyInfoEqualityComparer(); + } + + public ?(IBindableEntity P_0, string P_1) + { + ?? = P_0; + ?? = P_1; + foreach (PropertyInfo item in ?(Entity.GetType())) + { + if (!((item.GetCustomAttribute()?.Alias ?? item.Name) != P_1)) + { + ?? = item.Name; + ?? = item.PropertyType; + ?? = item; + break; + } + } + if (?? == null) + { + throw new BindingPropertyMissingException(P_1); + } + } + + public object ?() + { + try + { + if (?? == null || !??.CanRead) + { + return null; + } + return ???.GetValue(Entity); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + return null; + } + + public void ?(object P_0) + { + try + { + if (!(?? == null) && ??.CanWrite) + { + ??.SetValue(Entity, P_0); + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(11, 2); + defaultInterpolatedStringHandler.AppendFormatted(PropertyName); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Entity.GetType()); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + private static List ?(Type P_0) + { + if (??.TryGetValue(P_0, out var value)) + { + return value; + } + List ?? = new List(); + Type type = P_0; + do + { + PropertyInfo[] properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); + ??.AddRange(properties); + type = type.BaseType; + } + while (type != null); + ?? = ??.Distinct(??).ToList(); + ??.AddOrUpdate(P_0, (Type _) => ??, (Type _, List list) => ??); + return ??; + } + } + + [StructLayout(LayoutKind.Auto)] + [CompilerGenerated] + private struct ? + { + public Binding ??; + + public IList ??; + + public NotifyCollectionChangedEventArgs ??; + } + + [CompilerGenerated] + private readonly ? ??; + + [CompilerGenerated] + private readonly ? ??; + + [CompilerGenerated] + private Queue ??; + + [CompilerGenerated] + private Predicate ??; + + [CompilerGenerated] + private Func ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + [CompilerGenerated] + private Action ??; + + private bool ??; + + internal ? Accessor1 + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal ? Accessor2 + { + [CompilerGenerated] + get + { + return ??; + } + } + + internal Queue ConvertersQueue + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = queue; + } + } + + internal Predicate Predicate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = predicate; + } + } + + internal Func ItemsFactory + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = func; + } + } + + internal Action RemoveItemCallback + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = action; + } + } + + internal Action ClearItemsCallback + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = action; + } + } + + internal Action ApplyCallback + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = action; + } + } + + public Binding(IBindableEntity entity1, string propertyName1, IBindableEntity entity2, string propertyName2) + { + if (entity1 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (entity2 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + ?? = new ?(entity1, propertyName1); + ?? = new ?(entity2, propertyName2); + Accessor1.Entity.PropertyChanged += ?; + Accessor2.Entity.PropertyChanged += ?; + } + + private void ?(object P_0, PropertyChangedEventArgs P_1) + { + ? ? = ((P_0 == Accessor1.Entity) ? Accessor1 : Accessor2); + ? ?2 = ((P_0 == Accessor1.Entity) ? Accessor2 : Accessor1); + if (? == null || ?2 == null || P_1.PropertyName != ?.PropertyName || (Predicate != null && !Predicate(?.Entity))) + { + return; + } + try + { + if (!??) + { + ?? = true; + if (P_1 is CollectionChangedEventArgs e && ?2.?() is IList list) + { + this.?(?, list, e); + } + else + { + this.?(?, ?2); + } + } + } + finally + { + ?? = false; + } + } + + internal Binding ?(? P_0, ? P_1) + { + object obj = P_0.?(); + if (ConvertersQueue == null || !ConvertersQueue.Any()) + { + P_1.?(obj); + return this; + } + object convertedValue = obj; + foreach (IBindingValueConverter item in ConvertersQueue) + { + if (!item.TryConvert(convertedValue, P_0.PropertyType, P_0.Entity, out convertedValue)) + { + return this; + } + } + P_1.?(convertedValue); + ApplyCallback?.InvokeSafely(); + return this; + } + + private Binding ?(? P_0, IList P_1, CollectionChangedEventArgs P_2) + { + ? ? = default(?); + ?.?? = this; + ?.?? = P_1; + ?.?? = P_2.CollectionChangedArgs; + switch (?.??.Action) + { + case NotifyCollectionChangedAction.Add: + foreach (object newItem in ?.??.NewItems) + { + ?(newItem, ref ?); + } + break; + case NotifyCollectionChangedAction.Move: + { + object value = ?.??[?.??.OldStartingIndex]; + ?.??.RemoveAt(?.??.OldStartingIndex); + ?.??.Insert(?.??.NewStartingIndex, value); + break; + } + case NotifyCollectionChangedAction.Remove: + ?(ref ?); + break; + case NotifyCollectionChangedAction.Replace: + ?(ref ?); + foreach (object newItem2 in ?.??.NewItems) + { + ?(newItem2, ref ?); + } + break; + case NotifyCollectionChangedAction.Reset: + ClearItemsCallback?.InvokeSafely(); + ?.??.Clear(); + break; + default: + throw new ArgumentOutOfRangeException(); + } + return this; + } + + internal bool ?(object P_0) + { + if (Accessor1.Entity != P_0) + { + return Accessor2.Entity == P_0; + } + return true; + } + + public void Dispose() + { + Accessor1.Entity.PropertyChanged -= ?; + Accessor2.Entity.PropertyChanged -= ?; + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(18, 3); + defaultInterpolatedStringHandler.AppendFormatted(Accessor1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Accessor2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(ConvertersQueue?.Count); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + [CompilerGenerated] + private void ?(object P_0, ref ? P_1) + { + object value = ItemsFactory?.Invoke(P_0) ?? P_0; + P_1.??.Insert(P_1.??.NewStartingIndex, value); + } + + [CompilerGenerated] + private void ?(ref ? P_0) + { + object obj = P_0.??[P_0.??.OldStartingIndex]; + P_0.??.RemoveAt(P_0.??.OldStartingIndex); + RemoveItemCallback?.Invoke(obj); + } + } + public static class BindingExtensions + { + public static Binding WithConvertor(this Binding binding, IBindingValueConverter converter) + { + if (binding.ConvertersQueue == null) + { + Queue queue = (binding.ConvertersQueue = new Queue()); + } + binding.ConvertersQueue.Enqueue(converter); + return binding; + } + + public static Binding WithPredicate(this Binding binding, Predicate predicate) + { + binding.Predicate = predicate; + return binding; + } + + public static Binding WithItemsFactory(this Binding binding, Func itemsFactory) + { + binding.ItemsFactory = itemsFactory; + return binding; + } + + public static Binding WithRemoveItemCallback(this Binding binding, Action removeItemCallback) + { + binding.RemoveItemCallback = removeItemCallback; + return binding; + } + + public static Binding WithClearItemsCallback(this Binding binding, Action clearItemsCallback) + { + binding.ClearItemsCallback = clearItemsCallback; + return binding; + } + + public static Binding WithApplyCallback(this Binding binding, Action applyCallback) + { + binding.ApplyCallback = applyCallback; + return binding; + } + + public static Binding ApplyValue(this Binding binding) + { + return binding.?(binding.Accessor2, binding.Accessor1); + } + } + public class CollectionChangedEventArgs : PropertyChangedEventArgs + { + [CompilerGenerated] + private readonly NotifyCollectionChangedEventArgs ??; + + public NotifyCollectionChangedEventArgs CollectionChangedArgs + { + [CompilerGenerated] + get + { + return ??; + } + } + + public CollectionChangedEventArgs(string propertyName, NotifyCollectionChangedEventArgs collectionChangedArgs) + : base(propertyName) + { + ?? = collectionChangedArgs; + } + } +} +namespace ? +{ + internal class ? : IDisposable + { + [CompilerGenerated] + private sealed class ? + { + public IBindableEntity ??; + + internal bool ?(Binding P_0) + { + return P_0.?(??); + } + } + + private IBindableEntity ??; + + private readonly IList ??; + + public ?(IBindableEntity P_0) + { + ?? = P_0; + ?? = new List(); + } + + public Binding ?(IBindableEntity P_0, string P_1) + { + return ?(P_0, P_1, ??, P_1); + } + + public Binding ?(IBindableEntity P_0, string P_1, string P_2) + { + return ?(P_0, P_1, ??, P_2); + } + + public Binding ?(IBindableEntity P_0, string P_1, IBindableEntity P_2, string P_3) + { + try + { + Binding binding = new Binding(P_0, P_1, P_2, P_3); + ??.Add(binding); + return binding; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + return null; + } + + public void ?(IBindableEntity P_0) + { + if (P_0 == null) + { + return; + } + try + { + foreach (Binding item in ??.Where((Binding binding) => binding.?(P_0)).ToList()) + { + ??.Remove(item); + item.Dispose(); + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + + public void Dispose() + { + ?? = null; + foreach (Binding item in ??) + { + item.Dispose(); + } + } + } +} +namespace TradingPlatform.BusinessLayer.DataBinding +{ + public interface IBindableEntity : INotifyPropertyChanged + { + } + public interface IBindingValueConverter + { + bool TryConvert(object value, Type valueType, IBindableEntity source, out object convertedValue); + } + public interface ICommandBindableEntity : IBindableEntity, INotifyPropertyChanged + { + ICommand Command { get; set; } + } +} +namespace TradingPlatform.BusinessLayer.DataBinding.Mvvm +{ + public abstract class BindableView : BindableEntity, IBindableView, IDisposable + { + private IBindableEntity ??; + + private ? ??; + + public IBindableEntity BindingContext + { + get + { + return ??; + } + set + { + ?? = value; + ???.Dispose(); + if (?? == null) + { + return; + } + ?? = new ?(??); + try + { + BindContext(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + } + + protected virtual void BindContext() + { + } + + public Binding Bind(string propertyName) + { + return ??.?(this, propertyName); + } + + public Binding Bind(string propertyName1, string propertyName2) + { + return ??.?(this, propertyName1, propertyName2); + } + + public Binding Bind(IBindableEntity entity1, string propertyName) + { + return ??.?(entity1, propertyName, propertyName); + } + + public Binding Bind(IBindableEntity entity1, string propertyName1, string propertyName2) + { + return ??.?(entity1, propertyName1, propertyName2); + } + + public Binding Bind(IBindableEntity entity1, string propertyName1, IBindableEntity entity2, string propertyName2) + { + return ??.?(entity1, propertyName1, entity2, propertyName2); + } + + public void Unbind(IBindableEntity entity) + { + ??.?(entity); + } + + public virtual void Dispose() + { + BindingContext = null; + } + } + public interface IBindableView : IDisposable + { + IBindableEntity BindingContext { get; set; } + } +} +namespace TradingPlatform.BusinessLayer.DataBinding.Extensions +{ + public static class CommandBindableEntityExtensions + { + public static void TryExecuteCommand(this ICommandBindableEntity entity, object parameter = null) + { + entity.TryExecuteCommand(entity.Command, parameter); + } + + public static void TryExecuteCommand(this IBindableEntity entity, ICommand command, object parameter = null) + { + try + { + if (command != null) + { + if (parameter == null) + { + parameter = entity; + } + if (command.CanExecute(parameter)) + { + command.Execute(parameter); + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + } +} +namespace TradingPlatform.BusinessLayer.DataBinding.Exceptions +{ + public class BindingException : Exception + { + protected BindingException(string message) + : base(message) + { + } + } + public class BindingPropertyMissingException : BindingException + { + public BindingPropertyMissingException(string propertyAlias) + : base(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + propertyAlias + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + { + } + } +} +namespace TradingPlatform.BusinessLayer.DataBinding.Converters +{ + public class DateTimeTimeSpanConverter : IBindingValueConverter + { + public bool TryConvert(object value, Type valueType, IBindableEntity source, out object convertedValue) + { + convertedValue = null; + if (value is DateTime dateTime) + { + convertedValue = dateTime.TimeOfDay; + return true; + } + if (value is TimeSpan value2) + { + convertedValue = default(DateTime).Add(value2); + return true; + } + return false; + } + } + public class DoubleDecimalConverter : IBindingValueConverter + { + public bool TryConvert(object value, Type valueType, IBindableEntity source, out object convertedValue) + { + convertedValue = null; + if (value is double num) + { + if (!(num <= -7.922816251426434E+28)) + { + if (num >= 7.922816251426434E+28) + { + convertedValue = decimal.MaxValue; + return true; + } + convertedValue = (decimal)num; + return true; + } + convertedValue = decimal.MinValue; + return true; + } + if (value is decimal num2) + { + convertedValue = (double)num2; + return true; + } + return false; + } + } + public class IntDecimalConverter : IBindingValueConverter + { + public bool TryConvert(object value, Type valueType, IBindableEntity source, out object convertedValue) + { + convertedValue = null; + if (!(value is int num)) + { + if (value is decimal val) + { + decimal val2 = Math.Max(val, -2147483648m); + val2 = Math.Min(val2, 2147483647m); + convertedValue = (int)val2; + return true; + } + return false; + } + convertedValue = (decimal)num; + return true; + } + } + public class LongDecimalConverter : IBindingValueConverter + { + public bool TryConvert(object value, Type valueType, IBindableEntity source, out object convertedValue) + { + convertedValue = null; + if (!(value is long num)) + { + if (value is decimal val) + { + decimal val2 = Math.Max(val, -9223372036854775808m); + val2 = Math.Min(val2, 9223372036854775807m); + convertedValue = (long)val2; + return true; + } + return false; + } + convertedValue = (decimal)num; + return true; + } + } + public class SettingItemToStringConverter : IBindingValueConverter + { + public bool TryConvert(object value, Type valueType, IBindableEntity source, out object convertedValue) + { + convertedValue = null; + if (!(source is SettingItem settingItem)) + { + return false; + } + convertedValue = settingItem.Value?.ToString() ?? settingItem.Text; + return true; + } + } + public class StringToLocalizedStringConverter : IBindingValueConverter + { + public bool TryConvert(object value, Type valueType, IBindableEntity source, out object convertedValue) + { + convertedValue = null; + if (source is IBindableView) + { + return false; + } + if (!(value is string text)) + { + return false; + } + convertedValue = loc._(text, null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return true; + } + } + public class ValueConverter : IBindingValueConverter + { + private readonly Func ??; + + public ValueConverter(Func convertDelegate) + { + ?? = convertDelegate ?? throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + + public bool TryConvert(object value, Type valueType, IBindableEntity source, out object convertedValue) + { + convertedValue = null; + if (valueType != typeof(TValue)) + { + return false; + } + if (value is TValue arg) + { + convertedValue = ??(arg); + } + else + { + convertedValue = ??(default(TValue)); + } + return true; + } + } +} +namespace TradingPlatform.BusinessLayer.DataBinding.Commands +{ + public class BindingCommand : ICommand + { + private readonly Action ??; + + private readonly Predicate ??; + + [CompilerGenerated] + private EventHandler ??; + + public event EventHandler CanExecuteChanged + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + public BindingCommand(Action action, Predicate canExecutePredicate = null) + { + ?? = action; + ?? = canExecutePredicate; + } + + public bool CanExecute(object parameter) + { + return ???.Invoke(parameter) ?? (?? != null); + } + + public void Execute(object parameter) + { + try + { + ???.Invoke(parameter); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + } +} +namespace ? +{ + internal class ? + { + [CompilerGenerated] + private sealed class ? + { + public string ??; + + internal bool ?(? P_0) + { + return P_0.Regex.Match(??).Success; + } + } + + private static readonly IList ?? = new List + { + new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()), + new ?(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + }; + + public void ?(SettingItem P_0) + { + IList value = P_0.GetValue>(); + SettingItem itemByName = value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + SettingItem itemByName2 = value.GetItemByName(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + string text = itemByName.Value.ToString(); + foreach (? item in ??) + { + if (item.Regex.Match(text).Success) + { + itemByName.Value = text.Replace(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + item.OldName, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + item.NewName); + itemByName2.Value = item.NewName; + break; + } + } + } + + public string ?(string P_0) + { + ? ?2 = ??.FirstOrDefault((? ?3) => ?3.Regex.Match(P_0).Success); + if (?2 == null) + { + return P_0; + } + return P_0.Replace(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ?2.OldName, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ?2.NewName); + } + } + internal class ? + { + [CompilerGenerated] + private readonly string ??; + + [CompilerGenerated] + private readonly string ??; + + [CompilerGenerated] + private readonly Regex ??; + + public string OldName + { + [CompilerGenerated] + get + { + return ??; + } + } + + public string NewName + { + [CompilerGenerated] + get + { + return ??; + } + } + + public Regex Regex + { + [CompilerGenerated] + get + { + return ??; + } + } + + public ?(string P_0, string P_1) + { + ?? = P_0; + ?? = P_1; + ?? = new Regex(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + OldName + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } +} +namespace TradingPlatform.BusinessLayer.VolumeAnalysis.Storage +{ + public interface IVolumeAnalysisLocalStorage : ILocalStorage + { + void Save(VolumeAnalysisInterval volumeAnalysisInterval); + + VolumeAnalysisInterval Load(VolumeAnalysisDescription description, Interval interval); + + void Delete(VolumeAnalysisDescription description, Interval interval); + + VolumeAnalysisStorageInfo GetInfo(VolumeAnalysisDescription description); + } + public class VolumeAnalysisDescription + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private Period? ??; + + [CompilerGenerated] + private bool ??; + + public string SymbolId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Period? Period + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool IncludePriceLevels + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public VolumeAnalysisDescription(string symbolId, Period? period, bool includePriceLevels) + { + SymbolId = symbolId; + Period = period; + IncludePriceLevels = includePriceLevels; + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(6, 3); + defaultInterpolatedStringHandler.AppendFormatted(SymbolId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Period); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(IncludePriceLevels); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + public class VolumeAnalysisInterval + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal int ?(VolumeAnalysisData P_0) + { + return P_0.PriceLevels.Count; + } + } + + [CompilerGenerated] + private VolumeAnalysisDescription ??; + + [CompilerGenerated] + private Interval ??; + + [CompilerGenerated] + private IList ??; + + public VolumeAnalysisDescription Description + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Interval Interval + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IList VolumeAnalysis + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(32, 4); + defaultInterpolatedStringHandler.AppendFormatted(Description); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Interval); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(VolumeAnalysis.Count); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(VolumeAnalysis.Sum((VolumeAnalysisData P_0) => P_0.PriceLevels.Count)); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + public class VolumeAnalysisStorage : DataStorage + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func, bool> ??; + + internal bool ?(Interval P_0) + { + return !P_0.IsEmpty; + } + } + + [CompilerGenerated] + private sealed class ? + { + public Interval ??; + + public VolumeAnalysisByPeriodRequestParameters ??; + + internal VolumeAnalysisByPeriodRequestParameters ?(Interval P_0) + { + if (P_0 == ??) + { + return ??; + } + VolumeAnalysisByPeriodRequestParameters copy = ??.Copy; + copy.FromTime = P_0.From; + copy.ToTime = P_0.To; + return copy; + } + + internal Interval ?(Interval P_0) + { + return P_0.Intersect(??); + } + } + + [CompilerGenerated] + private sealed class ? + { + public VolumeAnalysisStorage ??; + + public VolumeAnalysisInterval ??; + + internal void ?() + { + ??.??.Save(??); + } + + internal void ?() + { + ??.??.Save(??); + } + } + + [CompilerGenerated] + private sealed class ? + { + public VolumeAnalysisStorage ??; + + public VolumeAnalysisDescription ??; + + public Interval ??; + + internal void ?() + { + ??.??.Delete(??, ??); + } + + internal void ?() + { + ??.??.Delete(??, ??); + } + } + + private readonly IVolumeAnalysisLocalStorage ??; + + private static readonly Type ??; + + public VolumeAnalysisStorage(IVolumeAnalysisLocalStorage storage, string localFilePath) + : base(storage, localFilePath) + { + ?? = storage; + } + + public IList Load(VolumeAnalysisByPeriodRequestParameters requestParameters, out List parametersForServerRequest) + { + CheckDisposed(); + List list = new List(); + parametersForServerRequest = new List(); + if (requestParameters == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + VolumeAnalysisDescription description = requestParameters.ToDescription(); + VolumeAnalysisStorageInfo info = ??.GetInfo(description); + if (info.StoredIntervals.Count == 0) + { + parametersForServerRequest.Add(requestParameters); + return list; + } + Interval ?? = requestParameters.Interval; + Interval[] source = ??.Subtract(info.StoredIntervals).ToArray(); + parametersForServerRequest.AddRange(source.Select(delegate(Interval P_0) + { + if (!(P_0 == ??)) + { + VolumeAnalysisByPeriodRequestParameters copy = requestParameters.Copy; + copy.FromTime = P_0.From; + copy.ToTime = P_0.To; + return copy; + } + return requestParameters; + })); + Interval[] array = (from P_0 in info.StoredIntervals + select P_0.Intersect(??) into P_0 + where !P_0.IsEmpty + select P_0).ToArray(); + foreach (Interval interval in array) + { + VolumeAnalysisInterval item = ??.Load(description, interval); + list.Add(item); + } + return list; + } + + public void Save(VolumeAnalysisInterval volumeAnalysisInterval, bool wait = false) + { + CheckDisposed(); + if (wait) + { + WaitForAction(delegate + { + ??.Save(volumeAnalysisInterval); + }); + } + else + { + PushAction(delegate + { + ??.Save(volumeAnalysisInterval); + }); + } + } + + public void Delete(VolumeAnalysisDescription description, Interval interval, bool wait = false) + { + CheckDisposed(); + if (wait) + { + WaitForAction(delegate + { + ??.Delete(description, interval); + }); + } + else + { + PushAction(delegate + { + ??.Delete(description, interval); + }); + } + } + + public VolumeAnalysisStorageInfo GetInfo(VolumeAnalysisDescription description) + { + CheckDisposed(); + return ??.GetInfo(description); + } + + static VolumeAnalysisStorage() + { + try + { + ?? = AssemblyLoader.LoadTypes(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), typeof(IVolumeAnalysisLocalStorage), null, SearchOption.AllDirectories)?.FirstOrDefault(); + } + catch + { + } + } + + public static VolumeAnalysisStorage Create(string connectionString) + { + if (?? == null) + { + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + IVolumeAnalysisLocalStorage obj = Activator.CreateInstance(??) as IVolumeAnalysisLocalStorage; + if (obj == null) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(30, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(??); + throw new InvalidOperationException(defaultInterpolatedStringHandler.ToStringAndClear()); + } + string directoryName = Path.GetDirectoryName(connectionString); + if (!Directory.Exists(directoryName)) + { + Directory.CreateDirectory(directoryName); + } + return new VolumeAnalysisStorage(obj, connectionString); + } + } + public class VolumeAnalysisStorageInfo + { + [CompilerGenerated] + private List> ??; + + public List> StoredIntervals + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public VolumeAnalysisStorageInfo() + { + StoredIntervals = new List>(); + } + } +} +namespace TradingPlatform.BusinessLayer.PowerTrades +{ + public interface IPowerTradesBaseSettings + { + double MinTradeVolume { get; } + + double MaxTradeVolume { get; } + + double TotalVolume { get; } + + double TimeInterval { get; } + + double BasisVolumeInterval { get; } + + int MaxZoneHeight { get; } + + int MinZoneHeight { get; } + + double DeltaFilter { get; } + + double BasisRatioFilter { get; } + } + public interface IPowerTradesHistoryItem : IHistoryItem, ICloneable + { + double Cumulative { get; } + + double Delta { get; } + + double DeltaPercent { get; } + + double MaxPrice { get; } + + double MinPrice { get; } + + double BasisRatioPercent { get; } + + DateTime LeftTime { get; } + + DateTime RightTime { get; } + } +} +namespace TradingPlatform.BusinessLayer.Media.Messengers +{ + public interface IMessenger : ICustomizable + { + string Name { get; } + + void SendMessage(MessengerMessage message, CancellationToken cancellationToken); + } + public static class Messenger + { + public const string TELEGRAM = "Telegram"; + + public const string EMAIL = "Email"; + } + public class MessengerMessage + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + public string Title + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Text + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + } + public class MessengersManager : ICustomizable, IDisposable + { + private readonly Dictionary ??; + + public IMessenger Telegram => this[3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()]; + + public IMessenger Email => this[3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()]; + + public IMessenger[] All => ??.Values.ToArray(); + + public IMessenger this[string name] + { + get + { + if (!TryGetMessenger(name, out var messenger)) + { + return null; + } + return messenger; + } + } + + public IList Settings + { + get + { + List list = new List(); + IMessenger[] all = All; + foreach (IMessenger messenger in all) + { + list.Add(new SettingItemGroup(messenger.Name, messenger.Settings)); + } + return list; + } + set + { + foreach (SettingItem item in value) + { + if (item is SettingItemGroup { Value: IList value2 } settingItemGroup && TryGetMessenger(settingItemGroup.Name, out var messenger)) + { + messenger.Settings = value2; + } + } + } + } + + internal MessengersManager() + { + ?? = new Dictionary(); + } + + internal void ?() + { + try + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (TypeWrapper item in AssemblyLoader.LoadTypes(Const.MESSENGERS_PATH, typeof(IMessenger), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SearchOption.AllDirectories)) + { + Type type = item; + try + { + if (!type.IsAbstract) + { + if (!(Activator.CreateInstance(type) is IMessenger messenger)) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + type.Name); + } + else if (??.ContainsKey(messenger.Name)) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + messenger.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + else + { + ??.Add(messenger.Name, messenger); + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(26, 2); + defaultInterpolatedStringHandler.AppendFormatted(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(??.Count); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear()); + } + catch (Exception ex2) + { + Core.Instance.Loggers.Log(ex2); + } + finally + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public bool TryGetMessenger(string messengerName, out IMessenger messenger) + { + return ??.TryGetValue(messengerName, out messenger); + } + + public void Dispose() + { + ??.Clear(); + } + } +} +namespace TradingPlatform.BusinessLayer.Serialization +{ + public interface IXElementSerialization + { + XElement ToXElement(); + + void FromXElement(XElement element, DeserializationInfo deserializationInfo); + } + /// + /// ??????? ??? ????????? + /// + [ProtoContract] + public class SnapshotData : IXElementSerialization + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func> ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + internal bool ?(Account P_0) + { + return !(P_0 is CryptoAccount); + } + + internal MessageAccount ?(Account P_0) + { + return ((IMessageBuilder)P_0).BuildMessage(); + } + + internal MessageCryptoAccount ?(CryptoAccount P_0) + { + return ((IMessageBuilder)P_0).BuildMessage(); + } + + internal IEnumerable ?(CryptoAccount P_0) + { + return P_0.Balances; + } + + internal MessageCryptoAssetBalances ?(CryptoAssetBalances P_0) + { + return P_0.BuildMessage(); + } + + internal MessageAsset ?(Asset P_0) + { + return ((IMessageBuilder)P_0).BuildMessage(); + } + + internal MessageExchange ?(Exchange P_0) + { + return ((IMessageBuilder)P_0).BuildMessage(); + } + + internal MessageSymbol ?(Symbol P_0) + { + return ((IMessageBuilder)P_0).BuildMessage(); + } + + internal DayBar ?(Symbol P_0) + { + return ((IMessageBuilder)P_0).BuildMessage(); + } + + internal MessageOpenOrder ?(Order P_0) + { + return P_0.BuildMessage(); + } + + internal MessageOpenPosition ?(Position P_0) + { + return P_0.BuildMessage(); + } + + internal MessageOpenDeliveredAsset ?(DeliveredAsset P_0) + { + return P_0.BuildMessage(); + } + + internal MessageSessionsContainer ?(SessionsContainer P_0) + { + return P_0.BuildMessage(); + } + } + + [CompilerGenerated] + private IEnumerable ??; + + [CompilerGenerated] + private IEnumerable ??; + + [CompilerGenerated] + private IEnumerable ??; + + [CompilerGenerated] + private IEnumerable ??; + + [CompilerGenerated] + private IEnumerable ??; + + [CompilerGenerated] + private IEnumerable ??; + + [CompilerGenerated] + private IEnumerable ??; + + [CompilerGenerated] + private IEnumerable ??; + + [CompilerGenerated] + private IEnumerable ??; + + [CompilerGenerated] + private IEnumerable ??; + + [CompilerGenerated] + private IEnumerable ??; + + [CompilerGenerated] + private IEnumerable ??; + + [ProtoMember(1)] + public IEnumerable AccountMessages + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = enumerable; + } + } + + [ProtoMember(2)] + public IEnumerable SymbolMessages + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = enumerable; + } + } + + [ProtoMember(3)] + public IEnumerable AssetsMessages + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = enumerable; + } + } + + [ProtoMember(4)] + public IEnumerable ExchangeMessages + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = enumerable; + } + } + + [ProtoMember(5)] + public IEnumerable DayBars + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = enumerable; + } + } + + [ProtoMember(7)] + public IEnumerable AssetBalances + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = enumerable; + } + } + + [ProtoMember(8)] + public IEnumerable CryptoAccounts + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = enumerable; + } + } + + [ProtoMember(9)] + public IEnumerable PositionMessages + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = enumerable; + } + } + + [ProtoMember(10)] + public IEnumerable OpenOrdersMessages + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = enumerable; + } + } + + [ProtoMember(11)] + public IEnumerable OpenDeliveredAssetMessages + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = enumerable; + } + } + + [ProtoMember(12)] + public IEnumerable OptionSeries + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = enumerable; + } + } + + [ProtoMember(13)] + public IEnumerable SessionsContainers + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = enumerable; + } + } + + public SnapshotData() + { + AccountMessages = new List(); + OpenOrdersMessages = new List(); + PositionMessages = new List(); + OpenDeliveredAssetMessages = new List(); + CryptoAccounts = new List(); + AssetBalances = new List(); + OptionSeries = new List(); + SessionsContainers = new List(); + } + + public static SnapshotData Create(IEnumerable symbolItems, IEnumerable uniqueAssets, IEnumerable uniqueExchanges, IEnumerable dayBars, IEnumerable accounts, IEnumerable cryptoAccounts, IEnumerable assetBalances, IEnumerable messageOptionSeries, IEnumerable sessionsData, IDictionary idsMap, IDictionary idsMap1) + { + foreach (KeyValuePair item in idsMap) + { + item.Value.Id = item.Key; + } + foreach (KeyValuePair item2 in idsMap1) + { + item2.Value.SymbolId = item2.Key; + } + return Create(symbolItems, uniqueAssets, uniqueExchanges, dayBars, accounts, cryptoAccounts, assetBalances, messageOptionSeries, sessionsData); + } + + public static SnapshotData Create(IEnumerable symbolItems, IEnumerable uniqueAssets, IEnumerable uniqueExchanges, IEnumerable dayBars, IEnumerable accounts, IEnumerable cryptoAccounts, IEnumerable assetBalances, IEnumerable messageOptionSeries, IEnumerable sessionsData) + { + return new SnapshotData + { + SymbolMessages = symbolItems, + DayBars = dayBars, + AssetsMessages = uniqueAssets, + ExchangeMessages = uniqueExchanges, + AccountMessages = accounts, + CryptoAccounts = cryptoAccounts, + AssetBalances = assetBalances, + OptionSeries = messageOptionSeries, + SessionsContainers = sessionsData + }; + } + + public static SnapshotData Create(Connection connection) + { + return new SnapshotData + { + AccountMessages = (from P_0 in connection.BusinessObjects.Accounts + where !(P_0 is CryptoAccount) + select ((IMessageBuilder)P_0).BuildMessage()).ToArray(), + CryptoAccounts = (from P_0 in connection.BusinessObjects.Accounts.OfType() + select ((IMessageBuilder)P_0).BuildMessage()).ToArray(), + AssetBalances = (from P_0 in connection.BusinessObjects.Accounts.OfType().SelectMany((CryptoAccount P_0) => P_0.Balances) + select P_0.BuildMessage()).ToArray(), + AssetsMessages = connection.BusinessObjects.Assets.Select((Asset P_0) => ((IMessageBuilder)P_0).BuildMessage()).ToArray(), + ExchangeMessages = connection.BusinessObjects.Exchanges.Select((Exchange P_0) => ((IMessageBuilder)P_0).BuildMessage()).ToArray(), + SymbolMessages = connection.BusinessObjects.Symbols.Select((Symbol P_0) => ((IMessageBuilder)P_0).BuildMessage()).ToArray(), + DayBars = connection.BusinessObjects.Symbols.Select((Symbol P_0) => ((IMessageBuilder)P_0).BuildMessage()).ToArray(), + OpenOrdersMessages = connection.BusinessObjects.Orders.Select((Order P_0) => P_0.BuildMessage()).ToArray(), + PositionMessages = connection.BusinessObjects.Positions.Select((Position P_0) => P_0.BuildMessage()).ToArray(), + OpenDeliveredAssetMessages = connection.BusinessObjects.DeliveredAssets.Select((DeliveredAsset P_0) => P_0.BuildMessage()).ToArray(), + SessionsContainers = connection.??.TradingSessions.Values.Select((SessionsContainer P_0) => P_0.BuildMessage()).ToArray() + }; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + List list = new List(); + foreach (XElement item in xElement.Elements()) + { + MessageAsset messageAsset = new MessageAsset(); + messageAsset.FromXElement(item, deserializationInfo); + list.Add(messageAsset); + } + AssetsMessages = list; + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + List list2 = new List(); + foreach (XElement item2 in xElement2.Elements()) + { + MessageExchange messageExchange = new MessageExchange(); + messageExchange.FromXElement(item2, deserializationInfo); + list2.Add(messageExchange); + } + ExchangeMessages = list2; + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + List list3 = new List(); + foreach (XElement item3 in xElement3.Elements()) + { + MessageAccount messageAccount = new MessageAccount(); + messageAccount.FromXElement(item3, deserializationInfo); + list3.Add(messageAccount); + } + AccountMessages = list3; + } + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + string name = typeof(MessageSymbol).Name; + List list4 = new List(); + foreach (XElement item4 in xElement4.Elements()) + { + try + { + MessageSymbol messageSymbol = new MessageSymbol(string.Empty); + if (item4.Name == name) + { + messageSymbol.FromXElement(item4, deserializationInfo); + } + else + { + XElement xElement5 = item4.Element(name); + if (xElement5 != null) + { + messageSymbol.FromXElement(xElement5, deserializationInfo); + } + } + list4.Add(messageSymbol); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + SymbolMessages = list4; + } + XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement6 != null) + { + List list5 = new List(); + foreach (XElement item5 in xElement6.Elements()) + { + MessageOptionSerie messageOptionSerie = new MessageOptionSerie(); + messageOptionSerie.FromXElement(item5, deserializationInfo); + list5.Add(messageOptionSerie); + } + OptionSeries = list5; + } + XElement xElement7 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement7 != null) + { + List list6 = new List(); + foreach (XElement item6 in xElement7.Elements()) + { + DayBar dayBar = new DayBar(string.Empty, Core.Instance.TimeUtils.DateTimeUtcNow); + dayBar.FromXElement(item6, deserializationInfo); + list6.Add(dayBar); + } + DayBars = list6; + } + XElement xElement8 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement8 != null) + { + List list7 = new List(); + foreach (XElement item7 in xElement8.Elements()) + { + MessageCryptoAccount messageCryptoAccount = new MessageCryptoAccount(); + messageCryptoAccount.FromXElement(item7, deserializationInfo); + list7.Add(messageCryptoAccount); + } + CryptoAccounts = list7; + } + XElement xElement9 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement9 != null) + { + List list8 = new List(); + foreach (XElement item8 in xElement9.Elements()) + { + MessageCryptoAssetBalances messageCryptoAssetBalances = new MessageCryptoAssetBalances(); + messageCryptoAssetBalances.FromXElement(item8, deserializationInfo); + list8.Add(messageCryptoAssetBalances); + } + AssetBalances = list8; + } + XElement xElement10 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement10 != null) + { + List list9 = new List(); + foreach (XElement item9 in xElement10.Elements()) + { + MessageOpenOrder messageOpenOrder = new MessageOpenOrder(); + messageOpenOrder.FromXElement(item9, deserializationInfo); + list9.Add(messageOpenOrder); + } + OpenOrdersMessages = list9; + } + XElement xElement11 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement11 != null) + { + List list10 = new List(); + foreach (XElement item10 in xElement11.Elements()) + { + MessageOpenPosition messageOpenPosition = new MessageOpenPosition(); + messageOpenPosition.FromXElement(item10, deserializationInfo); + list10.Add(messageOpenPosition); + } + PositionMessages = list10; + } + XElement xElement12 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement12 != null) + { + List list11 = new List(); + foreach (XElement item11 in xElement12.Elements()) + { + MessageOpenDeliveredAsset messageOpenDeliveredAsset = new MessageOpenDeliveredAsset(); + messageOpenDeliveredAsset.FromXElement(item11, deserializationInfo); + list11.Add(messageOpenDeliveredAsset); + } + OpenDeliveredAssetMessages = list11; + } + XElement xElement13 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement13 == null) + { + return; + } + List list12 = new List(); + foreach (XElement item12 in xElement13.Elements()) + { + MessageSessionsContainer messageSessionsContainer = new MessageSessionsContainer(); + messageSessionsContainer.FromXElement(item12, deserializationInfo); + list12.Add(messageSessionsContainer); + } + SessionsContainers = list12; + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), typeof(SnapshotData).Name)); + XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (MessageAsset assetsMessage in AssetsMessages) + { + xElement2.Add(assetsMessage.ToXElement()); + } + xElement.Add(xElement2); + XElement xElement3 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (MessageExchange exchangeMessage in ExchangeMessages) + { + xElement3.Add(exchangeMessage.ToXElement()); + } + xElement.Add(xElement3); + XElement xElement4 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + XElement xElement5 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (MessageAccount accountMessage in AccountMessages) + { + if (accountMessage is MessageCryptoAccount) + { + xElement5.Add(accountMessage.ToXElement()); + } + else + { + xElement4.Add(accountMessage.ToXElement()); + } + } + xElement.Add(xElement4); + xElement.Add(xElement5); + XElement xElement6 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (MessageSymbol symbolMessage in SymbolMessages) + { + xElement6.Add(symbolMessage.ToXElement()); + } + xElement.Add(xElement6); + XElement xElement7 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (MessageOptionSerie item in OptionSeries) + { + xElement7.Add(item.ToXElement()); + } + xElement.Add(xElement7); + XElement xElement8 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (DayBar dayBar in DayBars) + { + xElement8.Add(dayBar.ToXElement()); + } + xElement.Add(xElement8); + XElement xElement9 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (MessageCryptoAssetBalances assetBalance in AssetBalances) + { + xElement9.Add(assetBalance.ToXElement()); + } + xElement.Add(xElement9); + XElement xElement10 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (MessageOpenOrder openOrdersMessage in OpenOrdersMessages) + { + xElement10.Add(openOrdersMessage.ToXElement()); + } + xElement.Add(xElement10); + XElement xElement11 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (MessageOpenPosition positionMessage in PositionMessages) + { + xElement11.Add(positionMessage.ToXElement()); + } + xElement.Add(xElement11); + XElement xElement12 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (MessageOpenDeliveredAsset openDeliveredAssetMessage in OpenDeliveredAssetMessages) + { + xElement12.Add(openDeliveredAssetMessage.ToXElement()); + } + xElement.Add(xElement12); + XElement xElement13 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (MessageSessionsContainer sessionsContainer in SessionsContainers) + { + xElement13.Add(sessionsContainer.ToXElement()); + } + xElement.Add(xElement13); + return xElement; + } + } + public class DeserializationInfo + { + [CompilerGenerated] + private double ??; + + private readonly Func ??; + + public double Version + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + private DeserializationInfo() + { + Version = 1.0; + } + + public DeserializationInfo(Func fabric) + : this() + { + ?? = fabric; + } + + public IXElementSerialization CreateObject(XElement node) + { + try + { + return ???.Invoke(node); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex.Message, LoggingLevel.Verbose); + return null; + } + } + } + public static class Serializer + { + private const double ?? = 1.3; + + /// + /// Version 1.1: ?????????? ????? ?????? ? ??????????: ????? ???????? ????????? ???????? + /// + public const double VERSION_NEW_CONNECTIONS_SCHEMA = 1.1; + + public const double VERSION_CHANGE_ENCRYPTION_KEY_SCHEMA = 1.2; + + public const double VERSION_CHANGE_DATE_TIME_SERIALIZATION_FORMAT = 1.3; + + public const double VERSION_CHANGE_HOTKEYS_SETTING_ITEM_CLASS_NAME = 1.4; + + public const string CORE_SERIALIZATION_NAMESPACE_NAME = "TradingPlatform"; + + public static bool SerializeXML(string filePath, List list) + { + try + { + XElement xElement = ?(list); + if (xElement != null) + { + xElement.Save(filePath); + return true; + } + return false; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + return false; + } + } + + public static bool SerializeXML(Stream stream, List list) + { + try + { + XElement xElement = ?(list); + if (xElement != null) + { + xElement.Save(stream); + return true; + } + return false; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + return false; + } + } + + public static List DeserializeXML(string filePath, out double version, Func fabric) + { + List result = new List(); + version = 1.3; + if (string.IsNullOrEmpty(filePath)) + { + return result; + } + if (!File.Exists(filePath)) + { + return result; + } + FileStream fileStream = null; + try + { + fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); + result = DeserializeXML(fileStream, out version, fabric); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + fileStream?.Close(); + } + return result; + } + + public static List DeserializeXML(Stream stream, out double version, Func fabric) + { + List list = new List(); + version = 1.3; + if (stream == null) + { + return list; + } + try + { + XElement xElement = XElement.Load(stream); + DeserializationInfo deserializationInfo = new DeserializationInfo(fabric); + if (double.TryParse(xElement.Attribute(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()).Value, NumberStyles.Float, CultureInfo.InvariantCulture, out version)) + { + deserializationInfo.Version = version; + } + foreach (XElement item in xElement.Nodes()) + { + IXElementSerialization iXElementSerialization = DeserializeNode(item, deserializationInfo); + if (iXElementSerialization != null) + { + list.Add(iXElementSerialization); + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + return list; + } + + public static IEnumerable DeserializeXML(XElement element, DeserializationInfo info) + { + foreach (XElement item in element.Nodes()) + { + IXElementSerialization iXElementSerialization = DeserializeNode(item, info); + if (iXElementSerialization != null) + { + yield return iXElementSerialization; + } + } + } + + public static IXElementSerialization DeserializeNode(XElement node, DeserializationInfo info) + { + try + { + IXElementSerialization iXElementSerialization = info.CreateObject(node); + iXElementSerialization?.FromXElement(node, info); + return iXElementSerialization; + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + return null; + } + + private static XElement ?(List P_0) + { + try + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), new XAttribute(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), 1.3)); + for (int i = 0; i < P_0.Count; i++) + { + try + { + xElement.Add(P_0[i].ToXElement()); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + return xElement; + } + catch (Exception ex2) + { + Core.Instance.Loggers.Log(ex2); + return null; + } + } + } + [ProtoContract] + public sealed class TypedObjectSurrogate : TypedObjectSurrogate + { + [CompilerGenerated] + private T ??; + + [ProtoIgnore] + public override object ObjectValue => Value; + + [ProtoMember(1)] + public T Value + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public TypedObjectSurrogate() + { + } + + public TypedObjectSurrogate(T value) + { + Value = value; + } + } + [ProtoContract] + public abstract class TypedObjectSurrogate + { + [ProtoIgnore] + public abstract object ObjectValue { get; } + + public static object CreateSurrogate(T value) + { + if (value == null) + { + return new TypedObjectSurrogate(); + } + Type type = value.GetType(); + if (type == typeof(T)) + { + return new TypedObjectSurrogate(value); + } + return Activator.CreateInstance(typeof(TypedObjectSurrogate<>).MakeGenericType(type), value); + } + } +} +namespace TradingPlatform.BusinessLayer.Abstractions +{ + public interface IVwapHistoryItem : IHistoryItem, ICloneable + { + /// + /// + /// + int RangeIndex { get; } + + /// + /// + /// + new DateTime TimeLeft { get; } + + /// + /// Get VWAP value + /// + double Value { get; } + + /// + /// + /// + double STDCoefficient { get; } + + /// + /// + /// + double CumulativeVolume { get; } + + /// + /// + /// + double CumulativePriceMVolume { get; } + + /// + /// + /// + double MPDCoefficient { get; } + } +} +namespace TradingPlatform.BusinessLayer.Abstractions.Misc +{ + public interface ITaskSchedulerProvider + { + TaskScheduler TaskScheduler { get; } + } +} +namespace TradingPlatform.BusinessLayer.Integration +{ + public interface IBrowser + { + string BrowserTitle { get; set; } + + Size BrowerSize { get; set; } + + event BrowserEventHandler Navigated; + + event BrowserEventHandler Closed; + + void Show(); + + void Close(); + + void Navigate(string address); + } + public delegate void BrowserEventHandler(IBrowser browser, BrowserEventArgs e); + public interface IBrowserFactory + { + IBrowser CreateBrowser(string url = null); + } + public interface IHistoryVendor : IVendor + { + HistoryMetadata GetHistoryMetadata(CancellationToken cancelationToken); + + IList LoadHistory(HistoryRequestParameters requestParameters); + } + public interface IMessageBuilder where TMessage : Message + { + TMessage BuildMessage(); + } + public interface INeedSymbolToPocess + { + string SymbolId { get; } + } + public interface IQuoteVendor : IVendor + { + void SubscribeSymbol(SubscribeQuotesParameters parameters); + + void UnSubscribeSymbol(SubscribeQuotesParameters parameters); + } + public interface ISymbolVendor : IVendor + { + bool AllowNonFixedList { get; } + + IList GetSessions(CancellationToken token); + + IList GetExchanges(CancellationToken token); + + IList GetAssets(CancellationToken token); + + IList GetSymbols(CancellationToken token); + + MessageSymbolTypes GetSymbolTypes(CancellationToken token); + + IList GetSymbolGroups(CancellationToken token); + + MessageSymbol GetNonFixedSymbol(GetSymbolRequestParameters requestParameters); + + IList SearchSymbols(SearchSymbolsRequestParameters requestParameters); + + IList GetFutureContracts(GetFutureContractsRequestParameters requestParameters); + + IList GetOptionSeries(GetOptionSeriesRequestParameters requestParameters); + + IList GetStrikes(GetStrikesRequestParameters requestParameters); + } + public interface ITradingVendor : IVendor + { + LimitationMetadata GetLimitationMetadata(); + + IList GetAccounts(CancellationToken token); + + IList GetCryptoAssetBalances(CancellationToken token); + + IList GetRules(CancellationToken token); + + IList GetAccountOperations(CancellationToken token); + + IList GetAllowedOrderTypes(CancellationToken token); + + IList GetPendingOrders(CancellationToken token); + + IList GetPositions(CancellationToken token); + + TradesHistoryMetadata GetTradesMetadata(); + + IList GetTrades(TradesHistoryRequestParameters parameters); + + void GetTrades(TradesHistoryRequestParameters parameters, AccountTradesLoadingCallback callback); + + IList GetOrdersHistory(OrdersHistoryRequestParameters parameters); + + PnL CalculatePnL(PnLRequestParameters parameters); + + TradingOperationResult PlaceOrder(PlaceOrderRequestParameters parameters); + + TradingOperationResult PlaceMultiOrder(PlaceMultiOrderOrderRequestParameters parameters); + + TradingOperationResult ModifyOrder(ModifyOrderRequestParameters parameters); + + TradingOperationResult CancelOrder(CancelOrderRequestParameters parameters); + + TradingOperationResult ClosePosition(ClosePositionRequestParameters parameters); + + MarginInfo GetMarginInfo(OrderRequestParameters orderRequestParameters); + + IList GetReportsMetaData(CancellationToken token); + + Report GenerateReport(ReportRequestParameters reportRequestParameters); + } + public interface IVendor + { + string Key { get; set; } + + event EventHandler NewMessage; + + ConnectionResult Connect(ConnectRequestParameters connectRequestParameters); + + void Disconnect(); + + void OnConnected(CancellationToken token); + + PingResult Ping(); + + void PushMessage(Message msg); + + void SendCustomRequest(RequestParameters parameters); + } + public interface IVolumeAnalysisVendor : IVendor + { + VolumeAnalysisMetadata GetVolumeAnalysisMetadata(); + + VendorVolumeAnalysisByPeriodResponse LoadVolumeAnalysis(VolumeAnalysisByPeriodRequestParameters requestParameters); + } + public class BrowserEventArgs : EventArgs + { + [CompilerGenerated] + private string ??; + + public string Url + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public BrowserEventArgs(string url = null) + { + Url = url; + } + } + public class ConnectionLogger + { + private readonly ILogger ??; + + public ConnectionLogger(string vendorName, string connectionId) + { + string outputFolderPath = Path.Combine(Const.LOGS_FOLDER_PATH, vendorName, connectionId); + ?? = Core.Instance.Loggers.GetLogger(new LoggerConfig + { + LoggerName = connectionId, + OutputFolderPath = outputFolderPath, + Scope = LoggerScope.General + }); + } + + public void Log(string message) + { + ???.Log(message, Core.Instance.TimeUtils.DateTimeUtcNow, LoggingLevel.Verbose); + } + + public void Dispose() + { + ???.Dispose(); + } + } + /// + /// Vendor connection respond bundle + /// + [ProtoContract] + public sealed class ConnectionResult : ICloneable + { + [CompilerGenerated] + private ConnectionState ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private IList ??; + + /// + /// The connection status + /// + [ProtoMember(1)] + public ConnectionState State + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// The respond message + /// + [ProtoMember(2)] + public string Message + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(3)] + public bool Cancelled + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IList UpdatedSettings + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public static ConnectionResult CreateFail(string message, IList updatedSettings = null) + { + return new ConnectionResult + { + State = ConnectionState.Fail, + Message = message, + UpdatedSettings = updatedSettings + }; + } + + public static ConnectionResult CreateSuccess(string message = "", IList updatedSettings = null) + { + return new ConnectionResult + { + State = ConnectionState.Connected, + Message = message, + UpdatedSettings = updatedSettings + }; + } + + public static ConnectionResult CreateCancelled(string message = "") + { + return new ConnectionResult + { + State = ConnectionState.Fail, + Message = message, + Cancelled = true + }; + } + + public object Clone() + { + return new ConnectionResult + { + State = State, + Message = Message, + Cancelled = Cancelled + }; + } + } + [ProtoContract] + public sealed class ConnectRequestParameters : RequestParameters + { + [CompilerGenerated] + private IList ??; + + [CompilerGenerated] + private IBrowserFactory ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private IProgress ??; + + public override RequestType Type => RequestType.Connect; + + [ProtoMember(1)] + public IList ConnectionSettings + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = list; + } + } + + public IBrowserFactory BrowserFactory + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = browserFactory; + } + } + + public string ConnectionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + public IProgress ConnectingProgress + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = progress; + } + } + + public ConnectRequestParameters() + { + } + + public ConnectRequestParameters(IList connectionSettings) + { + ConnectionSettings = connectionSettings; + } + } +} +namespace ? +{ + internal class ? : BufferedProcessor + { + public int ??; + + private readonly Dictionary ??; + + public Action ??; + + public Func> ??; + + public ?() + { + ?? = new Dictionary(); + } + + public void ?() + { + ProcessTreadsCount = ??; + } + + protected override void Process(DayBarMessageGenerationParameters subject) + { + try + { + CancellationToken token; + lock (??) + { + if (??.TryGetValue(subject.SymbolId, out var value)) + { + value.Cancel(); + } + value = new CancellationTokenSource(); + ??[subject.SymbolId] = value; + token = value.Token; + } + if (!token.IsCancellationRequested) + { + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + HistoryRequestParameters arg = new HistoryRequestParameters + { + SymbolId = subject.SymbolId, + FromTime = dateTimeUtcNow.Date.AddDays(0L - (long)subject.DayToLoadCount).AddMilliseconds(-1.0), + ToTime = dateTimeUtcNow, + Aggregation = new HistoryAggregationTime(new Period(BasePeriod.Day, 1), subject.UpdateHistoryType), + CancellationToken = token + }; + IList list = ???.Invoke(arg); + if (list != null && list.Count != 0 && !token.IsCancellationRequested) + { + ? ?2 = new ?(subject.SymbolId) + { + UpdateHistoryType = subject.UpdateHistoryType + }; + ?2.?(token, subject.SymbolId, list); + ???.Invoke(?2); + ??.Remove(subject.SymbolId); + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + subject?.Callback?.Invoke(); + } + } + + protected internal override void Clear() + { + foreach (CancellationTokenSource value in ??.Values) + { + value.Cancel(); + } + base.Clear(); + } + } +} +namespace TradingPlatform.BusinessLayer.Integration +{ + public abstract class DayBarMessageCreator : IDayBarUpdate, IDisposable + { + public Action PushMessage; + + private protected ConcurrentDictionary ??; + + private bool ??; + + public virtual void Initialize() + { + ?? = new ConcurrentDictionary(); + } + + public void TryCreateEmptyDb(string symbol, HistoryType updateType) + { + if (!??.TryGetValue(symbol, out var value)) + { + value = new ?(symbol) + { + UpdateHistoryType = updateType + }; + ??[symbol] = value; + } + PushMessage?.Invoke(value.LastDayBar); + } + + public DayBar ProcessQuote(Quote quote1) + { + if (!??.TryGetValue(quote1.SymbolId, out var value)) + { + return null; + } + return value.ProcessQuote(quote1); + } + + public DayBar ProcessLast(Last last) + { + if (!??.TryGetValue(last.SymbolId, out var value)) + { + return null; + } + return value.ProcessLast(last); + } + + public DayBar ProcessMark(Mark mark) + { + if (!??.TryGetValue(mark.SymbolId, out var value)) + { + return null; + } + return value.ProcessMark(mark); + } + + public abstract void CreateDbFromHistory(string symbol, HistoryType updateType, Action callback = null); + + public void CheckIfNeedUpdate() + { + if (??) + { + return; + } + ?? = true; + try + { + foreach (KeyValuePair item in new Dictionary(??)) + { + string key = item.Key; + ? value = item.Value; + if ((Core.Instance.TimeUtils.DateTimeUtcNow - value.LastDayBarCreationTime).TotalDays > 1.0) + { + CreateDbFromHistory(key, value.UpdateHistoryType); + } + } + } + finally + { + ?? = false; + } + } + + public virtual void Dispose() + { + ???.Clear(); + } + } +} +namespace ? +{ + internal class ? : IDayBarUpdate + { + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private HistoryType ??; + + [CompilerGenerated] + private DayBar ??; + + public DateTime LastDayBarCreationTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dateTime; + } + } + + public HistoryType UpdateHistoryType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = historyType; + } + } + + internal string SymbolId => LastDayBar?.SymbolId; + + internal DayBar LastDayBar + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dayBar; + } + } + + internal ?(string P_0) + { + LastDayBar = new DayBar(P_0, Core.Instance.TimeUtils.DateTimeUtcNow); + } + + internal void ?(CancellationToken P_0, string P_1, IList P_2) + { + DayBar dayBar = null; + try + { + if (P_0.IsCancellationRequested || P_2 == null || !P_2.Any()) + { + return; + } + IHistoryItem historyItem = P_2[P_2.Count - 1]; + if (historyItem == null) + { + return; + } + TimeSpan timeSpan = Core.Instance.TimeUtils.DateTimeUtcNow - historyItem.TimeLeft; + LastDayBarCreationTime = historyItem.TimeLeft.AddDays((int)timeSpan.TotalDays); + dayBar = new DayBar(P_1, Core.Instance.TimeUtils.DateTimeUtcNow) + { + Open = historyItem[PriceType.Open], + High = historyItem[PriceType.High], + Low = historyItem[PriceType.Low], + Volume = historyItem[PriceType.Volume], + QuoteAssetVolume = historyItem[PriceType.QuoteAssetVolume] + }; + if (UpdateHistoryType == HistoryType.Last) + { + dayBar.Trades = (long)historyItem[PriceType.Ticks]; + } + else + { + dayBar.Ticks = (long)historyItem[PriceType.Ticks]; + } + if (P_2.Count > 1) + { + dayBar.PreviousClose = P_2[P_2.Count - 2][PriceType.Close]; + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + LastDayBar = dayBar; + } + + public DayBar ProcessQuote(Quote quote1) + { + DayBar lastDayBar = LastDayBar; + if (lastDayBar == null) + { + return null; + } + if (UpdateHistoryType switch + { + HistoryType.Ask => ?(lastDayBar, quote1.Ask) ? 1 : 0, + HistoryType.Bid => ?(lastDayBar, quote1.Bid) ? 1 : 0, + HistoryType.Midpoint => ?(lastDayBar, (quote1.Ask + quote1.Bid) / 2.0) ? 1 : 0, + _ => 0, + } == 0) + { + return null; + } + return lastDayBar; + } + + public DayBar ProcessLast(Last last) + { + bool flag = false; + DayBar lastDayBar = LastDayBar; + if (lastDayBar == null) + { + return null; + } + if (UpdateHistoryType == HistoryType.Last) + { + flag = ?(lastDayBar, last.Price); + } + if (!flag) + { + return null; + } + return lastDayBar; + } + + public DayBar ProcessMark(Mark mark) + { + bool flag = false; + DayBar lastDayBar = LastDayBar; + if (lastDayBar == null) + { + return null; + } + if (UpdateHistoryType == HistoryType.Mark) + { + flag = ?(lastDayBar, mark.Price); + } + if (!flag) + { + return null; + } + return lastDayBar; + } + + private static bool ?(DayBar P_0, double P_1) + { + bool result = false; + if (double.IsNaN(P_0.High) || P_0.High < P_1) + { + P_0.High = P_1; + result = true; + } + if (double.IsNaN(P_0.Low) || P_0.Low > P_1) + { + P_0.Low = P_1; + result = true; + } + return result; + } + } +} +namespace TradingPlatform.BusinessLayer.Integration +{ + public class DayBarMessageFromHistoryCreator : DayBarMessageCreator + { + private const int ?? = 5; + + public Func> LoadHistory; + + [CompilerGenerated] + private Action ??; + + public int GenerationThreadsCount; + + private readonly ? ??; + + public Action CorrectDayBar + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DayBarMessageFromHistoryCreator() + { + ?? = new ?(); + GenerationThreadsCount = 3; + } + + public override void Initialize() + { + base.Initialize(); + ??.?? = LoadHistory; + ??.?? = GenerationThreadsCount; + ??.?? = ?; + ??.?(); + ??.Start(); + } + + public override void CreateDbFromHistory(string symbol, HistoryType updateType, Action callback = null) + { + DayBarMessageGenerationParameters subject = new DayBarMessageGenerationParameters + { + SymbolId = symbol, + UpdateHistoryType = updateType, + DayToLoadCount = 5u, + Callback = callback + }; + ??.Push(subject); + } + + private void ?(? P_0) + { + DayBar lastDayBar = P_0.LastDayBar; + CorrectDayBar?.Invoke(lastDayBar); + ??[P_0.SymbolId] = P_0; + PushMessage?.Invoke(lastDayBar); + } + + public override void Dispose() + { + ???.Stop(); + base.Dispose(); + } + } + public class DayBarMessageGenerationParameters + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private HistoryType ??; + + [CompilerGenerated] + private uint ??; + + [CompilerGenerated] + private Action ??; + + public string SymbolId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public HistoryType UpdateHistoryType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public uint DayToLoadCount + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Action Callback + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + } + public interface IDayBarUpdate + { + DayBar ProcessQuote(Quote quote1); + + DayBar ProcessLast(Last last); + + DayBar ProcessMark(Mark mark); + } + /// + /// Ping state dictum + /// + public enum PingEnum + { + /// + /// Ping signals connected + /// + Connected, + /// + /// Ping signals disconnected + /// + Disconnected + } + public enum VolumeAnalysisAvailability + { + NotAvailable, + Available + } + /// + /// The asset formatting description. + /// + public class AssetFormattingDescription : FormattingDescription + { + private readonly string ??; + + private readonly bool ??; + + /// + /// Initializes a new instance of the class. + /// + /// The asset id. + /// The value. + /// If true, add currency name. + public AssetFormattingDescription(string assetId, double value, bool addCurrencyName = true) + : base(value) + { + ?? = assetId; + ?? = addCurrencyName; + } + + protected override bool IsValueValid(double value) + { + if (!double.IsNaN(value)) + { + return base.IsValueValid(value); + } + return false; + } + + protected override string FormatValue(double value) + { + Asset asset = Core.Instance.Connections[base.ConnectionId]?.BusinessObjects?.Assets.FirstOrDefault((Asset P_0) => P_0.Id == ??); + if (asset == null) + { + return value.Format(); + } + if (!??) + { + return asset.FormatPrice(value); + } + return asset.FormatPriceWithCurrency(value); + } + + [CompilerGenerated] + private bool ?(Asset P_0) + { + return P_0.Id == ??; + } + } + public class DateTimeFormattingDescription : FormattingDescription + { + public DateTimeFormattingDescription(DateTime dateTime) + : base(dateTime) + { + } + + protected override string FormatValue(DateTime value) + { + return Core.Instance.TimeUtils.ConvertFromUTCToSelectedTimeZone(value).ToString(Core.Instance.TimeUtils.CultureInfo); + } + } + public abstract class FormattingDescription : IFormattingDescription + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private readonly bool ??; + + private readonly TValue ??; + + public string ConnectionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool AllowFormatDefaultValue + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + protected virtual TValue DefaultValue => default(TValue); + + protected FormattingDescription(TValue value) + { + ?? = value; + } + + public string GetFormattedData() + { + if (!IsValueValid(??)) + { + return string.Empty; + } + return FormatValue(??); + } + + protected virtual bool IsValueValid(TValue value) + { + if (!AllowFormatDefaultValue) + { + return !object.Equals(DefaultValue, ??); + } + return true; + } + + protected abstract string FormatValue(TValue value); + } + public interface IFormattingDescription + { + string ConnectionId { get; set; } + + string GetFormattedData(); + } + public class OffsetFormattingDescription : FormattingDescription + { + private readonly string ??; + + public OffsetFormattingDescription(double offset, string symbolId) + : base(offset) + { + ?? = symbolId; + } + + protected override bool IsValueValid(double value) + { + if (!double.IsNaN(value)) + { + return base.IsValueValid(value); + } + return false; + } + + protected override string FormatValue(double value) + { + Symbol symbol = Core.Instance.Connections[base.ConnectionId]?.BusinessObjects?.Symbols?.FirstOrDefault((Symbol P_0) => P_0.Id == ??); + if (symbol == null) + { + return value.ToString(CultureInfo.InvariantCulture); + } + return symbol.FormatOffset(value, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + + [CompilerGenerated] + private bool ?(Symbol P_0) + { + return P_0.Id == ??; + } + } + public class OrderTypeNameFormattingDescription : FormattingDescription + { + public OrderTypeNameFormattingDescription(string orderTypeId) + : base(orderTypeId) + { + } + + protected override string FormatValue(string value) + { + return Core.Instance.GetOrderType(value, base.ConnectionId)?.Name ?? value; + } + } + public class PriceFormattingDescription : FormattingDescription + { + private readonly string ??; + + public PriceFormattingDescription(double price, string symbolId) + : base(price) + { + ?? = symbolId; + } + + protected override bool IsValueValid(double value) + { + if (!double.IsNaN(value)) + { + return base.IsValueValid(value); + } + return false; + } + + protected override string FormatValue(double value) + { + Symbol symbol = Core.Instance.Connections[base.ConnectionId]?.BusinessObjects?.Symbols?.FirstOrDefault((Symbol P_0) => P_0.Id == ??); + if (symbol != null) + { + return symbol.FormatPrice(value); + } + return value.ToString(CultureInfo.InvariantCulture); + } + + [CompilerGenerated] + private bool ?(Symbol P_0) + { + return P_0.Id == ??; + } + } + public class SlTpHolderFormattingDescription : FormattingDescription + { + private readonly string ??; + + public SlTpHolderFormattingDescription(SlTpHolder slTpHolder, string symbolId) + : base(slTpHolder) + { + ?? = symbolId; + } + + protected override string FormatValue(SlTpHolder value) + { + Symbol symbol = Core.Instance.Connections[base.ConnectionId]?.BusinessObjects?.Symbols?.FirstOrDefault((Symbol P_0) => P_0.Id == ??); + return value.Format(symbol); + } + + [CompilerGenerated] + private bool ?(Symbol P_0) + { + return P_0.Id == ??; + } + } + public class SymbolNameFormattingDescription : FormattingDescription + { + public SymbolNameFormattingDescription(string symbolId) + : base(symbolId) + { + } + + protected override string FormatValue(string value) + { + return Core.Instance.GetSymbol(new GetSymbolRequestParameters + { + SymbolId = value + }, base.ConnectionId, NonFixedListDownload.IgnoreDownload)?.Name ?? value; + } + } + public class VolumeFormattingDescription : FormattingDescription + { + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + private readonly string ??; + + public bool DisplayQuantityInLots + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool AbbreviateVolumes + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public VolumeFormattingDescription(double volume, string symbolId) + : base(volume) + { + ?? = symbolId; + } + + protected override bool IsValueValid(double value) + { + if (!double.IsNaN(value)) + { + return base.IsValueValid(value); + } + return false; + } + + protected override string FormatValue(double value) + { + Symbol symbol = Core.Instance.Connections[base.ConnectionId]?.?(new GetSymbolRequestParameters + { + SymbolId = ?? + }, NonFixedListDownload.IgnoreDownload); + if (symbol != null) + { + return symbol.FormatQuantity(value, DisplayQuantityInLots, AbbreviateVolumes); + } + return value.ToString(CultureInfo.InvariantCulture); + } + } + /// + /// Mediates a history meta data with available data types and intervals on vendor side + /// + [ProtoContract] + public sealed class HistoryMetadata + { + [CompilerGenerated] + private string[] ??; + + [CompilerGenerated] + private Period[] ??; + + [CompilerGenerated] + private BasePeriod[] ??; + + [CompilerGenerated] + private HistoryType[] ??; + + [CompilerGenerated] + private HistoryType[] ??; + + [CompilerGenerated] + private Period[] ??; + + [CompilerGenerated] + private BasePeriod[] ??; + + [CompilerGenerated] + private TimeSpan ??; + + [CompilerGenerated] + private TimeSpan ??; + + [CompilerGenerated] + private TimeSpan ??; + + [CompilerGenerated] + private TimeSpan ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [ProtoMember(1)] + public string[] AllowedAggregations + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(2)] + public Period[] AllowedPeriodsHistoryAggregationTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(3)] + public BasePeriod[] AllowedBasePeriodsHistoryAggregationTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(4)] + public HistoryType[] AllowedHistoryTypesHistoryAggregationTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(5)] + public HistoryType[] AllowedHistoryTypesHistoryAggregationTick + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(6)] + public Period[] AllowedPeriodsHistoryAggregationTimeStatistics + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(7)] + public BasePeriod[] AllowedBasePeriodsHistoryAggregationTimeStatistics + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(8)] + public TimeSpan DownloadingStep_Tick + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(9)] + public TimeSpan DownloadingStep_Second + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(10)] + public TimeSpan DownloadingStep_Minute + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(11)] + public TimeSpan DownloadingStep_Day + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(12)] + public int DegreeOfParallelism + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(13, IsRequired = true)] + public bool UseHistoryLocalCache + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(14)] + public bool BuildUncompletedBars + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(15)] + public bool ServerSideTickDirectionAvailable + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + internal HistoryMetadata Copy => new HistoryMetadata(this); + + public HistoryMetadata() + { + AllowedAggregations = Array.Empty(); + AllowedPeriodsHistoryAggregationTime = Array.Empty(); + AllowedHistoryTypesHistoryAggregationTime = Array.Empty(); + AllowedHistoryTypesHistoryAggregationTick = Array.Empty(); + AllowedBasePeriodsHistoryAggregationTime = Array.Empty(); + AllowedPeriodsHistoryAggregationTimeStatistics = Array.Empty(); + AllowedBasePeriodsHistoryAggregationTimeStatistics = Array.Empty(); + DownloadingStep_Tick = TimeSpan.FromDays(10.0); + DownloadingStep_Second = TimeSpan.FromDays(10.0); + DownloadingStep_Minute = TimeSpan.FromDays(1000.0); + DownloadingStep_Day = TimeSpan.FromDays(10000.0); + DegreeOfParallelism = Environment.ProcessorCount; + UseHistoryLocalCache = true; + BuildUncompletedBars = false; + ServerSideTickDirectionAvailable = false; + } + + public HistoryMetadata(HistoryMetadata historyMetadata) + { + AllowedAggregations = new string[historyMetadata.AllowedAggregations.Length]; + Array.Copy(historyMetadata.AllowedAggregations, AllowedAggregations, historyMetadata.AllowedAggregations.Length); + AllowedPeriodsHistoryAggregationTime = new Period[historyMetadata.AllowedPeriodsHistoryAggregationTime.Length]; + Array.Copy(historyMetadata.AllowedPeriodsHistoryAggregationTime, AllowedPeriodsHistoryAggregationTime, AllowedPeriodsHistoryAggregationTime.Length); + AllowedBasePeriodsHistoryAggregationTime = new BasePeriod[historyMetadata.AllowedBasePeriodsHistoryAggregationTime.Length]; + Array.Copy(historyMetadata.AllowedBasePeriodsHistoryAggregationTime, AllowedBasePeriodsHistoryAggregationTime, historyMetadata.AllowedBasePeriodsHistoryAggregationTime.Length); + AllowedHistoryTypesHistoryAggregationTime = new HistoryType[historyMetadata.AllowedHistoryTypesHistoryAggregationTime.Length]; + Array.Copy(historyMetadata.AllowedHistoryTypesHistoryAggregationTime, AllowedHistoryTypesHistoryAggregationTime, historyMetadata.AllowedHistoryTypesHistoryAggregationTime.Length); + AllowedHistoryTypesHistoryAggregationTick = new HistoryType[historyMetadata.AllowedHistoryTypesHistoryAggregationTick.Length]; + Array.Copy(historyMetadata.AllowedHistoryTypesHistoryAggregationTick, AllowedHistoryTypesHistoryAggregationTick, historyMetadata.AllowedHistoryTypesHistoryAggregationTick.Length); + AllowedPeriodsHistoryAggregationTimeStatistics = new Period[historyMetadata.AllowedPeriodsHistoryAggregationTimeStatistics.Length]; + Array.Copy(historyMetadata.AllowedPeriodsHistoryAggregationTimeStatistics, AllowedPeriodsHistoryAggregationTimeStatistics, AllowedPeriodsHistoryAggregationTimeStatistics.Length); + AllowedBasePeriodsHistoryAggregationTimeStatistics = new BasePeriod[historyMetadata.AllowedBasePeriodsHistoryAggregationTimeStatistics.Length]; + Array.Copy(historyMetadata.AllowedBasePeriodsHistoryAggregationTimeStatistics, AllowedBasePeriodsHistoryAggregationTimeStatistics, historyMetadata.AllowedBasePeriodsHistoryAggregationTimeStatistics.Length); + DownloadingStep_Tick = historyMetadata.DownloadingStep_Tick; + DownloadingStep_Second = historyMetadata.DownloadingStep_Second; + DownloadingStep_Minute = historyMetadata.DownloadingStep_Minute; + DownloadingStep_Day = historyMetadata.DownloadingStep_Day; + DegreeOfParallelism = historyMetadata.DegreeOfParallelism; + UseHistoryLocalCache = historyMetadata.UseHistoryLocalCache; + BuildUncompletedBars = historyMetadata.BuildUncompletedBars; + ServerSideTickDirectionAvailable = historyMetadata.ServerSideTickDirectionAvailable; + } + + internal TimeSpan ?(HistoryAggregation P_0) + { + Period getPeriod = P_0.GetPeriod; + int basePeriod = (int)getPeriod.BasePeriod; + TimeSpan timeSpan; + long val; + if (basePeriod >= 4) + { + timeSpan = DownloadingStep_Day; + val = getPeriod.Ticks / Period.DAY1.Ticks; + } + else if (basePeriod >= 2) + { + timeSpan = DownloadingStep_Minute; + val = getPeriod.Ticks / Period.MIN1.Ticks; + } + else + { + if (basePeriod < 1) + { + if (getPeriod.BasePeriod == BasePeriod.Tick && getPeriod.PeriodMultiplier != 1) + { + return TimeSpan.Zero; + } + return DownloadingStep_Tick; + } + timeSpan = DownloadingStep_Second; + val = getPeriod.Ticks / Period.SECOND1.Ticks; + } + return TimeSpan.FromTicks(Math.Min(timeSpan.Ticks * Math.Max(val, 1L), 31536000000000000L)); + } + } + public static class SymbolDefaultDescriptions + { + public static string GetDefaultDescription(string symbolName) + { + switch (?.?(symbolName)) + { + case 1620419802u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1350845065u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 68008159u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2335563927u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3889859125u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2018644614u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3962463764u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 4116658238u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1624907770u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1887691111u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2942542223u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2151569089u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1839836162u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1078471552u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2087596954u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1637628082u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3233654154u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2238471692u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3649218711u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2360299262u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 24114034u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1615521271u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 429890879u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1265226235u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 191367025u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1679457057u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2483540628u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3039026436u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3661938870u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2516370071u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2850936713u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 659044693u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 4232868562u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1045659265u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3789443832u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 641760120u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 988355861u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 4281617233u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 80800563u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 350375300u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 839191917u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1999194261u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 4244775404u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 4014714260u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2928008062u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1825504590u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2037013095u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1280195859u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1328771369u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3606328198u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2515488773u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 957338138u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3685275323u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 173045139u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1934807510u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 124375746u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2429247009u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3501247908u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3298783647u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 4058670711u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3554264809u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2716707914u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3352170512u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 457013197u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 320108201u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1750896523u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2305573784u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2228121868u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3638868887u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1208142671u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3002305103u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2349949438u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 13764210u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 419541055u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2636366975u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1254876411u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1814557834u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 181017201u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2585813309u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1669107233u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2473190804u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3651589046u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2506020247u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2840586889u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 94341894u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 648694869u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 4222518738u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 714960562u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1035309441u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 978006037u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2357959268u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2496842966u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3711978256u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2491396094u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3371260840u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2634575795u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3652951536u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3030116563u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3436039563u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3021718053u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 284478568u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2411620006u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3350668061u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2073801205u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1905909567u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2441366352u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 4221599727u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2436215740u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1801439256u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2518774546u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2500097719u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3342045897u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3519432546u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2416749392u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3552124516u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2003830314u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2238933702u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 612031836u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2823409836u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 408419246u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3233745107u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2336395862u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1006372052u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 804040855u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 347237120u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3799182549u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1932694036u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2852934106u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 984865474u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1255225665u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3213535021u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1838176045u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2687288967u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3602322474u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3517448641u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 287284361u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3471409855u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1306488298u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3509434492u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2952591452u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 4217526264u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 422909761u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2371299268u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 168257872u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 394422474u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1343306773u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1926913222u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3775114597u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2016932178u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1069676081u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3499941520u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 4011922870u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3346963607u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3498891434u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 698744176u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 44668826u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3991148999u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3661345779u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1183670000u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2497369850u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3183129029u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 18060235u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2213786847u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3985953508u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 4169618513u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3517981331u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3921296083u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2246776758u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1307284877u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1724953394u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1471925664u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1427930923u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 701623346u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 4194627902u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3296676779u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 4130881864u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2291264053u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2637100485u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 420402725u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2268114475u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2739153357u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 510157801u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1229808796u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2526228103u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 206975631u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3884664239u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2392630576u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3379624205u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 850190540u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3436469264u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 637122682u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 468120478u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1508096022u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1651264960u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2633683452u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 1648225525u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2706260476u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 401975857u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 78441955u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 2746663082u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 4007212653u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 628962940u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3134998797u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + case 3513957278u: + if (!(symbolName == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??())) + { + break; + } + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + return string.Empty; + } + } + public class MarginInfo + { + [CompilerGenerated] + private readonly SettingItem[] ??; + + public SettingItem[] Parameters + { + [CompilerGenerated] + get + { + return ??; + } + } + + public MarginInfo(SettingItem[] parameters) + { + ?? = parameters; + } + } + [ProtoContract] + public abstract class CustomMessage : Message, IBufferedProcessorValue, IConnectionBindedObject + { + [CompilerGenerated] + private string ??; + + public string ConnectionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + public abstract int MessageId { get; } + + public override MessageType Type => MessageType.Custom; + + public int Key => MessageId; + } + public enum MessageType + { + Account, + Symbol, + OpenOrder, + CloseOrder, + OpenPosition, + ClosePosition, + Trade, + Quote, + Level2, + Last, + DayBar, + Asset, + Custom, + DOM, + Exchange, + ReportMetadata, + SymbolTypes, + OrderHistory, + Rule, + DealTicket, + SymbolGroup, + CryptoAssetBalances, + CryptoAccount, + OptionSerie, + SymbolInfo, + Session, + OpenDeliveredAsset, + CloseDeliveredAsset, + CorporateAction, + AccountOperation, + ClosedPosition, + Mark, + NewsHeadline, + TradingSignal, + RemoveTradingSignal + } + public enum QuotePriceType + { + Bid, + Ask + } + public sealed class LicenceMessageRule : MessageRule + { + public override MessageType Type => MessageType.Rule; + + public LicenceMessageRule() + { + if (!?.?(Assembly.GetCallingAssembly().Location)) + { + throw new Exception(); + } + } + } + [Serializable] + [DataContract(Name = "Message", Namespace = "TradingPlatform")] + [KnownType(typeof(CustomMessage))] + [KnownType(typeof(MessageAccount))] + [KnownType(typeof(MessageAsset))] + [KnownType(typeof(MessageCloseOrder))] + [KnownType(typeof(MessageClosePosition))] + [KnownType(typeof(MessageExchange))] + [KnownType(typeof(MessageSymbol))] + [KnownType(typeof(MessageSymbolTypes))] + [KnownType(typeof(MessageOpenOrder))] + [KnownType(typeof(MessageOpenPosition))] + [KnownType(typeof(MessageReportType))] + [KnownType(typeof(MessageTrade))] + [KnownType(typeof(MessageQuote))] + [KnownType(typeof(MessageDealTicket))] + [KnownType(typeof(MessageRule))] + [KnownType(typeof(MessageOrderHistory))] + [ProtoContract] + [ProtoInclude(1, typeof(MessageAsset))] + [ProtoInclude(2, typeof(MessageAccount))] + [ProtoInclude(3, typeof(MessageSymbolInfo))] + [ProtoInclude(4, typeof(MessageSymbolTypes))] + [ProtoInclude(5, typeof(MessageExchange))] + [ProtoInclude(6, typeof(MessageQuote))] + [ProtoInclude(7, typeof(MessageOpenOrder))] + [ProtoInclude(8, typeof(MessageCloseOrder))] + [ProtoInclude(9, typeof(MessageOpenPosition))] + [ProtoInclude(10, typeof(MessageClosePosition))] + [ProtoInclude(11, typeof(MessageTrade))] + [ProtoInclude(12, typeof(MessageSessionsContainer))] + [ProtoInclude(13, typeof(MessageOptionSerie))] + [ProtoInclude(14, typeof(MessageCryptoAssetBalances))] + [ProtoInclude(15, typeof(MessageOpenDeliveredAsset))] + [ProtoInclude(16, typeof(CustomMessage))] + public abstract class Message + { + public abstract MessageType Type { get; } + + public override string ToString() + { + return Type.ToString(); + } + } + [DataContract(Name = "Account", Namespace = "TradingPlatform")] + [ProtoContract] + [ProtoInclude(1000, typeof(MessageCryptoAccount))] + public class MessageAccount : Message, IXElementSerialization + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private NettingType ??; + + [CompilerGenerated] + private List ??; + + public override MessageType Type => MessageType.Account; + + [DataMember(Name = "ID")] + [ProtoMember(1)] + public string AccountId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Name")] + [ProtoMember(2)] + public string AccountName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "AssetId")] + [ProtoMember(3)] + public string AssetId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Balance")] + [ProtoMember(4)] + public double Balance + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(5)] + public NettingType NettingType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(6)] + public List AccountAdditionalInfo + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public MessageAccount() + { + NettingType = NettingType.Undefined; + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(25, 4); + defaultInterpolatedStringHandler.AppendFormatted(Type); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(AccountId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(AccountName); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Balance); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AccountId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AccountName)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AssetId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Balance)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)NettingType)); + XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (AccountAdditionalInfo != null) + { + foreach (AdditionalInfoItem item in AccountAdditionalInfo) + { + xElement2.Add(item.ToXElement()); + } + } + xElement.Add(xElement2); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + AccountId = xElement.Value; + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + AccountName = xElement2.Value; + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + AssetId = xElement3.Value; + } + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + Balance = xElement4.ToDouble(); + } + XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement5 != null) + { + NettingType = (NettingType)xElement5.ToInt(); + } + XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement6 == null) + { + return; + } + AccountAdditionalInfo = new List(); + foreach (XElement item in xElement6.Elements()) + { + AdditionalInfoItem additionalInfoItem = new AdditionalInfoItem(); + additionalInfoItem.FromXElement(item, deserializationInfo); + AccountAdditionalInfo.Add(additionalInfoItem); + } + } + } + public sealed class MessageAccountOperation : Message + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private IList ??; + + [CompilerGenerated] + private AccountOperationUpdateHandler ??; + + [CompilerGenerated] + private AccountOperationConfirmationHandler ??; + + [CompilerGenerated] + private AccountOperationExecuteHandler ??; + + public override MessageType Type => MessageType.AccountOperation; + + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string ButtonText + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IList Settings + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public AccountOperationUpdateHandler UpdateHandler + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public AccountOperationConfirmationHandler BuildConfirmationHandler + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public AccountOperationExecuteHandler ExecuteHandler + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public MessageAccountOperation() + { + Settings = new List(); + } + + public override string ToString() + { + return Name ?? 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); + } + } + [DataContract(Name = "Asset", Namespace = "TradingPlatform")] + [ProtoContract] + public sealed class MessageAsset : Message, IXElementSerialization + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private double ??; + + private string ??; + + public override MessageType Type => MessageType.Asset; + + /// + /// Asset id bearer + /// + [DataMember(Name = "Id")] + [ProtoMember(1)] + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Asset name bearer + /// + [DataMember(Name = "Name")] + [ProtoMember(2)] + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Asset description + /// + [DataMember(Name = "Description")] + [ProtoMember(3)] + public string Description + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "MinimumChange")] + [ProtoMember(4)] + public double MinimumChange + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "ISO")] + [ProtoMember(5)] + public string IsoCode + { + get + { + return ?? ?? Name; + } + set + { + ?? = value; + } + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 3); + defaultInterpolatedStringHandler.AppendFormatted(Type); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Id); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Description)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MinimumChange)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), IsoCode)); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + Id = xElement.Value; + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + Name = xElement2.Value; + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + Description = xElement3.Value; + } + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + MinimumChange = xElement4.ToDouble(); + } + XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement5 != null) + { + IsoCode = xElement5.Value; + } + } + } + [DataContract(Name = "MessageCloseDeliveredAsset", Namespace = "TradingPlatform")] + [ProtoContract] + public sealed class MessageCloseDeliveredAsset : Message + { + [CompilerGenerated] + private string ??; + + public override MessageType Type => MessageType.CloseDeliveredAsset; + + [DataMember(Name = "Id")] + [ProtoMember(1)] + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(6, 2); + defaultInterpolatedStringHandler.AppendFormatted(Type); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Id); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + public class MessageClosedPosition : MessageOpenPosition + { + [CompilerGenerated] + private double ??; + + public override MessageType Type => MessageType.ClosedPosition; + + public double LastTradedPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public MessageClosedPosition(string symbolId) + : base(symbolId) + { + } + } + [DataContract(Name = "CloseOrder", Namespace = "TradingPlatform")] + [ProtoContract] + public sealed class MessageCloseOrder : Message + { + [CompilerGenerated] + private string ??; + + public override MessageType Type => MessageType.CloseOrder; + + [DataMember(Name = "OrderId")] + [ProtoMember(1)] + public string OrderId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(6, 2); + defaultInterpolatedStringHandler.AppendFormatted(Type); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderId); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + [DataContract(Name = "ClosePosition", Namespace = "TradingPlatform")] + [ProtoContract] + public sealed class MessageClosePosition : Message + { + [CompilerGenerated] + private string ??; + + public override MessageType Type => MessageType.ClosePosition; + + [DataMember(Name = "PositionId")] + [ProtoMember(1)] + public string PositionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(6, 2); + defaultInterpolatedStringHandler.AppendFormatted(Type); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(PositionId); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + [DataContract(Name = "CorporateAction", Namespace = "TradingPlatform")] + [ProtoContract] + public sealed class MessageCorporateAction : Message, INeedSymbolToPocess + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private CorporateActionType ??; + + public override MessageType Type => MessageType.CorporateAction; + + [DataMember(Name = "CorporateActionId")] + [ProtoMember(1)] + public string CorporateActionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "DateTime")] + [ProtoMember(2)] + public DateTime DateTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "InstrumentSymbol")] + [ProtoMember(3)] + public string SymbolId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Details")] + [ProtoMember(4)] + public string Details + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(5)] + public CorporateActionType CorporateActionType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + } + [DataContract(Name = "CryptoAccount", Namespace = "TradingPlatform")] + [ProtoContract] + public sealed class MessageCryptoAccount : MessageAccount + { + public override MessageType Type => MessageType.CryptoAccount; + } + [DataContract(Name = "CryptoAssetBalances", Namespace = "TradingPlatform")] + [ProtoContract] + public sealed class MessageCryptoAssetBalances : Message, IXElementSerialization, IEquatable + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private GetAvailableBalanceHandler ??; + + public override MessageType Type => MessageType.CryptoAssetBalances; + + [DataMember(Name = "AccountId")] + [ProtoMember(1)] + public string AccountId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Asset id bearer + /// + [DataMember(Name = "AssetId")] + [ProtoMember(2)] + public string AssetId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "TotalBalance")] + [ProtoMember(3)] + public double TotalBalance + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "AvailableBalance")] + [ProtoMember(4)] + public double AvailableBalance + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "ReservedBalance")] + [ProtoMember(5)] + public double ReservedBalance + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "TotalInUSD")] + [ProtoMember(6)] + public double TotalInUSD + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "TotalInBTC")] + [ProtoMember(7)] + public double TotalInBTC + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Debt")] + [ProtoMember(8)] + public double Debt + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Equity")] + [ProtoMember(9)] + public double Equity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "EquityInBTC")] + [ProtoMember(10)] + public double EquityInBTC + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public GetAvailableBalanceHandler AvailableBalanceHandler + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AccountId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AssetId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TotalBalance)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AvailableBalance)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ReservedBalance)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TotalInUSD)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TotalInBTC)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Debt)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Equity)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), EquityInBTC)); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + AccountId = xElement.Value; + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + AssetId = xElement2.Value; + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + TotalBalance = xElement3.ToDouble(); + } + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + AvailableBalance = xElement4.ToDouble(); + } + XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement5 != null) + { + ReservedBalance = xElement5.ToDouble(); + } + XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement6 != null) + { + TotalInUSD = xElement6.ToDouble(); + } + XElement xElement7 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement7 != null) + { + TotalInBTC = xElement7.ToDouble(); + } + XElement xElement8 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement8 != null) + { + Debt = xElement8.ToDouble(); + } + XElement xElement9 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement9 != null) + { + Equity = xElement9.ToDouble(); + } + XElement xElement10 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement10 != null) + { + EquityInBTC = xElement10.ToDouble(); + } + } + + public bool Equals(MessageCryptoAssetBalances other) + { + if (other == null) + { + return false; + } + if (this == other) + { + return true; + } + if (AccountId == other.AccountId && AssetId == other.AssetId && TotalBalance.Equals(other.TotalBalance) && AvailableBalance.Equals(other.AvailableBalance) && ReservedBalance.Equals(other.ReservedBalance) && TotalInUSD.Equals(other.TotalInUSD) && TotalInBTC.Equals(other.TotalInBTC) && Debt.Equals(other.Debt) && Equity.Equals(other.Equity) && EquityInBTC.Equals(other.EquityInBTC)) + { + return object.Equals(AvailableBalanceHandler, other.AvailableBalanceHandler); + } + return false; + } + + public override bool Equals(object obj) + { + if (this != obj) + { + if (obj is MessageCryptoAssetBalances other) + { + return Equals(other); + } + return false; + } + return true; + } + + public override int GetHashCode() + { + HashCode hashCode = default(HashCode); + hashCode.Add(AccountId); + hashCode.Add(AssetId); + hashCode.Add(TotalBalance); + hashCode.Add(AvailableBalance); + hashCode.Add(ReservedBalance); + hashCode.Add(TotalInUSD); + hashCode.Add(TotalInBTC); + hashCode.Add(Debt); + hashCode.Add(Equity); + hashCode.Add(EquityInBTC); + hashCode.Add(AvailableBalanceHandler); + return hashCode.ToHashCode(); + } + } + public delegate bool GetAvailableBalanceHandler(string assetId, OrderRequestParameters requestParameters, out double availableBalance); + [DataContract(Name = "DealTicket", Namespace = "TradingPlatform")] + public sealed class MessageDealTicket : Message + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private DealTicketType ??; + + public override MessageType Type => MessageType.DealTicket; + + [DataMember(Name = "Header")] + public string Header + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + [DataMember(Name = "Description")] + public string Description + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + [DataMember(Name = "DealTicketType")] + public DealTicketType DealTicketType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = dealTicketType; + } + } + + public MessageDealTicket(string header, string description = "", DealTicketType dealTicketType = DealTicketType.Info) + { + Header = header; + Description = description; + DealTicketType = dealTicketType; + } + + public static MessageDealTicket CreateInfoDealTicket(string header, string text) + { + return new MessageDealTicket(header, text); + } + + public static MessageDealTicket CreateRefuseDealTicket(string refuse) + { + return CreateRefuseDealTicket(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), refuse); + } + + public static MessageDealTicket CreateRefuseDealTicket(string header, string refuse) + { + return new MessageDealTicket(header, refuse, DealTicketType.Refuse); + } + } + [DataContract(Name = "Exchange", Namespace = "TradingPlatform")] + [ProtoContract] + public sealed class MessageExchange : Message, IXElementSerialization + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private string ??; + + public override MessageType Type => MessageType.Exchange; + + [DataMember(Name = "ExchangeId")] + [ProtoMember(1)] + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "ExchangeName")] + [ProtoMember(2)] + public string ExchangeName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "SortIndex")] + [ProtoMember(3)] + public int SortIndex + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string SessionsContainerId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(13, 3); + defaultInterpolatedStringHandler.AppendFormatted(Type); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Id); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(ExchangeName); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExchangeName)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SortIndex)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SessionsContainerId)); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + Id = xElement.Value; + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + ExchangeName = xElement2.Value; + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + SortIndex = xElement3.ToInt(); + } + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + SessionsContainerId = xElement4.Value; + } + } + } + public class MessageNewsHeadline : Message + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private IEnumerable ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + public override MessageType Type => MessageType.NewsHeadline; + + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DateTime CreationDate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Title + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IEnumerable SymbolsIds + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Category + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string SourceLink + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string SubscribeId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + } + [DataContract(Name = "MessageOpenDeliveredAsset", Namespace = "TradingPlatform")] + [ProtoContract] + public class MessageOpenDeliveredAsset : Message, INeedSymbolToPocess, IXElementSerialization + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private List ??; + + public override MessageType Type => MessageType.OpenDeliveredAsset; + + [DataMember(Name = "Id")] + [ProtoMember(1)] + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "AccountId")] + [ProtoMember(2)] + public string AccountId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "SymbolId")] + [ProtoMember(3)] + public string SymbolId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Quantity")] + [ProtoMember(4)] + public double Quantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Status")] + [ProtoMember(5)] + public string Status + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "CreationTime")] + [ProtoMember(6)] + public DateTime CreationTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(7)] + public List AdditionalInfoItems + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AccountId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SymbolId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Quantity)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Status)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CreationTime)); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + Id = xElement.Value; + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + AccountId = xElement2.Value; + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + SymbolId = xElement3.Value; + } + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + Quantity = xElement4.ToDouble(); + } + XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement5 != null) + { + Status = xElement5.Value; + } + XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement6 != null) + { + CreationTime = xElement6.ToDateTime(toUTC: true); + } + } + } + [DataContract(Name = "OpenOrder", Namespace = "TradingPlatform")] + [ProtoContract] + [ProtoInclude(23, typeof(MessageOrderHistory))] + public class MessageOpenOrder : Message, INeedSymbolToPocess, IXElementSerialization + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private Side ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private TimeInForce ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private OrderStatus ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private readonly List ??; + + [CompilerGenerated] + private readonly List ??; + + [CompilerGenerated] + private List ??; + + public override MessageType Type => MessageType.OpenOrder; + + [DataMember(Name = "OrderId")] + [ProtoMember(1)] + public string OrderId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "GroupId")] + [ProtoMember(2)] + public string GroupId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "PositionId")] + [ProtoMember(3)] + public string PositionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "AccountId")] + [ProtoMember(4)] + public string AccountId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "TotalQuantity")] + [ProtoMember(5)] + public double TotalQuantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "FilledQuantity")] + [ProtoMember(6)] + public double FilledQuantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Side")] + [ProtoMember(7)] + public Side Side + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Comment")] + [ProtoMember(8)] + public string Comment + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "LastUpdateTime")] + [ProtoMember(9)] + public DateTime LastUpdateTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "InstrumentSymbol")] + [ProtoMember(10)] + public string SymbolId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + [DataMember(Name = "OrderTypeId")] + [ProtoMember(11)] + public string OrderTypeId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Tif")] + [ProtoMember(12)] + public TimeInForce TimeInForce + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "ExpirationTime")] + [ProtoMember(13)] + public DateTime ExpirationTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Price")] + [ProtoMember(14)] + public double Price + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "TriggerPrice")] + [ProtoMember(15)] + public double TriggerPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "TrailOffset")] + [ProtoMember(16)] + public double TrailOffset + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Status")] + [ProtoMember(17)] + public OrderStatus Status + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "OriginalStatus")] + [ProtoMember(18)] + public string OriginalStatus + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "AverageFillPrice")] + [ProtoMember(19)] + public double AverageFillPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public SlTpHolder StopLoss + { + get + { + return StopLossItems.FirstOrDefault(); + } + set + { + if (value == null) + { + StopLossItems.Clear(); + } + else if (StopLossItems.Any()) + { + StopLossItems[0] = value; + } + else + { + StopLossItems.Add(value); + } + } + } + + public SlTpHolder TakeProfit + { + get + { + return TakeProfitItems.FirstOrDefault(); + } + set + { + if (value == null) + { + TakeProfitItems.Clear(); + } + else if (TakeProfitItems.Any()) + { + TakeProfitItems[0] = value; + } + else + { + TakeProfitItems.Add(value); + } + } + } + + [ProtoMember(20)] + public List StopLossItems + { + [CompilerGenerated] + get + { + return ??; + } + } + + [ProtoMember(21)] + public List TakeProfitItems + { + [CompilerGenerated] + get + { + return ??; + } + } + + [ProtoMember(22)] + public List AdditionalInfoItems + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + internal MessageOpenOrder() + { + Price = double.NaN; + TriggerPrice = double.NaN; + TrailOffset = double.NaN; + AverageFillPrice = double.NaN; + ?? = new List(); + ?? = new List(); + } + + public MessageOpenOrder(string symbolId) + : this() + { + SymbolId = symbolId; + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(41, 6); + defaultInterpolatedStringHandler.AppendFormatted(Type); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(SymbolId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Price); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderTypeId); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public string Format() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(13, 8); + defaultInterpolatedStringHandler.AppendFormatted(OrderId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(SymbolId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(AccountId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderTypeId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(FilledQuantity); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(TotalQuantity); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Status); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OrderId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), GroupId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), PositionId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AccountId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TotalQuantity)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), FilledQuantity)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Side)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Comment)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LastUpdateTime)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SymbolId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OrderTypeId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)TimeInForce)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExpirationTime)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Price)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TriggerPrice)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TrailOffset)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)Status)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OriginalStatus)); + XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + foreach (AdditionalInfoItem additionalInfoItem in AdditionalInfoItems) + { + xElement2.Add(additionalInfoItem.ToXElement()); + } + xElement.Add(xElement2); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + OrderId = xElement.Value; + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + GroupId = xElement2.Value; + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + PositionId = xElement3.Value; + } + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + AccountId = xElement4.Value; + } + XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement5 != null) + { + TotalQuantity = xElement5.ToDouble(); + } + XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement6 != null) + { + FilledQuantity = xElement6.ToDouble(); + } + XElement xElement7 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement7 != null) + { + Side = (Side)xElement7.ToInt(); + } + XElement xElement8 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement8 != null) + { + Comment = xElement8.Value; + } + XElement xElement9 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement9 != null) + { + LastUpdateTime = xElement9.ToDateTime(toUTC: true); + } + XElement xElement10 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement10 != null) + { + SymbolId = xElement10.Value; + } + XElement xElement11 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement11 != null) + { + OrderTypeId = xElement11.Value; + } + XElement xElement12 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement12 != null) + { + TimeInForce = (TimeInForce)xElement12.ToInt(); + } + XElement xElement13 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement13 != null) + { + ExpirationTime = xElement13.ToDateTime(toUTC: true); + } + XElement xElement14 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement14 != null) + { + Price = xElement14.ToDouble(); + } + XElement xElement15 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement15 != null) + { + TriggerPrice = xElement15.ToDouble(); + } + XElement xElement16 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement16 != null) + { + TrailOffset = xElement16.ToDouble(); + } + XElement xElement17 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement17 != null) + { + Status = (OrderStatus)xElement17.ToInt(); + } + XElement xElement18 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement18 != null) + { + OriginalStatus = xElement18.Value; + } + XElement xElement19 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement19 == null) + { + return; + } + List list = new List(); + foreach (XElement item in xElement19.Elements()) + { + AdditionalInfoItem additionalInfoItem = new AdditionalInfoItem(); + additionalInfoItem.FromXElement(item, deserializationInfo); + list.Add(additionalInfoItem); + } + AdditionalInfoItems = list; + } + } + [DataContract(Name = "OpenPosition", Namespace = "TradingPlatform")] + [ProtoContract] + public class MessageOpenPosition : Message, INeedSymbolToPocess, IXElementSerialization + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private Side ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private List ??; + + public override MessageType Type => MessageType.OpenPosition; + + [DataMember(Name = "PositionId")] + [ProtoMember(1)] + public string PositionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "OpenPrice")] + [ProtoMember(2)] + public double OpenPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "OpenTime")] + [ProtoMember(3)] + public DateTime OpenTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Quantity")] + [ProtoMember(4)] + public double Quantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Side")] + [ProtoMember(5)] + public Side Side + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Comment")] + [ProtoMember(6)] + public string Comment + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "AccountId")] + [ProtoMember(7)] + public string AccountId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "InstrumentSymbol")] + [ProtoMember(8)] + public string SymbolId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + [DataMember(Name = "OpenOrderId")] + [ProtoMember(9)] + public string OpenOrderId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "LiquidationPrice")] + [ProtoMember(10)] + public double LiquidationPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public List AdditionalInfoItems + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + internal MessageOpenPosition() + { + LiquidationPrice = double.NaN; + } + + public MessageOpenPosition(string symbolId) + : this() + { + SymbolId = symbolId; + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(30, 4); + defaultInterpolatedStringHandler.AppendFormatted(Type); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(PositionId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OpenPrice); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(SymbolId); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), PositionId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OpenPrice)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OpenTime)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Quantity)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Side)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Comment)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AccountId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SymbolId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OpenOrderId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LiquidationPrice)); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + PositionId = xElement.Value; + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + OpenPrice = xElement2.ToDouble(); + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + OpenTime = xElement3.ToDateTime(toUTC: true); + } + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + Quantity = xElement4.ToDouble(); + } + XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement5 != null) + { + Side = (Side)xElement5.ToInt(); + } + XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement6 != null) + { + Comment = xElement6.Value; + } + XElement xElement7 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement7 != null) + { + AccountId = xElement7.Value; + } + XElement xElement8 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement8 != null) + { + SymbolId = xElement8.Value; + } + XElement xElement9 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement9 != null) + { + OpenOrderId = xElement9.Value; + } + XElement xElement10 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement10 != null) + { + LiquidationPrice = xElement10.ToDouble(); + } + } + } + [DataContract(Name = "OptionSerie", Namespace = "TradingPlatform")] + [ProtoContract] + public class MessageOptionSerie : Message, IXElementSerialization + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private OptionSerieType ??; + + public override MessageType Type => MessageType.OptionSerie; + + [ProtoMember(1)] + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(2)] + public DateTime ExpirationDate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(3)] + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(4)] + public string UnderlierId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(5)] + public string ExchangeId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(6)] + public OptionSerieType SerieType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(25, 3); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(UnderlierId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(ExpirationDate.ToShortDateString()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExpirationDate)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), UnderlierId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)SerieType)); + return xElement; + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + Id = xElement.ToString(); + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + ExpirationDate = xElement2.ToDateTime(); + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + Name = xElement3.Value; + } + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + UnderlierId = xElement4.Value; + } + XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement5 != null) + { + SerieType = (OptionSerieType)xElement5.ToInt(); + } + } + } + [DataContract(Name = "OrderHistory", Namespace = "TradingPlatform")] + [ProtoContract] + public sealed class MessageOrderHistory : MessageOpenOrder + { + public override MessageType Type => MessageType.OrderHistory; + + private MessageOrderHistory() + { + base.AverageFillPrice = double.NaN; + } + + public MessageOrderHistory(string symbolId) + : base(symbolId) + { + base.AverageFillPrice = double.NaN; + } + + public MessageOrderHistory(MessageOpenOrder order) + : base(order.SymbolId) + { + base.OrderId = order.OrderId; + base.AccountId = order.AccountId; + base.OrderTypeId = order.OrderTypeId; + base.Price = order.Price; + base.TriggerPrice = order.TriggerPrice; + base.TrailOffset = order.TrailOffset; + base.FilledQuantity = order.FilledQuantity; + base.TotalQuantity = order.TotalQuantity; + base.Side = order.Side; + base.TimeInForce = order.TimeInForce; + base.ExpirationTime = order.ExpirationTime; + base.PositionId = order.PositionId; + base.GroupId = order.GroupId; + base.Comment = order.Comment; + base.LastUpdateTime = order.LastUpdateTime; + base.StopLoss = order.StopLoss; + base.TakeProfit = order.TakeProfit; + base.Status = order.Status; + base.OriginalStatus = order.OriginalStatus; + base.AverageFillPrice = order.AverageFillPrice; + } + } + public class MessageRemoveTradingSignal : Message + { + [CompilerGenerated] + private string ??; + + public override MessageType Type => MessageType.RemoveTradingSignal; + + public string TradingSignalId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public MessageRemoveTradingSignal(string tradingSignalId) + { + TradingSignalId = tradingSignalId; + } + } + [DataContract(Name = "MessageReportType", Namespace = "TradingPlatform")] + public sealed class MessageReportType : Message + { + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private List ??; + + [DataMember(Name = "Id")] + public int Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Name")] + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Parameters")] + public List Parameters + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override MessageType Type => MessageType.ReportMetadata; + + public MessageReportType() + { + Parameters = new List(); + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(14, 3); + defaultInterpolatedStringHandler.AppendFormatted(Type); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Id); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + [DataContract(Name = "Rule", Namespace = "TradingPlatform")] + public class MessageRule : Message + { + [CompilerGenerated] + private readonly string ??; + + [CompilerGenerated] + private readonly string ??; + + [CompilerGenerated] + private readonly string ??; + + [CompilerGenerated] + private readonly string ??; + + [CompilerGenerated] + private readonly object ??; + + public override MessageType Type => MessageType.Rule; + + [DataMember(Name = "Name")] + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + [DataMember(Name = "AccountId")] + public string AccountId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + [DataMember(Name = "InstrumentId")] + public string SymbolId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + [DataMember(Name = "OrderTypeId")] + public string OrderTypeId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + [DataMember(Name = "Value")] + public object Value + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public MessageRule() + { + Name = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); + AccountId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); + SymbolId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); + OrderTypeId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(); + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(15, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Name); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Value); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + [ProtoContract] + public class MessageSessionsContainer : Message, IXElementSerialization + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private HolidayInfo[] ??; + + [CompilerGenerated] + private SessionsSet[] ??; + + public override MessageType Type => MessageType.Session; + + [ProtoMember(1)] + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(2)] + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(3)] + public string Description + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(4)] + public HolidayInfo[] Holidays + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(5)] + public SessionsSet[] SessionsSets + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + Id = xElement.Value; + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + Name = xElement2.Value; + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + Description = xElement3.Value; + } + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + List list = new List(); + foreach (XElement item in xElement4.Elements()) + { + HolidayInfo holidayInfo = new HolidayInfo(); + holidayInfo.FromXElement(item, deserializationInfo); + list.Add(holidayInfo); + } + Holidays = list.ToArray(); + } + XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement5 == null) + { + return; + } + List list2 = new List(); + foreach (XElement item2 in xElement5.Elements()) + { + SessionsSet sessionsSet = new SessionsSet(); + sessionsSet.FromXElement(item2, deserializationInfo); + list2.Add(sessionsSet); + } + SessionsSets = list2.ToArray(); + } + + public XElement ToXElement() + { + XElement xElement = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Description)); + XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (Holidays != null) + { + HolidayInfo[] holidays = Holidays; + foreach (HolidayInfo holidayInfo in holidays) + { + xElement2.Add(holidayInfo.ToXElement()); + } + } + xElement.Add(xElement2); + XElement xElement3 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + SessionsSet[] sessionsSets = SessionsSets; + foreach (SessionsSet sessionsSet in sessionsSets) + { + xElement3.Add(sessionsSet.ToXElement()); + } + xElement.Add(xElement3); + return xElement; + } + } + [DataContract(Name = "Instrument", Namespace = "TradingPlatform")] + [ProtoContract] + public sealed class MessageSymbol : MessageSymbolInfo, IXElementSerialization, INeedSymbolToPocess + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal AdditionalInfoItem ?(AdditionalInfoItem P_0) + { + return (AdditionalInfoItem)P_0.Clone(); + } + } + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private TimeSpan ??; + + [CompilerGenerated] + private SymbolQuotingType ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private List ??; + + [CompilerGenerated] + private NettingType ??; + + [CompilerGenerated] + private SymbolVolumeType ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private DeltaCalculationType ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private HistoryMetadata ??; + + [CompilerGenerated] + private VolumeAnalysisMetadata ??; + + public override MessageType Type => MessageType.Symbol; + + [DataMember(Name = "productID")] + [ProtoMember(100)] + public string ProductAssetId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "quotingCurrencyID")] + [ProtoMember(105)] + public string QuotingCurrencyAssetID + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "quoteDelay")] + [ProtoMember(110)] + public TimeSpan QuoteDelay + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "quotingType")] + [ProtoMember(115)] + public SymbolQuotingType QuotingType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "lotSize")] + [ProtoMember(120)] + public double LotSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "instrumentAdditionalInfo")] + [ProtoMember(130)] + public List SymbolAdditionalInfo + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "nettingType")] + [ProtoMember(135)] + public NettingType NettingType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "VolumeType")] + [ProtoMember(145)] + public SymbolVolumeType VolumeType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "allowCalculateRealtimeTicks")] + [ProtoMember(150)] + public bool AllowCalculateRealtimeTicks + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "allowCalculateRealtimeTrades")] + [ProtoMember(155)] + public bool AllowCalculateRealtimeTrades + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "allowCalculateRealtimeVolume")] + [ProtoMember(160)] + public bool AllowCalculateRealtimeVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "allowCalculateRealtimeChange")] + [ProtoMember(165)] + public bool AllowCalculateRealtimeChange + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "allowAbbreviatePriceByTickSize")] + [ProtoMember(170)] + public bool AllowAbbreviatePriceByTickSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "notionalValueStep")] + [ProtoMember(175)] + public double NotionalValueStep + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "deltaCalculationType")] + [ProtoMember(180)] + public DeltaCalculationType DeltaCalculationType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "minVolumeAnalysisTickSize")] + [ProtoMember(183)] + public double MinVolumeAnalysisTickSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(185)] + public DateTime MaturityDate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + string INeedSymbolToPocess.SymbolId => base.UnderlierId; + + [DataMember(Name = "SessionsContainerId")] + [ProtoMember(186)] + public string SessionsContainerId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "HistoryMetadata")] + [ProtoMember(187)] + public HistoryMetadata HistoryMetadata + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(188)] + public VolumeAnalysisMetadata VolumeAnalysisMetadata + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + private MessageSymbol() + { + } + + public MessageSymbol(string symbolId) + : base(symbolId) + { + } + + public MessageSymbol(MessageSymbol origin) + : base(origin) + { + ProductAssetId = origin.ProductAssetId; + QuotingCurrencyAssetID = origin.QuotingCurrencyAssetID; + QuoteDelay = origin.QuoteDelay; + QuotingType = origin.QuotingType; + LotSize = origin.LotSize; + SymbolAdditionalInfo = ((origin.SymbolAdditionalInfo != null) ? new List(origin.SymbolAdditionalInfo.Select((AdditionalInfoItem P_0) => (AdditionalInfoItem)P_0.Clone())) : null); + NettingType = origin.NettingType; + base.GroupId = origin.GroupId; + VolumeType = origin.VolumeType; + AllowCalculateRealtimeTicks = origin.AllowCalculateRealtimeTicks; + AllowCalculateRealtimeTrades = origin.AllowCalculateRealtimeTrades; + AllowCalculateRealtimeVolume = origin.AllowCalculateRealtimeVolume; + AllowCalculateRealtimeChange = origin.AllowCalculateRealtimeChange; + AllowAbbreviatePriceByTickSize = origin.AllowAbbreviatePriceByTickSize; + NotionalValueStep = origin.NotionalValueStep; + DeltaCalculationType = origin.DeltaCalculationType; + MinVolumeAnalysisTickSize = origin.MinVolumeAnalysisTickSize; + MaturityDate = origin.MaturityDate; + SessionsContainerId = origin.SessionsContainerId; + HistoryMetadata = origin.HistoryMetadata; + VolumeAnalysisMetadata = origin.VolumeAnalysisMetadata; + } + + protected override void InitialState() + { + base.InitialState(); + NettingType = NettingType.Undefined; + AllowCalculateRealtimeTicks = true; + AllowCalculateRealtimeTrades = true; + AllowCalculateRealtimeVolume = true; + AllowCalculateRealtimeChange = true; + AllowAbbreviatePriceByTickSize = false; + LotSize = 1.0; + NotionalValueStep = 1.0; + MinVolumeAnalysisTickSize = double.NaN; + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(16, 3); + defaultInterpolatedStringHandler.AppendFormatted(Type); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.Id); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(base.Name); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + + public override XElement ToXElement() + { + XElement xElement = base.ToXElement(); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ProductAssetId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), QuotingCurrencyAssetID)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), QuoteDelay.ToString())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)QuotingType).ToString())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LotSize)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), NotionalValueStep)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)NettingType).ToString())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)base.HistoryType).ToString())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)VolumeType).ToString())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)DeltaCalculationType).ToString())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MinVolumeAnalysisTickSize)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AllowCalculateRealtimeTicks)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AllowCalculateRealtimeTrades)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AllowCalculateRealtimeVolume)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AllowCalculateRealtimeChange)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), AllowAbbreviatePriceByTickSize)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MaturityDate)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SessionsContainerId)); + if (base.FutureContractType.HasValue) + { + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)base.FutureContractType.Value).ToString())); + } + return xElement; + } + + public override void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + base.FromXElement(element, deserializationInfo); + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + ProductAssetId = xElement.Value; + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + QuotingCurrencyAssetID = xElement2.Value; + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + QuoteDelay = xElement3.ToTimeSpan(); + } + element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + NettingType = (NettingType)xElement4.ToInt(); + } + XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement5 != null) + { + QuotingType = (SymbolQuotingType)xElement5.ToInt(); + } + XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement6 != null) + { + LotSize = xElement6.ToDouble(); + } + XElement xElement7 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement7 != null) + { + NotionalValueStep = xElement7.ToDouble(); + } + XElement xElement8 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement8 != null) + { + base.HistoryType = (HistoryType)xElement8.ToInt(); + } + XElement xElement9 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement9 != null) + { + VolumeType = (SymbolVolumeType)xElement9.ToInt(); + } + XElement xElement10 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement10 != null) + { + DeltaCalculationType = (DeltaCalculationType)xElement10.ToInt(); + } + XElement xElement11 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement11 != null) + { + MinVolumeAnalysisTickSize = xElement11.ToDouble(); + } + XElement xElement12 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement12 != null) + { + AllowCalculateRealtimeTicks = xElement12.ToBool(); + } + XElement xElement13 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement13 != null) + { + AllowCalculateRealtimeTrades = xElement13.ToBool(); + } + XElement xElement14 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement14 != null) + { + AllowCalculateRealtimeVolume = xElement14.ToBool(); + } + XElement xElement15 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement15 != null) + { + AllowCalculateRealtimeChange = xElement15.ToBool(); + } + XElement xElement16 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement16 != null) + { + AllowAbbreviatePriceByTickSize = xElement16.ToBool(); + } + XElement xElement17 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement17 != null) + { + MaturityDate = xElement17.ToDateTime(); + } + XElement xElement18 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement18 != null) + { + SessionsContainerId = xElement18.Value; + } + XElement xElement19 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement19 != null) + { + base.FutureContractType = (FutureContractType)xElement19.ToInt(); + } + } + } + public class MessageSymbolGroup : Message + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private int ??; + + public override MessageType Type => MessageType.SymbolGroup; + + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string GroupName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int SortIndex + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(13, 3); + defaultInterpolatedStringHandler.AppendFormatted(Type); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Id); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(GroupName); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + [DataContract(Name = "Instrument", Namespace = "TradingPlatform")] + [ProtoContract] + [ProtoInclude(1000, typeof(MessageSymbol))] + public class MessageSymbolInfo : Message, IXElementSerialization + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private SymbolType ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private OptionType ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private HistoryType ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private AvailableDerivatives ??; + + [CompilerGenerated] + private AvailableDerivatives ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private FutureContractType? ??; + + [CompilerGenerated] + private string[] ??; + + [CompilerGenerated] + private List ??; + + public override MessageType Type => MessageType.SymbolInfo; + + [DataMember(Name = "id")] + [ProtoMember(5)] + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + internal set + { + ?? = text; + } + } + + [DataMember(Name = "name")] + [ProtoMember(10)] + public string Name + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "description")] + [ProtoMember(15)] + public string Description + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "type")] + [ProtoMember(20)] + public SymbolType SymbolType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "ExchangeId")] + [ProtoMember(25)] + public string ExchangeId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "lotStep")] + [ProtoMember(30)] + public double LotStep + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "minLot")] + [ProtoMember(35)] + public double MinLot + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "maxLot")] + [ProtoMember(40)] + public double MaxLot + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "underlierName")] + [ProtoMember(45)] + public string Root + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "optionType")] + [ProtoMember(50)] + public OptionType OptionType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "strikePrice")] + [ProtoMember(55)] + public double StrikePrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "expirationDate")] + [ProtoMember(60)] + public DateTime ExpirationDate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "HistoryType")] + [ProtoMember(70)] + public HistoryType HistoryType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "lastTradingDate")] + [ProtoMember(80)] + public DateTime LastTradingDate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "AvailableFutures")] + [ProtoMember(85)] + public AvailableDerivatives AvailableFutures + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "AvailableOptions")] + [ProtoMember(86)] + public AvailableDerivatives AvailableOptions + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "underlierId")] + [ProtoMember(90)] + public string UnderlierId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "optionSerieId")] + [ProtoMember(95)] + public string OptionSerieId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(96)] + public string GroupId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(97)] + public FutureContractType? FutureContractType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(98)] + public string[] AvailableOptionsExchanges + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "variableTickList")] + [ProtoMember(125)] + public List VariableTickList + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + protected MessageSymbolInfo() + { + InitialState(); + } + + public MessageSymbolInfo(string symbolId) + : this() + { + Id = symbolId; + } + + public MessageSymbolInfo(MessageSymbolInfo origin) + : this() + { + Fill(origin); + } + + protected virtual void InitialState() + { + ExchangeId = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + AvailableFutures = AvailableDerivatives.None; + AvailableOptions = AvailableDerivatives.None; + MinLot = 1.0; + MaxLot = 2147483647.0; + LotStep = 1.0; + } + + public void Fill(MessageSymbolInfo messageSymbolInfo) + { + Id = messageSymbolInfo.Id; + Name = messageSymbolInfo.Name; + Description = messageSymbolInfo.Description; + SymbolType = messageSymbolInfo.SymbolType; + ExchangeId = messageSymbolInfo.ExchangeId; + LotStep = messageSymbolInfo.LotStep; + MinLot = messageSymbolInfo.MinLot; + MaxLot = messageSymbolInfo.MaxLot; + Root = messageSymbolInfo.Root; + OptionType = messageSymbolInfo.OptionType; + StrikePrice = messageSymbolInfo.StrikePrice; + ExpirationDate = messageSymbolInfo.ExpirationDate; + HistoryType = messageSymbolInfo.HistoryType; + LastTradingDate = messageSymbolInfo.LastTradingDate; + AvailableFutures = messageSymbolInfo.AvailableFutures; + AvailableOptions = messageSymbolInfo.AvailableOptions; + UnderlierId = messageSymbolInfo.UnderlierId; + OptionSerieId = messageSymbolInfo.OptionSerieId; + FutureContractType = messageSymbolInfo.FutureContractType; + VariableTickList = ((messageSymbolInfo.VariableTickList != null) ? new List(messageSymbolInfo.VariableTickList) : null); + } + + public virtual XElement ToXElement() + { + XElement xElement = new XElement(GetType().Name); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Id)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Name)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Description)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)SymbolType).ToString())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExchangeId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LotStep)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MinLot)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MaxLot)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Root)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)AvailableFutures).ToString())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)AvailableOptions).ToString())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), UnderlierId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), OptionSerieId)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ((int)OptionType).ToString())); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), StrikePrice)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), ExpirationDate)); + xElement.Add(new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LastTradingDate)); + XElement xElement2 = new XElement(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (VariableTickList != null && VariableTickList.Count > 0) + { + for (int i = 0; i < VariableTickList.Count; i++) + { + xElement2.Add(VariableTickList[i].ToXElement()); + } + } + xElement.Add(xElement2); + return xElement; + } + + public virtual void FromXElement(XElement element, DeserializationInfo deserializationInfo) + { + XElement xElement = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement != null) + { + Id = xElement.Value; + } + XElement xElement2 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement2 != null) + { + Name = xElement2.Value; + } + XElement xElement3 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement3 != null) + { + Description = xElement3.Value; + } + XElement xElement4 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement4 != null) + { + SymbolType = (SymbolType)xElement4.ToInt(); + } + XElement xElement5 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement5 != null) + { + ExchangeId = xElement5.Value; + } + XElement xElement6 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement6 != null) + { + LotStep = xElement6.ToDouble(); + } + XElement xElement7 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement7 != null) + { + MaxLot = xElement7.ToDouble(); + } + XElement xElement8 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement8 != null) + { + MinLot = xElement8.ToDouble(); + } + XElement xElement9 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement9 != null) + { + Root = xElement9.Value; + } + XElement xElement10 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement10 != null) + { + AvailableFutures = (AvailableDerivatives)xElement10.ToInt(); + } + XElement xElement11 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement11 != null) + { + AvailableOptions = (AvailableDerivatives)xElement11.ToInt(); + } + XElement xElement12 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement12 != null) + { + UnderlierId = xElement12.Value; + } + XElement xElement13 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement13 != null) + { + OptionSerieId = xElement13.Value; + } + XElement xElement14 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement14 != null) + { + OptionType = (OptionType)xElement14.ToInt(); + } + XElement xElement15 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement15 != null) + { + StrikePrice = xElement15.ToDouble(); + } + XElement xElement16 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement16 != null) + { + ExpirationDate = xElement16.ToDateTime(); + } + XElement xElement17 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement17 != null) + { + LastTradingDate = xElement17.ToDateTime(); + } + XElement xElement18 = element.Element(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (xElement18 == null) + { + return; + } + List list = new List(); + foreach (XElement item in xElement18.Elements()) + { + VariableTick variableTick = new VariableTick(); + variableTick.FromXElement(item, deserializationInfo); + list.Add(variableTick); + } + VariableTickList = list; + } + } + [DataContract(Name = "InstrumentTypes", Namespace = "TradingPlatform")] + [ProtoContract] + public sealed class MessageSymbolTypes : Message + { + [CompilerGenerated] + private IList ??; + + public override MessageType Type => MessageType.SymbolTypes; + + [ProtoMember(1)] + public IList SymbolTypes + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + } + [DataContract(Name = "Trade", Namespace = "TradingPlatform")] + [ProtoContract] + public sealed class MessageTrade : Message, INeedSymbolToPocess + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private Side ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private PnLItem ??; + + [CompilerGenerated] + private PnLItem ??; + + [CompilerGenerated] + private PnLItem ??; + + [CompilerGenerated] + private PositionImpactType ??; + + public override MessageType Type => MessageType.Trade; + + [DataMember(Name = "TradeId")] + [ProtoMember(1)] + public string TradeId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "OrderId")] + [ProtoMember(2)] + public string OrderId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "PositionId")] + [ProtoMember(3)] + public string PositionId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Price")] + [ProtoMember(4)] + public double Price + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Quantity")] + [ProtoMember(5)] + public double Quantity + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Side")] + [ProtoMember(6)] + public Side Side + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "AccountId")] + [ProtoMember(7)] + public string AccountId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "InstrumentSymbol")] + [ProtoMember(8)] + public string SymbolId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "DateTime")] + [ProtoMember(9)] + public DateTime DateTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Comment")] + [ProtoMember(10)] + public string Comment + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "OrderType")] + [ProtoMember(11)] + public string OrderTypeId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "GrossPnl")] + [ProtoMember(12)] + public PnLItem GrossPnl + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "NetPnl")] + [ProtoMember(13)] + public PnLItem NetPnl + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [DataMember(Name = "Fee")] + [ProtoMember(14)] + public PnLItem Fee + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + [ProtoMember(15)] + public PositionImpactType PositionImpactType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public override string ToString() + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(28, 4); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(SymbolId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Side); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(Quantity); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(OrderId); + return defaultInterpolatedStringHandler.ToStringAndClear(); + } + } + public class MessageTradingSignal : Message + { + [CompilerGenerated] + private readonly string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private Side ??; + + [CompilerGenerated] + private OrderTypeBehavior ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + public override MessageType Type => MessageType.TradingSignal; + + public string Id + { + [CompilerGenerated] + get + { + return ??; + } + } + + public string Ticker + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Root + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string VendorName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Side Side + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public OrderTypeBehavior OrderTypeBehavior + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double EntryPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double TargetPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double StopPrice + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double Confidence + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DateTime Published + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DateTime Updated + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DateTime ExpiresAt + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Duration + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Status + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Description + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Details + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string Source + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public MessageTradingSignal(string id) + { + ?? = id; + } + + public override string ToString() + { + return 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + Side.ToString().ToUpperInvariant() + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + (Ticker ?? Root); + } + } + public abstract class MultiVendor : Vendor + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func> ??; + + public static Func, IEnumerable> ??; + + public static Func, IEnumerable> ??; + + public static Func, IEnumerable> ??; + + public static Func, IEnumerable> ??; + + public static Func, TimeSpan> ??; + + public static Func, TimeSpan> ??; + + public static Func, TimeSpan> ??; + + public static Func, bool> ??; + + public static Func, bool> ??; + + public static Func ??; + + public static Func ??; + + public static Func ??; + + internal bool ?(IVendor P_0) + { + return P_0 is Vendor; + } + + internal bool ?(ISymbolVendor P_0) + { + return P_0.AllowNonFixedList; + } + + internal IEnumerable ?(MessageSymbolTypes P_0) + { + return P_0.SymbolTypes; + } + + internal IEnumerable ?(KeyValuePair P_0) + { + return P_0.Value.AllowedAggregations; + } + + internal IEnumerable ?(KeyValuePair P_0) + { + return P_0.Value.AllowedPeriodsHistoryAggregationTime; + } + + internal IEnumerable ?(KeyValuePair P_0) + { + return P_0.Value.AllowedHistoryTypesHistoryAggregationTime; + } + + internal IEnumerable ?(KeyValuePair P_0) + { + return P_0.Value.AllowedHistoryTypesHistoryAggregationTick; + } + + internal TimeSpan ?(KeyValuePair P_0) + { + return P_0.Value.DownloadingStep_Day; + } + + internal TimeSpan ?(KeyValuePair P_0) + { + return P_0.Value.DownloadingStep_Minute; + } + + internal TimeSpan ?(KeyValuePair P_0) + { + return P_0.Value.DownloadingStep_Tick; + } + + internal bool ?(KeyValuePair P_0) + { + return P_0.Value.BuildUncompletedBars; + } + + internal bool ?(KeyValuePair P_0) + { + return P_0.Value.IsVolumeAnalysisAvailable; + } + + internal bool ?(VolumeAnalysisMetadata P_0) + { + return P_0.BuildUncompletedBars; + } + + internal TimeSpan ?(VolumeAnalysisMetadata P_0) + { + return P_0.MaxTicksLoadingPeriod; + } + + internal bool ?(AdditionalInfoItem P_0) + { + return P_0.Id == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + } + } + + [CompilerGenerated] + private sealed class ? + { + public CancellationToken ??; + + internal MessageSymbolTypes ?(ISymbolVendor P_0) + { + return P_0.GetSymbolTypes(??); + } + } + + [CompilerGenerated] + private ITradingVendor ??; + + private readonly Dictionary ??; + + private readonly Dictionary ??; + + private readonly Dictionary ??; + + private readonly Dictionary ??; + + protected readonly List AllVendors; + + private readonly Dictionary ??; + + private readonly Dictionary ??; + + private readonly Dictionary ??; + + private readonly Dictionary ??; + + private readonly Dictionary> ??; + + private readonly Dictionary> ??; + + private readonly Dictionary> ??; + + private readonly Dictionary> ??; + + private readonly Dictionary ??; + + private readonly Dictionary> ??; + + private readonly Dictionary ??; + + private readonly Dictionary> ??; + + private readonly Dictionary ??; + + private readonly Dictionary> ??; + + protected ITradingVendor TradingVendor + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = tradingVendor; + } + } + + /// + /// Confirms allowed nonfixed list by vendor + /// + public override bool AllowNonFixedList + { + get + { + if (??.Count == 0) + { + return base.AllowNonFixedList; + } + return ??.Values.Any((ISymbolVendor P_0) => P_0.AllowNonFixedList); + } + } + + protected MultiVendor() + { + ?? = new Dictionary(); + ?? = new Dictionary(); + ?? = new Dictionary(); + ?? = new Dictionary(); + AllVendors = new List(); + ?? = new Dictionary(); + ?? = new Dictionary(); + ?? = new Dictionary(); + ?? = new Dictionary(); + ?? = new Dictionary>(); + ?? = new Dictionary>(); + ?? = new Dictionary>(); + ?? = new Dictionary>(); + ?? = new Dictionary(); + ?? = new Dictionary>(); + ?? = new Dictionary(); + ?? = new Dictionary>(); + ?? = new Dictionary(); + ?? = new Dictionary>(); + } + + /// + /// Performs a binding with broker or data provider + /// + public override ConnectionResult Connect(ConnectRequestParameters connectRequestParameters) + { + if (AllVendors.Count == 0) + { + return ConnectionResult.CreateFail(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + foreach (IVendor allVendor in AllVendors) + { + try + { + ConnectionResult connectionResult = allVendor.Connect(connectRequestParameters); + if (connectionResult.State == ConnectionState.Fail) + { + return connectionResult; + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex.InnerException ?? ex); + return ConnectionResult.CreateFail(ex.GetMessageRecursive()); + } + } + return ConnectionResult.CreateSuccess(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?()); + } + + /// + /// Specifies any operation before breaking a connection with broker or data provider + /// + public override void Disconnect() + { + foreach (IVendor allVendor in AllVendors) + { + try + { + allVendor.Disconnect(); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + } + + /// + /// Called when platform finished retreiving all required informations from vendor during connecting + /// + public override void OnConnected(CancellationToken token) + { + foreach (IVendor allVendor in AllVendors) + { + try + { + allVendor.OnConnected(token); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + } + + /// + /// Ping processing before its visualization in the terminal + /// + public override PingResult Ping() + { + PingResult pingResult = new PingResult + { + State = PingEnum.Disconnected + }; + double num = 0.0; + double num2 = 0.0; + foreach (IVendor allVendor in AllVendors) + { + PingResult pingResult2 = allVendor.Ping(); + if (pingResult2.State != PingEnum.Connected) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + allVendor.Key + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + return pingResult2; + } + if (pingResult2.PingTime.HasValue) + { + num = Math.Max(num, pingResult2.PingTime.Value.TotalMilliseconds); + } + if (pingResult2.RoundTripTime.HasValue) + { + num2 = Math.Max(num2, pingResult2.RoundTripTime.Value.TotalMilliseconds); + } + } + pingResult.State = PingEnum.Connected; + pingResult.PingTime = TimeSpan.FromMilliseconds(num); + pingResult.RoundTripTime = TimeSpan.FromMilliseconds(num2); + return pingResult; + } + + public override LimitationMetadata GetLimitationMetadata() + { + if (TradingVendor == null) + { + return base.GetLimitationMetadata(); + } + return TradingVendor.GetLimitationMetadata(); + } + + /// + /// Retrieves an information about available accounts. Yon need to specify at least one account + /// + public override IList GetAccounts(CancellationToken token) + { + return TradingVendor?.GetAccounts(token) ?? base.GetAccounts(token); + } + + public override IList GetRules(CancellationToken token) + { + if (TradingVendor != null) + { + return TradingVendor.GetRules(token); + } + if (AllVendors.Where((IVendor P_0) => P_0 is Vendor).FirstOrDefault() is Vendor vendor) + { + return vendor.GetRules(token); + } + return base.GetRules(token); + } + + public override IList GetCryptoAssetBalances(CancellationToken token) + { + return TradingVendor?.GetCryptoAssetBalances(token) ?? base.GetCryptoAssetBalances(token); + } + + public override IList GetAccountOperations(CancellationToken token) + { + return TradingVendor?.GetAccountOperations(token) ?? base.GetAccountOperations(token); + } + + public override IList GetSessions(CancellationToken token) + { + List list = new List(); + foreach (KeyValuePair item2 in ??) + { + ISymbolVendor value = item2.Value; + foreach (MessageSessionsContainer session in value.GetSessions(token)) + { + MessageSessionsContainer item = ?(value.Key, session); + list.Add(item); + } + } + return list; + } + + /// + /// Retrieves a collection of available exchange markets from vendor + /// + public override IList GetExchanges(CancellationToken token) + { + List list = new List(); + foreach (KeyValuePair item2 in ??) + { + ISymbolVendor value = item2.Value; + foreach (MessageExchange exchange in value.GetExchanges(token)) + { + MessageExchange item = ?(value.Key, exchange); + list.Add(item); + } + } + return list; + } + + /// + /// Retrieves information about available assets. + /// + public override IList GetAssets(CancellationToken token) + { + if (??.Count == 0) + { + return base.GetAssets(token); + } + List list = new List(); + foreach (KeyValuePair item2 in ??) + { + ISymbolVendor value = item2.Value; + foreach (MessageAsset asset in value.GetAssets(token)) + { + MessageAsset item = ?(value.Key, asset); + list.Add(item); + } + } + return list; + } + + /// + /// Retrieves information about available symbols. + /// + public override IList GetSymbols(CancellationToken token) + { + if (??.Count == 0) + { + return base.GetSymbols(token); + } + List list = new List(); + foreach (KeyValuePair item2 in ??) + { + ISymbolVendor value = item2.Value; + foreach (MessageSymbol symbol in value.GetSymbols(token)) + { + MessageSymbol item = ?(value.Key, symbol); + list.Add(item); + } + } + return list; + } + + /// + /// Gets an available symbols types from vendor + /// + public override MessageSymbolTypes GetSymbolTypes(CancellationToken token) + { + if (??.Count == 0) + { + return base.GetSymbolTypes(token); + } + List symbolTypes = ??.Values.Select((ISymbolVendor P_0) => P_0.GetSymbolTypes(token)).SelectMany((MessageSymbolTypes P_0) => P_0.SymbolTypes).Distinct() + .ToList(); + return new MessageSymbolTypes + { + SymbolTypes = symbolTypes + }; + } + + public override IList GetSymbolGroups(CancellationToken token) + { + List list = new List(); + foreach (KeyValuePair item2 in ??) + { + ISymbolVendor value = item2.Value; + foreach (MessageSymbolGroup symbolGroup in value.GetSymbolGroups(token)) + { + MessageSymbolGroup item = ?(value.Key, symbolGroup); + list.Add(item); + } + } + return list; + } + + /// + /// Derives a non fixed symbol from vendor + /// + public override MessageSymbol GetNonFixedSymbol(GetSymbolRequestParameters requestParameters) + { + if (!?(requestParameters.SymbolId, out string text, out ISymbolVendor symbolVendor)) + { + return base.GetNonFixedSymbol(requestParameters); + } + if (!?(text, requestParameters.SymbolId, out var symbolId)) + { + return base.GetNonFixedSymbol(requestParameters); + } + requestParameters.SymbolId = symbolId; + MessageSymbol nonFixedSymbol = symbolVendor.GetNonFixedSymbol(requestParameters); + return ?(text, nonFixedSymbol); + } + + /// + /// Derives a non-fixed list of symbols from vendor + /// + public override IList SearchSymbols(SearchSymbolsRequestParameters requestParameters) + { + if (??.Count == 0) + { + return base.SearchSymbols(requestParameters); + } + List list = new List(); + foreach (KeyValuePair item2 in ??) + { + string key = item2.Key; + ISymbolVendor value = item2.Value; + SearchSymbolsRequestParameters requestParameters2 = requestParameters; + IList exchangeIds = requestParameters.ExchangeIds; + if (exchangeIds != null && exchangeIds.Count > 0) + { + List list2 = new List(); + Map map = ??[key]; + foreach (string exchangeId in requestParameters.ExchangeIds) + { + if (map.TryGetDirect(exchangeId, out var value2)) + { + list2.Add(value2); + } + else + { + list2.Add(exchangeId); + } + } + requestParameters2 = new SearchSymbolsRequestParameters(requestParameters) + { + ExchangeIds = list2 + }; + } + foreach (MessageSymbolInfo item3 in value.SearchSymbols(requestParameters2)) + { + MessageSymbolInfo item = ?(key, item3); + list.Add(item); + } + } + return list; + } + + public override IList GetFutureContracts(GetFutureContractsRequestParameters requestParameters) + { + List list = new List(); + string exchangeId = requestParameters.ExchangeId; + HashSet value2; + if (!string.IsNullOrEmpty(requestParameters.UnderlierId)) + { + string underlierId = requestParameters.UnderlierId; + if (?(underlierId, out string text, out ISymbolVendor symbolVendor) && ?(text, underlierId, out var underlierId2) && ??[text].TryGetDirect(exchangeId, out var value)) + { + requestParameters.ExchangeId = value; + requestParameters.UnderlierId = underlierId2; + foreach (MessageSymbolInfo futureContract in symbolVendor.GetFutureContracts(requestParameters)) + { + MessageSymbolInfo item = ?(text, futureContract); + list.Add(item); + } + } + } + else if (!string.IsNullOrEmpty(requestParameters.Root) && ??.TryGetValue(requestParameters.Root, out value2)) + { + foreach (string item3 in value2) + { + if (!??[item3].TryGetDirect(exchangeId, out var value3)) + { + continue; + } + requestParameters.ExchangeId = value3; + foreach (MessageSymbolInfo futureContract2 in ??[item3].GetFutureContracts(requestParameters)) + { + MessageSymbolInfo item2 = ?(item3, futureContract2); + list.Add(item2); + } + } + } + return list; + } + + public override IList GetOptionSeries(GetOptionSeriesRequestParameters requestParameters) + { + if (!?(requestParameters.UnderlierId, out string text, out ISymbolVendor symbolVendor)) + { + return base.GetOptionSeries(requestParameters); + } + if (!?(text, requestParameters.UnderlierId, out var underlierId)) + { + return base.GetOptionSeries(requestParameters); + } + requestParameters.UnderlierId = underlierId; + if (??[text].TryGetDirect(requestParameters.ExchangeId, out var value)) + { + requestParameters.ExchangeId = value; + } + IList optionSeries = symbolVendor.GetOptionSeries(requestParameters); + List list = new List(); + foreach (MessageOptionSerie item2 in optionSeries) + { + MessageOptionSerie item = ?(text, item2); + list.Add(item); + } + return list; + } + + public override IList GetStrikes(GetStrikesRequestParameters requestParameters) + { + if (!?(requestParameters.UnderlierId, out string text, out ISymbolVendor symbolVendor)) + { + return base.GetStrikes(requestParameters); + } + if (!?(text, requestParameters.UnderlierId, out var underlierId)) + { + return base.GetStrikes(requestParameters); + } + requestParameters.UnderlierId = underlierId; + requestParameters.SerieId = ParseLocalId(text, requestParameters.SerieId); + IList strikes = symbolVendor.GetStrikes(requestParameters); + List list = new List(); + foreach (MessageSymbolInfo item2 in strikes) + { + MessageSymbolInfo item = ?(text, item2); + list.Add(item); + } + return list; + } + + /// + /// Retrieves allowed/supported order types + /// + public override IList GetAllowedOrderTypes(CancellationToken token) + { + return TradingVendor?.GetAllowedOrderTypes(token) ?? base.GetAllowedOrderTypes(token); + } + + /// + /// Retrieves an information about opened orders at the time of connection. + /// + public override IList GetPendingOrders(CancellationToken token) + { + return TradingVendor?.GetPendingOrders(token) ?? base.GetPendingOrders(token); + } + + /// + /// Retrieves an information about positions at the time of connection + /// + public override IList GetPositions(CancellationToken token) + { + return TradingVendor?.GetPositions(token) ?? base.GetPositions(token); + } + + public override TradesHistoryMetadata GetTradesMetadata() + { + return TradingVendor?.GetTradesMetadata() ?? base.GetTradesMetadata(); + } + + /// + /// Gets trades history from server for requested time range + /// + public override IList GetTrades(TradesHistoryRequestParameters parameters) + { + return TradingVendor?.GetTrades(parameters) ?? base.GetTrades(parameters); + } + + public override void GetTrades(TradesHistoryRequestParameters parameters, AccountTradesLoadingCallback callback) + { + if (TradingVendor != null) + { + TradingVendor.GetTrades(parameters, callback); + } + else + { + base.GetTrades(parameters, callback); + } + } + + public override IList GetOrdersHistory(OrdersHistoryRequestParameters parameters) + { + return TradingVendor?.GetOrdersHistory(parameters) ?? base.GetOrdersHistory(parameters); + } + + public override PnL CalculatePnL(PnLRequestParameters parameters) + { + return TradingVendor?.CalculatePnL(parameters) ?? base.CalculatePnL(parameters); + } + + /// + /// Subscribing to quote data: Level1/Level2/Trade + /// + public override void SubscribeSymbol(SubscribeQuotesParameters parameters) + { + if (?(parameters.SymbolId, out string text, out IQuoteVendor quoteVendor) && ?(text, parameters.SymbolId, out var symbolId)) + { + quoteVendor.SubscribeSymbol(new SubscribeQuotesParameters(symbolId, parameters.SubscribeType) + { + CancellationToken = parameters.CancellationToken + }); + } + } + + /// + /// Unsubscribing from quote data: Level1/Level2/Trade + /// + public override void UnSubscribeSymbol(SubscribeQuotesParameters parameters) + { + if (?(parameters.SymbolId, out string text, out IQuoteVendor quoteVendor) && ?(text, parameters.SymbolId, out var symbolId)) + { + quoteVendor.UnSubscribeSymbol(new SubscribeQuotesParameters(symbolId, parameters.SubscribeType) + { + CancellationToken = parameters.CancellationToken + }); + } + } + + /// + /// Gets a list of supported historical intervals and data types by vendor + /// + public override HistoryMetadata GetHistoryMetadata(CancellationToken cancelationToken) + { + Dictionary dictionary = new Dictionary(); + foreach (KeyValuePair item in ??) + { + try + { + HistoryMetadata historyMetadata = item.Value.GetHistoryMetadata(cancelationToken); + dictionary.Add(item.Key, historyMetadata); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex.InnerException ?? ex); + } + } + return new HistoryMetadata + { + AllowedAggregations = dictionary.SelectMany((KeyValuePair P_0) => P_0.Value.AllowedAggregations).Distinct().ToArray(), + AllowedPeriodsHistoryAggregationTime = dictionary.SelectMany((KeyValuePair P_0) => P_0.Value.AllowedPeriodsHistoryAggregationTime).Distinct().ToArray(), + AllowedHistoryTypesHistoryAggregationTime = dictionary.SelectMany((KeyValuePair P_0) => P_0.Value.AllowedHistoryTypesHistoryAggregationTime).Distinct().ToArray(), + AllowedHistoryTypesHistoryAggregationTick = dictionary.SelectMany((KeyValuePair P_0) => P_0.Value.AllowedHistoryTypesHistoryAggregationTick).Distinct().ToArray(), + DownloadingStep_Day = dictionary.Min((KeyValuePair P_0) => P_0.Value.DownloadingStep_Day), + DownloadingStep_Minute = dictionary.Min((KeyValuePair P_0) => P_0.Value.DownloadingStep_Minute), + DownloadingStep_Tick = dictionary.Min((KeyValuePair P_0) => P_0.Value.DownloadingStep_Tick), + BuildUncompletedBars = dictionary.Any((KeyValuePair P_0) => P_0.Value.BuildUncompletedBars) + }; + } + + public override IList LoadHistory(HistoryRequestParameters requestParameters) + { + List result = new List(); + if (!?(requestParameters.SymbolId, out string text, out IHistoryVendor historyVendor)) + { + return result; + } + if (!?(text, requestParameters.SymbolId, out var symbolId)) + { + return result; + } + return historyVendor.LoadHistory(new HistoryRequestParameters(requestParameters) + { + SymbolId = symbolId + }); + } + + public override VolumeAnalysisMetadata GetVolumeAnalysisMetadata() + { + if (??.Count == 0) + { + return base.GetVolumeAnalysisMetadata(); + } + foreach (KeyValuePair item in ??) + { + try + { + VolumeAnalysisMetadata volumeAnalysisMetadata = item.Value.GetVolumeAnalysisMetadata(); + ??.Add(item.Key, volumeAnalysisMetadata); + } + catch (Exception exception) + { + Core.Instance.Loggers.Log(exception.GetMessageRecursive()); + } + } + VolumeAnalysisAvailability volumeAnalysisAvailability = (??.Any((KeyValuePair P_0) => P_0.Value.IsVolumeAnalysisAvailable) ? VolumeAnalysisAvailability.Available : VolumeAnalysisAvailability.NotAvailable); + bool buildUncompletedBars = ??.Values.Any((VolumeAnalysisMetadata P_0) => P_0.BuildUncompletedBars); + TimeSpan maxTicksLoadingPeriod = ??.Values.Max((VolumeAnalysisMetadata P_0) => P_0.MaxTicksLoadingPeriod); + Dictionary dictionary = new Dictionary(); + Dictionary dictionary2 = new Dictionary(); + if (volumeAnalysisAvailability == VolumeAnalysisAvailability.Available) + { + foreach (VolumeAnalysisMetadata value in ??.Values) + { + ?(value.GetDownloadingStepByPeriod(includePriceLevels: false), dictionary); + ?(value.GetDownloadingStepByPeriod(includePriceLevels: true), dictionary2); + } + } + return new VolumeAnalysisMetadata + { + VolumeAnalysisAvailability = volumeAnalysisAvailability, + BuildUncompletedBars = buildUncompletedBars, + MaxTicksLoadingPeriod = maxTicksLoadingPeriod, + DownloadingStepByPeriod = dictionary, + DownloadingLevelsStepByPeriod = dictionary2 + }; + } + + public override VendorVolumeAnalysisByPeriodResponse LoadVolumeAnalysis(VolumeAnalysisByPeriodRequestParameters requestParameters) + { + if (!?(requestParameters.SymbolId, out string text, out IVolumeAnalysisVendor volumeAnalysisVendor)) + { + return null; + } + if (!??.TryGetValue(text, out var value)) + { + return null; + } + if (!value.GetAllowedPeriods(requestParameters.CalculatePriceLevels).Contains(requestParameters.Period)) + { + return null; + } + if (!?(text, requestParameters.SymbolId, out var symbolId)) + { + return null; + } + VolumeAnalysisByPeriodRequestParameters copy = requestParameters.Copy; + copy.SymbolId = symbolId; + return volumeAnalysisVendor.LoadVolumeAnalysis(copy); + } + + /// + /// Prepare and sending order placing request to broker + /// + public override TradingOperationResult PlaceOrder(PlaceOrderRequestParameters parameters) + { + return TradingVendor?.PlaceOrder(parameters) ?? base.PlaceOrder(parameters); + } + + public override TradingOperationResult PlaceMultiOrder(PlaceMultiOrderOrderRequestParameters parameters) + { + return TradingVendor?.PlaceMultiOrder(parameters) ?? base.PlaceMultiOrder(parameters); + } + + /// + /// Sending order modification request to broker + /// + public override TradingOperationResult ModifyOrder(ModifyOrderRequestParameters parameters) + { + return TradingVendor?.ModifyOrder(parameters) ?? base.ModifyOrder(parameters); + } + + /// + /// Sending order cancellation request to broker + /// + public override TradingOperationResult CancelOrder(CancelOrderRequestParameters parameters) + { + return TradingVendor?.CancelOrder(parameters) ?? base.CancelOrder(parameters); + } + + /// + /// Sending position closing request to broker + /// + public override TradingOperationResult ClosePosition(ClosePositionRequestParameters parameters) + { + return TradingVendor?.ClosePosition(parameters) ?? base.ClosePosition(parameters); + } + + public override MarginInfo GetMarginInfo(OrderRequestParameters orderRequestParameters) + { + return TradingVendor?.GetMarginInfo(orderRequestParameters) ?? base.GetMarginInfo(orderRequestParameters); + } + + /// + /// Gets information about available reports from vendor + /// + public override IList GetReportsMetaData(CancellationToken token) + { + return TradingVendor?.GetReportsMetaData(token) ?? base.GetReportsMetaData(token); + } + + /// + /// Called when platform need to generate particular report + /// + public override Report GenerateReport(ReportRequestParameters reportRequestParameters) + { + return TradingVendor?.GenerateReport(reportRequestParameters) ?? base.GenerateReport(reportRequestParameters); + } + + private MessageSessionsContainer ?(string P_0, MessageSessionsContainer P_1) + { + P_1.Id = CreateGlobalId(P_0, P_1.Id); + return P_1; + } + + private MessageExchange ?(string P_0, MessageExchange P_1) + { + if (!??.TryGetValue(P_1.ExchangeName, out var value)) + { + value = new MessageExchange + { + Id = ??.Count.ToString(), + ExchangeName = P_1.ExchangeName + }; + ??.Add(value.ExchangeName, value); + } + if (!string.IsNullOrEmpty(P_1.SessionsContainerId)) + { + value.SessionsContainerId = CreateGlobalId(P_0, P_1.SessionsContainerId); + } + if (!??.TryGetValue(P_0, out var value2)) + { + ??.Add(P_0, value2 = new Map()); + } + if (!value2.ContainsDirect(value.Id)) + { + value2.Add(value.Id, P_1.Id); + } + return value; + } + + private MessageSymbolGroup ?(string P_0, MessageSymbolGroup P_1) + { + if (!??.TryGetValue(P_1.GroupName, out var value)) + { + ??.Add(P_1.GroupName, value = P_1); + } + if (!??.TryGetValue(P_0, out var value2)) + { + ??.Add(P_0, value2 = new Map()); + } + if (!value2.ContainsDirect(value.Id)) + { + value2.Add(value.Id, P_1.Id); + } + return value; + } + + private MessageSymbolInfo ?(string P_0, MessageSymbolInfo P_1) + { + if (!??.TryGetValue(P_0, out var value)) + { + return null; + } + if (!value.TryGetReverse(P_1.ExchangeId, out var value2)) + { + return null; + } + MessageSymbolInfo messageSymbolInfo = new MessageSymbolInfo(P_1) + { + Id = CreateGlobalId(P_0, P_1.Id), + ExchangeId = value2 + }; + if (!string.IsNullOrEmpty(messageSymbolInfo.Root)) + { + if (!??.TryGetValue(messageSymbolInfo.Root, out var value3)) + { + ??.Add(messageSymbolInfo.Root, value3 = new HashSet()); + } + value3.Add(P_0); + } + if (!string.IsNullOrEmpty(messageSymbolInfo.UnderlierId)) + { + messageSymbolInfo.UnderlierId = CreateGlobalId(P_0, P_1.UnderlierId); + } + return messageSymbolInfo; + } + + private MessageSymbol ?(string P_0, MessageSymbol P_1) + { + MessageSymbolInfo messageSymbolInfo = ?(P_0, (MessageSymbolInfo)P_1); + MessageSymbol messageSymbol = new MessageSymbol(P_1); + messageSymbol.Fill(messageSymbolInfo); + if (!string.IsNullOrEmpty(messageSymbol.ProductAssetId)) + { + messageSymbol.ProductAssetId = CreateGlobalId(P_0, messageSymbol.ProductAssetId); + } + if (!string.IsNullOrEmpty(messageSymbol.QuotingCurrencyAssetID)) + { + messageSymbol.QuotingCurrencyAssetID = CreateGlobalId(P_0, messageSymbol.QuotingCurrencyAssetID); + } + if (!string.IsNullOrEmpty(messageSymbol.SessionsContainerId)) + { + messageSymbol.SessionsContainerId = CreateGlobalId(P_0, messageSymbol.SessionsContainerId); + } + if (!string.IsNullOrEmpty(messageSymbol.GroupId)) + { + if (!??.TryGetValue(P_0, out var value)) + { + return null; + } + if (!value.TryGetReverse(messageSymbol.GroupId, out var value2)) + { + return null; + } + messageSymbol.GroupId = value2; + } + if (messageSymbol.SymbolAdditionalInfo != null) + { + AdditionalInfoItem additionalInfoItem = messageSymbol.SymbolAdditionalInfo.FirstOrDefault((AdditionalInfoItem additionalInfoItem2) => additionalInfoItem2.Id == 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (additionalInfoItem != null && additionalInfoItem.Value != null) + { + additionalInfoItem.Value = CreateGlobalId(P_0, additionalInfoItem.Value.ToString()); + } + } + return messageSymbol; + } + + private MessageAsset ?(string P_0, MessageAsset P_1) + { + P_1.Id = CreateGlobalId(P_0, P_1.Id); + return P_1; + } + + private MessageOptionSerie ?(string P_0, MessageOptionSerie P_1) + { + if (!??.TryGetValue(P_0, out var value)) + { + return null; + } + if (!value.TryGetReverse(P_1.ExchangeId, out var value2)) + { + return null; + } + P_1.Id = CreateGlobalId(P_0, P_1.Id); + P_1.UnderlierId = CreateGlobalId(P_0, P_1.UnderlierId); + P_1.ExchangeId = value2; + return P_1; + } + + private MessageQuote ?(string P_0, MessageQuote P_1) + { + if (!??.TryGetValue(P_0, out var value)) + { + return null; + } + if (!value.TryGetReverse(P_1.SymbolId, out var value2)) + { + return null; + } + P_1.SymbolId = value2; + return P_1; + } + + public override void SendCustomRequest(RequestParameters parameters) + { + foreach (IVendor allVendor in AllVendors) + { + try + { + allVendor.SendCustomRequest(parameters); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + } + + protected void RegisterTradingVendor(ITradingVendor tradingVendor) + { + if (TradingVendor != null) + { + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + TradingVendor = tradingVendor ?? throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + ?(tradingVendor); + } + + protected void RegisterSymbolVendor(ISymbolVendor symbolVendor) + { + ?(symbolVendor.Key, symbolVendor, ??, ??); + } + + protected void RegisterQuoteVendor(IQuoteVendor quoteVendor) + { + ?(quoteVendor.Key, quoteVendor, ??, ??); + } + + protected void RegisterHistoryVendor(IHistoryVendor historyVendor) + { + ?(historyVendor.Key, historyVendor, ??, ??); + } + + protected void RegisterVolumeAnalysisVendor(IVolumeAnalysisVendor volumeAnalysisVendor) + { + ?(volumeAnalysisVendor.Key, volumeAnalysisVendor, ??, ??); + } + + private void ?(string P_0, ? P_1, Dictionary P_2, Dictionary> P_3) where ? : IVendor + { + if (P_1 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + P_2.Add(P_0, P_1); + P_3.Add(P_0, new Map()); + this.?(P_1); + } + + private void ?(? P_0) where ? : IVendor + { + if (P_0 == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + if (!AllVendors.Contains(P_0)) + { + P_0.NewMessage += this.?; + AllVendors.Add(P_0); + } + } + + private void ?(object P_0, VendorEventArgs P_1) + { + if (P_1.Message == null) + { + return; + } + Message message = null; + Message message2 = P_1.Message; + if (!(message2 is MessageExchange messageExchange)) + { + if (!(message2 is MessageSymbolGroup messageSymbolGroup)) + { + if (!(message2 is MessageSymbol messageSymbol)) + { + if (!(message2 is MessageSymbolInfo messageSymbolInfo)) + { + if (!(message2 is MessageAsset messageAsset)) + { + if (!(message2 is MessageOptionSerie messageOptionSerie)) + { + if (message2 is MessageQuote messageQuote) + { + message = ?(P_1.VendorKey, messageQuote); + } + else + { + PushMessage(P_1.Message); + } + } + else + { + message = ?(P_1.VendorKey, messageOptionSerie); + } + } + else + { + message = ?(P_1.VendorKey, messageAsset); + } + } + else + { + message = ?(P_1.VendorKey, messageSymbolInfo); + } + } + else + { + message = ?(P_1.VendorKey, messageSymbol); + } + } + else + { + message = ?(P_1.VendorKey, messageSymbolGroup); + } + } + else + { + message = ?(P_1.VendorKey, messageExchange); + } + if (message != null) + { + PushMessage(message); + } + } + + protected virtual string GetSymbolVendorKey(string globalSymbolId) + { + return ParseVendorKey(globalSymbolId); + } + + protected virtual string GetQuoteVendorKey(string globalSymbolId) + { + return ParseVendorKey(globalSymbolId); + } + + protected virtual string GetHistoryVendorKey(string globalSymbolId) + { + return ParseVendorKey(globalSymbolId); + } + + protected virtual string GetVolumeAnalysisVendorKey(string globalSymbolId) + { + return ParseVendorKey(globalSymbolId); + } + + protected virtual string GetSymbolVendorSymbolId(string vendorKey, string globalSymbolId) + { + return ParseLocalId(vendorKey, globalSymbolId); + } + + protected virtual string GetQuoteVendorSymbolId(string vendorKey, string globalSymbolId) + { + return ParseLocalId(vendorKey, globalSymbolId); + } + + protected virtual string GetHistoryVendorSymbolId(string vendorKey, string globalSymbolId) + { + return ParseLocalId(vendorKey, globalSymbolId); + } + + protected virtual string GetVolumeAnalysisVendorSymbolId(string vendorKey, string globalSymbolId) + { + return ParseLocalId(vendorKey, globalSymbolId); + } + + private bool ?(string P_0, out string P_1, out ISymbolVendor P_2) + { + return ?(P_0, ??, ??, GetSymbolVendorKey, out P_1, out P_2); + } + + private bool ?(string P_0, out string P_1, out IQuoteVendor P_2) + { + return ?(P_0, ??, ??, GetQuoteVendorKey, out P_1, out P_2); + } + + private bool ?(string P_0, out string P_1, out IHistoryVendor P_2) + { + return ?(P_0, ??, ??, GetHistoryVendorKey, out P_1, out P_2); + } + + private bool ?(string P_0, out string P_1, out IVolumeAnalysisVendor P_2) + { + return ?(P_0, ??, ??, GetVolumeAnalysisVendorKey, out P_1, out P_2); + } + + private static bool ?(string P_0, Dictionary P_1, Dictionary P_2, Func P_3, out string P_4, out ? P_5) where ? : IVendor + { + P_4 = null; + P_5 = default(?); + if (P_1.Count == 0) + { + return false; + } + if (P_1.Count == 1) + { + P_4 = P_1.First().Key; + P_5 = P_1.First().Value; + return true; + } + if (!P_2.TryGetValue(P_0, out P_4)) + { + P_4 = P_3(P_0); + if (string.IsNullOrEmpty(P_4)) + { + return false; + } + P_2.Add(P_0, P_4); + } + return P_1.TryGetValue(P_4, out P_5); + } + + private bool ?(string P_0, string P_1, out string P_2) + { + return ?(P_0, P_1, ??[P_0], GetSymbolVendorSymbolId, out P_2); + } + + private bool ?(string P_0, string P_1, out string P_2) + { + return ?(P_0, P_1, ??[P_0], GetQuoteVendorSymbolId, out P_2); + } + + private bool ?(string P_0, string P_1, out string P_2) + { + return ?(P_0, P_1, ??[P_0], GetHistoryVendorSymbolId, out P_2); + } + + private bool ?(string P_0, string P_1, out string P_2) + { + return ?(P_0, P_1, ??[P_0], GetVolumeAnalysisVendorSymbolId, out P_2); + } + + private static bool ?(string P_0, string P_1, Map P_2, Func P_3, out string P_4) + { + if (P_2.TryGetDirect(P_1, out P_4)) + { + return true; + } + P_4 = P_3(P_0, P_1); + if (string.IsNullOrEmpty(P_4)) + { + return false; + } + P_2.Add(P_1, P_4); + return true; + } + + protected virtual string CreateGlobalId(string vendorKey, string localId) + { + return localId + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + vendorKey; + } + + public static string ParseLocalId(string vendorKey, string globalId) + { + string empty = string.Empty; + int num = globalId.IndexOf(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + vendorKey); + if (num == -1) + { + return globalId; + } + return globalId.Substring(0, num); + } + + public static string ParseVendorKey(string globalId) + { + string[] array = globalId.Split(new string[1] { 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() }, StringSplitOptions.RemoveEmptyEntries); + if (array.Length != 2) + { + return string.Empty; + } + return array[1]; + } + + [CompilerGenerated] + internal static void ?(IDictionary P_0, IDictionary P_1) + { + foreach (KeyValuePair item in P_0) + { + if (P_1.ContainsKey(item.Key)) + { + if (item.Value < P_1[item.Key]) + { + P_1[item.Key] = item.Value; + } + } + else + { + P_1[item.Key] = item.Value; + } + } + } + } + public sealed class NewsRealtimeByTimerUpdater : IDisposable + { + private bool ??; + + private readonly Timer ??; + + private readonly ConcurrentDictionary ??; + + private readonly Action ??; + + private readonly Func> ??; + + public NewsRealtimeByTimerUpdater(Action pushMessage, Func> getNews, TimeSpan updatePeriod) + { + ?? = pushMessage; + ?? = getNews; + ?? = new ConcurrentDictionary(); + ?? = new Timer(?, null, updatePeriod, updatePeriod); + } + + public void Dispose() + { + ??.Dispose(); + } + + public void SubscribeNewsUpdates(SubscribeNewsRequestParameters parameters) + { + ??[parameters.SubscribeId] = new ?(parameters.AdditionalParameters) + { + lastRealTimeNewsRequestTime = Core.Instance.TimeUtils.DateTimeUtcNow + }; + } + + public void UnsubscribeNewsUpdates(SubscribeNewsRequestParameters parameters) + { + ??.TryRemove(parameters.SubscribeId, out var _); + } + + private void ?(object P_0) + { + if (??) + { + return; + } + try + { + ?? = true; + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + foreach (KeyValuePair item in ??) + { + IEnumerable enumerable = ??(new GetNewsRequestParameters + { + AdditionalParameters = item.Value.??, + From = item.Value.lastRealTimeNewsRequestTime, + To = dateTimeUtcNow + }); + item.Value.lastRealTimeNewsRequestTime = dateTimeUtcNow; + foreach (MessageNewsHeadline item2 in enumerable) + { + item2.SubscribeId = item.Key; + ??(item2); + } + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + ?? = false; + } + } + } +} +namespace ? +{ + internal sealed class ? + { + public readonly IEnumerable ??; + + [CompilerGenerated] + private DateTime ??; + + public DateTime lastRealTimeNewsRequestTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = dateTime; + } + } + + public ?(IEnumerable P_0) + { + ?? = P_0; + } + } +} +namespace TradingPlatform.BusinessLayer.Integration +{ + public class PingMeter + { + private readonly string ??; + + private readonly Ping ??; + + private readonly Uri ??; + + public PingMeter(string ownerName, string endpoint) + { + ?? = ownerName; + ?? = new Ping(); + ?? = new Uri(endpoint); + } + + public TimeSpan? MeasurePing() + { + try + { + PingReply pingReply = ??.Send(??.Host); + if (pingReply != null && pingReply.Status == IPStatus.Success) + { + return TimeSpan.FromMilliseconds(pingReply.RoundtripTime); + } + Core.Instance.Loggers.Log(?? + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + ??.Host); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + return null; + } + } + /// + /// Ping respond bundle + /// + public class PingResult + { + [CompilerGenerated] + private TimeSpan? ??; + + [CompilerGenerated] + private TimeSpan? ??; + + [CompilerGenerated] + private PingEnum ??; + + [CompilerGenerated] + private bool ??; + + /// + /// Ping time + /// + public TimeSpan? PingTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Time spent for single request + /// + public TimeSpan? RoundTripTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Ping state + /// + public PingEnum State + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + /// + /// Disable auto reconnecting + /// + public bool StopReconnecting + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public static PingResult Disconnected() + { + return new PingResult + { + State = PingEnum.Disconnected + }; + } + } + public class ResponseWaiterBase + { + public readonly long RequestId; + + public bool isFinish; + + [CompilerGenerated] + private TimeSpan ??; + + public TimeSpan Elapsed + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = timeSpan; + } + } + + public ResponseWaiterBase(long requestId) + { + RequestId = requestId; + } + + public bool WaitForResponse(TimeSpan timeout, CancellationToken cancellationToken = default(CancellationToken)) + { + Elapsed = TimeSpan.Zero; + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + while (!isFinish) + { + if (cancellationToken.IsCancellationRequested) + { + return false; + } + Elapsed = stopwatch.Elapsed; + if (timeout < stopwatch.Elapsed) + { + return false; + } + Thread.Sleep(20); + } + return true; + } + } + public class ResponseWaiter : ResponseWaiterBase + { + public T Response; + + public ResponseWaiter(long requestId) + : base(requestId) + { + } + } + public class TradesHistoryMetadata + { + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ?? = true; + + [CompilerGenerated] + private bool ??; + + public bool AllowLocalStorage + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool AllowSingleSymbolLoading + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool AllowReloadFromServer + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool LoadTradesFromCurrentTradingDate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public TradesHistoryMetadata() + { + } + + public TradesHistoryMetadata(TradesHistoryMetadata origin) + : this() + { + AllowLocalStorage = origin.AllowLocalStorage; + AllowSingleSymbolLoading = origin.AllowSingleSymbolLoading; + AllowReloadFromServer = origin.AllowReloadFromServer; + LoadTradesFromCurrentTradingDate = origin.LoadTradesFromCurrentTradingDate; + } + } + public abstract class Vendor : ITradingVendor, IVendor, ISymbolVendor, IQuoteVendor, IHistoryVendor, IVolumeAnalysisVendor + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + internal bool ?(Period P_0) + { + return P_0.BasePeriod == BasePeriod.Tick; + } + + internal int ?(Period P_0) + { + return P_0.PeriodMultiplier; + } + } + + public static readonly string LOGIN_PARAMETER_USER = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + + public static readonly string LOGIN_PARAMETER_PASSWORD = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + + public const string LOGIN_PARAMETER_GROUP = "ConnectionGroup"; + + public const string ADDITIONAL_PARAMETER_GROUP = "AdditionalParametersGroup"; + + public const string REPORT_TYPE_PARAMETER_ACCOUNT = "Account"; + + public const string REPORT_TYPE_PARAMETER_SYMBOL = "Symbol"; + + public const string REPORT_TYPE_PARAMETER_DATETIME_FROM = "From"; + + public const string REPORT_TYPE_PARAMETER_DATETIME_TO = "To"; + + public static readonly string CONNECTION = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(); + + public static readonly string CONNECTION_DEMO = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + + public static readonly string CONNECTION_REAL = loc.key(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + + public const string EMULATOR = "Emulator"; + + public const string MARKET_REPLAY = "Market Replay"; + + public const string TRADING_SIMULATOR = "Trading Simulator"; + + [CompilerGenerated] + private EventHandler ??; + + private string ??; + + /// + /// Confirms allowed non fixed list by vendor + /// + public virtual bool AllowNonFixedList => false; + + public virtual DateTime? ServerTime => null; + + string IVendor.Key + { + get + { + return ??; + } + set + { + ?? = text; + } + } + + public event EventHandler NewMessage + { + [CompilerGenerated] + add + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Combine(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + [CompilerGenerated] + remove + { + EventHandler eventHandler = ??; + EventHandler eventHandler2; + do + { + eventHandler2 = eventHandler; + EventHandler value2 = (EventHandler)Delegate.Remove(eventHandler2, value); + eventHandler = Interlocked.CompareExchange(ref ??, value2, eventHandler2); + } + while ((object)eventHandler != eventHandler2); + } + } + + [SpecialName] + private void ?(EventHandler P_0) + { + NewMessage += P_0; + } + + void IVendor.add_NewMessage(EventHandler P_0) + { + //ILSpy generated this explicit interface implementation from .override directive in ? + this.?(P_0); + } + + [SpecialName] + private void ?(EventHandler P_0) + { + NewMessage -= P_0; + } + + void IVendor.remove_NewMessage(EventHandler P_0) + { + //ILSpy generated this explicit interface implementation from .override directive in ? + this.?(P_0); + } + + /// + /// Performs a binding with broker or data provider + /// + public virtual ConnectionResult Connect(ConnectRequestParameters connectRequestParameters) + { + return new ConnectionResult + { + State = ConnectionState.Fail + }; + } + + /// + /// Specifies any operation before breaking a connection with broker or data provider + /// + public virtual void Disconnect() + { + } + + /// + /// Called when platform finished retreiving all required informations from vendor during connecting + /// + public virtual void OnConnected(CancellationToken token) + { + } + + /// + /// Ping processing before its visualization in the terminal + /// + public virtual PingResult Ping() + { + return new PingResult(); + } + + public virtual LimitationMetadata GetLimitationMetadata() + { + return new LimitationMetadata(); + } + + /// + /// Retrieves an information about available accounts. Yon need to specify at least one account + /// + public virtual IList GetAccounts(CancellationToken token) + { + return new List(); + } + + public virtual IList GetRules(CancellationToken token) + { + return new List(); + } + + public virtual IList GetCryptoAssetBalances(CancellationToken token) + { + return new List(); + } + + public virtual IList GetAccountOperations(CancellationToken token) + { + return new List(); + } + + public virtual IList GetSessions(CancellationToken token) + { + return new List(); + } + + /// + /// Retrieves a collection of available exchange markets from vendor + /// + public virtual IList GetExchanges(CancellationToken token) + { + return new List + { + new MessageExchange + { + Id = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + ExchangeName = 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), + SortIndex = -1 + } + }; + } + + /// + /// Retrieves information about available assets. + /// + public virtual IList GetAssets(CancellationToken token) + { + return new List(); + } + + public virtual IList GetSymbols(CancellationToken token) + { + return new List(); + } + + /// + /// Retrieves information about available symbols. + /// + public virtual IList GetAllOptionSeries(CancellationToken token) + { + return new List(); + } + + /// + /// Gets an available symbols types from vendor + /// + public virtual MessageSymbolTypes GetSymbolTypes(CancellationToken token) + { + return new MessageSymbolTypes + { + SymbolTypes = new List((SymbolType[])Enum.GetValues(typeof(SymbolType))) + }; + } + + public virtual IList GetSymbolGroups(CancellationToken token) + { + return new List(); + } + + /// + /// Derives a non fixed symbol from vendor + /// + public virtual MessageSymbol GetNonFixedSymbol(GetSymbolRequestParameters requestParameters) + { + return null; + } + + /// + /// Derives a non-fixed list of symbols from vendor + /// + public virtual IList SearchSymbols(SearchSymbolsRequestParameters requestParameters) + { + return new List(); + } + + public virtual IList GetFutureContracts(GetFutureContractsRequestParameters requestParameters) + { + return new List(); + } + + public virtual IList GetOptionSeries(GetOptionSeriesRequestParameters requestParameters) + { + return new List(); + } + + public virtual IList GetStrikes(GetStrikesRequestParameters requestParameters) + { + return new List(); + } + + /// + /// Retrieves an information about opened orders at the time of connection. + /// + public virtual IList GetPendingOrders(CancellationToken token) + { + return new List(); + } + + /// + /// Retrieves an information about positions at the time of connection + /// + public virtual IList GetPositions(CancellationToken token) + { + return new List(); + } + + /// + /// Retrieves an information about closed positions at the time of connection + /// + public virtual IList GetClosedPositions(CancellationToken token) + { + return new List(); + } + + /// + /// Subscribing to quote data: Level1/Level2/Trade + /// + public virtual void SubscribeSymbol(SubscribeQuotesParameters parameters) + { + } + + /// + /// Unsubscribing from quote data: Level1/Level2/Trade + /// + public virtual void UnSubscribeSymbol(SubscribeQuotesParameters parameters) + { + } + + public virtual IList LoadHistory(HistoryRequestParameters requestParameters) + { + return new List(); + } + + /// + /// Gets a list of supported historical intervals and data types by vendor + /// + public virtual HistoryMetadata GetHistoryMetadata(CancellationToken cancellationToken) + { + return new HistoryMetadata(); + } + + public virtual VendorVolumeAnalysisByPeriodResponse LoadVolumeAnalysis(VolumeAnalysisByPeriodRequestParameters requestParameters) + { + return VendorVolumeAnalysisByPeriodResponse.CreateDefault(); + } + + public virtual VolumeAnalysisMetadata GetVolumeAnalysisMetadata() + { + return new VolumeAnalysisMetadata(); + } + + /// + /// Prepare and sending order placing request to broker + /// + public virtual TradingOperationResult PlaceOrder(PlaceOrderRequestParameters parameters) + { + return TradingOperationResult.CreateError(parameters.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + + public virtual TradingOperationResult PlaceMultiOrder(PlaceMultiOrderOrderRequestParameters parameters) + { + return TradingOperationResult.CreateError(parameters.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + + /// + /// Sending order modification request to broker + /// + public virtual TradingOperationResult ModifyOrder(ModifyOrderRequestParameters parameters) + { + return TradingOperationResult.CreateError(parameters.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + + /// + /// Sending order cancellation request to broker + /// + public virtual TradingOperationResult CancelOrder(CancelOrderRequestParameters parameters) + { + return TradingOperationResult.CreateError(parameters.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + + /// + /// Sending position closing request to broker + /// + public virtual TradingOperationResult ClosePosition(ClosePositionRequestParameters parameters) + { + return TradingOperationResult.CreateError(parameters.RequestId, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + + public virtual MarginInfo GetMarginInfo(OrderRequestParameters orderRequestParameters) + { + return null; + } + + /// + /// Gets information about available reports from vendor + /// + public virtual IList GetReportsMetaData(CancellationToken token) + { + return new List(); + } + + /// + /// Called when platform need to generate particular report + /// + public virtual Report GenerateReport(ReportRequestParameters reportRequestParameters) + { + return new Report(); + } + + public virtual IEnumerable GetNewsProviderSettings(CancellationToken cancellationToken) + { + return Array.Empty(); + } + + public virtual IEnumerable GetNews(GetNewsRequestParameters requestParameters) + { + return Array.Empty(); + } + + public virtual void SubscribeNewsUpdates(SubscribeNewsRequestParameters subscribeNewsRequestParameters) + { + } + + public virtual void UnsubscribeNewsUpdates(SubscribeNewsRequestParameters subscribeNewsRequestParameters) + { + } + + public virtual string GetNewsArticleContent(GetNewsArticleContentRequestParameters requestParameters) + { + return string.Empty; + } + + public virtual IEnumerable GetTradingSignals(CancellationToken cancellationToken) + { + return Array.Empty(); + } + + public virtual TradesHistoryMetadata GetTradesMetadata() + { + return new TradesHistoryMetadata(); + } + + public virtual IList GetTrades(TradesHistoryRequestParameters parameters) + { + return Array.Empty(); + } + + public virtual void GetTrades(TradesHistoryRequestParameters parameters, AccountTradesLoadingCallback callback) + { + callback?.Invoke(GetTrades(parameters), isFinished: true); + } + + public virtual IList GetOrdersHistory(OrdersHistoryRequestParameters parameters) + { + return Array.Empty(); + } + + /// + /// Retrieves allowed/supported order types + /// + public virtual IList GetAllowedOrderTypes(CancellationToken token) + { + return new List(); + } + + public void PushMessage(Message msg) + { + ???.Invoke(this, new VendorEventArgs(??, msg)); + } + + public virtual PnL CalculatePnL(PnLRequestParameters parameters) + { + return null; + } + + public virtual void SendCustomRequest(RequestParameters parameters) + { + } + + protected static ConnectionInfo CreateDefaultConnectionInfo(string name, string vendorName, string logoPath = null, string group = null, bool allowCreateCustomConnections = true, ConnectionState connectionState = ConnectionState.Disconnected, IList settings = null, List links = null, string copyrights = null) + { + return new ConnectionInfo(name, group, vendorName) + { + ConnectionLogoPath = logoPath, + AllowCreateCustomConnections = allowCreateCustomConnections, + ConnectionState = connectionState, + ConnectionSettings = settings, + Links = links, + Copyrights = copyrights + }; + } + + [Conditional("quantower_licences")] + [Conditional("quantower_in_licences")] + [Conditional("quantower_br_licences")] + [Conditional("capfinex_licences")] + [Conditional("roemaker_licences")] + [Conditional("coincidence_licences")] + [Conditional("alpha_trader_licenses")] + [Conditional("vt_terminal_licences")] + [Conditional("quantower_de_licences")] + [Conditional("flowtrade_licences")] + [Conditional("spy_money_licences")] + [Conditional("total_trading_terminal_licences")] + protected void CheckLicenceMultiAssetVendor() + { + if ((Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) ?? Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?())) == null && Core.Instance.Licences.GetLicenceRuleItem(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) != null) + { + throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + } + + public static bool TryCorrectPeriodForDirectDownload(Period[] allowedPeriods, Period currentPeriod, out Period allowedPeriod) + { + allowedPeriod = currentPeriod; + if (allowedPeriods == null) + { + allowedPeriods = Array.Empty(); + } + if (allowedPeriods.Contains(currentPeriod)) + { + return true; + } + if (currentPeriod.BasePeriod == BasePeriod.Tick) + { + Period[] array = (from P_0 in allowedPeriods + where P_0.BasePeriod == BasePeriod.Tick + orderby P_0.PeriodMultiplier descending + select P_0).ToArray(); + for (int num = 0; num < array.Length; num++) + { + Period period = array[num]; + if (currentPeriod.PeriodMultiplier % period.PeriodMultiplier == 0) + { + allowedPeriod = period; + return true; + } + } + } + else + { + Period[] array = allowedPeriods; + for (int num = 0; num < array.Length; num++) + { + Period period2 = array[num]; + if (currentPeriod.Ticks % period2.Ticks == 0L) + { + allowedPeriod = period2; + return true; + } + } + } + return false; + } + } + public delegate void AccountTradesLoadingCallback(IList messages, bool isFinished); + public class VendorEventArgs : EventArgs + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private Message ??; + + public string VendorKey + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = text; + } + } + + public Message Message + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = message; + } + } + + public VendorEventArgs(string vendorKey, Message message) + { + VendorKey = vendorKey; + Message = message; + } + } + public class VendorInfo + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal SettingItem ?(SettingItem P_0) + { + return P_0.GetCopy(); + } + } + + [CompilerGenerated] + private VendorMetaData ??; + + private readonly IList ??; + + [CompilerGenerated] + private ConnectionInfo[] ??; + + private readonly Type ??; + + private readonly SemaphoreSlim ??; + + public VendorMetaData MetaData + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = vendorMetaData; + } + } + + public SettingItem[] ConnectionParameters => ??.Select((SettingItem P_0) => P_0.GetCopy()).ToArray(); + + public ConnectionInfo[] DefaultConnections + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = array; + } + } + + internal VendorInfo(VendorMetaData P_0, Type P_1) + { + MetaData = P_0; + ?? = P_0.GetConnectionParameters(); + DefaultConnections = P_0.GetDefaultConnections().ToArray(); + ConnectionInfo[] defaultConnections = DefaultConnections; + for (int i = 0; i < defaultConnections.Length; i++) + { + defaultConnections[i].VendorInfo = this; + } + ?? = P_1; + if (P_0.SimultaneousConnectingProcessLimit > 0) + { + ?? = new SemaphoreSlim(P_0.SimultaneousConnectingProcessLimit); + } + } + + internal Vendor ?() + { + return Activator.CreateInstance(??) as Vendor; + } + + internal void ?() + { + ???.Wait(); + } + + internal void ?() + { + ???.Release(); + } + + public override string ToString() + { + return MetaData?.VendorName; + } + } + public class VendorManager + { + private readonly Dictionary ??; + + public VendorInfo[] Vendors => ??.Values.ToArray(); + + public VendorInfo this[string vendorName] + { + get + { + ??.TryGetValue(vendorName, out var value); + return value; + } + } + + internal VendorManager() + { + ?? = new Dictionary(); + } + + internal void ?() + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + if (!Directory.Exists(Const.CUSTOM_VENDORS_PATH)) + { + Directory.CreateDirectory(Const.CUSTOM_VENDORS_PATH); + } + List list = AssemblyLoader.LoadTypes(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), typeof(Vendor), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SearchOption.AllDirectories); + list.AddRange(AssemblyLoader.LoadTypes(Const.CUSTOM_VENDORS_PATH, typeof(Vendor), 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), SearchOption.AllDirectories)); + if (!list.Any()) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + return; + } + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(38, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(list.Count); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); + foreach (TypeWrapper item in list) + { + Type type = item; + try + { + if (type.IsAbstract) + { + continue; + } + MethodInfo method = type.GetMethod(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), BindingFlags.Static | BindingFlags.Public); + if (!(method != null)) + { + continue; + } + if (method.Invoke(null, null) is VendorMetaData vendorMetaData) + { + if (vendorMetaData == null || string.IsNullOrEmpty(vendorMetaData.VendorName)) + { + LoggerManager loggers2 = Core.Instance.Loggers; + defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(54, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(type); + loggers2.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Verbose); + } + else if (??.ContainsKey(vendorMetaData.VendorName)) + { + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + vendorMetaData.VendorName, LoggingLevel.Verbose); + } + else + { + ??.Add(vendorMetaData.VendorName, new VendorInfo(vendorMetaData, type)); + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + vendorMetaData.VendorName + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + } + } + else + { + Core.Instance.Loggers.Log(type.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + } + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + } + Core.Instance.Loggers.Log(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), LoggingLevel.Verbose); + } + + internal void ?() + { + ???.Clear(); + } + } + public class VendorMetaData + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func> ??; + + public static Func> ??; + + internal IList ?() + { + return new List(); + } + + internal IList ?() + { + return new List(); + } + } + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private int ??; + + public Func> GetDefaultConnections; + + /// + /// Gets a settings list from a vendor selection of the setup window + /// + public Func> GetConnectionParameters; + + public string VendorName + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string VendorDescription + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int SimultaneousConnectingProcessLimit + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public VendorMetaData() + { + GetDefaultConnections = () => new List(); + GetConnectionParameters = () => new List(); + } + } + public class VendorHistoryResponse : VendorIntervalResponse> + { + public VendorHistoryResponse(IList data) + : base(data) + { + } + + public VendorHistoryResponse(string errorText) + : base(errorText) + { + } + + public static VendorHistoryResponse CreateSuccess(IList data) + { + return new VendorHistoryResponse(data); + } + + public static VendorHistoryResponse CreateError(string errorText) + { + return new VendorHistoryResponse(errorText); + } + + public static VendorHistoryResponse CreateError(Exception exception) + { + return new VendorHistoryResponse(exception.GetMessageRecursive()); + } + } + public class VendorIntervalResponse : VendorResponse + { + [CompilerGenerated] + private Interval ??; + + public Interval ActualDataInterval + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public VendorIntervalResponse(TData data) + : base(data) + { + } + + public VendorIntervalResponse(string errorText) + : base(errorText) + { + } + } + public class VendorResponse + { + [CompilerGenerated] + private TData ??; + + [CompilerGenerated] + private string ??; + + public TData Data + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public string ErrorText + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public VendorResponse(TData data) + { + Data = data; + } + + public VendorResponse(string errorText) + { + ErrorText = errorText; + } + } + public class VendorVolumeAnalysisByPeriodResponse : VendorIntervalResponse> + { + private VendorVolumeAnalysisByPeriodResponse(IList P_0) + : base(P_0) + { + } + + private VendorVolumeAnalysisByPeriodResponse(string P_0) + : base(P_0) + { + } + + public static VendorVolumeAnalysisByPeriodResponse CreateDefault() + { + return new VendorVolumeAnalysisByPeriodResponse(new List()); + } + + public static VendorVolumeAnalysisByPeriodResponse CreateSuccess(IList data, Interval actualInterval) + { + return new VendorVolumeAnalysisByPeriodResponse(data) + { + ActualDataInterval = actualInterval + }; + } + + public static VendorVolumeAnalysisByPeriodResponse CreateError(string errorText) + { + return new VendorVolumeAnalysisByPeriodResponse(errorText); + } + + public static VendorVolumeAnalysisByPeriodResponse CreateError(Exception exception) + { + return new VendorVolumeAnalysisByPeriodResponse(exception.GetMessageRecursive()); + } + } + public class VendorVolumeAnalysisResponse : VendorIntervalResponse + { + private VendorVolumeAnalysisResponse(VolumeAnalysisData P_0) + : base(P_0) + { + } + + private VendorVolumeAnalysisResponse(string P_0) + : base(P_0) + { + } + + public static VendorVolumeAnalysisResponse CreateDefault() + { + return new VendorVolumeAnalysisResponse(new VolumeAnalysisData()); + } + + public static VendorVolumeAnalysisResponse CreateSuccess(VolumeAnalysisData data, Interval actualInterval) + { + return new VendorVolumeAnalysisResponse(data) + { + ActualDataInterval = actualInterval + }; + } + + public static VendorVolumeAnalysisResponse CreateError(string errorText) + { + return new VendorVolumeAnalysisResponse(errorText); + } + + public static VendorVolumeAnalysisResponse CreateError(Exception exception) + { + return new VendorVolumeAnalysisResponse(exception.GetMessageRecursive()); + } + } + public class VolumeAnalysisByPeriodRequestParameters : VolumeAnalysisRequestParameters + { + [CompilerGenerated] + private Period ??; + + [CompilerGenerated] + private bool ??; + + public override RequestType Type => RequestType.VolumeAnalysisByPeriod; + + public Period Period + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool ForceReload + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public new VolumeAnalysisByPeriodRequestParameters Copy => new VolumeAnalysisByPeriodRequestParameters(this); + + public VolumeAnalysisByPeriodRequestParameters() + { + base.CalculatePriceLevels = false; + } + + internal VolumeAnalysisByPeriodRequestParameters(VolumeAnalysisByPeriodRequestParameters P_0) + : base(P_0) + { + Period = P_0.Period; + ForceReload = P_0.ForceReload; + } + + public VolumeAnalysisDescription ToDescription() + { + return new VolumeAnalysisDescription(base.SymbolId, Period, base.CalculatePriceLevels); + } + } + [ProtoContract] + public class VolumeAnalysisMetadata + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + internal long ?(Period P_0) + { + return P_0.Ticks; + } + } + + [CompilerGenerated] + private readonly VolumeAnalysisAvailability ??; + + private readonly Dictionary ??; + + [CompilerGenerated] + private readonly Dictionary ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private TimeSpan ??; + + public VolumeAnalysisAvailability VolumeAnalysisAvailability + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public Dictionary DownloadingStepByPeriod + { + private get + { + return ??; + } + init + { + ?? = value; + if (DownloadingLevelsStepByPeriod == null || DownloadingLevelsStepByPeriod.Count == 0) + { + DownloadingLevelsStepByPeriod = new Dictionary(value); + } + } + } + + public Dictionary DownloadingLevelsStepByPeriod + { + [CompilerGenerated] + private get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + internal bool IsVolumeAnalysisAvailable + { + get + { + if (VolumeAnalysisAvailability == VolumeAnalysisAvailability.Available) + { + return DownloadingStepByPeriod.Count > 0; + } + return false; + } + } + + public bool BuildUncompletedBars + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public TimeSpan MaxTicksLoadingPeriod + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + internal VolumeAnalysisMetadata Copy => new VolumeAnalysisMetadata + { + VolumeAnalysisAvailability = VolumeAnalysisAvailability, + BuildUncompletedBars = BuildUncompletedBars, + MaxTicksLoadingPeriod = MaxTicksLoadingPeriod, + DownloadingStepByPeriod = new Dictionary(DownloadingStepByPeriod), + DownloadingLevelsStepByPeriod = new Dictionary(DownloadingLevelsStepByPeriod) + }; + + public VolumeAnalysisMetadata() + { + VolumeAnalysisAvailability = VolumeAnalysisAvailability.NotAvailable; + MaxTicksLoadingPeriod = TimeSpan.FromHours(1.0); + DownloadingStepByPeriod = new Dictionary(); + } + + public IDictionary GetDownloadingStepByPeriod(bool includePriceLevels) + { + if (!includePriceLevels) + { + return DownloadingStepByPeriod; + } + return DownloadingLevelsStepByPeriod; + } + + public Period[] GetAllowedPeriods(bool includePriceLevels) + { + return GetDownloadingStepByPeriod(includePriceLevels)?.Keys.OrderByDescending((Period P_0) => P_0.Ticks).ToArray(); + } + + public bool TryFindLargestLoadingPeriod(DateTime from, DateTime to, bool includeLevels, out Period period) + { + return TryFindLargestLoadingPeriod(new Interval(from, to), includeLevels, out period); + } + + public bool TryFindLargestLoadingPeriod(Interval interval, bool includeLevels, out Period period) + { + period = default(Period); + Period[] allowedPeriods = GetAllowedPeriods(includeLevels); + foreach (Period period2 in allowedPeriods) + { + if (interval.Contains(period2)) + { + period = period2; + return true; + } + } + return false; + } + } + public class VolumeAnalysisRequestParameters : RequestParameters + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private DateTime ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private ISessionsContainer ??; + + public override RequestType Type => RequestType.VolumeAnalysis; + + public string SymbolId + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DateTime FromTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public DateTime ToTime + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double MinVolumeAnalysisTickSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public Interval Interval + { + get + { + return new Interval(FromTime, ToTime); + } + set + { + FromTime = value.From; + ToTime = value.To; + } + } + + public bool CalculatePriceLevels + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public ISessionsContainer SessionsContainer + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public VolumeAnalysisRequestParameters Copy => new VolumeAnalysisRequestParameters(this); + + public VolumeAnalysisRequestParameters() + { + CalculatePriceLevels = true; + MinVolumeAnalysisTickSize = double.NaN; + } + + internal VolumeAnalysisRequestParameters(VolumeAnalysisRequestParameters P_0) + { + SymbolId = P_0.SymbolId; + FromTime = P_0.FromTime; + ToTime = P_0.ToTime; + CalculatePriceLevels = P_0.CalculatePriceLevels; + base.CancellationToken = P_0.CancellationToken; + SessionsContainer = P_0.SessionsContainer; + MinVolumeAnalysisTickSize = P_0.MinVolumeAnalysisTickSize; + } + } +} +namespace TradingPlatform.BusinessLayer.Integration.Limitation +{ + public record Limit + { + public Period Period + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public int Value + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public LimitInterval Interval + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + public RequestType[] RequestTypes + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + + [CompilerGenerated] + private readonly Period ??; + + [CompilerGenerated] + private readonly int ??; + + [CompilerGenerated] + private readonly LimitInterval ??; + + [CompilerGenerated] + private readonly RequestType[] ??; + + public Limit(Period Period, int Value, LimitInterval Interval, params RequestType[] RequestTypes) + { + ?? = Period; + ?? = Value; + ?? = Interval; + ?? = RequestTypes; + base..ctor(); + } + + [CompilerGenerated] + public override string ToString() + { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + stringBuilder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + if (PrintMembers(stringBuilder)) + { + stringBuilder.Append(' '); + } + stringBuilder.Append('}'); + return stringBuilder.ToString(); + } + + [CompilerGenerated] + protected virtual bool PrintMembers(StringBuilder builder) + { + RuntimeHelpers.EnsureSufficientExecutionStack(); + builder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + builder.Append(Period.ToString()); + builder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + builder.Append(Value.ToString()); + builder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + builder.Append(Interval.ToString()); + builder.Append(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + builder.Append(RequestTypes); + return true; + } + + [CompilerGenerated] + public void Deconstruct(out Period Period, out int Value, out LimitInterval Interval, out RequestType[] RequestTypes) + { + Period = this.Period; + Value = this.Value; + Interval = this.Interval; + RequestTypes = this.RequestTypes; + } + } + public class LimitationMetadata + { + [CompilerGenerated] + private readonly IList ??; + + public IList Limits + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + } + public enum LimitInterval + { + FixedCalendar, + FloatingWindow + } +} +namespace ? +{ + internal class ? : IDisposable + { + private class ? + { + private readonly CancellationToken ??; + + private readonly ManualResetEventSlim ??; + + private IList ??; + + public bool IsCancelled => ??.IsCancellationRequested; + + public IList History + { + get + { + return ??; + } + set + { + ?? = list; + ??.Set(); + } + } + + public ?(CancellationToken P_0) + { + ?? = P_0; + ?? = new ManualResetEventSlim(); + } + + public void ?(CancellationToken P_0) + { + WaitHandle.WaitAny(new WaitHandle[2] { ??.WaitHandle, P_0.WaitHandle }); + } + } + + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func ??; + + public static Func ??; + + public static Func> ??; + + public static Func ??; + + internal int ?(HistoryInterval P_0) + { + return P_0.History.Count; + } + + internal DateTime ?(HistoryInterval P_0) + { + return P_0.Interval.From; + } + + internal IEnumerable ?(HistoryInterval P_0) + { + return P_0.History; + } + + internal bool ?(? P_0) + { + return !P_0.IsCancelled; + } + } + + [CompilerGenerated] + private sealed class ? + { + public ? ??; + + public HistoryRequestParameters ??; + + public int ??; + + internal void ?() + { + IList history = null; + try + { + history = ??.?(??); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + lock (??.??) + { + if (??.??.TryGetValue(??, out var value)) + { + ??.??.Remove(??); + foreach (? item in value) + { + item.History = history; + } + } + } + } + } + } + + private readonly HistoryStorage ??; + + private readonly TaskFactory ??; + + private readonly DegreeOfParallelismTaskScheduler ??; + + private readonly ? ??; + + private readonly Dictionary> ??; + + private readonly object ??; + + public static ? ?(? P_0) + { + HistoryStorage historyStorage = null; + if (P_0.AllowLocalStorage) + { + historyStorage = HistoryStorage.Create(P_0.LocalStorageConnectionString); + } + return new ?(P_0.DegreeOfParallelism, P_0.LoadHistoryDelegate, historyStorage); + } + + internal ?(int P_0, ? P_1, HistoryStorage P_2 = null) + { + ?? = new DegreeOfParallelismTaskScheduler(P_0); + ?? = new TaskFactory(??); + ?? = P_1; + ?? = P_2; + ?? = new Dictionary>(); + ?? = new object(); + } + + public IList ?(HistoryRequestParameters P_0) + { + int ?? = ?(P_0); + ? ?2 = new ?(P_0.CancellationToken); + bool flag = false; + lock (??) + { + if (??.TryGetValue(??, out var value)) + { + value.Add(?2); + } + else + { + ??.Add(??, new List { ?2 }); + flag = true; + } + } + if (flag) + { + ??.StartNew(delegate + { + IList history = null; + try + { + history = ?(P_0); + } + catch (Exception ex) + { + Core.Instance.Loggers.Log(ex); + } + finally + { + lock (??) + { + if (??.TryGetValue(??, out var value2)) + { + ??.Remove(??); + foreach (? item in value2) + { + item.History = history; + } + } + } + } + }); + } + ?2.?(P_0.CancellationToken); + return ?2.History ?? new List(); + } + + internal virtual IList ?(HistoryRequestParameters P_0) + { + List result = new List(); + List list = new List(); + List historyParametersForServerRequest = new List(); + if (!P_0.ForceReload && ?? != null) + { + LoggerManager loggers = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(52, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); + IList list2 = ??.Load(P_0, out historyParametersForServerRequest); + if (?(P_0)) + { + return result; + } + list.AddRange(list2); + LoggerManager loggers2 = Core.Instance.Loggers; + defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(75, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(list2.Sum((HistoryInterval historyInterval) => historyInterval.History.Count)); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers2.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); + } + else + { + historyParametersForServerRequest.Add(P_0); + } + foreach (HistoryRequestParameters item in historyParametersForServerRequest) + { + if (?(P_0)) + { + break; + } + LoggerManager loggers3 = Core.Instance.Loggers; + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(50, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers3.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); + DateTime dateTimeUtcNow = Core.Instance.TimeUtils.DateTimeUtcNow; + if (!(??(item) is List list3) || ?(P_0)) + { + break; + } + if (item.Aggregation is HistoryAggregationTick && !item.Symbol.HistoryMetadata.ServerSideTickDirectionAvailable) + { + list3.ProcessTickDirection(P_0.CancellationToken); + } + list.Add(new HistoryInterval + { + Description = item.ToDescription(), + Interval = item.Interval, + History = new List(list3) + }); + if (?(item, list3, dateTimeUtcNow, item.Symbol.HistoryMetadata.BuildUncompletedBars)) + { + ???.Save(new HistoryInterval + { + Description = item.ToDescription(), + Interval = item.Interval, + History = list3 + }); + } + LoggerManager loggers4 = Core.Instance.Loggers; + defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(73, 2); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(P_0.RequestId); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(list3.Count); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + loggers4.Log(defaultInterpolatedStringHandler.ToStringAndClear(), LoggingLevel.Performance); + } + return list.OrderBy((HistoryInterval historyInterval) => historyInterval.Interval.From).SelectMany((HistoryInterval historyInterval) => historyInterval.History).ToList(); + } + + public void Dispose() + { + ??.Dispose(); + ???.Dispose(); + } + + internal static bool ?(HistoryRequestParameters P_0, List P_1, DateTime P_2, bool P_3) + { + HistoryAggregation aggregation = P_0.Aggregation; + if (!(aggregation is HistoryAggregationTick)) + { + if (!(aggregation is HistoryAggregationTickBars historyAggregationTickBars)) + { + if (!(aggregation is HistoryAggregationTime historyAggregationTime)) + { + if (aggregation is HistoryAggregationTimeStatistics historyAggregationTimeStatistics) + { + return ?(P_0, P_1, P_2, P_3, historyAggregationTimeStatistics.Period); + } + throw new Exception(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??() + P_0.Aggregation.Name); + } + return ?(P_0, P_1, P_2, P_3, historyAggregationTime.Period); + } + if (!P_1.Any()) + { + if (P_3 && (P_2 - P_0.ToTime).TotalSeconds < 60.0) + { + return false; + } + return true; + } + IHistoryItem historyItem = P_1[P_1.Count - 1]; + if (historyItem.TicksLeft <= P_0.ToTime.Ticks && historyItem is HistoryItemBar historyItemBar && historyItemBar.Ticks < historyAggregationTickBars.TicksCount) + { + P_1.Remove(historyItem); + P_0.ToTime = historyItem.TimeLeft; + } + else + { + P_0.ToTime = new DateTime(Math.Max(historyItem.TicksRight, historyItem.TicksLeft + historyAggregationTickBars.TicksCount), DateTimeKind.Utc); + } + return true; + } + TimeSpan timeSpan = TimeSpan.FromSeconds(5.0); + if (P_0.Interval.To < P_2 && P_2 - P_0.Interval.To > timeSpan) + { + return true; + } + if (!P_1.Any()) + { + P_0.Interval = new Interval(P_0.Interval.From, P_0.Interval.To - timeSpan); + return !P_0.Interval.IsReversal; + } + P_0.Interval = new Interval(P_0.Interval.From, P_1.Last().TimeLeft.AddTicks(1L)); + return true; + } + + private static bool ?(HistoryRequestParameters P_0, List P_1, DateTime P_2, bool P_3, Period P_4) + { + if (!P_1.Any()) + { + if (P_0.ToTime.Ticks - P_0.FromTime.Ticks < P_4.Ticks) + { + return false; + } + if (P_3 && (P_2 - P_0.ToTime).TotalSeconds < 60.0) + { + return false; + } + long ticks = P_0.Interval.GetLength().Ticks; + ticks = ticks / P_4.Ticks * P_4.Ticks; + P_0.ToTime = P_0.FromTime.AddTicks(ticks); + return true; + } + IHistoryItem historyItem = P_1[P_1.Count - 1]; + long num = P_4.BasePeriod switch + { + BasePeriod.Month => historyItem.TimeLeft.AddMonths(P_4.PeriodMultiplier).Ticks, + BasePeriod.Year => historyItem.TimeLeft.AddYears(P_4.PeriodMultiplier).Ticks, + _ => historyItem.TicksLeft + P_4.Ticks, + }; + if (historyItem.TicksLeft <= P_0.ToTime.Ticks && num > P_0.ToTime.Ticks + 1) + { + P_1.Remove(historyItem); + P_0.ToTime = historyItem.TimeLeft; + } + else + { + P_0.ToTime = new DateTime(num, DateTimeKind.Utc); + } + return true; + } + + private static int ?(HistoryRequestParameters P_0) + { + HashCode hashCode = default(HashCode); + hashCode.Add(P_0.SymbolId); + hashCode.Add(P_0.Interval); + hashCode.Add(P_0.ForceReload); + hashCode.Add(P_0.Aggregation.Name); + HistoryAggregation aggregation = P_0.Aggregation; + if (!(aggregation is HistoryAggregationTick historyAggregationTick)) + { + if (!(aggregation is HistoryAggregationTickBars historyAggregationTickBars)) + { + if (!(aggregation is HistoryAggregationTime historyAggregationTime)) + { + if (!(aggregation is HistoryAggregationTimeStatistics historyAggregationTimeStatistics)) + { + throw new Exception(P_0.Aggregation.Name + 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + hashCode.Add(historyAggregationTimeStatistics.Period); + } + else + { + hashCode.Add(historyAggregationTime.Period); + hashCode.Add(historyAggregationTime.HistoryType); + } + } + else + { + hashCode.Add(historyAggregationTickBars.TicksCount); + hashCode.Add(historyAggregationTickBars.HistoryType); + } + } + else + { + hashCode.Add(historyAggregationTick.HistoryType); + } + return hashCode.ToHashCode(); + } + + private bool ?(HistoryRequestParameters P_0) + { + if (!P_0.CancellationToken.IsCancellationRequested) + { + return false; + } + int key = ?(P_0); + lock (??) + { + if (!??.TryGetValue(key, out var value)) + { + return true; + } + if (value.Any((? ?2) => !?2.IsCancelled)) + { + return false; + } + ??.Remove(key); + return true; + } + } + } + internal delegate IList ?(HistoryRequestParameters P_0); + internal class ? + { + [CompilerGenerated] + private string ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private ? ??; + + [CompilerGenerated] + private bool ??; + + public string LocalStorageConnectionString + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = text; + } + } + + public int DegreeOfParallelism + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = num; + } + } + + public ? LoadHistoryDelegate + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = ?2; + } + } + + public bool AllowLocalStorage + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = flag; + } + } + } +} +namespace TradingPlatform.BusinessLayer.History.Aggregations +{ + public sealed class HistoryAggregationPowerTradesParameters : ICustomizable, ICloneable, IPowerTradesBaseSettings + { + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private int ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double ??; + + [CompilerGenerated] + private double? ??; + + public double MinTradeVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double MaxTradeVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double TotalVolume + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double TimeInterval + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double BasisVolumeInterval + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int MaxZoneHeight + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int MinZoneHeight + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double DeltaFilter + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double BasisRatioFilter + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public double? CustomTickSize + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IList Settings + { + get + { + List list = new List + { + new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MinTradeVolume) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + }, + new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MaxTradeVolume) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + }, + new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TotalVolume) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + }, + new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), TimeInterval) + { + Minimum = 0.1, + DecimalPlaces = 1, + Increment = 0.1, + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + }, + new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), BasisVolumeInterval) + { + Minimum = 0.1, + Increment = 0.1, + DecimalPlaces = 1, + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + }, + new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), DeltaFilter) + { + Minimum = 0.0, + Maximum = 100.0, + DecimalPlaces = 0, + Increment = 1.0, + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + }, + new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), BasisRatioFilter) + { + Minimum = 0.0, + Maximum = 100.0, + DecimalPlaces = 2, + Increment = 0.01, + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + }, + new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MaxZoneHeight) + { + Minimum = 1, + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + }, + new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), MinZoneHeight) + { + Minimum = 0, + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + } + }; + if (CustomTickSize.HasValue) + { + list.Add(new SettingItemDouble(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), CustomTickSize.Value) + { + Text = loc._(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), null, 3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()) + }); + } + return list; + } + set + { + SettingsHolder settingsHolder = new SettingsHolder(value); + if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value2) && value2.Value is double minTradeVolume) + { + MinTradeVolume = minTradeVolume; + } + if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2.Value is double maxTradeVolume) + { + MaxTradeVolume = maxTradeVolume; + } + if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2.Value is double totalVolume) + { + TotalVolume = totalVolume; + } + if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2.Value is double timeInterval) + { + TimeInterval = timeInterval; + } + if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2.Value is double basisVolumeInterval) + { + BasisVolumeInterval = basisVolumeInterval; + } + if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2.Value is int maxZoneHeight) + { + MaxZoneHeight = maxZoneHeight; + } + if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2.Value is int minZoneHeight) + { + MinZoneHeight = minZoneHeight; + } + if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2.Value is double deltaFilter) + { + DeltaFilter = deltaFilter; + } + if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2.Value is double basisRatioFilter) + { + BasisRatioFilter = basisRatioFilter; + } + if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2.Value is double value3 && !value3.IsNanOrDefault()) + { + CustomTickSize = value3; + } + } + } + + public object Clone() + { + return new HistoryAggregationPowerTradesParameters + { + TotalVolume = TotalVolume, + BasisRatioFilter = BasisRatioFilter, + BasisVolumeInterval = BasisVolumeInterval, + DeltaFilter = DeltaFilter, + CustomTickSize = CustomTickSize, + MaxTradeVolume = MaxTradeVolume, + MaxZoneHeight = MaxZoneHeight, + MinZoneHeight = MinZoneHeight, + MinTradeVolume = MinTradeVolume, + TimeInterval = TimeInterval + }; + } + } + public sealed class HistoryAggregationVwapParameters : ICustomizable, ICloneable + { + [CompilerGenerated] + private Period? ??; + + [CompilerGenerated] + private HistoryAggregation ??; + + [CompilerGenerated] + private VwapDataType ??; + + [CompilerGenerated] + private VwapPriceType ??; + + [CompilerGenerated] + private VwapStdCalculationType ??; + + [CompilerGenerated] + private TimeZone? ??; + + public Period? Period + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public HistoryAggregation Aggregation + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public VwapDataType DataType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public VwapPriceType PriceType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public VwapStdCalculationType StdCalculationType + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public TimeZone? TimeZone + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IList Settings + { + get + { + List list = new List(); + if (Period.HasValue) + { + list.Add(new SettingItemPeriod(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), Period.Value)); + } + list.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)DataType)); + list.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)PriceType)); + list.Add(new SettingItemInteger(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), (int)StdCalculationType)); + if (Aggregation != null) + { + list.Add(new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), new List + { + new SettingItemString(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Aggregation.Name), + new SettingItemGroup(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), Aggregation.Settings) + })); + } + return list; + } + set + { + SettingsHolder settingsHolder = new SettingsHolder(value); + if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), out var value2) && value2.Value is Period value3) + { + Period = value3; + } + if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2?.Value is int dataType) + { + DataType = (VwapDataType)dataType; + } + if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2?.Value is int priceType) + { + PriceType = (VwapPriceType)priceType; + } + if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out value2) && value2?.Value is int stdCalculationType) + { + StdCalculationType = (VwapStdCalculationType)stdCalculationType; + } + if (settingsHolder.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.?(), out value2) && value2?.Value is IList settings && settings.TryGetValue(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value4) && settings.TryGetValue>(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), out var value5)) + { + Aggregation = Core.Instance.HistoryAggregations[value4]; + if (Aggregation != null) + { + Aggregation.Settings = value5; + } + } + } + } + + public HistoryAggregationVwapParameters() + { + } + + public HistoryAggregationVwapParameters(HistoryAggregationVwapParameters original) + { + Period = original.Period; + Aggregation = original.Aggregation?.Clone() as HistoryAggregation; + DataType = original.DataType; + PriceType = original.PriceType; + StdCalculationType = original.StdCalculationType; + TimeZone = original.TimeZone; + } + + public object Clone() + { + return new HistoryAggregationVwapParameters(this); + } + } +} +namespace TradingPlatform.BusinessLayer.History.Storage +{ + public interface IHistoryLocalStorage : ILocalStorage + { + void Save(HistoryInterval interval); + + HistoryInterval Load(HistoryDescription description, Interval interval); + + void Delete(HistoryDescription description, Interval interval); + + HistoryStorageInfo GetInfo(HistoryDescription description, HistoryStorageInfoScope scope); + + List GetAllAvailableHistoryDescriptions(); + + void Vacuum(); + } + [Flags] + public enum HistoryStorageInfoScope + { + StoredIntervals = 1, + ItemsCount = 2, + All = 3 + } + public struct HistoryDescription + { + [CompilerGenerated] + private readonly string ??; + + [CompilerGenerated] + private HistoryAggregation ??; + + public readonly string SymbolId + { + [CompilerGenerated] + get + { + return ??; + } + } + + public HistoryAggregation Aggregation + { + [CompilerGenerated] + readonly get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public HistoryDescription(string symbolId, HistoryAggregation aggregation) + { + ?? = symbolId; + Aggregation = aggregation; + } + } + public class HistoryInterval + { + [CompilerGenerated] + private Interval ??; + + [CompilerGenerated] + private HistoryDescription ??; + + [CompilerGenerated] + private IList ??; + + public Interval Interval + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public HistoryDescription Description + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public IList History + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + } + public class HistoryStorage : DataStorage, IHistoryStorage + { + [Serializable] + [CompilerGenerated] + private sealed class ? + { + public static readonly ? ?? = new ?(); + + public static Func, bool> ??; + + internal bool ?(Interval P_0) + { + return !P_0.IsEmpty; + } + } + + [CompilerGenerated] + private sealed class ? + { + public HistoryRequestParameters ??; + + public HistoryStorage ??; + + public HistoryDescription ??; + + internal HistoryRequestParameters ?(Interval P_0) + { + if (P_0 == ??.Interval) + { + return ??; + } + return new HistoryRequestParameters(??) + { + FromTime = P_0.From, + ToTime = P_0.To + }; + } + + internal Interval ?(Interval P_0) + { + return P_0.Intersect(??.Interval); + } + + internal HistoryInterval ?(Interval P_0) + { + return ??.??.Load(??, P_0); + } + } + + [CompilerGenerated] + private sealed class ? + { + public HistoryStorage ??; + + public HistoryInterval ??; + + internal void ?() + { + ??.??.Save(??); + } + + internal void ?() + { + ??.??.Save(??); + } + } + + [CompilerGenerated] + private sealed class ? + { + public HistoryStorage ??; + + public HistoryDescription ??; + + public Interval ??; + + internal void ?() + { + ??.??.Delete(??, ??); + } + + internal void ?() + { + ??.??.Delete(??, ??); + } + } + + private readonly IHistoryLocalStorage ??; + + private static readonly Type ??; + + public HistoryStorage(IHistoryLocalStorage storage, string localFilePath) + : base(storage, localFilePath) + { + ?? = storage; + } + + public IList Load(HistoryRequestParameters requestParameters, out List historyParametersForServerRequest) + { + CheckDisposed(); + if (requestParameters == null) + { + throw new ArgumentNullException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + HistoryDescription ?? = requestParameters.ToDescription(); + HistoryStorageInfo info = ??.GetInfo(??, HistoryStorageInfoScope.StoredIntervals); + if (info.StoredIntervals.Count == 0) + { + historyParametersForServerRequest = new List { requestParameters }; + return new List(); + } + historyParametersForServerRequest = (from P_0 in requestParameters.Interval.Subtract(info.StoredIntervals) + select (P_0 == requestParameters.Interval) ? requestParameters : new HistoryRequestParameters(requestParameters) + { + FromTime = P_0.From, + ToTime = P_0.To + }).ToList(); + return (from P_0 in info.StoredIntervals + select P_0.Intersect(requestParameters.Interval) into P_0 + where !P_0.IsEmpty + select ??.Load(??, P_0)).ToList(); + } + + public void Save(HistoryInterval historyInterval, bool wait = false) + { + CheckDisposed(); + if (wait) + { + WaitForAction(delegate + { + ??.Save(historyInterval); + }); + } + else + { + PushAction(delegate + { + ??.Save(historyInterval); + }); + } + } + + public void Delete(HistoryDescription description, Interval interval, bool wait = false) + { + CheckDisposed(); + if (wait) + { + WaitForAction(delegate + { + ??.Delete(description, interval); + }); + } + else + { + PushAction(delegate + { + ??.Delete(description, interval); + }); + } + } + + public HistoryStorageInfo GetInfo(HistoryDescription description, HistoryStorageInfoScope scope) + { + CheckDisposed(); + return ??.GetInfo(description, scope); + } + + public List GetAllAvailableHistoryDescriptions() + { + CheckDisposed(); + return ??.GetAllAvailableHistoryDescriptions(); + } + + internal void ?() + { + ???.Vacuum(); + } + + static HistoryStorage() + { + try + { + ?? = AssemblyLoader.LoadTypes(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??(), typeof(IHistoryLocalStorage), null, SearchOption.AllDirectories)?.FirstOrDefault(); + } + catch + { + } + } + + public static HistoryStorage Create(string connectionString) + { + if (?? == null) + { + throw new InvalidOperationException(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + } + IHistoryLocalStorage obj = Activator.CreateInstance(??) as IHistoryLocalStorage; + if (obj == null) + { + DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(30, 1); + defaultInterpolatedStringHandler.AppendLiteral(3E560F35-EA4B-4F47-8302-BE30F80C1E18.??()); + defaultInterpolatedStringHandler.AppendFormatted(??); + throw new InvalidOperationException(defaultInterpolatedStringHandler.ToStringAndClear()); + } + string directoryName = Path.GetDirectoryName(connectionString); + if (!Directory.Exists(directoryName)) + { + Directory.CreateDirectory(directoryName); + } + return new HistoryStorage(obj, connectionString); + } + } + public class HistoryStorageInfo + { + [CompilerGenerated] + private List> ??; + + [CompilerGenerated] + private int ??; + + public List> StoredIntervals + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public int ItemsCount + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public HistoryStorageInfo() + { + StoredIntervals = new List>(); + } + } + public interface IHistoryStorage + { + IList Load(HistoryRequestParameters requestParameters, out List historyParametersForServerRequest); + + void Save(HistoryInterval historyInterval, bool wait = false); + + void Delete(HistoryDescription description, Interval interval, bool wait = false); + + HistoryStorageInfo GetInfo(HistoryDescription description, HistoryStorageInfoScope scope); + } +} +namespace TradingPlatform.BusinessLayer.Chart +{ + public interface IFixLocationDrawing : IDrawing, ICustomizable + { + int[][] ScreenPoints { get; set; } + + bool IsFixed { get; set; } + } + public interface ILineDrawing : IDrawing, ICustomizable + { + Color Color { get; set; } + + LineStyle Style { get; set; } + + int Width { get; set; } + } + public interface IRotationStepDrawing : IDrawing, ICustomizable + { + double[][] Points { get; set; } + } + /// + /// Access to the chart panel + /// + [Published] + public interface IChart + { + /// + /// Chart panel unique ID + /// + string ID { get; } + + /// + /// Collection of chart windows + /// + IChartWindow[] Windows { get; } + + /// + /// Current X scale value - width of the bar in pixels + /// + int BarsWidth { get; } + + /// + /// Provides time zone of current chart. + /// + TimeZone CurrentTimeZone { get; } + + /// + /// Provides account of current chart. + /// + Account Account { get; } + + /// + /// Provides custom sessions of current chart. + /// + ISessionsContainer CurrentSessionContainer { get; } + + /// + /// Current tick size of the chart + /// + double TickSize { get; } + + /// + /// Main window of the chart + /// + IChartWindow MainWindow { get; } + + /// + /// Current right offset value + /// + int RightOffset { get; } + + /// + /// Collection of chart drawingsCollection + /// + IChartDrawingsCollection Drawings { get; } + + /// + /// The MouseDown event occurs when the mouse button is pressed down + /// + event EventHandler MouseDown; + + /// + /// The MouseUp event occurs when the mouse button is released + /// + event EventHandler MouseUp; + + /// + /// The MouseClick event occurs when the mouse button is clicked + /// + event EventHandler MouseClick; + + /// + /// The MouseMove event occurs when the mouse moving over the chart + /// + event EventHandler MouseMove; + + /// + /// The MouseDown event occurs when the user scrolling mouse wheel + /// + event EventHandler MouseWheel; + + /// + /// The MouseDown event occurs when the mouse enter the chart + /// + event EventHandler MouseEnter; + + /// + /// The MouseDown event occurs when the mouse leave the chart + /// + event EventHandler MouseLeave; + + /// + /// The SettingsChanged event occurs when any settings were changed + /// + event EventHandler SettingsChanged; + + /// + /// The AccountChanged event occurs when the account was changed + /// + event EventHandler AccountChanged; + + /// + /// Force chart redraw + /// + void RedrawBuffer(); + } + /// + /// Access to the chart drawingsCollection collection + /// + [Published] + public interface IChartDrawingsCollection + { + /// + /// The Added events occured, when new chart drawing was added to collection + /// + event Action Added; + + /// + /// The Moved events occured, when chart drawing was moved + /// + event Action Moved; + + /// + /// The Removed events occured, when chart drawing was removed from the collection + /// + event Action Removed; + + /// + /// The SelectionChanged events occured, when selected chart drawing was changed + /// + event Action SelectionChanged; + + /// + /// Add chart drawing to the collection + /// + /// + void Add(IDrawing drawing); + + /// + /// Remove specified chart drawing from collection + /// + /// + void Remove(IDrawing drawing); + + /// + /// Get chart drawing by ID + /// + /// + /// + IDrawing FindById(string drawingId); + + /// + /// Get all chart drawingsCollection assigned to specified symbol + /// + /// + List GetAll(Symbol symbol = null); + } + /// + /// Access to the particular window from chart panel + /// + [Published] + public interface IChartWindow + { + /// + /// Client rectangle of the chart window + /// + Rectangle ClientRectangle { get; } + + /// + /// Determines, whether this window is the main window of the chart + /// + bool IsMainWindow { get; } + + /// + /// Chart window number + /// + int WindowNumber { get; } + + /// + /// Special object, allows you to convert values from x/y scale to Time/Price and back + /// + IChartWindowCoordinatesConverter CoordinatesConverter { get; } + + /// + /// + /// + double YScaleFactor { get; } + } + /// + /// Converter between x/y and Time/Price scales + /// + [Published] + public interface IChartWindowCoordinatesConverter + { + /// + /// Get the DateTime value that is corresponding to specified x coordinate + /// + /// + /// + DateTime GetTime(double x); + + /// + /// Get the Price value that is corresponding to specified y coordinate + /// + /// + /// + double GetPrice(double y); + + /// + /// Get the X coordinate that is corresponding to specified DateTime value + /// + /// + /// + double GetChartX(DateTime dt); + + /// + /// Get the Y coordinate that is corresponding to specified price value + /// + /// + /// + double GetChartY(double price); + + /// + /// Get the bar index that is corresponding to specified DateTime value + /// + /// + /// + double GetBarIndex(DateTime dt); + } + /// + /// Access to the chart drawing + /// + [Published] + public interface IDrawing : ICustomizable + { + DrawingType Type { get; } + + /// + /// Determines, the way how chart drawing was created: manually or programmatically + /// + DrawingCreationMode CreationMode { get; } + + /// + /// Determines, the availability of drawing - only current chart or all charts with same symbol + /// + DrawingAvailability Availability { get; } + + /// + /// The unique ID of the chart drawing + /// + string Id { get; } + + /// + /// Determines, whether chart drawing draws above or below the main chart + /// + bool MoveToBackground { get; set; } + + /// + /// Determines, state of the chart drawing: Locked or Unlocked + /// + DrawingState State { get; set; } + + /// + /// Get time and price of the particular point of the chart drawing + /// + (DateTime, double) GetPoint(int pointIndex); + + /// + /// Set time and price value for particular point of the chart drawing + /// + void SetPoint(int pointIndex, DateTime time, double price); + } + [Published] + public enum DrawingState + { + Unlocked, + Locked + } + [Published] + public enum DrawingSelectionState + { + None, + Hovered, + Selected + } + [Published] + public enum DrawingCreationMode + { + Manually, + Programmatically + } + public enum DrawingCreationType + { + ByMouseClick, + ByMouseMove + } + [Published] + public enum DrawingAvailability + { + CurrentChart, + AllChartsWithSameSymbol + } + public enum IndicatorPosition + { + NewSubWindow = -2, + OnBackChart, + OverChart + } + [Obfuscation(ApplyToMembers = true, Exclude = true)] + public enum DrawingType + { + [Description("Trading tool")] + TradingTool = 0, + [Description("Horizontal line")] + HorizontalLine = 1, + [Description("Vertical line")] + VerticalLine = 2, + [Description("Line")] + Line = 3, + [Description("Rectangle")] + Rectangle = 4, + [Description("Triangle")] + Triangle = 5, + [Description("Poligon")] + Polygon = 6, + [Description("Circle")] + Circle = 7, + [Description("Ellipse")] + Ellipse = 8, + [Description("Andrew's pitchfork")] + AndrewsPitchFork = 9, + [Description("Price channel")] + PriceChannel = 10, + [Description("Fibonacci retracement")] + FibonacciRetracement = 11, + [Description("Fibonacci price expansion")] + FibonacciPriceExpansion = 12, + [Description("Fibonacci arc")] + FibonacciArc = 13, + [Description("Fibonacci spiral")] + FibonacciSpiral = 14, + [Description("Fibonacci ellipse")] + FibonacciEllipse = 15, + [Description("Fibonacci fans")] + FibonacciFans = 16, + [Description("Fibonacci phi-channel")] + FibonacciPhiChannel = 17, + [Description("Fibonacci time extension")] + FibonacciTimeExtension = 18, + [Description("Fibonacci time zone")] + FibonacciTimeZone = 19, + [Description("Gann line")] + GannLine = 20, + [Description("Gann fan")] + GannFan = 21, + [Description("Gann grid")] + GannGrid = 22, + [Description("Ruler")] + InfoLine = 23, + [Description("Symbol")] + Symbol = 24, + [Description("Text")] + Text = 25, + [Description("Up arrow")] + UpArrow = 26, + [Description("Down arrow")] + DownArrow = 27, + [Description("Uncpecified")] + Unspecified = 28, + [Description("Label")] + Label = 29, + [Description("Line by angle")] + LineByAngle = 30, + [Description("Regression channel")] + RegressionChanel = 31, + [Description("ABC Pattern")] + ABCPatern = 32, + [Description("Gartley Butterfly")] + ButterflyGartley = 35, + [Description("Custom profile")] + CustomProfile = 36, + [Description("Line arrow")] + LineArrow = 37, + [Description("Head&Shoulders")] + HeadAndShoulders = 38, + [Description("Gann box")] + GannBox = 39, + [Description("Price targets")] + PriceTargets = 40, + [Description("Flag marker")] + FlagMarker = 41, + [Description("Price marker")] + PriceMarker = 42, + [Description("Note")] + NoteMarker = 43, + [Description("Comment")] + Comment = 44, + [Description("Angled line")] + AngledLine = 45, + [Description("Horizontal alert")] + AlertHorizontalLine = 46, + [Description("Elliot triangle wave")] + ElliotTriangleWave = 47, + [Description("Three drives pattern")] + ThreeDrivesPattern = 48, + [Description("Triangle pattern")] + TrianglePattern = 49, + [Description("TPA Strategy")] + TPAStrategy = 50, + [Description("Anchor VWAP")] + CustomVWAP = 51, + [Description("Whale Splash")] + WhaleSplash = 52, + [Description("Fibonacci time expansion")] + FibonacciTimeExpansion = 53, + [Description("Fibonacci price extension")] + FibonacciPriceExtension = 54, + [Description("Minotauro Fibonacci price extension")] + MinotauroFibonacciPriceExtension = 55, + [Description("Minotauro Move Up")] + MinotauroFibonacciRetracementMoveUp = 56, + [Description("Minotauro Move Down")] + MinotauroFibonacciRetracementMoveDown = 57, + [Description("POC line")] + POCLine = 58, + [Description("Week POC line")] + WeekPOCLine = 59, + [Description("VIP Analysis")] + VIPAnalysis = 60, + [Description("Brush")] + Brush = 61, + [Description("Marker")] + Marker = 62, + [Description("Cross line")] + CrossLine = 63, + [Description("Vertical alert")] + AlertVerticalLine = 64, + [Description("Fixed text")] + FixedText = 65 + } + public class ChartEventArgs : EventArgs + { + [CompilerGenerated] + private readonly Account ??; + + public Account Account + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + init + { + ?? = value; + } + } + } + public class ChartMouseNativeEventArgs : NativeMouseEventArgs + { + [CompilerGenerated] + private readonly IChart ??; + + [CompilerGenerated] + private IChartWindow ??; + + [CompilerGenerated] + private bool ??; + + [CompilerGenerated] + private bool ??; + + public IChart Chart + { + [CompilerGenerated] + get + { + return ??; + } + } + + public IChartWindow Window + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + private set + { + ?? = chartWindow; + } + } + + public bool NeedRedraw + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public bool NeedMouseCapture + { + [CompilerGenerated] + get + { + return ??; + } + [CompilerGenerated] + set + { + ?? = value; + } + } + + public ChartMouseNativeEventArgs(IChart chart, IChartWindow window, NativeMouseEventArgs ev) + : base(ev.Button, ev.Clicks, ev.X, ev.Y, ev.Delta) + { + ?? = chart; + Window = window; + NeedRedraw = false; + } + } + public class DrawingEventArgs : EventArgs + { + public IDrawing Drawing; + + public DrawingEventArgs(IDrawing drawing) + { + Drawing = drawing; + } + } + public class DrawingSelectionEventArgs : DrawingEventArgs + { + public DrawingSelectionState SelectionState; + + public DrawingSelectionEventArgs(IDrawing drawing, DrawingSelectionState state) + : base(drawing) + { + SelectionState = state; + } + } + public interface IChartObjectTemplate + { + string Name { get; } + + string Group { get; } + + IList Settings { get; } + } +} +namespace ? +{ + [CompilerGenerated] + internal sealed class ? + { + internal static uint ?(string P_0) + { + uint num = default(uint); + if (P_0 != null) + { + num = 2166136261u; + for (int i = 0; i < P_0.Length; i++) + { + num = (P_0[i] ^ num) * 16777619; + } + } + return num; + } + } +} +namespace {C306A0DD-1657-4827-8B17-3122184442EB} +{ + [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] + internal class 3E560F35-EA4B-4F47-8302-BE30F80C1E18 + { + [StructLayout(LayoutKind.Explicit, Pack = 1, Size = 39059)] + private struct 2 + { + } + + internal static 2 3/* Not supported: data(F9 DF C9 DB DA CA DE 83 C7 DB C5 9A 86 87 99 85 EF D5 CB CC CE CF D3 CF C6 D6 D4 91 C4 C2 D8 D0 AA FD E9 E5 FB EA AC F9 FB F3 E5 C0 EA EB EB F2 BA EF EA F8 FA F6 F2 FA D3 FF FC FE E1 B7 C7 D9 AB 87 84 86 99 CF B8 BD A3 8F 8C 8E 91 C7 B7 A9 DA AF 8A 98 97 93 95 93 95 B2 9C 9D 99 80 D4 98 A5 AF A1 AF B7 EF A3 BF A6 A6 B2 80 AA AB AB B2 FA B6 B7 BD B7 B9 A5 FD B3 BE BF A4 B8 A3 95 B9 46 44 5F 09 43 40 48 44 44 5A 00 51 54 4E 47 40 7B 57 54 56 49 1F 51 52 56 5A 56 48 16 43 5D 53 46 4E 5E 4C 42 3D 53 44 51 5C 41 46 41 55 41 42 5B 4F 5D 5D 5F 73 70 72 65 33 60 70 64 63 7D 74 06 4B 0B 05 01 1C 09 4D 12 0C 13 08 12 0E 0B 0B 3B 17 14 16 09 5F 19 05 02 1C 02 05 37 3B 38 3A 1D 14 1E 06 02 1A 01 08 1D 02 0E 00 0A 1E 17 0C 09 04 1E 0B 11 12 03 09 1B 10 1B 0E 1E 1E 07 01 E5 F9 F1 E8 E2 E3 E5 E3 ED ED E5 FE F6 E6 E7 EE FB FC FD F7 91 FE CE C8 DE D6 FE D0 DB D2 D5 D6 E9 E4 FD E7 FA FC F5 E0 E0 EC EC C0 E5 E4 EB F0 F4 EF B8 F8 F0 FB BC EE EB FE F2 FE FA B7 F9 E0 99 9F C8 8B 8B CF 8A 9F 8D 8E C0 92 87 8A 81 C5 99 94 96 97 9B 9C 88 94 9D 9D 9F 83 92 92 86 A1 B3 BB AD 88 AD AC A3 B8 AC B7 E0 A0 A8 A3 E4 AA A8 BF BD AB FE AB A5 AD B7 F3 BD A4 A5 A3 F4 B7 4F 0B 4E 5B 41 42 0C 5E 43 4E 45 01 45 48 4A 4B 5F 58 4C 50 51 51 6C 4F 5B 50 55 0B 16 17 67 5C 70 6E 32 29 34 2F 24 24 22 39 3A 21 4E 6E 77 71 75 69 61 58 79 78 6E 78 75 72 64 78 79 79 59 74 04 0A 0F 0C 1C 55 4C 04 0C 0A 14 08 07 0B 0D 1F 1B 0F 11 16 10 51 52 53 3A 1A 03 05 19 05 0D 25 38 24 2B 2C 3D 3C 23 3F 31 0B 29 32 32 28 36 3C 0A 29 37 3A 3B 2C 2F 32 20 14 35 25 1F 39 32 3A 8A 86 88 CF CF C6 C0 8D D6 CC 80 D3 C3 D3 D6 CC DF CD DD 99 D7 D1 DA D2 92 D2 D2 DE C3 C3 94 D4 ED EC FA EC E9 EE F8 E4 ED ED A0 AC A6 E1 E5 EC F6 BB EC F6 BE FC EE F8 F3 E7 F5 B1 F7 F0 F3 E7 8F 8C 89 9D 87 80 82 CD 8D 81 8A 84 85 93 C4 C8 DA 9A D8 9F 9B 88 DC 89 8B 83 95 82 D6 80 9D 81 A2 EB BC A1 AB EF BF AC AF A6 E0 AF A7 AA A1 8D B3 A8 AC B6 AC A6 9D BA B5 A1 B5 B6 B7 A3 BD BA 44 66 49 47 4F 48 49 5F 18 03 49 4F 4F 53 4D 44 56 52 42 5C 5A 1F 4F 48 51 50 55 42 45 51 41 59 66 72 78 68 7C 6E 61 68 76 66 72 40 61 60 76 60 7D 7A 6C 70 71 71 5F 7C 7C 73 64 31 70 7E 7A 71 4A 0A 0F 0E 1C 0A 0B 0C 16 0C 12 41 11 0E 10 0D 5A 08 08 1C 1D 16 1A 14 17 17 50 1F 17 1A 11 55 1A 79 0D 31 3E 20 22 28 2C 37 29 20 2A 67 09 2A 2C 32 36 3E 7E 1E 2A 38 20 32 37 34 1B 38 22 3C C4 CC 88 C8 D8 CA DE CC C5 C6 D3 F1 C3 D5 CD CA DE 9B D7 DF 9E FA C4 CD DD DD D5 DF C2 DE D5 D9 AA C6 E7 FF E7 E1 EB AD C3 F5 E5 F3 E7 E0 E1 D6 F5 EE EA FA FB EC BC ED E0 FA F3 F4 E5 B7 F2 FA 98 CB A5 A8 AD 8E 80 8E 97 8F 81 95 8F 88 8A C5 8E 82 88 9C B2 96 92 98 93 81 9C 88 D6 A0 91 9C AD A3 BC AC AA EF 81 A2 B4 AA AE A6 E6 86 B2 A0 A8 BA BF BC 8E BA AE B4 BD B7 F0 BE B0 F7 98 82 67 6A 7B 46 5B 5D 4F 48 51 03 50 53 4F 44 41 56 1A 5D 57 4B 1E 73 6B 70 73 60 59 5C 46 5B 51 15 47 64 7E 60 60 68 2C 4C 74 66 72 60 61 62 54 60 68 72 77 7D 3E 70 7A 3D 41 7A 7D 61 7A 72 34 58 05 1D 01 07 09 4F 2D 1B 07 11 01 06 03 34 09 0A 15 0F 10 1C 1A 5F 31 12 04 1A 1E 16 56 36 02 10 38 2A 2F 2C 1E 2A 3E 24 2D 27 60 2E 20 67 17 28 35 34 2C 31 3B 3B 7C 10 3D 25 39 3F 31 77 15 23 CF D9 C9 CE CB FF C5 DB CD D7 80 F1 C9 CE CA D1 9A F6 D7 CF D7 D1 DB 9D F3 C5 D5 C3 D7 D0 D1 E5 EF F9 E1 E6 EA AF E3 EB A2 D3 D0 CC C7 B4 C9 C4 C9 F2 FF F7 FF F3 CF F5 FD E1 E4 B1 DB F8 E2 FC 84 8C C8 A8 98 8A 9E 8C 85 86 C0 B1 83 95 8D 8A 9E B6 91 9D 9A 93 99 DD BF 9C 86 98 98 90 D4 B4 BC AE BA A8 A9 AA EC 9D A7 B1 A9 AE A2 8B AB AB BD FB 95 B6 A8 B6 B2 BA F2 92 A6 B4 A4 B6 B3 B0 0A 7B 4D 5B 47 40 48 6C 4F 4C 55 4F 52 07 4B 43 1A 59 59 4B 4D 1F 4C 5C 41 40 55 55 16 55 51 53 65 79 6D 29 61 7F 69 63 6B 6D 67 21 76 68 77 6C 6E 72 77 77 5C 70 70 71 7B 7D 77 74 64 37 56 74 04 0F 1B 2A 06 0E 02 03 07 0F 13 31 03 15 0D 0A 1E 5B 17 1F 5E 32 3D 5D 14 1C 02 51 13 19 02 10 26 24 38 2C 3D 19 2D 21 37 26 60 2E 20 67 27 2A 34 3D 31 3D 3B 31 3F 38 72 3A 3E 25 33 25 22 34 C6 FF D1 D9 CB 8F C3 CB 82 CE CF D7 CF C9 C3 85 DB CD DD CB DF D8 D9 FE DD DE DD DE D2 DE C0 CC AA C8 E0 E8 E0 E1 E9 E1 A2 CA EE E5 E3 FF CB F6 F9 F2 F4 F5 FF EB F3 EF E1 C3 F5 E3 FF F8 F0 C1 93 9B 8D C9 81 89 CC A0 8D 95 89 8F 81 C7 A5 93 9F 89 99 9E 9B B2 93 99 9B 95 99 94 92 D7 B9 9A BC A2 A6 AE EE 8E BA A8 B0 A2 A7 A4 96 A2 B6 AC B5 BF F8 B6 B8 FF 91 B2 B6 BA B6 B8 B3 B3 F4 98 45 5D 41 47 49 0F 6D 5B 47 51 41 46 43 75 41 42 48 5E 4B 4A 57 50 52 1D 7E 5A 5E 54 66 52 46 5C 65 6F 28 66 68 2F 40 64 6C 66 61 73 26 55 61 62 68 7E 6B 6A 77 70 72 4E 7D 66 62 72 73 64 34 65 18 02 0B 0C 1D 4F 0A 02 10 43 14 09 03 47 16 00 1D 09 1D 0A 0D 16 13 13 52 1F 19 1F 13 27 06 1C 29 2E 68 0A 26 2E 22 23 27 2F 10 24 34 2E 2B 21 7A 34 3E 79 2E 2D 35 3E 37 73 33 39 37 39 3A 30 C6 EA DD DD C1 DD C9 CA D0 C6 D3 D2 CF D1 C1 85 FC D2 D6 D0 CA DA 9C F4 DF C3 C5 DD C5 D2 94 E7 EF F8 F8 E6 E0 FC E9 AD CF EC F6 E8 E8 E0 A4 C4 EC FE EA F8 F9 FA D4 F4 F6 F7 F5 FF C1 FE FA F1 85 9C C8 B9 8B 9D 85 82 86 B0 8F 94 94 84 81 96 DA 8B 8A 90 9D 9A 8F DD 94 9C 82 D1 82 9F 91 D5 8B AD A1 BB A3 AE EC A1 AB AD A5 96 AF A9 A0 AA AD B2 B6 BE FE B9 A9 B3 B1 A7 B9 BE B8 9B B1 B4 59 5F 05 5A 5F 5A 4D 5F 47 50 00 4C 43 53 4C 4A 5E 69 5D 55 5F 4B 55 4B 57 13 63 45 44 52 5A 52 7E 63 28 40 60 6B 69 75 50 50 49 21 76 62 76 6C 75 7F 4B 76 6B 6D 7F 78 61 33 60 63 7F 74 71 66 4A 0D 07 1B 4E 1B 04 08 42 31 33 28 46 0B 0D 0B 1F 36 17 1D 1B 5F 1A 12 00 53 04 19 13 57 26 26 03 6B 24 20 20 2A 1F 20 2D 2C 34 29 2F 29 23 65 2A 3E 2A 30 31 3B 11 3E 15 3A 3E 3D 33 2E 74 11 D3 C5 C9 C4 C7 CC E8 D4 CC C2 CD C8 C5 87 D0 D7 DB D8 D3 D0 D0 D8 9C DB D3 D0 C4 DE C4 E4 DB C0 F8 E8 ED A9 FE FD E5 EE E7 CE EF F7 EF E9 E3 A5 DB ED FD EB FF F8 F9 BD D7 FD E6 F4 FA F8 E4 F0 BF 9B 8A 88 80 8B CC 89 87 95 89 80 92 8E 8B 8B DA 92 96 D9 DB BB 93 8A 9C 91 91 9F 92 D7 90 90 BC A2 A9 BD A7 A0 A2 ED AB AD E0 E4 96 A6 B6 A4 B8 B4 B4 B0 BD FF 8F 9C 80 87 A2 B4 B8 B3 87 A1 4F 5B 08 46 48 0F 5C 4C 50 42 42 4E 4A 4E 47 05 69 7A 6A 19 4D 46 4F 49 57 5E 7D 50 4E 5E 59 40 67 2B 7E 68 62 7A 69 2D 64 6C 72 21 72 6F 61 25 7B 78 7B 7C 72 7A 6E 7C 66 7A 7F 7F 36 71 75 76 1E 04 1A 28 19 0A 1F 02 0F 06 40 2E 15 04 0D 09 16 1A 0C 16 0C 3C 14 1C 1C 17 15 51 3B 18 19 10 24 3F 3D 24 6E 00 3F 2E 2B 2F 2C 20 32 28 36 13 35 37 39 2D 37 33 35 29 2B 09 39 36 0C 36 33 05 CF D9 CB CC C0 DB 8C E9 C7 D5 C9 C0 D2 CE CB CB FB C9 D7 D6 D0 FE EE F2 FD FD 90 E1 D3 C5 DD DA EE D8 FC E8 E0 EB ED FF E6 A3 C4 E4 F0 EE E5 F1 F3 F4 F6 D4 F1 E9 F5 F3 F5 B3 D1 E7 F3 E5 F5 F2 8F CB AB 86 80 99 89 9F 85 86 8E 82 83 C8 A0 8C 8C 9E 8A 9E 9B 91 9F 98 A2 96 82 98 99 93 D4 9A AC EB AE A8 BD BB EC 88 8F 82 90 A4 B4 AE AB A1 FA B4 BE F9 AD B3 B3 AA F2 96 9D 90 86 B2 A6 BC 45 4F 08 46 48 0F 5F 44 45 4D 41 4D 06 62 69 64 71 5A 51 4B 57 1F 6E 58 5E 52 44 58 40 52 14 7C 64 6F 6D 71 4C 60 60 61 6B 6D 67 64 74 27 46 64 74 7F 6B 39 58 73 7D 69 56 76 66 78 77 63 7D 7A 04 39 09 1D 0B 4F 03 0B 42 20 08 00 08 00 01 35 1F 09 11 16 1A 5F 13 1B 52 1E 1F 1C 13 19 00 00 27 06 27 24 2B 21 38 38 2F 13 25 33 2F 28 20 65 3C 34 2A 79 13 30 31 38 3C 27 25 3C 05 38 21 27 C9 CE DB 89 DE DD C5 CE C7 D0 80 C7 C9 D5 84 E8 D5 D6 DD D7 CA CA D1 98 E0 93 FC D0 C4 C5 CD 95 DD E2 E4 E5 E7 EE E1 FE D2 F1 E9 E2 E3 A7 CB F6 F9 F2 F4 F5 FF EB F3 EF C2 F6 E2 F8 F9 F3 B4 FA 8C CB A5 A8 DF BF 89 9F 8B 8C 84 C1 89 81 C4 A8 BB C9 B5 96 88 96 92 9A D2 B2 86 94 84 96 93 90 EA A4 AE E9 81 BC AF A4 AE AF A1 B5 A9 B5 8B AB FA 99 B9 B5 BF B1 BF B8 F2 85 BF BD A3 BA B1 83 45 47 5D 44 4B 7F 43 5E 4B 57 49 57 43 07 72 4A 56 4E 55 5C 1E 76 52 59 57 4B 7D 5E 58 52 4D 15 4C 67 67 7E 2E 46 62 69 67 7B 4D 47 4F 27 54 60 68 72 77 7D 5F 7C 7F 78 7E 76 62 70 62 7E 7B 7B 4A 24 1B 0A 07 03 00 0C 16 0C 12 20 10 02 16 04 1D 1E 58 2D 0C 0A 19 5D 20 12 1E 16 13 27 11 07 23 24 2C 69 21 29 6C 00 2D 35 29 2F 21 67 05 33 3F 29 39 3E 3B 14 3D 28 34 3E 31 3F 76 16 30 34 DA DF C1 DF CB 8F E1 C2 D4 CA CE C6 86 E6 D2 C0 C8 DA DF DC 9D F9 DD CE C6 90 E3 DD D9 C0 E5 C6 FE E2 EB E2 DD F8 E5 E3 E5 A3 C9 EF E2 E2 FC C1 F3 ED F1 FD FB ED C8 EF E7 F6 B0 C2 E2 E5 F1 FB 8D 9F 80 C9 A7 81 88 88 9A A5 89 93 95 93 C4 A8 BB DB 88 9C 8C 96 93 99 A1 96 93 9E 98 93 D4 B8 8B EB B8 AC BC A6 A3 A9 83 B5 A5 B3 A7 A0 A1 E5 9E B2 AA BC BD AB B5 B2 BC B2 BC F1 9F B9 B0 B0 52 60 4D 45 5A 41 49 5F 02 60 48 40 48 49 41 49 6A 5E 4A 50 51 5B 1C 52 54 13 7D 70 16 51 5B 47 2A 40 6D 65 7A 61 69 7F 25 70 20 42 6E 66 6A 6B 7F 77 5B 76 7B 79 7A 74 71 7A 75 7F 62 37 7B 73 4A 08 00 08 00 01 09 01 45 10 40 16 0F 03 10 0D 2A 1E 0A 1A 1B 11 08 1C 15 16 50 21 04 1E 17 10 6A 04 3B 2A 27 23 20 2C 36 2C 32 07 27 34 30 65 1F 16 19 79 0E 3A 2E 34 3D 37 03 3D 39 20 74 10 E7 EA 88 F9 CB DD C5 C2 C6 F0 C9 C6 C8 C6 C8 85 FF F6 F9 99 EE DA CE D4 DD D7 E3 C5 D9 D4 DC D4 F9 FF E1 EA AE DC E0 E2 F5 D0 ED EE E9 F3 EC EC F4 FC DC F6 EB FD F0 F8 B2 E0 FD FE F9 E3 FC FC 84 8C BC 90 9E 8A CC 82 84 C3 93 8C 89 88 90 8D 93 95 9F D9 AD 8B 93 9E 9A 92 83 85 9F 94 A7 81 A5 A8 A0 A8 BD BB A5 AE E2 BB E0 93 A3 AB A5 B1 B3 AD BD F9 8D AB AE B8 BC B4 A4 B9 F6 9E BA B1 4F 53 7A 7A 67 0F 7C 48 50 4A 4F 45 03 6C 04 75 5F 49 51 56 5A 1A 78 1D 62 56 42 58 59 53 7D 56 62 62 65 66 65 7A 58 68 6C 68 61 6F 26 54 61 6B 51 72 72 6C 70 3F 4F 78 7C 40 75 7F 7D 78 61 35 39 1B 09 07 4E 2D 28 04 10 06 03 15 0F 08 0A 04 16 5B 35 16 08 1A 11 18 1C 07 50 38 18 13 11 0D 0B 27 24 20 29 2E 38 22 30 17 39 31 23 67 2B 23 7A 11 39 2E 7E 12 33 2B 3B 3D 37 71 17 21 31 27 CB CC CD FA C1 DA DE CE C7 83 D0 D3 CF C4 C1 85 DC D4 CA 99 F4 DE CB 9D FF DC C6 D8 D8 D0 94 F4 FC EE FA E8 E9 EA DC E8 F0 EA EF E5 A6 E8 E2 A5 D0 FA EF B9 D3 F0 EA F4 FC F4 B0 D0 E0 F2 E6 F4 8D 8E BB 81 87 89 98 CD 8D 85 C0 AB 87 90 C4 A8 95 8D 91 97 99 DF BD 8B 97 81 91 96 93 A3 8D 85 AF EB A7 AF EE 9B A9 A8 B6 AB E0 8C A9 B1 AD AB BD FB 99 AF BB AD BD BA B7 80 BF A4 A4 B4 B1 F5 5A 59 41 4A 4B 0F 4A 42 50 03 74 44 43 53 4C 05 77 54 4E 50 50 58 1C 7C 44 56 42 50 51 52 64 50 78 62 67 6D 2E 60 6A 2D 56 66 65 75 6E 27 49 6A 6C 72 76 7E 3E 5E 6A 78 60 72 77 74 45 7F 7D 73 1E 4B 07 0F 4E 3B 09 08 16 0B 40 2C 09 11 0D 0B 1D 5B 39 0F 1B 0D 1D 1A 17 27 09 01 13 57 1B 13 6A 07 21 39 3D 6F 01 22 34 2A 2E 26 66 06 32 20 28 3A 3F 3C 0D 30 29 2F 31 36 70 21 24 3E 37 30 8A CD C7 DB 8E E3 C5 DD D1 83 ED CE D0 CE CA C2 9A FA CE DC CC DE DB D8 E2 D6 C2 D8 D9 D3 94 DA EC AB C4 E0 FE FC AC C0 ED F5 E9 EF E1 A7 C5 F3 FF E9 F9 FE FB CC F4 F4 F4 E7 B0 FE F0 B7 D8 FC 9A 98 C8 A4 81 99 85 83 85 C3 A1 97 83 95 85 82 9F B3 91 8A 8A 90 8E 94 91 92 9C D1 A0 98 98 94 BE A2 A4 A0 BA B6 9F 99 86 93 A5 B3 AF A8 A0 93 B5 B7 B9 AD B7 B3 B5 A9 AB 83 B5 A3 BF B8 B0 86 45 5E 5A 4A 4B 5C 0C 5D 50 4A 43 44 55 07 42 4A 48 1B 70 6F 7F 53 50 1D 5A 5A 43 45 59 45 4D 7D 63 78 7C 66 7C 76 2C 7D 67 71 69 6E 62 43 6D 76 6A 77 79 60 3E 72 73 79 77 33 3D 31 36 6B 34 56 05 07 07 1B 4E 52 4C 24 0C 07 09 02 07 13 0B 17 37 1A 16 18 19 1A 0E 47 52 1A 1E 18 02 1E 15 19 23 31 29 3D 27 20 22 63 6C 6D 09 2F 22 2E 27 24 2E 34 2A 14 3F 31 3D 3A 37 21 6A 71 3F 39 3D 21 C3 CA C4 C0 D4 CA C8 8D D1 D6 C3 C2 C3 D4 D7 C3 CF D7 D4 C0 D7 D1 D8 D4 D1 D2 C4 DE C4 F9 D5 D8 EF DB E4 E8 ED EA C3 FF E6 E6 F2 D2 F2 F5 E5 F1 FF FC E1 D4 FF F1 FD FA F7 E1 AA B1 FF F9 FD E1 83 8A 84 80 94 8E 98 84 8D 8D CE CF C8 B7 88 84 99 9E B7 8B 9A 9A 8E AE 86 81 91 85 93 90 8D B8 AB A5 A9 AE AB BD F6 ED AB AD A9 B5 AF A6 A8 AC A0 BE BC F9 AD AA BF BE B7 A0 A3 B7 A3 BB B8 AC 6C 4A 41 45 4B 4B 0C 59 4D 03 49 4F 4F 53 4D 44 56 52 42 5C 1E 4C 5F 4F 5B 43 44 11 11 10 48 69 24 6F 64 65 68 7D 63 60 52 62 74 69 72 68 54 64 6E 73 7E 70 72 7A 4F 69 60 72 64 74 71 6E 59 74 04 0A 0F 0C 1C 55 4C 04 0C 0A 14 08 07 0B 0D 1F 1B 0F 11 16 10 51 52 53 21 07 02 10 02 12 13 0C 07 2A 26 28 29 2A 3E 77 62 2A 2E 28 32 2E 25 29 33 21 3D 3D 7E 2C 29 3E 31 36 23 22 30 22 38 39 D3 D8 DC DB CF DB C9 CA DB ED C1 CC C3 D4 D0 D7 DB CF DD DE C7 D6 D2 DB DD 9D C8 DC DA FC D1 CC AA F9 ED F8 FB EA FF F9 AC A3 D2 E4 F7 F2 E1 F6 EE D2 FC B9 A3 BF A7 BD C1 F6 FE F5 FF F9 F3 B5 99 84 9D 9B 8D 8A CC D0 C2 B7 88 84 94 82 C4 8C 89 DB 96 96 DE 8F 9D 8F 97 9D 84 D1 98 96 99 90 AE AE B8 AC A0 AB A9 A3 B6 8A B4 A4 AB B7 A5 B7 BF B5 AC 90 AA BA B1 AE F2 B2 A2 B6 A3 BA B1 BB 5E 0B 45 5C 5D 5B 0C 4E 4D 4D 54 40 4F 49 57 05 5B 4F 18 55 5B 5E 4F 49 12 5C 5E 54 16 52 58 50 67 6E 66 7D 4A 6A 6F 64 6F 62 6C 51 6A 66 67 60 69 4D 79 75 6B 7A 48 6F 73 77 79 7F 71 37 5B 65 0F 19 09 1D 07 00 02 57 42 20 01 0F 05 02 08 45 15 09 1C 1C 0C 0C 52 5D 21 16 1E 15 1F 19 13 55 39 24 3D 3B 2D 2A 6C 70 62 17 32 20 22 2E 2A 22 7A 14 28 3C 2C 3E 28 34 3D 3D 6A 71 15 36 3A 36 CF C7 88 C6 DC CB C9 DF D1 8D 80 EE D4 C3 C1 D7 C9 9B DB D6 CB D1 C8 9D 8F 93 90 E2 D3 D9 D0 DC E4 EC A8 FA E1 FA FE EE E7 A3 BD A1 D2 F5 E5 E1 F3 F5 FF B9 D1 EF F9 EF F3 E7 F9 FE F8 AD B4 D6 8B 85 8B 8C 82 CF 83 9F 86 86 92 92 C8 C7 B7 9C 97 99 97 95 DE C2 DC A9 80 92 94 98 98 90 D4 BA BA AE BA A8 BA A6 A3 A3 F8 E3 83 A0 A8 A4 A1 A9 FA B4 AA BD BB AD AF F3 F2 92 B3 B2 B9 A2 BA A1 0A 16 08 12 0E 6E 4F 4E 4D 56 4E 55 06 1A 04 1E 1A 68 51 5D 5B 1F 01 1D 66 41 51 55 5F 59 53 15 45 7B 6D 7B 6F 7B 65 62 6C 39 20 42 67 69 67 60 76 3B 77 6B 7A 7A 6E 6E 3C 33 43 78 72 72 34 28 4A 50 48 3D 07 02 09 4D 0B 0D 40 07 09 15 07 00 5A 46 58 2D 0C 1E 18 14 1C 14 50 3E 06 12 06 14 3E 22 27 27 74 6F 0F 2C 2C 20 25 2D 66 28 36 21 3F 29 2B 77 7E 0B 35 30 37 73 39 3F 76 31 3B 27 C9 CE 88 94 8E 94 8C E2 D0 C7 C5 D3 86 D3 DD D5 DF 9B 85 99 85 9F F3 CF D6 D6 C2 91 C2 CE C4 D0 AA E9 ED E1 EF F9 E5 E2 F0 A3 BD A1 D2 F5 E5 E1 F3 F5 FF B9 D1 EF F9 EF F3 E7 F9 FE F8 AD B4 D6 8B 85 8B 8C 82 CF 83 9F 86 86 92 92 C8 C7 AB 97 9E 9E 8A D9 8A 86 8C 98 D2 91 95 99 97 81 9D 9A B8 EB F5 E9 8F A3 A0 A2 B5 E3 83 A0 A8 A4 A1 A9 9B B7 B4 96 AE BA B2 92 A0 B7 B5 A3 A5 98 BA 86 53 46 4A 46 42 6E 40 41 4D 54 00 62 47 49 47 40 56 7A 54 55 71 4F 59 53 7D 41 54 54 44 44 7B 5B 4B 68 6B 66 7B 61 78 4C 6E 6F 6F 76 26 44 65 6B 79 7E 74 58 72 73 53 6D 77 7D 5F 63 72 72 66 66 25 05 3B 10 03 0D 03 01 23 0D 04 20 05 04 0B 10 14 0F 2C 0B 1F 1B 15 13 15 53 3F 01 13 05 15 01 23 24 26 73 6E 0C 20 22 31 26 60 31 29 34 2D 31 33 34 36 2A 70 7F 0F 38 3C 37 39 3F 31 77 27 3A DF D9 CB CC 8E 92 8C F9 D0 C2 C4 C8 C8 C0 84 EA CA DE CA D8 CA D6 D3 D3 88 93 F3 DD D9 C4 D1 95 FA E4 FB E0 FA E6 E3 E3 F1 AD A0 D2 FF EA E6 EA F6 BB A5 B9 CA ED FD F9 FB FD F7 B1 D9 E7 F1 E7 8B 9F 81 86 80 D5 CC AE 8E 8C 93 84 C6 97 8B 96 93 8F 91 96 90 8C D2 DD B3 90 93 9E 83 99 80 D5 F7 EB 9C BB AF AB A5 A3 A5 E3 8F B1 A3 B5 A5 B1 B3 B4 B6 E3 FE 9C B0 B2 A1 B6 F0 A1 B9 A4 BD A1 43 44 46 5A 00 0F 7F 44 46 46 00 1C 06 73 56 44 5E 52 56 5E 1E 70 4C 58 40 52 44 58 59 59 0E 15 49 67 67 7A 6B 2F 7C 62 71 6A 74 68 70 62 24 75 75 68 71 6D 77 70 72 6E 3C 33 43 74 78 73 7D 7B 0D 4B 1B 06 1B 1D 0F 08 42 5E 40 35 14 06 00 0C 14 1C 58 36 0E 1A 0E 1C 06 1A 1F 1F 4C 57 37 19 25 38 2D 69 3E 20 3F 24 36 2A 36 24 66 37 2B 36 33 2F 31 36 30 2C 72 7D 01 2A 3D 33 39 3B 74 68 8A FF DA C8 CA C6 C2 CA 82 EC D0 C4 D4 C6 D0 CC D5 D5 82 99 FD D3 D3 CE D7 93 DE D4 D1 D6 C0 DC FC EE A8 F9 E1 FC E5 F9 EB EC EE F2 A8 A7 D7 E0 F4 FF F1 F7 F9 BF EF F2 E7 E1 F3 F4 B6 AA B4 C1 98 8A 8C 80 80 88 CC A2 92 86 92 80 92 8E 8B 8B C0 DB BB 95 91 8C 99 DD 9C 96 97 90 82 9E 82 90 EA BB A7 BA A7 BB A5 A2 AC B0 EE E1 95 BE A9 A7 B5 B7 F8 E4 FE 8B AE BC B6 BA BE B6 F6 98 A4 B0 58 4A 5C 40 41 41 16 0D 70 46 56 44 54 54 41 05 4A 54 4B 50 4A 56 53 53 41 1D 10 62 53 59 50 5C 64 6C 28 7A 61 7A 7E 6E 67 23 3D 21 52 75 65 61 73 75 7F 39 51 6F 79 6F 73 67 79 7E 78 2D 34 47 0F 1D 0D 1B 1D 0A 4C 1D 0D 10 09 15 0F 08 0A 16 54 5B 2B 00 13 1D 13 11 52 4E 50 25 04 16 10 1C 24 2C 68 06 3E 2A 3E 2C 36 2A 2F 2F 7C 67 16 20 2C 3E 2A 2A 3B 7F 2C 32 21 3A 24 38 39 39 27 7B 8A EA CB CA C1 DA C2 D9 82 9E 80 F5 D4 C6 C0 CC D4 DC 98 F6 CE DA CE DC C6 DA DF DF 8C 97 F2 D9 EB FF FC EC E0 A1 AC DE E7 ED E4 E8 E8 E0 A4 F6 F5 EE EA FA FB BF A1 BD C6 E1 F1 F5 FF F9 F3 B5 A5 9B 8D 9B 8F 9B 85 82 8C D9 C0 A7 8A 86 90 91 9F 95 D6 D9 AD 86 91 9F 9D 9F D0 CC D6 B1 98 94 BE BF AD A7 F4 EF A3 BF A6 A6 B2 B2 E6 B0 A1 B7 BF FB B6 B6 AA FF BF BC BC B0 B5 BD BA B2 B0 F5 4B 4D 5C 4C 5C 0F 19 0D 51 46 43 4E 48 43 57 09 1A 5D 57 4B 5D 5A 1C 4D 5D 40 59 45 5F 58 5A 15 69 67 67 7A 67 61 6B 23 56 71 61 65 6F 69 63 25 55 6B 7D 6B 7F 6B 75 72 7C 29 30 53 64 72 75 7E 0F 1D 0D 07 40 4F 3C 02 11 0A 14 08 09 09 44 58 5A 40 58 36 18 19 0F 18 06 53 4D 51 4D 57 35 11 2E 22 3C 20 21 21 2D 21 62 33 21 33 27 2A 21 31 3F 29 2B 79 3D 30 29 33 26 73 6D 71 26 38 27 3C DE C2 C7 C7 ED CE C2 8A D6 83 C6 C8 C8 C3 84 F6 F6 9B D7 CB DA DA CE F2 DC D6 90 C1 D9 C4 DD C1 E3 E4 E6 A9 E0 EA F8 F9 EB ED E7 A1 F2 FE F4 E0 BA E9 FD E8 EB F6 EE F8 F6 C0 E4 FE E6 B7 FB E7 8E 8E 9A C9 9A 96 9C 88 C2 91 85 90 93 8E 96 80 9E B4 88 9C 90 9A 98 DD 82 9C 83 98 82 9E 9B 9B EA B9 AD B8 BB A6 BE A8 A6 97 A9 AC A3 A8 B1 B1 88 BE BE AC AD BA 9F BC BC F4 A4 F1 B0 BE BA B1 0A 4A 46 50 0E 5C 58 42 52 0B 53 08 06 46 4A 41 1A 4F 59 52 5B 17 4F 14 12 5C 42 55 53 45 47 61 78 6A 6C 60 60 68 2C 42 72 66 72 60 72 6E 6B 6B 20 3B 59 7D 74 6A 6F 69 32 40 5C 3E 42 47 3A 35 3A 04 1B 00 1A 06 03 03 42 5E 40 28 08 11 05 09 13 1F 58 0A 0A 10 0C 5D 1E 1C 03 02 56 16 10 1F 3F 38 3C 24 2B 21 38 6D 30 26 33 34 2A 33 0D 2B 2C 3A 34 30 3A 7F 28 3C 39 36 70 21 24 38 32 3C DE 8B C9 CD C4 DA DF D9 CF C6 CE D5 86 D5 C1 D6 CF D7 CC F8 D2 D3 D3 CA 92 FF D9 DF DD 97 FB F6 C5 DF FA E8 EA E6 E2 EA A2 CC F0 E4 F4 E6 F0 EC F5 F5 A2 B9 DF FB F6 E8 E1 E7 B0 E2 E2 F8 E4 B5 86 84 9B 9A C0 CF BC 82 91 8A 94 88 89 89 C4 D8 DA C0 D8 AA 8A 90 8C 8E C8 D3 CB D1 BF 99 9D 81 A3 AA A4 E9 BD BB A3 BD E2 AF AF B2 B5 FD E4 91 A8 BA BC B0 B0 B8 FC 92 A2 B6 A2 B0 A2 BE BB BB 10 0B 69 4D 44 5A 5F 59 02 57 41 4A 43 07 54 57 55 5D 51 4D 10 1F 6C 52 41 5A 44 58 59 59 14 08 2A 30 28 5D 6F 64 69 7E 38 23 3B 21 4F 69 6D 71 73 7A 74 39 6A 7E 77 78 32 63 62 7E 70 7E 60 2F 4A 22 06 0A 01 1D 1E 08 01 17 40 15 07 15 03 00 0E 5B 0C 18 15 1A 5C 0D 00 1A 13 14 31 05 1B 00 3A 1F 3A 28 2A 26 22 2A 0D 33 25 33 27 33 2D 2A 34 7B 23 79 0A 26 2C 38 72 6E 70 7D 76 11 3D 39 DE CE DA DA 8E 92 8C DD C3 D1 C1 CC C3 D3 C1 D7 C9 EF CA D8 DA D6 D2 DA 92 DC C0 D4 C4 D6 C0 DC E5 E5 FB A9 E7 FC AC E1 ED E0 EB E4 E2 D3 F6 E4 FE F2 F6 FE BE F0 EC F8 E0 F2 E4 F8 F9 F9 E7 B5 83 98 C8 85 81 8C 87 88 86 C3 86 8E 94 C7 85 86 99 94 8D 97 8A AA 92 96 9C 9C 87 9F D6 83 86 94 AE A2 A6 AE EE A0 BC A8 B0 A2 B4 A8 A9 A9 B4 A4 A8 BA B5 BC AA BA AE AE 9E BA A3 A5 86 B6 A6 B0 44 5F 08 46 5C 4B 49 5F 02 4C 52 01 56 48 57 4C 4E 52 57 57 1E 56 4F 1D 5C 46 5C 5D 78 58 14 5A 78 6F 6D 7B 2E 7B 75 7D 67 70 20 67 69 75 24 66 76 74 6B 70 70 78 3C 72 60 77 75 63 65 44 6D 78 08 04 04 49 0F 01 08 4D 03 00 03 0E 13 09 10 45 1B 09 1D 59 10 0A 10 11 3D 01 14 14 04 57 1C 14 39 6B 26 26 3A 6F 29 35 2B 30 34 11 29 34 2D 31 33 34 36 79 36 3E 2F 7D 3C 3C 24 71 33 2F 3D 26 DE C6 DB CA C1 DD C0 C4 C0 F7 D2 C0 C2 CE CA C2 EA D7 D9 CD D8 D0 CE D0 9C F1 C5 C2 DF D9 D1 C6 F9 C7 E9 F0 EB FD CE E4 EC E7 E9 EF E1 D5 E1 E1 F3 E9 FD FA EA B1 E4 F0 FE DD F1 FC F3 C5 F1 F1 83 99 8D 8A 9A BF 8D 99 8A A5 81 88 8A C7 90 8A DA 8B 8A 96 9D 9A 8F 8E D2 B1 99 9F 92 9E 9A 92 98 AE AC A0 BC AA AF B9 EC BB AD AD E6 A1 AD A9 BF F1 F6 BD B2 B3 8F A4 A1 A7 B5 BC 95 A2 A7 A1 45 46 66 48 43 4A 60 42 41 48 45 45 68 73 66 68 51 1B 1B 15 0E 11 1F 1E 11 10 13 12 15 14 17 16 29 27 38 27 3E 2C 2C 44 6C 6D 65 73 26 62 7C 66 7F 6B 6C 70 71 71 26 3D 7B 67 75 7C 65 5E 7A 76 05 19 1A 0C 0D 1B 4C 0F 10 02 03 0A 03 13 17 45 0A 1A 0A 18 13 1A 08 18 00 00 5E 51 22 18 00 14 26 6B 2B 28 22 2C 39 21 23 37 25 25 66 36 31 24 34 2F 31 2D 27 7F 74 74 72 37 3F 34 25 77 3A 3A DE 8B C5 C8 DA CC C4 8D CD D1 C4 C4 D4 87 D5 D0 DB D5 CC D0 CA C6 9C 95 9B 9D F9 DF D5 D8 C6 C7 EF E8 FC A9 EC FD ED EE E9 E6 F4 F2 A6 F7 E5 F7 FB F6 FD ED FB ED EF B3 B2 D1 E2 F0 F5 FC F1 E1 CA 9A 9D 88 80 9B 85 99 9B C3 83 80 88 C7 8A 8A 8E DB 9A 9C DE CF D2 8D 93 87 98 BD 93 81 91 99 B9 9F 8D A7 BB A2 EC A0 B7 B0 B4 E1 A4 A2 E4 A4 B4 FB BD B7 AB B2 B9 AF B3 A7 B5 B5 F6 A3 AD A5 4F 7F 5A 48 4A 46 42 4A 71 5A 4D 43 49 4B 43 09 76 54 5F 5E 5B 4D 7F 52 5C 55 59 56 7A 58 53 52 6F 79 46 68 63 6A 2C 30 22 2F 20 4E 73 73 74 70 6E 5D 77 75 7A 7A 6E 4D 73 67 78 31 2B 37 38 35 39 08 07 19 0B 4F 51 4D 2E 0C 07 06 03 15 17 29 15 1C 1F 1C 0C 3E 0C 0D 1E 1A 13 10 02 1E 1B 1B 64 65 14 67 60 13 00 22 25 30 13 24 34 2E 28 2A 3D 37 37 3E 39 3E 3E 31 37 00 24 30 24 23 74 31 CF C7 CD DD C7 C1 CB 8D CD CF C4 81 CA C8 C3 85 DC D2 D4 DC CD 91 92 93 F6 D6 DC D4 C2 DE DA D2 AA ED E1 E7 E7 FC E4 E8 E6 AD CC EE E1 E0 E1 F7 A0 BB DC FC F2 FA E8 F8 B2 FF FF F6 B6 F1 FD F9 8F 98 C6 A6 A3 8A 9F 9E 83 84 85 DB C6 A2 9C 86 9F 8B 8C 90 91 91 C6 DD D1 9B 99 95 92 92 9A D6 89 A4 BA AC 82 A0 AF AC B0 AA BA A4 B4 AB AB A6 BB B7 BD F7 B3 B0 B9 B3 FF 86 83 9D B9 B4 B5 B9 43 51 4D 5B 00 66 42 44 56 66 6E 62 47 53 45 49 55 5C 17 17 4A 4B 74 75 08 5E 5D 59 5E 0D 59 58 2A 7F 7C 41 46 35 61 60 38 70 73 69 6E 3D 69 68 20 68 6B 39 6A 6B 48 74 7F 76 45 65 7F 7B 67 2F 4A 02 06 00 1A 06 0D 01 0B 19 01 15 0F 08 0A 4B 54 55 2C 10 13 1A 29 09 1B 1F 03 4B 56 1E 1A 1C 3E 22 29 25 27 35 29 29 62 30 35 22 25 22 37 36 3C 2E 34 35 27 18 38 2E 21 20 23 6B 30 31 32 21 CE 85 E5 87 D7 D6 C8 C9 8C EE ED 8F DF DE C0 C1 94 F6 F5 97 C7 C6 C5 C4 D6 94 9F 96 FB 90 9B 92 F3 F2 EC ED A9 A0 AB C0 CF A4 AF A6 FF FE E0 E1 BD B4 BF D4 D3 B8 B3 BA EB EA E9 E8 DB B9 F0 BB 93 92 A5 A4 C0 8B 88 C3 9B 9A AD AC C8 83 80 CB 83 82 81 80 B3 D8 D3 DA 96 D4 DF D6 8F 8E B9 B8 ED E4 EF AD AA E8 E3 EA BB BA 8D 8C E1 E8 E3 A1 BE FC F7 FE A7 A6 A5 A4 91 B2 BE F6 A2 F7 A7 B0 5E 0B 5B 59 4B 4C 45 4B 4B 40 00 55 4F 4A 41 7F 55 55 5D 70 50 59 53 1D 42 52 42 50 5B 52 40 50 78 2B 7F 60 7A 67 2C 41 6D 60 61 6D 26 73 7D 75 7F 4F 70 7C 3E 4B 75 70 77 49 7F 7F 73 5E 7A 73 05 4B 01 1A 4E 01 19 01 0E 2F 0F 02 07 0B 31 31 39 5B 50 2C 2A 3C 55 51 52 53 00 03 1F 14 11 55 26 2E 3E 2C 22 3C 1A 02 0E 16 0D 04 07 09 05 09 03 08 11 0A 01 0F 1D 1E 19 12 17 14 1B 02 18 01 E3 F4 E9 FA FD EA F8 F2 F2 E2 E3 EA E7 E0 E1 E6 E8 E2 E8 ED F1 E0 EC FC F1 F8 F1 F6 F3 EE DB C0 F8 AB E4 E0 ED EA E2 FE E7 A3 E4 EE E3 F4 EA A2 EE BB F9 F5 F2 F0 EB BD C4 FC FC E4 FB F2 B4 D4 84 8A 84 90 9D 86 9F B4 8D 96 92 C1 8A 8E 87 80 94 88 9D D9 9F 93 90 92 85 80 D0 9E 98 9B 8D D5 FB EB BF AC AB A4 EC A2 A4 E3 96 AE AA B2 A9 A0 FA 9A B6 B8 B2 A6 AF B4 A1 9A BE A7 B7 BB BD B1 0A 59 4D 5A 5E 40 42 5E 47 03 46 53 49 4A 04 68 55 5F 5D 03 1E 6A 52 56 5C 5C 47 5F 65 4E 59 58 6F 7F 7A 60 6D 2F 4D 6E 76 6A 76 64 55 7E 69 68 7F 6F 6A 70 7D 3F 4C 7C 61 7A 66 74 55 7B 7D 70 04 1F 3B 0C 1C 19 09 1F 20 11 0F 00 02 04 05 16 0E 76 72 35 11 1C 1D 11 52 07 19 1C 13 4D 54 78 40 07 27 2A 2F 23 6C 0E 2E 2C 23 2A 66 08 22 23 29 3E 2C 63 7E 7F 31 2E 5F 59 20 3E 39 3B 7A 3B DE DB 86 C6 DC C8 D8 C4 CF C6 8E D6 CF C9 C0 CA CD C8 96 DA D1 D2 C8 D4 DF D6 9E D6 D9 D8 D3 D9 EF A5 EB E6 E3 FB E5 E0 E7 AD EE E8 F5 F3 AA E2 F5 ED CC F0 F3 FA BC EA F3 E0 B0 E2 EF F9 F7 FD 98 84 86 80 94 8A 88 C3 C2 A0 95 93 94 82 8A 91 DA 94 9E 9F 8D 9A 88 DD DA 9E 83 D8 CC D7 A7 80 B9 BB AD AA BA AA A8 ED AB AD A3 AE B4 B5 A1 A6 AE FB B7 BF B8 AC B9 A9 F2 B5 A2 BE BB F7 A7 B0 58 5D 4D 5B 14 0F 7F 48 4E 46 43 55 43 43 04 4A 58 51 5D 5A 4A 1F 5F 5C 5C 14 44 11 54 52 14 46 6F 79 61 68 62 66 76 68 66 55 61 73 6F 66 66 69 7F 3B 6F 70 6A 77 3C 6E 62 76 73 78 70 7E 71 71 4A 05 09 04 0B 4F 02 02 16 43 05 19 0F 14 10 16 1D 17 17 1B 1F 13 2A 1C 00 1A 11 13 1A 12 07 03 2B 39 21 28 2C 23 29 23 23 2E 25 37 27 2B 31 20 33 28 16 2C 32 33 1B 31 3D 31 31 3D 00 36 26 3C CB C9 C4 CC DD 81 C8 CC D6 F7 D2 D4 C3 F3 CB CA 9A D9 D1 DE 9E D0 DE D7 D7 D0 C4 F3 C3 D1 D2 D0 F8 EE EC D9 FC E0 EF E8 F1 F0 EF F3 D1 EE F0 ED CA E9 F1 F6 EC F6 E8 E4 BC C3 E2 FE F5 F2 E7 E6 A7 8A 86 90 BA 8E 9F 86 91 D9 C0 A0 88 C7 81 97 88 94 8A D9 91 9C 9F 88 80 96 94 CB D6 B5 81 93 AC AE BA AC AA 9F BE A2 A1 A6 B3 B2 A9 B5 93 AC AE B3 88 AB B7 B0 AE B4 A6 AA FE 81 A3 A4 BC EF 0A 6A 46 09 4B 5D 5E 42 50 03 4F 42 45 52 56 40 5E 01 18 70 50 49 5D 51 5B 57 10 41 44 5E 5B 47 63 7F 71 79 62 7A 6B 20 6B 6D 73 2F 28 5B 2A 2B 46 35 36 45 56 76 6F 69 7D 61 69 47 79 7B 61 78 0F 2A 06 08 02 16 1F 04 11 36 13 04 14 33 16 04 1E 1E 0B 3A 1F 1C 14 18 21 16 04 05 1F 19 13 06 19 28 3A 20 3E 3B 3F 1E 21 31 29 31 32 34 00 24 2E 3A 11 37 3A 36 3F 3C 26 3C 22 22 05 23 26 34 DE CE CF C0 CB DC FC C1 C3 C0 C5 EE D4 C3 C1 D7 E9 CF CA D8 CA DA DB D4 D7 C0 E6 D4 D8 D3 DB C7 F9 E9 E1 E7 DA EA E1 FD CF E6 E4 E8 E7 CA E1 F6 E9 FE F6 FE FB ED EF D4 FC E7 F5 E3 E0 F6 F8 AF CA 86 89 91 AA 8A 8B 9F 87 86 AF 87 B6 86 96 84 96 97 9D 95 97 8C 91 BE 9D 9D 9E 94 95 83 9D 9A A4 EB AE A0 A0 A6 BF A5 A7 A7 83 AE A8 A9 A1 A6 AE B2 B7 B7 FE B3 B3 AE A6 9C A2 B5 B3 A5 F4 B6 58 4E 49 5D 4B 4B 03 4E 43 4D 43 44 4A 42 40 0A 48 5E 48 55 5F 5C 59 59 7D 41 54 54 44 17 52 5C 66 67 6D 6D 41 7D 68 68 70 23 72 64 6C 62 67 71 7F 7F 48 76 6D 76 68 74 7D 7D 30 72 7A 78 67 70 0E 2F 0D 0F 0F 1A 00 19 42 02 0C 04 14 13 31 15 1E 1A 0C 1C 5E 3E 0A 1C 1B 1F 11 13 1A 12 17 1A 24 25 2D 2A 3A 26 23 23 04 2A 2E 28 35 2F 21 21 74 2C 39 2F 3D 30 32 33 37 30 24 38 39 39 18 3A D9 DF 86 DE CF D9 E3 DF C6 C6 D2 E2 D4 C2 C5 D1 DF DF 96 CE DF C9 D3 CF D6 D6 C2 F7 DF DB D8 D0 EE A5 FF E8 F8 E0 FE E9 E7 F1 D2 E4 EC E2 E7 F1 FF FF B6 EE FF E9 CC F2 E1 FA E4 F8 F9 F9 D7 F9 85 98 8D 8D C0 98 8D 9B A6 86 86 80 93 8B 90 A4 96 9E 8A 8D D0 88 9D 8B A7 83 94 90 82 92 DA 82 AB BD 93 E6 E5 F2 91 B4 E2 A7 9C A5 9A E7 AC 99 B2 B3 84 B1 82 FF B1 81 BF BE BD 8D EC A4 A7 A6 76 58 4C 09 46 0F 41 0D 51 6F 49 42 43 49 47 40 71 5E 41 6A 4A 5E 4E 49 76 52 44 54 62 5E 57 5E 79 4E 66 6D 4A 6E 78 68 56 6A 63 6A 75 4E 6A 73 7B 77 71 7D 3E 6B 73 76 77 7D 30 65 6F 67 71 2F 4A 29 29 3A 27 2C 33 3D 23 20 2B 20 21 22 29 2C 28 29 37 2B 21 2B 2E 3C 36 3A 3E 36 27 22 35 3B 1E 04 1F 0C 1C 10 00 04 16 06 03 13 1F 17 10 0A 05 12 16 1D 17 1E 03 0D 13 10 1B 10 11 12 04 07 EF E6 E1 FC E3 F0 FC E1 F7 F0 FF F1 E7 E4 EF E4 FD FE E8 F6 E9 FA EE E9 E0 F2 F4 F4 E5 E8 E4 F4 C9 C0 C9 CE CB DF DE C8 CF CA D5 CC D9 D7 C5 C6 D1 DA DF DC D1 CF C8 D4 DD DD C3 CE C6 D6 D7 DE AB AC AD BD BE A0 AF A5 A3 B1 B4 BE B6 A6 A7 AE BB BC BD AD AC BE B8 B4 BC B4 AF A2 BF B0 BA B4 86 94 98 88 8D 84 8D 8A 87 87 8F 8C 95 92 96 83 9B 98 9D 86 8E 9E 9F 96 93 94 95 9E 84 93 91 87 6C 67 67 7E 71 7F 6D 6E 69 62 67 64 72 75 71 60 7E 7A 6C 78 61 69 79 71 7D 70 79 65 6F 74 61 66 5E 44 45 4C 5C 5F 5E 42 52 5C 4C 48 45 42 4A 56 5F 4A 4D 58 50 4B 53 4A 57 41 4F 50 52 41 55 5B 29 2E 2C 36 2B 3E 39 24 36 3A 31 34 27 29 30 2A 2D 3E 2A 26 3F 3B 2A 3C 3C 30 35 35 29 3E 3A 31 03 08 0D 1A 1F 1A 0D 03 16 0C 17 04 14 18 05 01 0C 1A 16 1A 1B 1B 03 1E 1D 1E 1D 1E 12 1E 00 0C FB FE E9 E7 FA E0 FB E8 F0 FC E1 E5 F0 E6 EA E6 FF FF E7 FC EF EA F5 E9 EB EC F3 FE FB FA FB F1 C3 DF C1 CC DD CC C9 C9 D0 CC CD C0 D4 CC C1 D1 DE DA CC D8 C1 CF DD DE D9 D2 D7 D4 D4 F6 E7 FC 89 A8 9A 90 9E 9B 83 CD B2 82 83 8A 87 80 81 A8 8F 97 8C 90 D3 9E 8F 8E 97 87 D0 A1 97 94 9F 94 AD AE 89 AD B8 AE A2 AE A7 A7 E0 87 A3 A6 B0 B0 A8 BE AB 89 AC BA B1 B4 A7 BE F0 81 BA A2 A7 94 46 47 08 40 40 0F 43 43 47 75 4F 4D 53 4A 41 05 7B 55 59 55 47 4C 55 4E 62 5C 47 54 44 17 60 47 6B 6F 6D 7A 4A 40 41 2D 71 76 72 67 67 64 61 4A 68 7F 7D 6B 3E 59 70 72 65 47 40 5E 36 54 7C 74 18 1F 27 19 1A 06 03 03 42 17 12 00 02 0E 0A 02 39 0E 0B 0D 11 12 19 0F 22 01 1F 01 3B 1E 06 07 25 39 68 1D 3C 2E 28 24 2C 24 14 33 27 23 2D 2B 3D 7B 0B 20 2D 2B 39 30 21 02 25 30 38 23 3B 22 CF D9 88 E5 C7 DB C9 FC D7 C2 CE D5 C9 D0 C1 D7 9A FA DC CF DF D1 DF D8 D6 93 9D 91 F3 C6 C1 DC FE F2 DC FB FB EA AC C9 E3 F7 E1 A1 D0 E2 E8 EA F9 F2 EC E0 CF EA FD F3 E6 FC E7 F4 E4 B7 D5 F1 9C 8A 86 8A 8B 8B CC C0 C2 AA 8E 85 8F 84 81 96 DA D3 B1 97 9A 9A 84 DD B4 D5 BF D8 A7 82 95 9B BE A4 BF AC BC EF 8D A9 B4 A2 AE A2 A3 A3 E4 ED 99 B4 B5 B4 B1 BB B5 A9 AB FA 81 A4 B7 B9 A0 BA 5D 4E 5A 09 6F 4B 5A 4C 4C 40 45 45 06 0A 04 60 4B 4E 51 4D 47 1F 1A 1D 71 5C 5D 5C 59 53 5D 41 73 48 6D 6D 7C 60 2C 40 63 71 6B 64 72 27 60 64 6E 7A 5B 78 70 7C 79 71 32 64 71 78 62 37 75 76 09 0E 1B 1A 4E 1B 03 06 07 0D 05 0F 02 14 01 16 09 12 17 17 58 21 5A 1E 1F 17 5F 12 56 04 00 14 38 3F 68 31 2A 28 61 22 32 26 2E 2E 36 22 2A 02 3F 2F 1E 2B 3B 3A 0C 32 20 27 19 3F 04 36 3A 32 CF 87 88 E6 DB DB 8C C2 C4 83 D0 CE D4 D3 D7 D6 CF D9 DD D4 DF D6 D0 D8 DC C7 D9 C5 CF 86 D1 DB FE E2 FC F0 BC A1 AC CE ED ED F6 E4 F4 F3 E1 F7 E9 BB A5 B9 DD F0 F2 F3 F7 F0 E4 F8 F9 F9 DD F1 AD 99 87 9C 9E C2 AE 84 8C 82 8E 82 83 A5 8D 8B 9B 95 9B 9C DE AC 8C 92 86 B1 99 9F 97 99 97 90 EA 9E 9B 8B A7 A1 AD A3 A1 A6 E0 92 B6 A8 B0 E5 8F 88 9A B0 B0 BE B2 BE B7 F3 96 A4 A2 A2 A6 B0 59 69 41 47 4F 41 4F 48 02 76 73 65 72 0A 69 05 7C 4E 4C 4C 4C 5A 4F 15 1F 1A 18 1C 4A 13 1D 15 76 2B 28 75 2E 4C 63 78 6C 77 20 3C 26 27 78 25 4E 74 6C 78 72 3F 70 78 64 76 7C 62 36 2A 34 43 0F 19 1B 00 01 01 3F 08 10 0A 01 0D 0F 1D 01 17 40 5B 1E 18 17 13 5C 09 1D 53 02 14 05 03 1B 07 2F 6B 21 3D 2B 22 62 3E 27 37 34 28 28 20 37 31 33 38 33 2A 1F 0A 18 72 11 12 14 10 03 13 7B 16 E2 ED E9 FC EA 80 E6 FD FB E2 F5 E5 89 ED F4 FC 9A 93 EF FC FB F4 F9 F3 F6 9A F1 E4 F2 98 FC FE CE CA DD CD A1 C1 D6 C9 C3 D6 C4 AE D5 C0 C0 C4 CF DF B7 CC CD DB DD C8 D6 BC C5 C2 D2 B7 BC C2 AF AE A3 AC A0 AB C5 AE A3 A7 CF A2 AE A1 A7 A4 BE D4 B0 B2 BA BC BD B9 DD B9 A0 A8 B5 B6 B0 DA 99 8C 8C 8A 86 89 E3 85 89 87 83 89 80 E8 8E 95 83 98 90 9F F1 85 9D 8F 97 86 82 FE 97 82 90 90 7F 79 07 6A 6F 6B 69 78 70 0C 63 69 60 62 71 77 15 78 62 72 7B 6A 6E 12 76 78 7B 74 63 65 1B 72 48 5B 4D 5C 5C 20 44 46 46 46 55 53 29 4F 51 43 5F 4E 4A 36 54 4F 45 58 47 41 3F 5C 4E 59 51 40 38 44 26 26 25 2A 39 3F 4D 2D 3A 25 23 32 36 4A 2A 37 36 3C 2B 2D 53 2F 3D 3D 35 24 24 58 26 20 08 0E 1D 1B 61 1C 09 06 07 16 12 6E 15 00 00 00 0F 09 77 0D 0C 06 19 08 00 7C 05 02 12 12 01 07 85 FE FB ED 8E 87 FB E8 E7 E8 E5 EF E2 8E E1 F0 E8 94 E2 F8 EC F8 FE ED 9D F2 E5 F5 F1 F5 E4 9A C9 CA CC CE CC DF A3 CE CA C5 C7 C3 D6 A8 C7 DF D1 DC DA C9 B1 DB D7 D6 D5 D1 C0 BE DE DC D0 D2 A8 BB C7 A1 BB A9 AB AF B2 CC AA B1 BF A0 A6 B5 D5 B6 A0 B7 B9 BD AC D2 BC BC BB B6 B4 A7 DB BB 90 8F 8F 8B 9E E0 9C 81 8C 84 82 91 E9 94 81 8E 9D 99 88 F6 8D 98 98 9A 90 83 FF 85 84 8E 93 97 7A 04 7D 7A 6A 68 6E 7D 0D 76 73 65 06 0F 73 60 7F 70 7D 77 7A 16 7B 7F 62 1C 6A 70 64 7F 7F 71 25 41 58 50 40 40 47 22 51 46 4B 4F 5C 43 2B 46 5B 5F 56 43 5A 30 5F 55 54 5D 4A 55 39 5F 5F 51 24 31 2C 46 24 3F 35 23 38 27 4F 32 21 23 2A 3F 3E 54 2D 2A 3A 2C 3B 39 5D 30 38 37 25 30 30 5A 02 00 0C 1A 09 0B 63 07 12 1A 14 13 1F 68 0E 15 03 0E 0B 1D 71 1C 1D 19 07 00 14 7E 15 1F 12 00 F9 EF 87 EA E6 E9 8C 85 F5 E6 E5 EA E3 E9 E0 8C EF E8 FC 96 FD F1 F4 E8 E1 F7 9F F2 EC FC E1 E6 CE A4 CC C2 C5 DA DF C9 AD CB CB C5 D3 D4 C0 AA D3 D5 CA CC CD DB B3 D5 C7 D5 C5 C2 D2 B8 DD D9 B9 BE BB AD C1 A5 BC B4 B7 B0 A4 CE AC B7 BD C5 D2 AC BD BC B5 BA B2 B9 DB A6 A3 B5 D9 BA AC BB 9F 98 8C E6 80 80 87 98 91 87 EF 91 8A 89 91 96 9E F4 8A 96 90 8A 8F 99 FD 81 85 93 83 84 90 FA 79 6A 7A 7C 7D 6B 03 7E 67 68 75 72 62 08 77 62 7E 6E 6B 7D 11 6B 74 7F 67 60 74 1E 62 65 6D 60 59 4F 27 53 4F 5D 56 4C 50 2C 4A 51 5F 40 48 41 35 58 56 51 4D 53 4A 32 51 5D 58 56 59 5B 50 3A 2B 3E 2C 2E 21 23 28 42 21 22 24 26 29 2B 20 4A 39 33 3E 3E 31 33 38 52 37 26 22 36 39 3B 30 5A 0D 09 18 0E 01 03 08 62 0A 08 04 06 09 0B 00 6A 10 0B 01 1E 11 13 18 72 1C 09 14 16 19 1B 10 7A F9 EC EC EE E1 E3 E8 82 F1 EA EC F7 E3 F5 F7 EC F6 ED FD EB 91 FE E9 F9 E1 FA FC E7 F3 E5 9B F6 CB CF DB C0 C2 D9 C9 DF AD C0 C8 C7 D5 CE C8 D3 DF C9 B7 DC CB CD CF D4 DE C5 D5 C3 B9 D0 D6 C5 B9 A2 A4 BF AB BD C3 A5 A9 A7 B3 A8 AA B1 A1 B7 D5 B1 A8 A0 AD B6 B0 AB B7 A1 DF BF AC B3 A7 BC 86 9D 8D 9B E1 9C 8B 89 9A 82 87 EE 87 92 80 9D 9B 9C F7 8C 8D 9B 84 9C 87 FC 91 84 92 8F 95 80 05 6E 7D 7B 76 6E 79 02 77 70 64 79 76 63 0B 70 69 7F 60 69 6A 10 69 6E 76 72 65 62 04 07 04 74 5F 58 5C 5B 4F 43 45 4C 22 31 30 31 45 4F 4D 4B 5B 3B 59 2C 2E 5C 53 4D 42 56 42 54 45 47 27 20 2F 3E 3A 26 3E 2A 4C 58 52 26 35 32 32 3F 51 55 3C 29 39 4D 4E 39 2E 3C 3C 30 35 51 42 47 33 30 18 78 78 0E 0B 1D 01 0C 0C 1A 60 72 76 00 01 17 17 1A 16 00 7E 6C 6C 7D 7A 1E 19 1F 1F 7E 13 10 F8 E6 E9 E7 F7 8F 9F 9D 82 8B F7 E4 E3 EC E1 EB FE 92 F0 F2 F9 8C 8F F5 FD FD F7 91 FD F8 FA F2 AA B8 BB C1 C1 C1 CB AD C9 CC CE C6 A6 B2 B4 CC D4 DF D1 D8 BE AA AC D4 C6 D2 A4 A1 DC C7 DA A7 D8 DE A2 A8 BE AE A2 CD D0 D1 D5 AB A7 B7 A5 AB DA C9 CA CC DE D7 AB B8 B7 B8 B5 BF B2 DE BA B4 99 FA F8 F9 80 8A 88 FF F7 8D 85 95 8E 82 96 89 9B 95 9C 8A FE ED E9 8E 9B 9D 97 90 86 98 86 90 0A 18 18 7A 7E 6E 65 63 02 10 15 72 76 7F 11 15 0A 68 6D 70 0C 0F 6F 6A 77 00 00 62 61 7E 67 66 2A 39 38 5D 4F 46 5B 4C 4C 23 49 4F 42 42 5C 50 51 2A 28 29 4B 54 3C 2C 22 23 45 5A 36 26 24 4C 4A 2C 21 25 3A 3A 3F 5E 52 36 33 41 28 26 37 45 4B 4B 48 2C 2D 5F 2E 28 21 20 50 43 46 47 44 20 19 6B 1B 19 16 6F 79 7D 72 16 13 61 15 17 1C 65 6F 6B 68 79 76 12 15 13 1B 7A 05 02 76 03 11 16 E2 8B 99 99 9E FA FF 8D F6 E6 E3 E9 86 96 94 95 9A 93 F5 F0 F0 F6 95 E8 E1 93 E7 F0 FA FB 94 E6 DE AB BB B9 D9 CE C0 C1 A2 D0 D4 D3 C3 C2 D0 A5 A9 AB CF D8 D2 D3 BC CE C6 C1 D5 D4 C2 B7 A7 A5 CA C3 A5 A0 A0 A6 C5 BE AD BA A6 A3 B4 A2 AA B1 DA B8 AA AC BA BA DC B2 BB BF B3 BE A4 B9 B3 BA 86 8F 8F 86 82 8B EC E5 91 93 8F 95 EF 80 8B 89 9E FB F0 8A 8E 90 88 FD 9F 9A 9E 98 FF 90 9B 99 6E 0B 00 7A 7E 60 78 04 02 0B 77 64 63 6C 61 6B 7E 12 6B 70 72 69 79 6F 61 7A 7C 67 73 65 14 1D 59 5B 47 5D 27 5C 45 41 54 46 52 21 2E 54 54 4A 4E 3B 55 50 50 56 35 53 55 52 43 5F 57 43 41 47 2B 27 48 2E 2F 3C 3C 2C 2E 2F 21 25 2F 32 29 35 36 3A 2C 30 30 2A 31 2E 3D 2A 32 34 37 39 27 26 1F 0C 09 1B 1B 04 6C 0F 10 06 0E 15 66 6F 17 15 15 0F 71 0C 0D 7F 1F 0F 07 17 15 71 7E 04 04 1A FE 82 FD FA 8E EC FE F8 E6 E6 80 89 F5 F7 EB F1 93 9B 90 EE FB FA F7 F8 FC F7 99 E4 E5 97 FA F4 DE DE DA C8 C2 AF CB CC D1 A3 A8 D2 D6 C8 D0 AC CF C8 D7 D0 D2 CA D7 D2 DB DF C7 D4 C5 C3 B4 C1 AF B3 A9 BA CE A0 A5 A1 B5 AB A5 A0 B2 A4 AC AB CF CB C9 C9 AB AC B2 B2 A6 B6 C5 A4 A5 B9 BB A1 8F 89 9D 87 8A 9B 8E 82 8C 87 8A 91 88 85 8B 8B 9E 8E 93 9B 91 91 98 88 81 F3 E1 E1 8F F7 80 F8 64 64 7C 6C 7B 7C 0C 1F 7B 03 74 0C 68 68 70 60 6F 68 18 0C 67 1F 68 10 7C 7C 64 74 63 64 14 61 27 49 47 47 4A 5A 5F 49 4D 4F 4C 40 54 5F 46 51 35 4E 4B 5D 46 5A 48 32 47 40 54 49 54 59 3B 40 39 2F 30 25 2D 40 39 3E 26 3B 32 31 49 32 37 21 3B 0E 0B 0D 0C 1E 10 14 13 1D 50 35 19 1B 18 14 38 6B 3E 3A 60 6F 0F 2C 2C 22 24 28 27 29 64 01 35 37 34 38 2C 1E 29 2E 26 21 31 3D 3F 36 3A 75 EE C4 C4 C5 CF DD 8C DB D1 8D 80 F2 D1 CE D7 D6 9A FD CA D8 D0 DC FD C8 C1 C7 C2 D0 DA DE D5 DB AA CF E7 E5 E2 EE FE AD F4 F0 AE A1 CC E6 F4 E4 F4 FE EB FC BE C6 F9 F3 D3 E6 E3 E5 E4 F6 F8 FC 8B 85 C8 AD 81 83 80 8C 90 C3 96 92 C8 C7 AE 84 8A 9A 96 9C 8D 9A DC A4 97 9D D0 D9 A1 92 91 9E AF A5 AC E0 8F BA BF B9 B0 A2 AC A8 A7 A9 E4 81 B5 B7 B4 B8 AC FF AA AE FC F3 98 BE B8 B0 F4 9E 45 45 4F 09 6A 40 40 41 43 51 61 54 55 53 56 44 56 52 59 57 1E 7B 53 51 5E 52 42 11 40 44 1A 15 44 6E 7F 29 54 6A 6D 61 63 6D 64 21 42 68 68 69 7B 69 59 6C 6D 6B 6E 7C 7E 7A 71 7F 36 53 7B 79 06 0A 1A 49 18 1C 42 4D 31 0A 0E 06 07 17 0B 17 1F 5B 3C 16 12 13 1D 0F 33 06 03 05 04 16 18 1C 2B 25 68 0D 21 23 20 2C 30 63 36 32 68 67 11 16 7A 1F 37 35 32 3E 2E 1C 27 20 24 23 37 3B 3D 34 C4 8B EC C6 C2 C3 CD DF 82 D5 D3 8F 86 F2 F7 85 FE D4 D4 D5 DF CD 9C 95 E5 D6 D5 DA D3 D9 D0 9C C9 EA E6 E8 EA E6 ED E3 A2 C7 EF ED EA E6 F6 A5 EC E8 B6 B9 CD E8 F5 EE E1 B3 D6 E3 F7 F9 F7 D6 8B 85 89 8D 87 8E 82 CD A6 8C 8C 8D 87 95 C4 93 89 D5 D8 B1 91 91 9B DD B9 9C 9E 96 D6 B3 9B 99 A6 AA BA 8A AF A1 AD A9 AB A2 AE E1 82 A8 A8 A9 BB A9 F8 AF AD F1 FC 97 B3 A3 B1 BF B3 A4 B1 F5 73 4E 46 6A 4F 41 4D 49 4B 42 4E 01 62 48 48 49 5B 49 18 4F 4D 11 1C 6E 5B 5D 57 50 46 58 46 50 2A 4F 67 65 62 6E 7E 5E 75 6A 73 72 26 41 76 64 74 78 38 6F 6D 31 3C 55 7D 7D 77 31 5D 78 7A 72 4A 2F 07 05 02 0E 1E 3E 15 0A 13 12 46 21 16 04 14 18 58 0F 0D 51 5C 37 13 03 11 1F 13 04 11 55 13 2E 26 1A 39 26 3F 3E 62 05 32 20 28 24 64 33 29 75 78 0A 31 2A 28 35 72 12 36 23 3F 34 35 3B 8A F9 C9 C7 CA EA D9 DF CD 83 D6 D2 88 87 E5 D0 C9 CF CA D8 D2 D6 DD D3 92 F7 DF DD DA D6 C6 F0 FF F9 E7 A9 F8 FC A2 AD C1 E2 EE E0 E2 EE E5 EB BA DF F7 F5 F2 FE EE D8 E7 E1 FF B1 E0 E4 BA B5 B9 9C 81 9A 9D CF AA 9F 83 8D 83 A4 93 95 8B C5 8C 88 D6 D9 BD 85 99 9E 9A D3 BB 9E 84 82 9A 94 8F BE BA A6 EE B9 BF E3 E2 87 A1 AF AF B4 AC E5 91 A9 B7 B7 BB 9A A9 AF BD F3 A6 A2 F8 F7 96 A7 43 5F 41 5A 46 0F 7C 42 57 4D 44 64 53 55 4B 05 4C 48 16 19 76 50 52 5A 12 78 5F 5F 51 17 70 5A 66 67 69 7B 4B 7A 7E 62 22 75 73 2F 26 4F 71 6B 7D 7A 6A 70 7F 71 3C 5B 7D 61 79 7F 62 52 61 67 05 4B 1E 1A 40 4F 26 0C 12 02 0E 04 15 02 44 3C 1F 15 3D 0C 0C 10 5C 0B 01 5D 50 3C 13 0F 1D 16 2B 25 68 19 2B 3C 23 08 37 31 2F 61 30 34 6A 65 14 34 2A 2E 3B 38 35 3C 3C 73 1B 23 39 39 31 10 DF D9 C7 89 D8 DC 82 8D EC C6 D7 81 FC C2 C5 C9 DB D5 DC 99 FA D0 D0 D1 D3 C1 F5 C4 C4 D8 94 C3 F9 A5 A8 D9 E1 E3 E5 FE EA A3 DA ED E9 F3 FD C0 EF E9 F7 B9 E8 EC B2 BD C0 FC FD F0 F8 FE F5 FB CA A7 8D 9C AB 9A 9E 82 C2 95 93 CF C6 B5 91 96 89 92 99 97 DE AD 89 9F 9E 96 B5 84 84 98 D4 83 B9 E5 E8 9A B9 AA A8 A4 B1 AB E0 8A B4 A8 AA A4 9F AE AA B6 FE A9 AF F3 F2 80 B9 BF B1 B6 A4 BA 58 4E 08 6D 41 43 40 4C 50 66 55 53 49 07 52 56 14 1B 6C 4C 4C 54 55 4E 5A 13 7C 58 44 56 71 40 78 64 28 7F 7D 21 2C 58 51 23 44 6E 6A 6B 65 77 5F 6E 6A 76 3E 69 6F 33 32 46 43 31 52 78 78 79 0B 19 48 41 39 0A 09 06 07 0D 04 48 23 12 16 0A 5A 0D 0B 57 5E 2C 13 08 06 1B 50 30 10 05 1D 16 2B 25 68 1B 2F 21 28 0F 30 2A 34 28 35 2F 64 15 35 2E 36 3D 7E 29 2F 73 72 12 25 22 22 25 35 39 C3 CA C6 89 EA C0 C0 C1 C3 D1 E2 D3 CF D3 CD D6 D2 9B E8 D6 CB D1 D8 9D C4 C0 9E 91 F5 D6 DA D4 EE E2 E9 E7 AE CB E3 E1 EE E2 F2 C3 F4 EE F0 EC E9 F3 B8 C9 F1 EA F2 F9 B2 E5 E3 BF B6 C4 E3 FC 99 98 C8 AF 9C 8E 82 8E A0 91 89 95 8F 94 8C C5 AA 94 8D 97 9A DF 8A 8E DC D3 B3 8B 93 94 9C D5 81 A4 BA BC A0 AE 8E BF AB B7 A9 B2 AE E7 94 AA AF B5 BC F9 A8 AC F2 FD 96 B2 BE B8 A5 BF F4 9E 58 44 46 4C 6C 5D 45 59 4B 50 48 01 76 48 51 4B 5E 1B 4E 4A 10 1F 74 52 5C 54 10 7A 59 59 53 15 4E 64 64 65 6F 7D 4E 7F 6B 77 69 72 6E 27 54 6A 6F 75 7C 39 68 6C 32 3D 5A 66 7E 76 77 65 7D 74 04 4B 2E 06 1C 06 02 19 20 11 09 15 0F 14 0C 45 2A 14 0D 17 1A 5F 0A 0E 5C 53 3A 10 06 16 1A 10 39 2E 68 10 2B 21 0E 3F 2B 37 29 32 2E 67 14 2A 2F 35 3C 79 28 2C 72 7D 1F 36 28 38 35 36 3A 75 FA CE DB C6 EC DD C5 D9 CB D0 C8 81 F6 C8 D1 CB DE 9B CE CA 90 9F F2 D2 C0 C4 D5 D6 DF D6 DA 95 C1 F9 E7 E7 EB CD FE E4 F6 EA F3 E9 A6 D7 EB F0 F4 FF B8 EF ED B1 BC D3 F7 E4 B0 CB F3 F6 F8 F4 84 8F C8 AD 81 83 80 8C 90 A1 92 88 92 8E 97 8D DA AB 97 8C 90 9B DC 8B 81 DD D0 A1 99 9B 9D 86 A2 EB 92 A5 A1 BB B5 8F B0 AA B4 A8 B5 AF E4 95 B5 AE B6 BD FE A9 AF F3 F2 80 A7 B4 B2 BE A7 BD 0A 60 5A 46 40 4E 6E 5F 4B 57 49 52 4E 07 74 4A 4F 55 5C 19 48 4C 12 1D 61 5A 5E 56 57 47 5B 47 6F 2B 4C 66 62 63 6D 7F 40 71 69 75 6F 74 6C 25 4A 74 6D 77 7A 3F 6A 6E 3C 33 44 64 64 7C 7D 66 02 4B 24 00 1C 0E 2E 1F 0B 17 09 12 0E 47 34 0A 0F 15 1C 59 08 0C 52 5D 27 20 50 35 19 1B 18 14 38 09 3A 20 3A 26 3F 25 62 13 2F 34 28 23 64 33 29 75 78 0C 0D 7F 18 32 3E 3F 31 23 76 7F 03 30 CF C0 CD C7 CA 86 EE DF CB D7 C9 D2 CE 87 F4 CA CF D5 DC 99 C8 CC 92 9D E1 DC C5 C5 DE 97 F5 D3 F8 E2 EB E8 E0 AF DE EC EC E7 C8 EE E8 E0 A4 CE F5 F5 FF B9 DA F0 F0 F1 F3 E1 B0 E7 E5 B9 B4 DF 8B 9B 89 87 8B 9C 89 CD BB 86 8E AF 89 95 93 80 9D 92 99 97 DE B4 8E 92 9C 96 D0 87 85 D9 D4 A6 BD AE AC A0 BD A7 EC 86 B0 AC AE A0 88 A2 B3 E5 80 BE B9 B5 BF B1 B8 FD 96 BC BC BD B7 A5 F4 A3 59 05 08 6A 4F 41 4D 49 4B 42 4E 01 62 48 48 49 5B 49 76 5C 49 1F 66 58 53 5F 51 5F 52 17 70 5A 66 67 69 7B 2E 79 7F 23 22 50 77 68 75 74 24 43 68 7A 76 7A 50 7A 6B 3D 48 76 71 7D 77 79 70 35 2E 04 04 05 0F 1D 4C 1B 11 4D 40 29 09 09 03 45 31 14 16 1E 5E 3B 13 11 1E 12 02 3F 13 00 54 2F 2F 2A 24 28 20 2B 6C 09 2D 2F 2C 20 34 67 32 36 74 7B 12 38 2E 3E 32 38 21 36 70 08 33 39 1A 30 DD 8B F2 CC CF C3 CD C3 C6 83 E4 CE CA CB C5 D7 9A CD CB 97 9E EC D5 D3 D5 D2 C0 DE C4 D2 94 F1 E5 E7 E4 E8 FC C1 E9 FA A2 D9 E5 E0 EA E6 EA E1 BA DF F7 F5 F2 FE EE BD E4 E0 BE B1 C3 C4 B4 D1 85 87 84 88 9C BC 85 83 85 82 90 8E 94 82 C4 A1 95 97 94 98 8C DF 8A 8E DC D3 A3 86 9F 84 87 D5 8C B9 A9 A7 AD 9C A5 A3 A5 A2 B0 AE B4 A2 E4 81 B5 B7 B4 B8 AC FF AA AE FC F3 98 BE B8 B0 F4 9E 45 45 4F 09 6A 40 40 41 43 51 73 48 48 40 45 55 55 49 5D 19 7A 50 50 51 53 41 10 47 45 19 14 7F 6B 7B 69 67 6B 7C 69 2D 5B 66 6E 55 73 75 6F 6C 69 73 38 55 77 6D 7D 3D 64 60 3E 31 5C 76 64 74 04 0E 1B 0C 4E 36 09 03 37 30 40 25 09 0B 08 04 08 5B 0E 0A 50 5F 3F 1C 1C 12 14 18 17 19 54 31 25 27 24 28 3C 1A 1F 6D 06 2C 2C 2D 27 35 64 33 29 75 78 0A 29 36 2F 2E 72 15 22 30 38 34 01 06 8A EF C7 C5 C2 CE DE 8D D4 D0 8E 81 F5 D0 CD D6 C9 9B FE CB DF D1 DF 9D 9A E4 D5 D4 DD D2 DA D1 A3 DE DB A9 CA E0 E0 E1 E3 F1 A0 F7 F5 A9 A4 C6 F2 F2 F6 FC ED FA BC C4 E7 F2 FE C4 C5 B7 D0 FA 86 87 89 9B CE 99 9F C3 C2 A0 9A 84 85 8F C4 AE 95 89 8D 97 9F AA AF DD B6 9C 9C 9D 97 85 D4 83 B9 E5 E8 8D AF A1 A5 BE AA E3 8B B3 A9 A9 A1 90 89 FB 9C B6 B2 B3 BD AF F2 A5 A3 FF F6 9F BB BB 4D 0B 63 46 40 48 0C 69 4D 4F 4C 40 54 72 77 05 7E 54 54 55 5F 4D 1C 4B 41 1D 10 78 58 53 5D 54 64 2B 5A 7C 7E 6A 69 58 51 23 44 6E 6A 6B 65 77 3A 6D 6B 37 3E 57 69 73 75 72 62 78 77 79 34 53 05 19 01 07 1A 3A 3F 4D 26 0C 0C 0D 07 15 44 13 09 55 58 30 0D 0D 1D 18 1E 1A 50 3F 13 00 54 26 22 2E 39 2C 22 1A 1F 6D 06 2C 2C 2D 27 35 64 33 29 75 78 13 3F 2F 3D 33 37 20 35 71 0F 32 3A 00 F9 8B EC C6 C2 C3 CD DF 82 D5 D3 8F 86 ED C5 D5 DB D5 DD CA DB 9F E5 D8 DC 93 98 E6 D3 D2 DF D0 E4 EF A1 DC DD AF C8 E2 EE EF E1 F3 A6 F1 F7 AB BA D6 FD E1 F7 FC FD F3 B2 C3 F5 E2 F9 C2 C7 B5 AE 84 84 85 8F 9D CC 9B 91 CD C0 AF 89 95 93 80 9D 92 99 97 DE B4 8E 92 9C 96 A5 A2 D6 B3 9B 99 A6 AA BA E9 B8 BC E2 ED 92 AC AC A8 B5 AF E4 9F B6 B4 AC A0 8B AC FC 99 BD BF BC B0 A4 F7 A2 A6 04 0B 7A 46 43 4E 42 44 43 4D 00 6D 43 52 71 76 1A 7F 57 55 52 5E 4E 1D 44 40 1E 11 64 42 47 46 63 6A 66 29 5C 7A 6E 61 67 56 53 21 42 68 68 69 7B 69 38 6F 6D 31 3C 4E 73 66 74 78 36 56 66 74 08 02 09 07 4E 3D 05 14 03 0F 35 32 46 23 0B 09 16 1A 0A 59 08 0C 52 5D 21 04 15 15 1F 04 1C 55 01 39 27 27 2F 1A 1F 6D 06 2C 2C 2D 27 35 64 33 29 75 78 0A 37 31 3B 3C 22 3C 22 34 76 13 3B 39 C6 CA DA FC FD 8F E8 C2 CE CF C1 D3 86 D1 D7 8B 9A EF D0 D8 D7 9F FE DC DA C7 E5 E2 96 F3 DB D9 E6 EA FA A9 F8 FC A2 AD D6 F6 F2 EA EF F4 EC A5 D6 F2 EA F8 CB CC BC D9 FD FF FC F0 E4 B7 E2 E6 C4 CB BB 86 9B 9B 84 CD A3 85 92 88 85 86 8A C5 A8 9A 96 9D AD 90 89 89 9A D3 B1 97 84 9E 97 94 A4 EB 9A A8 A0 AB EC BB B1 ED E0 8B A7 B7 A5 AB BF A8 BD F9 87 BA B2 9A BD BF B4 F1 A0 A4 FA F5 69 43 41 47 4B 5C 49 0D 7B 56 41 4F 75 4E 48 53 5F 49 18 4F 4D 11 1C 7E 5A 5A 5E 54 45 52 14 6C 7F 6A 66 4E 61 63 68 2D 74 70 2E 21 47 72 77 71 68 7A 74 70 7F 71 3C 59 7D 7F 7C 70 64 50 7B 79 0E 4B 1E 1A 40 4F 2F 0C 0C 02 04 08 07 09 44 21 15 17 14 18 0C 38 13 11 16 53 06 02 58 57 27 02 23 38 3B 69 08 3D 2D 23 21 04 2F 2D 22 67 32 36 74 7B 1D 2C 2C 30 1B 32 3E 37 70 27 25 79 74 17 D8 C2 DC C0 DD C7 8C FD CD D6 CE C5 E1 C8 C8 C1 9A CD CB 97 9E F7 D3 D3 D5 93 FB DE D8 D0 94 F1 E5 E7 E4 E8 FC C8 E3 E1 E6 A3 F6 F2 A8 A7 CE E4 EA FA F6 FC ED FA BC C4 F7 FD D7 FE FA F3 B4 E3 99 C5 C8 A7 8B 98 CC B7 87 82 8C 80 88 83 C4 A1 95 97 94 98 8C B8 93 91 96 D3 86 82 D8 D7 A7 9C A4 AC A9 B9 A1 BD A9 ED 86 AC AC AD A7 B5 83 AA B6 BF F8 AF AD F1 FC 8E BB BF A6 B4 A4 84 BD B9 5C 4E 5A 09 58 5C 02 0D 63 56 53 55 54 46 48 4C 5B 55 18 7D 51 53 50 5C 40 60 59 5D 40 52 46 15 7C 78 26 29 4D 6E 62 6C 66 6A 61 6F 26 43 6B 69 76 7A 6A 4A 77 73 6A 78 60 33 66 62 38 37 52 67 0B 05 0B 3A 07 03 1A 08 10 43 16 12 48 47 21 10 08 14 2B 10 12 09 19 0F 52 05 03 5F 56 27 1B 00 24 2F 1B 20 22 39 29 3F 62 35 33 6F 66 0F 2B 2B 3D 7B 13 36 30 38 7C 19 3D 3F 3C 30 24 04 3D 39 DC CE DA 89 D8 DC 82 8D E8 C2 D0 C0 C8 C2 D7 C0 9A E2 DD D7 ED D6 D0 CB D7 C1 90 C7 C5 99 94 FB EF FC A8 D3 EB EE E0 EC EC E7 A0 C5 E9 EB E8 E4 E8 C8 F1 F5 E8 FA EE BD E4 E0 BE B1 C5 FE FA F2 8B 9B 87 9B 8B CF A8 82 8E 8F 81 93 B5 97 8B 91 DA A8 91 95 88 9A 8E AE 82 9C 84 D1 B1 98 98 91 99 BB A7 BD EE 9F AD A1 AE A2 A4 A8 B3 AA 97 B5 B5 AF F8 89 B2 BE A8 B4 BC A6 BD 82 F0 87 FB 94 79 73 08 40 40 4B 49 55 02 4C 46 01 67 52 57 51 48 5A 54 50 5F 51 1C 51 5B 40 44 54 52 17 47 5D 6B 79 6D 7A 4F 5C 54 2D 51 53 49 21 34 37 34 25 5F 6A 6D 70 6A 66 3C 54 7C 77 75 69 36 54 52 51 4A 28 07 07 1A 1D 0D 0E 16 20 08 08 08 06 44 24 4F 4B 58 10 10 1B 19 05 52 1C 16 51 35 1F 1D 1B 2F 38 2D 69 22 26 3F 39 27 27 60 32 2E 26 36 20 29 18 37 29 2E 3A 2E 7D 1B 3D 34 34 2E 1E 16 10 F2 8B 9B 9C 8E C6 C2 C9 C7 DB 80 CE C0 87 F7 D5 DB D5 D1 CA D6 9F D0 D4 C1 C7 D5 D5 96 C4 DC D4 F8 EE FB DA DA C0 D4 D5 B7 B3 C5 A1 C3 F6 F1 EC EE E2 B8 D0 F0 FB F9 E5 B2 D0 D6 D5 B6 D4 FB FB 9E 99 89 8A 9A AA 99 9F 8D C3 B3 95 89 9F 9C C5 CF CB D8 90 90 9B 99 85 D2 9C 96 D1 B3 82 86 9A BA AE A9 A7 EE A3 A5 BE B6 A6 A4 E1 B5 AF A5 B7 BF A8 9B 98 9D FF E8 ED F2 BA BE B5 B3 AF F4 BA 4C 0B 6E 5B 4B 41 4F 45 02 4F 49 52 52 42 40 05 49 53 59 4B 5B 4C 7F 7C 71 13 04 01 16 72 45 40 63 7F 71 29 47 61 68 68 7A 23 43 47 42 27 47 6A 74 6F 6A 78 7D 6B 58 5C 4A 33 79 7F 72 72 6C 35 05 0D 48 2E 0B 1D 01 0C 0C 43 0C 08 15 13 01 01 5A 08 10 18 0C 1A 0F 39 33 2B 50 42 46 57 31 04 3F 22 3C 30 6E 06 22 29 27 3B 60 02 00 03 64 06 35 35 2C 2B 3F 3C 28 19 13 0B 70 62 66 77 11 24 DF C2 DC D0 8E E6 C2 C9 C7 DB 80 EC CF C9 CD 85 F9 FD FC 99 FD D0 D2 C9 C0 D2 D3 C5 F2 F6 EC 95 B9 BB A8 CC FF FA E5 F9 FB A3 C9 EF E2 E2 FC A5 D9 DD DC B9 DD F0 F2 E9 E0 F2 F3 E5 B6 BF C3 F0 8F 80 8D 87 8A C6 A4 8C 8C 84 C0 B2 83 89 83 C5 93 95 9C 9C 86 DF 93 9B D2 BB 9F 9F 91 D7 BF 9A A4 AC E8 A5 A7 BC B8 A8 A6 E3 B3 A9 A7 B5 A1 B6 92 BA B6 BE FE 8C B9 B3 B5 F3 B9 BF B2 B2 AC F5 45 4D 08 61 41 41 4B 0D 69 4C 4E 46 06 4B 4D 56 4E 5E 5C 19 4D 57 5D 4F 57 40 10 72 70 73 7C 54 64 6C 28 5A 6B 61 6B 2D 47 72 75 68 72 7E 24 4C 74 7F 7D 61 3E 5C 5A 59 32 50 7F 7F 62 65 75 76 1E 22 06 0D 07 0E 4C 58 52 43 09 0F 02 02 1C 45 15 1D 58 30 10 1B 15 1C 1C 53 1C 18 05 03 11 11 6A 38 20 28 3C 2A 3F 0B 16 10 05 61 0B 0E 06 65 33 35 3C 3C 26 7F 33 3B 72 1A 24 30 3A 3E 35 3B 8A C7 C1 DA DA CA C8 8D D1 CB C1 D3 C3 D4 EA CC D1 D0 DD D0 9E 8D 8E 88 92 DA DE D5 D3 CF 94 DA EC AB C2 E8 FE EE E2 E8 F1 E6 A0 ED EF F4 F0 E0 FE BB EB F1 FF ED F9 EE DC FA FB FA F3 FE B4 A7 D8 DE C8 AC 9F 9A 85 99 9B C3 A9 8F 82 82 9C C5 B9 BD BC D9 BD 90 92 89 80 92 93 85 B8 9E 9F 9E AF A2 E8 FB FC FA EC 88 B3 B6 A9 B5 BF E7 8D AB BE BE A0 F9 9D 99 98 FD 91 BC BE A5 A4 B6 B7 A1 0A 03 7F 4C 4B 44 49 43 46 0A 74 64 65 6F 04 14 0A 0B 18 50 50 5B 59 45 12 5C 56 11 63 64 14 59 63 78 7C 6C 6A 2F 7F 65 63 71 65 72 48 62 60 60 68 77 79 77 7A 3F 2E 28 32 50 71 62 7E 37 5D 7B 0E 0E 10 28 2B 37 4C 04 0C 07 05 19 46 08 02 45 32 14 14 15 1F 11 18 5A 01 53 1C 18 05 03 11 11 6A 38 20 28 3C 2A 3F 6D 01 05 04 08 28 23 21 3D 7A 34 3E 79 2A 30 2C 7D 01 14 08 71 25 3F 35 27 CF D8 88 EA E8 EB E5 EF E7 FB 80 92 93 87 E1 D4 CF D2 CC C0 9E F6 D2 D9 D7 CB 90 F2 F0 F3 94 F6 E5 E5 FC FB EF EC F8 DE A4 D3 A0 B4 B6 B7 A4 EC F4 FF FD E1 BE F0 FA BD C7 C0 B0 FD FF E4 E0 F0 8E CB 9B 81 8F 9D 89 9E B1 94 89 92 95 C7 A9 84 88 90 9D 8D DE B6 92 99 97 8B D0 9E 90 D7 A7 82 A3 B8 BB E9 A2 A6 BF B9 A7 A7 E0 B2 AE A6 B6 A0 A9 94 95 81 FE 8C A8 B2 B1 B8 B8 BE BA BA F4 E6 1A 0B 61 47 4A 4A 54 7E 6F 6A 00 67 53 53 51 57 5F 48 18 7A 78 7B 68 5C 5B 44 51 5F 16 5E 5A 51 6F 73 28 66 68 2F 58 6C 6B 74 61 6F 63 74 61 25 76 72 6B 6D 7B 7B 3C 6E 7A 72 62 74 65 51 40 46 2F 4B 59 59 5E 4F 05 03 06 06 18 41 09 01 44 30 31 5B 14 10 0D 0B 19 19 52 00 18 10 04 12 07 33 1E 18 0D 69 7F 7F 7C 6D 07 32 35 28 32 3E 64 0C 34 3F 3D 21 7E 1C 1A 19 72 10 3F 3F 22 25 35 36 DE E7 C7 C7 C9 8F EB C4 CE D7 80 E7 D3 D3 D1 D7 DF C8 98 FA F8 FB F5 D3 D6 D6 C8 91 D9 D1 94 C1 E5 FB A8 BA BE AF FF E5 E3 F1 E5 F2 A6 E8 EA A5 CD FA F4 F5 BE CC E8 EF F7 F6 E4 DF D7 C4 D0 D4 BB CB D9 D9 DE CF 85 83 86 86 98 C1 89 81 C4 B0 A9 DB 94 90 8D 8B 99 99 D2 80 98 90 84 92 87 D5 89 8D 8C 9B BB BC BF A8 AE AF E0 F3 F6 F7 F4 E5 93 B5 BC BC A6 FF 91 B4 BC BA F0 97 A3 A3 A1 A7 4F 58 08 6A 68 6B 7F 0B 72 03 15 11 16 07 61 54 4F 52 4C 40 1E 76 52 59 57 4B 10 72 70 73 14 76 65 65 7C 7B 6F 6C 78 5E 24 53 20 34 36 37 24 40 6B 6E 71 6D 67 3F 55 73 76 76 68 31 5B 7E 7A 7C 4A 28 2E 2D 4E 2C 03 03 16 11 01 02 12 29 05 16 1E 1A 09 59 4F 4F 4C 5D 37 02 05 18 02 0E 54 3C 24 2F 2D 31 6E 0C 0A 09 62 00 2F 2F 32 35 25 26 2E 15 39 2A 3A 3E 2D 7D 63 63 60 71 13 26 21 3C DE D2 88 E0 C0 CB C9 D5 82 EE C9 CF CF 87 E7 E3 FE 9B FB D6 D0 CB CE DC D1 C7 F9 DF D2 D2 CC 95 E5 ED A8 FD E6 EA AC F9 ED F3 A0 F2 EE E6 F6 E0 E9 BB F7 F7 BE C8 FD F1 FE B3 C3 E5 E4 F2 F1 E1 CA A8 AE AD AA 80 9B CD A8 8C 8E 84 95 C7 D7 D5 DA BE 89 8C 97 8B 85 DD BB 9D 94 94 8E D7 B7 B3 8E EB 8B A6 A0 BB BE AC A1 B7 84 AE B1 E7 8E AA B4 BE AB F9 ED EF FC 98 A3 A6 B9 A5 AF F7 9D BB 4E 4E 50 09 63 46 42 44 02 60 66 65 06 64 4B 4B 4E 49 59 5A 4A 6C 53 44 50 56 51 5F 75 45 41 51 6F 2B 47 60 62 2F 24 4F 70 66 6E 75 2F 44 6B 77 74 3B 7E 6C 6A 6A 6E 78 61 33 53 57 52 50 7B 79 0E 4B 3B 19 01 1B 2B 02 0E 07 40 32 16 08 10 45 3C 23 58 3A 11 11 08 0F 13 10 04 36 19 1B 10 55 19 3B 27 3D 6E 02 25 23 2B 63 06 19 66 04 2B 2B 2E 29 39 3A 2A 18 33 31 36 73 03 21 39 23 74 13 F2 8B EB C6 C0 DB DE CC C1 D7 80 89 F1 C2 C1 CE DF D5 DC 90 ED D6 D0 CB D7 C1 90 E2 C6 D8 C0 E6 E3 E7 FE EC FC AF DF FD ED F7 A0 C7 DE A7 C7 EA F4 EF EA F8 FD EB CF F4 FE E5 F5 E3 B6 C4 E4 FA 9E CB A5 80 80 86 CC AB BA C3 A3 8E 88 93 96 84 99 8F AB 89 91 8B DC B3 93 87 85 83 97 9B D4 B2 AB B8 86 A8 BA BA BE AC AE E3 87 A0 B5 E7 A2 B0 AE AE AA BC AD FF 9F 9B 96 83 B1 BD BA B6 B0 BC 5F 46 08 5F 5D 01 0C 78 71 03 64 4E 4A 4B 45 57 6A 57 59 4D 57 51 49 50 12 45 43 1F 16 62 67 15 4E 64 64 65 6F 7D 5F 62 7B 61 65 60 68 74 24 63 6F 6F 6D 6B 7B 6C 3C 5E 54 57 43 64 71 76 66 35 0C 1E 1C 1C 1C 0A 1F 4D 21 25 24 34 2D 47 26 17 1F 15 0C 59 2D 0F 13 09 52 35 28 51 35 18 1A 01 38 2A 2B 3D 1B 1C 6C 0E 30 36 24 24 66 14 34 2A 2E 7B 1E 01 7E 1C 33 33 26 21 31 32 22 02 07 75 E9 D9 DD CD CB 8F FF DD CD D7 80 E7 FE 87 E7 CA D4 CF CA D8 DD CB 9C 95 E5 D6 D5 DA D3 D9 D0 9C DF D8 A8 C7 EF FB F9 FF E3 EF A0 C6 E7 F4 A4 D6 EA F4 EC B9 D8 C7 BC DE FD FD E4 E3 F7 F4 E0 C6 9A 84 9C C9 BB BC CC AE 90 96 84 84 C6 A8 8D 89 A9 8B 97 8D DE AA B7 DD B1 81 85 95 93 D7 BB 9C A6 88 BA BC AA AA EC 82 AB AF E0 E9 91 93 8D EC 8D B3 BD B8 AA FF BA A8 A6 A6 A2 B4 A5 F7 97 93 6E 68 40 40 40 4E 0C 6C 17 13 00 68 48 43 41 5D 6F 68 18 08 0E 1F 65 58 53 41 43 11 62 45 51 54 79 7E 7A 70 2E 41 63 79 67 56 53 21 33 27 5D 60 7B 69 6B 39 4A 6D 79 7C 61 66 62 68 36 59 7B 61 0F 2E 1D 1B 01 4F 2E 18 0C 07 35 32 46 54 54 45 23 1E 19 0B 0D 5F 28 0F 17 12 03 04 04 0E 54 37 25 25 2C 3A 04 2E 3C 2C 2C 63 14 33 23 26 37 30 28 22 78 17 31 2B 39 08 19 73 04 23 33 36 27 20 D8 D2 88 E7 C1 DB C9 F9 C7 CD 8D D8 C3 C6 D6 85 EF 95 EB 97 9E EB CE D8 D3 C0 C5 C3 CF 97 FA DA FE EE A8 CA C8 CB D8 FA ED AE F9 E4 E7 F5 A4 D0 B4 C8 B6 B9 CA ED F9 FC E1 E6 E2 E8 B6 D9 FB E1 8F CB AB AF AA A9 85 9B 87 CE 99 84 87 95 C4 B0 D4 A8 D6 D9 AA 8D 99 9C 81 86 82 88 D6 B9 9B 81 AF EB 8B 8F 8A 9A E2 9E EC E3 94 B3 A3 A6 B7 B0 A8 A2 F8 9B B1 B1 B8 FD 91 95 94 84 85 F7 90 BA 46 47 49 5B 0E 66 42 49 47 5B 62 48 52 44 4B 4C 54 1B 4E 4A 1E 6A 6F 1D 76 5C 5C 5D 57 45 71 41 62 6E 7A 6C 7B 62 2C 7B 71 23 55 52 26 43 6B 69 76 7A 6A 5B 77 6B 72 72 66 76 30 67 65 37 41 46 4A 2F 07 05 02 0E 1E 21 07 15 09 00 14 47 12 16 5A 2E 2B 59 3A 10 10 11 13 01 22 18 06 07 18 10 6A 6B 3E 3A 6E 1A 1F 6D 06 2C 2C 2D 27 35 6A 65 1F 29 2A 36 2C 7F 2B 35 3B 3F 35 71 26 3E 3A 32 C3 C5 CF 89 C6 C0 DF D9 98 83 F6 C4 C8 C3 CB D7 F7 DA D6 D8 D9 DA CE 87 92 DA DE D8 C2 DE D5 D9 E3 F1 E9 FD E7 E0 E2 A3 AC AD D6 E4 E8 E3 EB F7 CC FE F6 FD F1 ED D1 FC FC F2 F7 F4 E4 AD B4 F3 8B 82 84 C9 9A 80 CC 81 8D 82 84 C1 B0 82 8A 81 95 89 D8 8D 87 8F 99 D3 D2 BA 9E 98 82 9E 95 99 A3 B1 A9 BD A7 A0 A2 ED B1 A8 A9 B1 B6 A2 A0 EB 8C BE B6 BD B1 AD 91 BC BC B2 B7 B4 A4 ED F4 F5 5C 4E 46 4D 41 5D 0C 44 56 46 4D 52 06 50 45 56 1A 5D 57 4C 50 5B 7B 58 46 65 55 5F 52 58 46 78 6F 7F 69 4D 6F 7B 6D 5B 67 6D 64 6E 74 4A 65 6B 7B 7C 7D 6B 24 3F 6A 78 7C 77 7F 63 36 7A 71 61 0B 0F 09 1D 0F 4F 05 1E 42 0D 0F 15 46 04 0B 17 08 1E 1B 0D 50 5F 28 04 02 16 50 4C 56 21 11 1B 2E 24 3A 04 2F 21 2D 2A 27 31 7A 61 30 22 2A 21 35 29 78 30 2D 7F 3D 31 20 36 31 35 2F 77 35 31 CE CE CC 89 DA C0 8C CE C3 C0 C8 C4 88 87 EA C4 D7 DE 98 84 9E 9F CA D8 DC D7 DF C3 96 C0 D5 C6 AA E2 E6 E0 FA E6 ED E1 EB F9 E5 E5 A6 F4 F1 E6 F9 FE EB EA F8 EA F0 F1 EB B3 BD B1 F0 F6 FD F9 CA 9F 87 C9 9C 8A 98 9F 8B 86 96 84 C6 8E 8A 83 95 DB 99 9B 91 8A 88 DD 84 96 9E 95 99 85 A2 90 A4 AF A7 BB 83 AE A2 AC A5 A6 B2 FB E6 AE AA AC AE B2 B9 B5 B7 A5 B9 B9 F2 A0 A5 B2 B5 B2 A7 A6 4C 5E 44 45 57 63 45 40 4B 57 70 44 54 4E 4B 41 1A 06 18 15 1E 69 5D 51 47 56 10 0C 16 1B 14 7C 64 7F 6D 7B 78 6E 60 2D 3F 23 2C 21 54 62 75 70 7F 68 6C 4D 67 6F 79 6E 32 2E 30 59 7F 64 60 7A 18 12 48 1B 0B 1E 19 08 11 17 40 3A 0F 03 59 38 40 5B 2A 1C 0A 0D 15 18 04 1A 1E 16 56 13 15 01 2B 6B 2E 3B 21 22 6C 2E 23 20 28 24 68 69 6A 18 60 7B 0A 3C 2A 2D 35 38 24 3A 3E 36 76 33 35 21 CB 8B CE DB C1 C2 8C CE C3 C0 C8 C4 86 C1 CD CB D3 C8 D0 DC DA 91 9C E6 FB C7 D5 DC C5 97 D7 DA FF E5 FC B3 AE D2 D1 B7 A2 CF EF E0 E2 EE EA E2 BA FF F9 ED FF BF FA EF FD FE B0 E2 F3 E5 E2 F0 98 C5 C6 C7 B3 D5 CC A1 8D 82 84 88 88 80 C4 81 9B 8F 99 D9 98 8D 93 90 D2 80 95 83 80 92 86 D5 AC A2 A6 A0 BD A7 A9 A9 EC E3 9B 88 B2 A2 A9 B6 FA B8 B7 AC B0 AB E6 FD 87 BD A3 A4 A6 A7 BB A7 5E 4E 4C 09 4F 48 4B 5F 47 44 41 55 4F 48 4A 1F 1A 1B 59 5E 59 4D 59 5A 53 47 59 5E 58 17 5A 5A 7E 2B 7B 7C 7E 7F 63 7F 76 66 64 45 35 46 30 30 2C 58 2A 2E 29 5C 28 5E 23 22 23 26 21 25 26 50 5C 5D 2A 5A 5C 5B 29 2E 57 21 57 59 22 21 26 27 3B 4D 4A 4C 4E 4F 48 49 30 46 40 40 37 40 4C 44 0B 08 0D 08 7C 0E 79 7E 72 77 01 07 71 77 02 7D 69 6C 6A 6F 6E 1D 6B 6A 67 12 68 1C 37 3E 3A 11 CF CD C9 DC C2 DB FF C8 D1 D0 C9 CE C8 D4 E7 CA D4 CF D9 D0 D0 DA CE F0 D7 C0 C3 D0 D1 D2 F5 C6 F9 EE FC C0 EA C8 FE E2 F7 F3 C9 EF E0 E8 D7 EA E8 EF D1 F7 FA FA E4 D3 F3 FE F5 DA F3 EE C0 FA 85 87 BC 80 9E A4 89 94 A6 82 94 80 B2 9E 94 80 BC 94 8A 94 9F 8B 95 93 95 A7 89 81 93 B4 81 86 BE A4 A5 88 BD BC A9 B9 8B 87 96 A8 B5 AE A6 A9 BF 92 AB 95 B7 B1 B7 94 B6 F3 ED F1 FA F7 93 A7 45 5E 58 09 13 0F 00 0D 74 4A 53 48 44 4B 41 05 07 1B 14 19 76 56 58 59 57 5D 10 0C 16 60 55 5C 7E 62 66 6E 2E 69 63 7F 22 70 74 60 74 73 24 71 73 76 7D 5A 71 73 70 78 71 67 30 78 62 72 79 66 4A 1F 07 49 0C 1A 0A 0B 07 11 40 32 07 11 01 01 5A 5B 11 0D 1B 12 0F 53 0A 20 09 1C 14 18 18 36 25 2E 2E 2F 27 2C 25 28 2C 37 14 33 27 23 21 17 3B 2F 31 36 0F 2A 3D 33 26 3A 24 28 04 3E 27 3E F8 C2 DB C2 8E DF C9 DF C1 C6 CE D5 EF C9 C7 CA D7 D2 D6 DE 9E DE CE DA C7 DE D5 DF C2 97 DC D4 F9 AB FF FB E1 E1 EB AD F6 FA F0 E4 A8 A7 C1 FD EA FE FB ED FB FB BC BA B5 B3 E4 E8 E6 F2 DC FA 86 82 8C 88 97 A6 82 8B 8D A7 81 95 83 B4 81 96 89 92 97 97 B1 8F 99 93 A6 9A 9D 94 A2 8E 84 90 83 B8 98 BB A7 A2 AD BF BB 80 AC AE B5 A2 90 AC B7 BE 8B BC AD AC B5 B2 BC A0 94 B0 AF A4 90 B4 53 64 4E 7E 4B 4A 47 6E 47 51 54 40 4F 49 60 44 4E 5E 4B 7B 4B 4C 55 53 57 40 43 7E 54 5D 51 56 7E 42 66 6F 61 4E 6F 6E 6D 76 6E 75 52 7E 74 60 3A 75 77 6D 3E 6C 69 6D 62 7C 62 65 73 73 50 70 19 08 1A 00 1E 1B 05 02 0C 59 40 41 5D 24 05 0B 1A 0F 58 1F 17 11 18 5D 1E 1A 03 05 56 00 1D 01 22 6B 3B 39 2B 2C 25 2B 2B 26 24 61 28 26 29 20 7A 66 78 3F 2A 2F 72 2C 27 32 3E 25 39 20 31 27 84 C2 C6 CB CF CC C7 D8 D2 D0 CD C0 C8 C6 C3 C0 C8 FE D5 FF C8 D1 D4 FC F5 80 D3 C8 D9 CD D5 8C DB B3 DE FE C5 E2 E5 FE E1 F0 F9 EC E4 E8 E8 F6 C5 F7 F1 EA EA EC E8 E4 E2 F6 C3 DD C2 C7 E4 E7 83 88 8D 98 9B 8E 82 99 8B 97 99 91 94 8E 87 80 B7 9E 99 8A 8B 8D 99 90 97 9D 84 B0 94 84 9B 99 BF BF AD 86 A8 A9 BF A8 B6 AA B3 95 B4 A6 AD A9 B3 B5 BF A8 AB BE B2 A9 BB A7 A9 81 B3 A5 B7 B0 44 5F 49 4E 4B 7F 5E 44 41 46 70 53 4F 44 41 68 5F 5A 4B 4C 4C 5A 51 58 5C 47 79 42 62 45 55 5C 66 62 66 6E 5F 7A 6D 63 76 6A 74 78 56 62 76 66 7F 75 6C 78 79 7A 20 3D 2E 2E 30 47 77 65 7D 74 08 07 0D 3D 07 0C 07 21 07 05 14 23 09 15 00 00 08 29 11 1E 16 0B 3E 12 00 17 15 03 3F 19 17 19 3F 2F 2D 05 2B 29 38 0F 2D 31 24 24 34 13 2D 26 31 08 31 23 3B 0B 35 3E 39 10 3F 22 22 07 26 30 C9 C2 DB C0 C1 C1 ED C1 D0 C6 C1 C5 DF 87 C7 CA D4 D5 DD DA CA D6 D2 DA 92 DD DF C6 F2 DE C7 D6 E5 E5 E6 EC ED FB E5 E3 E5 A3 EE EE F1 A7 E7 EA F4 F5 FD FA EA F6 F2 FA BC BD BE B1 F5 F8 FA FB 8F 88 9C 80 80 88 CC 8B 83 8A 8C 84 82 C9 C4 B7 9F 9A 8B 96 90 C5 DC B1 9D 92 94 98 98 90 D4 86 AF B8 BB A0 A1 A1 BF E3 EC ED 83 FB 9A 80 AD B1 B6 BA BA F4 8C AA B2 B3 B7 A1 8C B3 A3 BE B8 B1 59 77 1A 4A 76 1A 6E 63 6E 73 7C 11 7A 44 48 4C 5F 55 4C 65 4A 5A 4E 50 5B 5D 51 5D 6A 53 51 43 6F 67 67 79 63 6A 62 79 5E 41 75 72 6F 69 61 76 69 57 79 60 7B 6D 40 49 60 72 74 78 78 70 44 79 0B 1F 0E 06 1C 02 42 2F 17 10 09 0F 03 14 17 29 1B 02 1D 0B 22 3C 13 13 1C 16 13 05 1F 18 1A 06 16 08 27 27 20 2A 2F 39 2B 2C 2E 6F 25 34 08 2A 3B 3F 31 37 39 7F 39 25 31 3B 31 3F 31 32 27 7B 84 85 E4 C6 CF CB C5 C3 C5 83 D3 D8 CB C5 CB C9 9A DC CA D6 CB CF CF 93 9C 9D FC DE D7 D3 DD DB ED AB E7 FB EA EA FE AD F6 FA F0 E4 F5 A9 AA AB D6 F4 F9 FD F7 F1 FB BD F3 E0 E3 F4 E2 E4 BA BB C4 A7 87 88 8A 86 82 8A C2 82 83 82 89 92 8A 91 89 D5 D6 D7 B2 90 9D 99 9B 9D 97 D1 99 87 80 9C A5 A5 E8 BA AB BD A5 A8 B1 ED EE EF 8A A8 A5 A1 B3 B5 BF F9 AD A6 B1 BF BD BF A3 FF F8 F9 98 BA 4B 4F 41 47 49 0F 5E 58 4E 46 53 0F 08 09 68 4A 5B 5F 51 57 59 1F 4C 52 41 5A 44 58 59 59 47 1B 24 25 44 66 6F 6B 65 63 65 23 63 6D 69 74 61 61 3A 6B 77 6A 77 6B 75 72 7C 60 3E 3F 38 5B 7B 74 0E 02 06 0E 4E 1D 09 1D 0D 11 14 12 48 49 4A 29 15 1A 1C 10 10 18 5C 12 00 17 15 03 05 59 5A 5B 06 24 29 2D 27 21 2B 6D 23 20 23 2E 33 29 30 65 35 2B 3D 2B 3F 2B 35 32 3C 20 7E 7F 78 1B 3B 34 CE C2 C6 CE 8E DB DE CC C6 CA CE C6 86 D4 CD C2 D4 DA D4 CA 90 91 92 ED C0 DC D3 D4 C5 C4 DD DB ED AB E5 EC FD FC ED EA E7 F0 AE AF A8 EF ED F6 EE F4 EA E0 B0 FB FE EB FD FF E5 FC F3 BA F5 FB 8B 87 91 9A 87 9C C2 89 80 96 93 84 94 CA 90 97 9B 9F 9D 8A D0 9B 9E B2 82 96 82 90 82 9E 9B 9B EA BC A9 BA EE AC AD A3 A1 A6 AC AD A3 A3 E4 A6 B5 B5 B6 BC BD AB B9 B9 F2 A0 A5 B2 B5 B2 A7 A6 4C 5E 44 45 57 4C 43 43 4C 46 43 55 43 43 67 4A 54 55 5D 5A 4A 56 53 53 12 44 51 42 16 53 5D 46 69 64 66 67 6B 6C 78 68 66 23 64 74 63 27 70 6A 3A 6F 70 7C 3E 73 7D 7E 79 33 7F 77 36 7B 7D 76 0F 05 1B 0C 37 00 19 4D 0A 02 16 04 46 05 01 00 14 5B 1B 16 10 11 19 1E 06 16 14 51 05 02 17 16 2F 38 3B 2F 3B 23 20 34 0D 37 28 24 34 67 32 20 34 3F 37 2B 2D 7F 2B 38 20 36 70 35 3F 24 37 3A C4 C5 CD CA DA CA C8 8D C6 D6 C5 81 D2 C8 84 D1 D2 DE 98 D5 DF DC D7 9D DD D5 90 DD DF D4 D1 DB F9 EE CB E6 E0 E1 E9 EE F6 EA EF EF C1 F5 EB F0 EA F4 D9 EC EA F7 BC F2 E2 E7 F9 FE F8 E4 B4 E2 8B 98 C8 87 81 9B CC 9E 87 97 A6 80 8F 8B C4 91 95 DB 9F 9C 90 9A 8E 9C 86 96 D0 83 97 99 90 9A A7 EB B8 A6 BC BB A4 B9 B6 B3 FA EE E9 AB AB A6 BB B7 B0 B6 AD AB E6 BE 86 A1 B1 B5 B3 A5 B7 B9 43 4E 46 5D 71 46 48 4E 4E 4A 45 4F 52 78 57 40 59 49 5D 4D 4C 5A 5A 4F 57 40 58 6E 42 58 5F 50 64 6C 7A 68 60 7B 53 79 7B 73 65 40 65 64 61 76 69 4F 77 72 7B 71 4E 78 74 61 75 62 7E 43 7B 7E 0F 05 2D 11 1E 06 1E 08 11 2A 0E 22 09 09 0A 00 19 0F 11 16 10 45 5C 2E 17 07 50 23 13 11 06 10 39 23 1C 26 25 2A 22 1F 27 30 35 2D 32 67 34 37 35 2B 3D 2B 2A 36 39 2E 31 3C 34 34 35 38 30 30 8A CF C7 CC DD 8F C2 C2 D6 83 C5 D9 CF D4 D0 D7 DF DF D1 CB DB DC C8 E2 C7 C1 D9 D0 C3 C3 DC DA F8 E2 F2 E8 FA E6 E3 E3 DD E0 EF E5 E3 E3 ED F6 F9 F4 F6 F7 FB FC E8 F4 FC F4 B0 F5 FF E4 F7 FA 84 85 8D 8A 9A 86 82 8A CC CD CE C1 82 8E 97 86 95 95 96 9C 9D 8B 99 99 D2 90 9F 9F 98 92 97 81 A3 A4 A6 E9 A2 A0 BF B9 E2 82 B5 B5 A9 E7 B6 A0 B9 B8 B7 B7 BB BC A8 B4 BD BD F0 B8 A5 F7 B0 BC 59 4A 4A 45 4B 4B 6F 42 4C 4D 45 42 52 4E 4B 4B 1A 52 4B 19 50 50 48 1D 51 5C 5E 5F 53 54 40 50 6E 48 67 67 60 6A 6F 79 6B 6C 6E 21 6F 74 24 50 74 70 76 76 69 71 3C 72 60 77 75 63 36 63 6D 65 0F 24 1A 0D 0B 1D 4C 1D 03 11 01 0C 03 13 01 17 09 5B 11 0A 5E 1A 11 0D 06 0A 23 08 1B 15 1B 19 39 6B 2E 3B 21 22 6C 29 2B 25 26 24 34 22 2A 31 7A 38 37 37 30 3A 3F 29 3B 3C 3E 22 17 3B 38 3A DD 8B E6 CC D9 8F E3 EE ED F3 CC C0 C5 C2 84 EA F9 F4 98 D7 D1 CB 9C DC DE DF DF C6 D3 D3 F3 D0 FE C5 E7 E7 C8 E6 F4 E8 E6 D0 F9 EC E4 E8 E8 A5 E8 FE E9 EC FB EC E8 BD E6 FA FD F4 B6 F8 E1 E1 CA 98 91 84 8C 80 80 CD 8B 87 C0 DC C6 AB 8B 84 9E 92 96 9E DE DF 9A 8F 9D 9E CA D1 D6 83 9B CF EA EB AE A0 A0 A6 BF A5 A7 A7 E0 A7 A7 AE A8 B6 AF B8 BB BC AD AC F0 FD 90 B2 A2 A2 EC F7 F8 F5 6E 5E 5A 48 5A 46 43 43 18 03 6E 13 06 54 41 46 4F 4B 5C 58 4A 5A 7D 5E 46 5A 5F 5F 16 54 5B 40 66 6F 28 67 61 7B 2C 6F 67 23 6E 74 6A 6B 67 64 76 77 7A 78 7D 74 72 72 32 72 73 65 7F 61 71 35 05 19 0C 0C 1C 1C 4C 0C 01 17 09 17 03 47 0B 17 1E 1E 0A 51 0D 56 5C 55 1C 1C 50 01 19 04 1D 01 23 24 26 3A 6E 3F 23 3E 2B 37 29 2E 28 6F 37 6C 7A 73 78 2E 37 2B 34 7D 72 32 3E 35 76 1A 31 26 D9 CA CF CC E1 DF C9 C3 ED D1 C4 C4 D4 87 CC C4 CC DE 98 D7 D1 9F FD DE D1 DC C5 DF C2 FE D0 99 AA DB E7 FA E7 FB E5 E2 EC CA E4 A1 BB A7 C9 E0 E9 E8 F9 FE FB D0 EC F8 FC DC E2 F5 F3 E5 B4 FD 8B 9D 8D C9 80 80 CC BE 9B 8E 82 8E 8A AE 80 C9 DA AB 97 8A 97 8B 95 92 9C BA 94 D1 CB D7 B9 90 B9 B8 A9 AE AB 80 BC A8 AC 93 AF B2 AF B3 AD AA B4 FB B0 B8 A8 BA FC B3 BD F3 91 B2 B5 B8 A1 BB 5E 62 4C 05 0E 7F 43 5E 4B 57 49 4E 48 6E 40 05 07 1B 75 5C 4D 4C 5D 5A 57 7C 40 54 58 67 5B 46 63 7F 61 66 60 2F 64 6C 74 66 20 6F 69 27 57 7C 77 79 77 75 57 7B 30 3D 42 7C 63 78 62 7E 7B 7B 23 0F 48 54 4E 22 09 1E 11 02 07 04 25 0B 0B 16 1F 1F 28 16 0D 16 08 14 1D 1D 50 19 17 01 11 55 24 24 68 08 2D 2C 23 38 2C 37 09 25 6A 67 14 2A 29 32 2C 30 31 31 15 39 72 6E 70 1C 33 24 27 34 CD CE EB C5 C1 DC C9 C9 F2 CC D3 C8 D2 CE CB CB 9A D3 D9 CF DB 9F D2 D2 92 E0 C9 DC D4 D8 D8 FC EE A7 A8 D9 E1 FC E5 F9 EB EC EE C8 E2 A7 B9 A5 D7 FE EB EA FF F8 F9 DE E0 EA E0 E5 F9 D6 E7 E6 8F 9F AA 88 82 8E 82 8E 87 90 C0 89 87 91 81 C5 94 94 D8 B8 9D 9C 93 88 9C 87 B9 95 BB 92 87 86 AB AC AD 8A BC B6 BC B9 AD 82 B3 B2 A3 B3 86 A4 B6 BA B6 BA BB AC FC B5 B3 A5 B5 F1 B8 B8 F4 94 59 58 4D 5D 67 4B 6F 5F 5B 53 54 4E 67 44 47 4A 4F 55 4C 19 57 4C 1C 4F 57 42 45 58 44 52 50 15 6C 64 7A 29 43 6A 7F 7E 63 64 65 42 74 7E 74 71 75 5A 6B 6A 7B 6B 5E 7C 7E 72 7E 72 73 64 3A 35 2B 08 0B 06 1B 01 18 4D 0B 07 40 5C 46 24 05 0B 1A 0F 58 1F 17 11 18 5D 13 10 13 1E 03 19 00 55 3D 22 3C 21 6E 26 28 6D 7F 63 03 2E 28 29 21 26 2E 32 37 37 7E 31 3D 30 37 05 35 3F 32 38 26 1B CB C6 CD E0 DD E9 CD DB CD D6 D2 C8 D2 C2 E7 CA D4 D5 DD DA CA D6 D3 D3 E1 C7 D1 C5 D3 F4 C6 D0 EB FF E1 E6 E0 DB F5 FD E7 CD E1 EC E3 BD A4 A5 CC FE F6 FD F1 ED A6 BD B2 D5 F1 E7 F9 E5 FD E1 8F D1 C8 AA 81 81 82 88 81 97 89 8E 88 94 DE C5 93 95 91 8D 97 9E 90 94 88 92 84 98 99 99 DA DB E4 88 A7 A7 A0 AA AF B9 AB AC AE B2 FC E7 AD AB B3 AF B1 B8 B2 B6 A6 B8 B6 F3 A3 A4 B5 B4 B1 A6 59 4D 5D 45 42 56 5A 48 4C 47 4F 53 68 46 49 40 79 5A 56 1E 4A 1F 5A 54 5C 57 10 55 53 51 55 40 66 7F 28 6A 61 61 62 68 61 77 69 6E 68 27 6D 6B 7C 74 38 7F 71 6D 3C 6B 77 7D 74 7E 64 37 29 35 4A 0A 06 0D 4E 08 1E 02 17 13 40 5C 46 24 16 00 1B 0F 1D 59 1D 0A 0F 09 1D 1E 50 12 19 19 1A 10 29 3F 21 26 20 3C 6C 24 31 63 24 24 28 2E 21 21 7A 3D 37 2B 7E 29 39 33 36 3C 22 71 6B 77 37 3A C4 C5 CD CA DA C6 C3 C3 EB CD C6 CE E7 C3 C0 85 CE DE DB D1 D0 D6 DF DC DE 93 F3 DE D8 D9 D1 D6 FE E2 E7 E7 C7 E1 EA E2 A2 EA F3 A1 E2 E2 EA EC FF FF F6 FC E9 D1 FD F0 F7 D0 FF E3 F3 AD B4 FC 84 82 9C 80 8F 83 85 97 83 97 89 8E 88 C9 CA CB B6 94 9F 9E 9B 8D C6 DD 9B 9D 99 85 9F 96 98 9C B0 AE AC E9 BD BA AF AE A7 B0 B3 A7 B3 AB A8 BC 99 B4 AA BC E4 FF B5 B3 BB A7 B9 B0 BA BE AE B0 4E 0B 5B 5C 4D 4C 49 5E 51 45 55 4D 4A 5E 45 46 59 54 4D 57 4A 76 52 5B 5D 70 65 62 62 78 79 6A 59 52 45 4B 41 43 53 4E 4D 4D 4E 44 45 53 4D 4A 54 53 51 4A 4A 50 4E 54 51 52 5C 4E 45 4E 59 57 25 27 37 2A 21 21 22 28 21 37 29 2E 28 38 2D 21 23 14 0D 59 16 1E 0A 18 52 1E 1F 03 13 57 00 1D 2B 25 68 26 20 2A 6C 2C 21 37 29 37 23 67 27 2A 34 35 3D 3A 2A 36 33 33 7E 73 29 3E 23 77 27 3D C5 DE C4 CD 8E DC DC C8 C1 CA C6 D8 86 C4 CB CB D4 DE DB CD D7 D0 D2 F4 D6 93 C0 D0 C4 D6 D9 D0 FE EE FA A9 FA E0 AC EA E7 F7 A0 F2 FF EA E6 EA F6 E8 E1 F4 FC F0 F0 D4 FC F5 FF E3 F3 E6 E1 F0 99 9F B8 88 9C 8E 81 88 96 86 92 92 BF 88 91 C5 97 8E 8B 8D DE 8C 8C 98 91 9A 96 88 D6 A5 9B 9A BE EB A7 BB EE BA A2 A9 A7 B1 AC A8 A3 B5 9D AA AF FB B0 B8 A8 BA FC B0 BD A1 B5 F1 A2 BF B5 BB 0A 44 46 4C 0E 4E 4F 59 4B 55 45 01 45 48 4A 4B 5F 58 4C 50 51 51 10 1D 4B 5C 45 11 45 5F 5B 40 66 6F 28 7A 7E 6A 6F 64 64 7A 20 62 69 69 6A 60 79 6F 71 76 70 56 78 3D 62 72 62 70 7B 72 60 70 18 4B 1C 06 4E 08 09 19 42 05 15 15 13 15 01 45 19 14 16 0D 0C 1E 1F 09 01 26 1E 15 13 05 18 1C 2F 39 01 2D 1D 2A 3E 24 27 0A 24 0E 34 23 21 37 7A 2E 28 3D 3F 2B 39 12 20 37 35 23 76 25 31 38 C5 DD CD C6 DC CB C9 DF F6 DA D0 C4 EF C3 FD CA CF 9B D0 D8 C8 DA 9C D0 DD C1 D5 91 C2 DF D5 DB AA E4 E6 EC AE EE EF F9 EB F5 E5 A1 E5 E8 EA EB FF F8 EC F0 F1 F1 B0 BD EB FC E5 B1 E5 FF FB E0 86 8F C8 9A 9E 8A 8F 84 84 9A C0 82 89 89 8A 80 99 8F 91 96 90 B6 98 DD 82 92 82 90 9B 92 80 90 B8 EB BC A6 EE A8 A9 B9 E2 8C B2 A5 A3 B5 90 BC AA BE 96 B6 FE B2 BD A9 B1 BB B9 BF B1 F7 B7 BA 44 45 4D 4A 5A 46 43 43 76 51 41 45 43 09 04 6A 48 5F 5D 4B 1E 56 52 5B 5D 09 10 52 57 59 13 41 2A 6D 61 67 6A 2F 63 7F 66 66 72 4E 74 63 61 77 3A 73 71 6A 6A 70 6E 64 41 67 7F 61 45 63 7B 65 26 02 05 00 1A 3B 1E 43 11 17 0F 11 2B 06 16 0E 1F 0F 0A 1C 0F 0A 19 0E 06 01 15 00 03 12 07 01 39 0A 24 25 21 38 6C 2A 30 2C 35 31 66 28 36 21 3F 29 2B 36 2C 3B 39 2F 21 2A 3D 33 39 3B 27 19 C3 D8 DC E7 CF C2 C9 DE DB CE C2 CE CA D4 CA C0 CD E8 C1 D4 DC D0 D0 CE FE DA C3 C5 F8 D6 D9 D0 C8 F9 E9 E7 EA E6 E2 EA C7 EE F5 ED E7 F3 EB F7 D7 FA EA F2 FB EB BC CF F7 E3 FC F0 EF C3 E6 F4 8E 82 86 8E CE BC 85 80 97 8F 81 95 89 95 B6 80 8B 8E 9D 8A 8A DF 8E 98 98 96 93 85 93 93 D4 91 BF AE E8 BD A1 EF B8 BF A3 A7 A9 AF A1 E7 B4 B7 B5 AF BD BA AA B6 B3 B3 F2 A0 A9 A2 A2 B2 B9 FB 0A 68 40 4C 4D 44 0C 54 4D 56 52 01 55 42 50 51 53 55 5F 4A 1E 17 7B 58 5C 56 42 50 5A 17 47 50 7E 7F 61 67 69 7C 2C 20 3C 23 54 73 67 63 6D 6B 7D 3B 68 6B 71 6B 79 7E 66 7A 7F 7F 3F 54 2E 49 2D 02 1C 05 0F 0D 41 3F 17 0D 0E 04 14 3B 06 10 13 17 1C 0A 22 4D 1F 25 47 31 3E 3D 26 2B 44 29 29 27 21 2C 20 3B 10 39 27 31 2D 28 28 26 28 19 3E 3E 2E 3C 32 30 2C 30 37 3D 24 0D 14 22 27 3C C4 CE DB DA E2 CE D5 C8 D0 FF F4 D3 C7 C3 CD CB DD EB D4 D8 CA D9 D3 CF DF 9D F2 C4 C5 DE DA D0 F9 F8 C4 E8 F7 EA FE D1 C1 EC F2 E4 A8 E4 F7 CA E8 FF FD EB BE ED F9 EC E7 F6 E3 E5 B6 E5 F1 FF 8F 88 9C 8C 8A CF 88 98 87 C3 94 8E C6 C0 A7 8A 94 9D 91 8B 93 DF 88 8F 93 97 99 9F 91 D7 9B 9B EA B9 AD A8 A2 EF AF A2 AC AD A5 A2 B2 AE AB AB FA AC B1 AD B6 FF AE A8 BC BD B9 BF B1 F7 A7 BC 47 5E 44 48 5A 40 5E 0A 02 50 45 55 52 4E 4A 42 14 1B 7B 51 5B 5C 57 1D 4B 5C 45 43 16 44 51 41 7E 62 66 6E 7D 2F 24 4A 67 6D 65 73 67 6B 24 76 7F 6F 6C 70 70 78 6F 3D 3F 2D 30 52 79 79 72 7C 18 06 09 1D 07 00 02 1E 42 45 40 36 07 15 0A 0C 14 1C 0B 50 17 0C 3D 1E 06 1A 06 14 12 16 00 10 25 3B 2D 27 01 29 2A 3E 27 37 23 2D 29 34 21 0A 3C 3D 2B 3C 2A 3B 3D 24 21 3C 20 34 38 03 3D 38 CF C8 C4 C6 DD CA F8 C4 CF C6 C9 C5 C5 C8 CA CB DF D8 CC D0 D1 D1 F5 D9 D7 CB D3 D9 D7 D9 D3 D0 C3 EF FB F0 E3 ED E3 E1 CB E7 E3 EE E8 F3 E5 EC F4 FE EA D0 FA EB F5 F0 F7 C9 FF FF F3 E3 FD F8 8F B1 87 87 8B A6 82 8B 8D 90 85 92 95 8E 8B 8B 89 93 97 95 97 9B 9D 84 81 80 95 82 85 9E 9B 9B 89 A4 A6 BD AF A6 A2 A8 B0 B0 A1 B2 B5 AE A3 AB B7 BE B6 AD AD 9C BD B3 B2 A7 F0 B7 BF B9 B0 F5 4B 4C 4F 5B 4B 48 4D 59 4B 4C 4E 01 51 4E 50 4D 1A 48 48 5C 5D 56 5A 54 57 57 10 5F 57 5A 51 15 59 7F 69 7B 7A 2F 7C 7F 6D 60 65 72 75 6E 6A 62 34 35 36 39 45 4C 68 78 62 33 3E 3F 38 37 4F 48 50 4B 3B 1D 0B 1F 4C 43 42 22 07 06 14 02 03 04 0E 12 17 17 5E 17 15 0E 06 1C 02 08 58 59 5A 55 39 24 3D 3B 2D 2A 6C 25 2B 30 34 2E 34 3E 64 26 35 2E 36 2D 7E 71 7C 1C 35 34 22 34 31 36 20 3C C5 C5 88 C1 C7 DC D8 C2 D0 DA 80 C7 CF C9 CD D6 D2 DE DC 97 9E E4 F5 C9 D7 DE C3 91 D5 D8 C1 DB FE B1 A8 A9 FE FD E3 EE E7 F0 F3 E4 E2 A9 D0 EC F9 F0 C8 EB F1 FC F9 EE E1 FA FE F6 B6 F1 FD FB 83 98 80 8C 8A C1 CC B6 B6 8C 94 80 8A C7 94 97 95 98 9D 8A 8D 96 92 9A D2 87 99 9C 93 CD D4 D5 B9 E5 E8 9D A1 BB AD A1 E2 B3 B2 AE A5 A2 B7 B6 BF BF F8 B0 AA BA B1 AE E8 F3 FE F1 84 B2 A7 A0 46 5F 08 48 49 48 5E 48 45 42 54 44 42 07 4D 51 5F 56 4B 03 1E 7C 5D 53 15 47 10 57 5F 59 50 15 63 65 6C 60 6D 6E 78 62 70 23 77 68 72 6F 24 62 73 6D 7D 77 3E 71 7D 70 77 50 71 7F 76 63 34 73 03 05 0C 49 0F 08 0B 1F 07 04 01 15 09 15 44 03 15 09 58 0A 1B 13 19 1E 06 16 14 51 06 16 06 14 27 2E 3C 2C 3C 3C 27 28 3B 15 21 2D 33 22 64 28 2F 28 2C 79 3C 3A 7C 3A 20 36 31 25 33 25 74 21 C2 CA C6 89 9E DF C9 DF CB CC C4 EC D3 CB D0 CC CA D7 D1 DC CC EA D2 D6 DC DC C7 DF 96 D5 D5 C6 EF AB F8 EC FC E6 E3 E9 C1 B9 DC C6 EF F3 E8 E4 F8 B6 CA EC F0 F1 F9 EF CE F1 E5 F8 FA F3 E7 C9 D8 88 B0 DC AC A1 A0 BD BE D3 BC 82 8A 8E 81 8B 8E A7 8C 9C 8C 92 95 93 93 9F AC 95 93 81 91 99 A5 BB A5 AC A0 BB 90 8F B7 B0 A9 AF A3 B4 B7 89 BB A2 BD AB 82 8B AE BC B6 BA BE B6 86 BB B5 A1 4C 44 5A 44 00 6D 59 5E 4B 4D 45 52 55 6B 45 5C 5F 49 64 71 57 4C 48 52 40 4A 6C 61 53 45 5D 5A 6E 25 6B 7A 63 47 48 5A 5B 41 61 72 63 57 61 77 73 74 7C 49 7B 6D 75 72 76 5E 65 7D 62 7E 64 79 13 0E 1A 20 00 1F 19 19 42 13 01 13 07 0A 01 11 1F 09 0B 3A 44 23 3B 14 06 1F 11 13 5B 25 01 1B 24 2E 3A 15 2C 3A 25 21 26 30 1C 73 25 1F 71 07 14 17 08 05 6E 03 3F 31 3B 36 3E 25 0A 23 31 27 C7 C2 C6 C8 C2 F3 C8 C8 D4 C6 CC CE D6 CA C1 CB CE E7 FA CC CD D6 D2 D8 C1 C0 FC D0 CF D2 C6 E9 DE F9 E9 ED E7 E1 EB DD EE E2 F4 E7 E9 F5 E9 AB D8 EE EB F0 F0 FA EF EE DE F2 E9 F4 E4 CB D9 FA 8E 9E 84 8C 9D B3 A9 95 87 80 95 95 8F 88 8A A0 94 8F 91 8D 87 D1 9F 8E BB 9D 80 84 82 A7 95 87 AB A6 AD BD AB BD BF ED EF E3 B0 A0 B4 A6 A9 A0 AE BE AA F9 FC FD FC BC BE A1 B5 B0 B2 AE F4 B0 52 42 5B 5D 5D 7C 4F 5F 4B 53 54 6A 43 5E 6D 4B 59 54 4A 4B 5B 5C 48 1D 5E 56 5E 56 42 5F 14 5A 6C 2B 5E 68 7C 66 6D 63 76 70 2E 21 4F 73 24 68 6F 68 6C 39 7C 7A 3C 78 64 76 7E 31 3E 7C 71 6C 4A 46 48 1F 0F 03 19 08 42 13 01 08 14 14 4D 28 1F 16 1A 1C 0C 5F 08 04 02 16 50 1C 03 04 00 55 28 2E 68 00 0D 20 21 3D 23 31 21 23 2A 22 0B 27 30 3E 3B 2D 2D 7F 28 24 22 36 70 3E 30 77 02 34 D8 C2 C9 C7 DA DC 82 8D EB D7 80 CC D3 D4 D0 85 D8 DE 98 F0 FD D0 D1 CD D3 C1 D1 D3 DA D2 E2 D4 F8 E2 E9 E7 FA FC AC E4 F6 E6 ED A1 E2 E8 E1 F6 BA F5 F7 ED BE EB F4 F8 B2 E0 F1 FC F3 B7 E0 EC 9A 8E C8 9D 86 8E 98 CD 83 97 94 93 8F 85 91 91 9F 9F D8 9A 92 9E 8F 8E D2 9E 95 9C 94 92 86 DB EA 82 BC E9 A3 BA BF B9 E2 A1 A5 E1 88 A8 B0 E5 A9 AE A8 A9 B1 AD A8 B8 B6 F3 B9 BF A6 A2 A0 F5 5A 4A 5A 48 43 4A 58 48 50 03 54 58 56 42 04 0D 53 55 5C 50 5D 5E 48 52 40 7A 5E 55 5F 54 55 41 65 79 28 60 7D 2F 6D 61 70 66 61 65 7F 27 65 61 7E 7E 7C 55 77 71 79 5B 7D 61 7D 70 62 63 71 71 3C 0A 04 1C 0B 20 1E 09 07 11 13 29 0F 14 10 0A 08 02 2A 1C 0F 0A 19 0E 06 23 11 03 17 1A 11 01 2F 39 3B 2F 3C 20 21 39 2D 17 32 20 22 22 37 0D 33 28 2C 36 2C 26 0E 38 23 26 35 22 22 07 35 27 CB C6 CD DD CB DD DF CB CD D1 C3 C4 F4 C2 C8 CA DB DF F7 F8 CB CB D4 EF D7 C0 C5 DD C2 F2 DA D6 F8 F2 F8 FD EB EB DE E8 E4 F1 E5 F2 EE D3 EB EE FF F5 CD EA FB CC FD EB F7 F7 C4 FE FD F2 FA E6 A6 82 86 82 BA 8A 94 99 B2 82 93 92 91 88 96 81 B2 94 94 9D 9B 8D AC 9C 81 80 87 9E 84 93 A7 94 BC AE 98 A8 BD BC BB A2 B0 A7 B4 B3 A7 A3 A5 A7 B6 BE 8B A0 B3 BD B3 B1 A3 A6 BF A5 B3 A4 87 AC 47 49 47 45 5A 46 4F 46 6A 4A 53 55 49 55 5D 76 43 56 5A 56 52 52 55 53 47 47 55 79 5F 44 40 5A 78 72 5B 70 63 6D 63 61 66 62 79 49 6F 74 70 6A 68 62 4B 60 73 7D 73 71 64 7C 7C 64 7B 72 55 7B 0B 07 11 1A 07 1C 3F 14 0F 01 0F 0D 15 1E 09 07 15 17 35 18 0E 0C 05 10 10 1C 1C 3C 17 07 3D 11 1E 39 29 2D 2F 2D 20 28 11 3A 2D 23 29 2B 17 3C 37 39 37 35 7E 32 3D 2D 72 35 3F 23 76 77 35 39 D8 CE C9 CD D7 8F C9 D5 CB D0 D4 D2 F2 D5 C5 C1 DB D9 D4 DC 9E DE D2 D9 92 C2 C5 DE C2 D2 C7 95 F9 F2 E5 EB E1 E3 AC EC F0 E6 A0 F5 EE E2 A4 F6 FB F6 FD B7 BE D2 FD ED E2 FA FE F6 B6 FE E7 B5 8C 84 9A 8B 87 8B 88 88 8C C3 94 8E C6 8E 90 96 9F 97 9E AD 8C 9E 98 9C 90 9F 95 D1 97 99 90 D5 BE A2 AB A2 BD EF A4 A4 B1 B7 AF B3 BF E7 B7 BC B7 B9 B7 B5 FE BE AE B8 F2 A7 B8 B4 F6 A4 B5 B8 4F 05 08 64 4F 5F 5C 44 4C 44 00 48 55 07 42 4A 48 59 51 5D 5A 5A 52 1D 46 5C 10 58 42 44 51 59 6C 5F 7A 68 6A 6E 6E 61 67 23 61 6F 62 27 69 6C 74 6E 6C 7C 6D 3F 74 74 61 67 7F 63 6F 37 67 6C 07 09 07 05 4E 0E 1E 08 42 17 08 04 46 14 05 08 1F 55 58 34 1F 0F 0C 14 1C 14 50 18 05 57 12 1A 38 29 21 2D 2A 2A 22 6D 36 2C 60 28 32 34 21 29 3C 0F 2A 38 3A 3E 3E 31 37 73 31 3F 32 77 30 34 D3 D8 88 C1 C7 DC D8 C2 D0 DA 80 D2 DF CA C6 CA D6 9B D9 CB DB 9F C8 D5 D7 93 C3 D0 DB D2 9A 95 C7 EA F8 F9 E7 E1 EB AD EB F0 A0 E7 E9 F5 E6 EC FE FF FD F7 BE EB F3 BD FB E7 E3 F4 FA F1 C0 E7 8B 8F 89 8B 82 8A CC 8C 8C 87 C0 97 89 8B 91 88 9F DB 99 97 9F 93 85 8E 9B 80 D0 82 8F 9A 96 9A A6 EB A9 BB AB EF B8 A5 A7 E3 B3 A0 AB A2 EA E5 97 BA A8 A9 B7 B1 BB FD BB A0 F0 B7 B9 A5 B6 BC 4E 4F 4D 47 0E 5B 43 0D 4B 57 53 44 4A 41 04 08 04 1B 61 56 4B 1F 54 5C 44 56 10 5F 59 43 14 45 65 78 7B 60 6C 66 60 64 76 7A 20 75 69 27 67 77 7F 7A 6C 7C 3E 6C 65 70 70 7C 7C 62 36 7A 75 65 1A 02 06 0E 4E 0D 09 0E 03 16 13 04 46 0E 10 45 1D 14 0C 59 0A 10 5C 1E 1B 01 13 1D 13 57 07 0C 27 29 27 25 3D 6F 21 2C 32 33 29 2F 21 67 6C 16 23 36 3A 36 32 1E 3F 3E 3D 26 3E 25 06 36 3D 27 F9 D2 C5 CB C1 C3 8C 90 82 8F 80 E0 C5 C4 CB D0 D4 CF 98 84 9E EE C9 DC DC C7 DF C6 D3 C5 76 1C AA DA FD E8 E0 FB E3 FA E7 F1 A0 CD CA C4 A8 A5 A8 AB A9 A1 B0 BF DD F1 FE B3 E2 F8 F1 FF E0 E6 CA 99 8D 9A 8B 9D 9A 88 86 8B 94 95 96 94 DE CA D5 8A 8D 98 90 8B 93 8A 97 81 DE 92 99 9A DB 85 B8 A2 BE A8 AD B6 A4 B9 B6 B3 B3 FB E9 E8 B3 B2 AD F5 A9 AC BF B1 A8 B2 A5 B6 A2 FF B5 B8 B9 FA 5E 4E 5A 44 5D 02 43 4B 0F 56 53 44 4E 53 50 55 49 01 17 16 4F 4A 5D 53 46 5C 47 54 44 19 57 5A 67 24 60 7D 7A 7F 7F 37 2D 2C 76 33 28 7D 6B 75 73 76 36 7A 71 72 33 6A 7B 77 77 74 62 38 78 7C 1C 0E 0B 01 0F 1B 42 05 16 0E 0C 5E 07 17 0D 3A 19 1A 14 15 0D 42 59 48 30 56 45 35 50 1F 1B 06 3E 25 29 24 2B 72 3D 38 23 2D 34 2E 31 22 36 6B 39 34 35 7F 35 3A 25 60 67 04 1E 35 1B 27 63 67 9D E8 DF E8 CC F7 EA E2 ED F9 D4 DB EA C8 EF D5 E2 CF 81 F2 E6 C9 F4 FB 94 DF D1 DF D1 8A D1 DB AC E3 FC FD FE FC B6 A2 AD F6 F0 E5 E7 F3 E1 F6 B4 EA ED F8 F0 EB F3 EA F7 E1 BE F2 F9 FA BB C4 9F 8A 86 9D 81 98 89 9F 8A 97 94 91 95 DD CB CA 8B 8E 99 97 8A 90 8B 98 80 DD 93 9E 9B D8 84 87 A3 A8 A1 A7 A9 A7 B8 B9 B2 B0 FA EE E9 A6 A7 A6 B5 AE B6 AD AD F1 AD A8 B3 BD A4 BE A1 B2 A6 FB 49 44 45 7E 4B 0F 44 4C 54 46 00 52 43 53 04 50 4A 1B 4C 51 5B 1F 58 58 54 52 45 5D 42 17 40 47 6B 6F 61 67 69 2F 69 63 74 6A 72 6E 68 6A 61 6B 6E 3B 7E 76 6C 3F 65 72 67 33 67 78 62 7F 34 57 03 05 09 07 0D 0A 4C 24 0C 05 0F 41 0B 08 00 00 54 47 1A 0B 40 43 1E 0F 4C 2A 1F 04 56 1A 15 0C 6A 28 27 27 20 2A 2F 39 62 37 2F 61 34 22 25 29 7A 39 2A 36 35 3A 2E 7D 25 3B 35 3F 76 2E 3B 20 8A CA DA CC 8E DD C9 CC C6 DA 80 D5 C9 87 D7 D1 DB C9 CC 99 CA CD DD D9 DB DD D7 9F F5 D8 C1 D9 EE AB E6 E6 FA AF E0 E2 E3 E7 A0 F3 E3 F6 F1 EC E8 FE FC B9 FF EC EF F8 FF F1 FC E8 B6 F6 E1 E1 85 86 89 9D 87 8C 8D 81 8E 9A C0 AF 87 8A 81 DF DA DB AA 9C 8F 8A 99 8E 86 9A 9E 96 B7 84 87 90 A7 A9 A4 B0 F4 EF 8E A4 AC A7 A9 AF A1 E7 B6 A0 BE B2 AA BC BD AB FC AA B3 A0 F0 B0 A6 A7 B8 BC 4F 4F 08 5D 41 0F 62 4C 4F 46 1A 01 06 75 41 41 53 49 5D 5A 4A 6F 5D 49 5A 09 10 7F 57 5A 51 15 69 6A 66 29 60 60 78 2D 60 66 20 64 6B 77 70 7C 4E 73 7D 39 77 6B 79 70 32 64 79 65 7E 37 67 74 07 0E 48 07 0F 02 09 4D 03 0F 12 04 07 03 1D 45 1F 03 11 0A 0A 0C 29 56 3C 12 1D 14 56 14 1B 00 26 2F 68 2A 21 21 38 2C 2B 2D 33 7B 66 0A 25 2C 36 1D 2A 36 33 1E 38 39 20 36 23 22 76 3E 27 75 C4 DE C4 C5 8E C0 DE 8D C7 CE D0 D5 DF D3 C1 DD CE 94 C8 D5 DF D6 D2 81 F0 E1 8E BB 8A F5 E6 8B AA CE E5 EB EB EB E8 E8 E6 A3 E9 EC E7 E0 E1 A5 A6 F2 F5 FE BE EC EE FE AF F0 F9 F5 AC F4 FB F8 9A 8A 86 90 82 80 8B 82 DC DF A2 B3 D8 93 81 9D 8E D4 90 8D 93 93 9F 92 9F 83 91 9F 8F 9B 9B 92 A5 98 AD BD BA A6 A2 AA B1 8E A1 AF A7 A0 A1 B7 F4 96 B9 B0 B2 8C B9 AF A4 B6 A2 FF 9B B6 BD B9 7F 58 4D 7A 7D 63 6F 42 4C 4D 45 42 52 4E 4B 4B 6F 48 5D 19 6D 6C 70 1D 51 5C 5E 5F 53 54 40 5C 65 65 5B 6C 7A 7B 65 63 65 70 4D 60 68 66 63 60 68 35 55 78 77 73 4F 78 60 65 75 63 38 5A 75 7C 06 27 07 0E 07 01 2D 18 16 0B 05 0F 12 0E 07 04 0E 12 17 17 5E 13 13 1A 1B 1D 23 14 02 03 1D 1B 2D 38 05 28 20 2E 2B 28 30 6D 0D 20 2F 2B 17 20 28 2D 3D 2B 70 12 3D 34 3E 03 31 22 25 20 3B 27 CE EA DD DD C6 CA C2 D9 CB C0 C1 D5 CF C8 CA 85 CA DA CB CA C9 D0 CE D9 E1 D6 C4 C5 DF D9 D3 C6 C7 EA E6 E8 E9 EA FE A3 CF E2 E9 ED D5 E2 F6 F3 FF E9 B6 D4 FF F6 F0 CE DF C7 C0 C2 F3 E5 E2 F0 98 BF 81 84 8B 80 99 99 B1 AE B4 B1 C6 94 81 97 8C 9E 8A D9 8A 96 91 98 9D 86 84 DD D6 9A 87 A6 AF BF BC A0 A0 A8 BF 80 A3 AD A1 A6 A3 B5 EA 88 BB B2 B4 8A BB AD AA B8 A0 FD 9D B0 BF BB 87 98 7E 7B 7B 4C 5C 59 49 5F 71 6E 74 71 06 54 41 57 4C 5E 4A 6A 5B 4B 48 54 5C 54 43 7C 57 59 55 52 6F 79 26 44 6F 66 60 5E 67 71 76 64 74 29 49 64 73 77 4B 54 4A 4F 4C 72 60 67 43 5C 42 47 34 65 05 19 1C 39 0F 06 1E 2E 0D 0F 0F 13 25 08 08 0A 08 4A 3B 16 12 10 0E 4F 21 0A 1D 13 19 1B 07 55 26 22 3B 3D 6E 21 2D 20 27 63 23 20 28 67 2A 2A 2E 7B 3A 3C 7E 3A 31 2D 26 2A 03 30 3B 32 74 26 D3 C6 CA C6 C2 DC 8C C1 CB D0 D4 81 C8 C6 C9 C0 9A DA D4 CB DB DE D8 C4 92 D6 C8 D8 C5 C3 9A 95 C5 F9 EC EC FC AF C5 E9 B8 A3 A0 D3 E3 F6 F1 E0 E9 EF D1 FD A4 BF C8 EF F3 F7 F9 FF F1 B7 FB E5 8F 99 89 9D 87 80 82 CD 90 86 93 94 8A 93 C0 B3 95 97 8D 94 9B DF 9D 93 93 9F 89 82 9F 84 D4 96 AB A7 AB BC A2 AE B8 A4 AD AD E0 A7 B4 A8 A9 E5 AE B2 BB B2 AD FF B4 B4 A1 A7 BF A3 AF F7 BD A6 0A 45 47 5D 0E 4E 40 41 4D 54 45 45 06 41 4B 57 1A 1B 59 5B 51 4D 48 58 56 1D 10 62 4F 5A 56 5A 66 2B 35 29 61 7F 78 64 6D 6D 55 6F 62 62 76 69 73 7E 6A 50 6A 7A 71 5C 71 67 79 7E 78 56 73 72 18 0E 1B 1A 01 1D 2A 01 03 04 23 00 0A 04 11 09 1B 0F 17 0B 44 5F 3D 11 17 01 04 34 18 16 16 19 2F 2F 01 3A 0D 20 20 22 30 2A 2E 26 07 2B 21 37 2E 1D 31 35 2A 3A 2E 1C 3E 36 22 25 18 32 31 31 E9 C4 C6 CF C7 DD C1 F9 D0 C2 C4 C8 C8 C0 E1 DD CA D2 CA DC FB C7 CC D4 C0 CA E4 D8 DB D2 D0 D1 C7 C6 F1 F0 F7 F6 AC C5 CA B9 ED EC BC F4 F7 AB FC FD FE FF F8 F9 CE F8 E2 F6 F1 E5 D7 FB F1 E7 9E AA 8B 9D 87 80 82 9E B0 86 90 84 87 93 A9 84 82 B8 97 8C 90 8B AE 98 82 96 91 85 A6 92 86 9C A5 AF 85 A0 A0 BA B8 A8 B1 90 A5 A0 B4 A4 AC 84 B6 BE AA AD 97 9B 9F B2 BC B7 B9 A5 BF B8 BA 92 58 44 5D 59 5D 6E 4F 59 4B 4C 4E 52 65 48 4A 41 53 4F 51 56 50 4C 69 53 56 56 56 58 58 52 50 66 73 66 6A 66 62 20 4E 78 71 6A 6E 64 75 74 4B 67 70 7E 7B 6D 57 71 7A 72 53 70 73 7E 63 79 60 3A 28 1E 1B 00 00 0A 1F 1E 2D 01 0A 04 05 13 2D 0B 1C 14 31 0A 2D 1A 10 18 11 07 15 15 35 18 19 18 23 38 3B 20 21 21 0D 3F 20 2A 34 33 27 20 21 16 23 36 3A 36 32 0B 35 30 37 15 22 30 3B 32 17 3A C4 CD C1 CE C7 DB C9 C0 F6 CA C3 CA 86 8A 84 F1 D3 D8 D3 99 93 9F 8D C9 DB D0 DB C2 E2 DE D7 DE AA E9 E9 FB FD CC E0 F8 F1 F7 E5 F3 C5 F2 F7 F1 F5 F6 DB F6 F2 F0 EE D1 F7 E5 F5 FD DF E4 D7 FD 8F 88 83 8C 8A BB 89 95 96 A0 8F 8D 89 95 A6 84 99 90 9F 8B 91 8A 92 9A B1 9C 9C 9E 84 B4 9B 99 A5 B9 9B BD B7 A3 A9 9A AB B7 A8 82 A9 AB AB B7 89 AF A1 B5 BB 88 B5 B9 A6 BB 93 BE BA A2 B9 BB 69 44 46 4D 47 5B 45 42 4C 6A 54 44 4B 64 4B 4B 5E 52 4C 50 51 51 68 44 42 56 73 5E 58 53 5D 41 63 64 66 5F 6F 63 79 68 41 6C 6C 74 6B 69 35 4A 7C 7D 6B 7C 6A 5C 73 71 67 7E 7E 23 59 71 72 66 0F 1F 2B 06 02 1A 01 03 50 31 01 0F 01 02 37 00 16 1E 1B 0D 11 0D 2E 1C 1C 14 15 25 0F 07 11 30 24 2F 07 2F 28 3C 29 39 04 31 2F 2C 12 28 02 2C 38 34 36 38 3D 3C 35 11 37 25 35 3D 1A 32 22 30 C6 FE DB CC ED DA DF D9 CD CE E9 D2 E3 C9 C5 C7 D6 DE DC FA DF CF C8 D4 DD DD F6 DE D8 C3 F7 DA E6 E4 FA CA EF FF F8 E4 ED ED C6 EE E8 F3 C2 E4 F7 F2 F4 E0 D0 FE F1 F8 D1 F2 E0 E5 FF F8 FA D3 85 85 9C BA 87 95 89 BD 8D 8A 8E 95 AA 8E 8A 80 B5 8B 8C 90 91 91 8F AA 9B 87 98 B2 9E 92 97 9E 88 A4 B0 9E A7 BB A4 83 B7 AE A5 B3 AF A4 93 AC AE B3 9B B6 B2 B0 AE 9B BD BD A4 9C B7 AF BD B8 5F 46 7F 40 4A 5B 44 61 4B 4D 45 72 52 5E 48 40 68 48 4B 70 4A 5A 51 4E 60 40 43 62 53 43 40 5C 64 6C 7B 4B 7B 7C 65 63 67 70 73 21 48 62 73 76 3A 49 7D 6C 6A 7A 6E 6E 7A 67 64 61 2C 38 3B 73 0F 0E 0C 1A 40 1D 09 18 16 06 12 12 48 04 0B 08 55 09 1D 0C 0A 1A 0E 0E 5D 11 05 02 1F 19 11 06 39 25 2D 3E 3D 0D 0E 0E 62 16 0B 29 32 33 34 7F 75 74 3E 3C 3B 3B 2F 73 30 31 33 38 78 34 3B 7B DF C0 87 C7 CB D8 DF 82 D6 C6 C3 C9 C8 C8 C8 CA DD C2 97 CB CD CC 92 C5 DF DF 8F D4 D2 DE C0 DC E5 E5 B5 FC E5 C2 ED FF E9 E6 F4 F1 F3 EB F7 E0 F2 EF EC E9 A4 B0 B3 FB F7 F6 F4 E2 B8 FA F5 E7 81 8E 9C 9E 8F 9B 8F 85 CC 80 8F 8C C9 8A 85 97 91 9E 8C 8E 9F 8B 9F 95 DD 9E 91 83 9D 92 80 85 BF A7 BB AC E1 9D BF BE 8B B7 A5 AC 8F B4 85 A6 AE B2 AE BC 8B AD B0 B8 BC B2 B2 BD B3 B3 97 EF 76 6C 41 5D 42 4E 4E 00 70 56 4E 4F 43 55 78 47 4F 52 54 5D 4D 63 0E 5E 6A 06 72 7F 7A 67 68 05 56 68 64 60 6B 61 78 51 76 66 72 6C 6F 69 65 69 46 7F 7D 6F 7B 73 73 6D 7F 76 7E 65 4A 55 61 66 03 05 0D 1A 1D 23 0D 14 07 11 3C 35 14 06 00 0C 14 1C 28 15 1F 0B 1A 12 00 1E 5E 33 03 04 1D 1B 2F 38 3B 05 2F 36 29 3F 1E 16 34 28 2A 34 18 11 28 3A 3C 30 30 38 0C 2F 3D 27 35 32 22 3E 3B 3B F6 FF DA C8 CA C6 C2 CA F2 D1 CF D5 C3 C4 D0 CA C8 95 DB CA CE DA CE D4 DD D7 DC D8 DB DE C0 FA F8 EF ED FB FD AF E0 E4 EF EA F4 D2 E3 F3 F0 EC F4 FC EB D4 FF F1 FD FA F7 E1 BE C5 E4 F6 F0 FC 84 8C B8 9B 81 9B 89 8E 96 8A 8F 8F C8 A8 96 81 9F 89 8B B5 97 92 95 89 93 87 99 9E 98 D9 A4 90 B8 A2 A7 AD 9D AA B8 B9 AB AD A7 B2 8B A6 AA A4 BD BE AA F7 8A AD BD B9 BB BD B7 81 A4 B8 A0 B0 49 5F 41 46 40 01 63 5F 46 46 52 52 6A 4E 49 4C 4E 5A 4C 50 51 51 12 71 5B 5E 59 45 75 42 46 47 6F 65 7C 59 6F 7B 64 5E 6D 76 6E 65 4F 73 61 68 69 6F 77 6B 7F 78 79 59 73 67 71 42 62 78 66 74 0D 0E 48 00 1D 4F 08 04 11 13 0F 12 03 03 2B 31 2A 33 17 15 1A 1A 0E 32 26 23 26 10 1A 02 11 36 25 25 2C 20 3A 26 23 23 06 22 34 20 09 37 21 37 3B 35 3C 68 11 2F 39 2F 33 3D 34 63 15 38 3A 31 C3 DF C1 C6 C0 E6 D8 C8 CF D0 EF D1 C3 D5 C5 CB DE F8 CD CA CA D0 D1 EE C6 C1 D9 DF D1 F8 C4 D0 F8 EA E6 ED CD FA FF F9 ED EE D3 F8 EB E5 EB E9 D5 EB FD EB FF F1 F8 DE E7 E0 E4 FE FB D3 F5 E1 8F A4 98 8C 9C 8E 82 89 A1 96 93 95 89 8A A5 86 99 94 8D 97 8A B0 8C 98 80 92 9E 95 B5 82 87 81 A5 A6 9B AC A2 AA AF B9 AD B1 8F B1 A3 B5 A5 AB BE 94 BA B3 BB BC A8 8D A0 BC A0 B4 A4 A3 AD 9A 5A 4E 5A 48 40 4B 63 4F 48 46 43 55 76 55 4B 55 5F 49 4C 40 6D 5A 50 58 51 47 5F 43 65 43 55 47 7E 2B 7A 6C 7D 7B 63 7F 67 23 72 64 60 75 61 76 72 3B 6C 76 75 7A 72 5B 73 7A 7C 74 72 37 60 7A 4A 19 0D 1A 1A 00 1E 08 42 13 12 04 10 0E 0B 10 09 5B 0B 1C 0D 0C 15 12 1C 5D 4C 33 24 49 24 19 2F 2A 3B 2C 6E 23 23 2A 2B 2D 60 20 21 26 2D 2B 74 1D 39 30 32 7F 28 32 72 37 35 32 24 2E 24 21 8A E4 E9 FC FA E7 8C DF C7 D0 D4 CE D4 C2 84 D1 D5 D0 DD D7 FB D1 D8 9D C0 D6 C3 C5 D9 C5 D1 95 F8 EE EE FB EB FC E4 AD F6 EC EB E4 E8 C6 F1 F1 F2 F4 EA F0 EA E6 BC C8 C0 DF B0 F9 F7 E4 B4 FB 85 9F C8 8F 81 9A 82 89 A4 82 89 8D C6 93 8B C5 99 94 96 97 9B 9C 88 DD 86 9C D0 9E B7 82 80 9D EA F1 E8 8F AF A6 A0 ED B6 AC E0 A6 A3 B3 E4 B0 A9 BE AA F9 B7 B1 BA B2 F2 E9 F0 9D BF B4 B1 BB 49 4E 08 5A 4B 5D 5A 44 41 46 00 74 74 6B 04 4D 5B 48 18 57 51 4B 1C 5B 5D 46 5E 55 70 56 5D 59 6F 6F 28 7D 61 2F 6F 62 6C 6D 65 62 72 3D 24 37 2B 2D 29 2B 2B 2C 24 2D 22 23 20 25 22 24 39 40 04 00 06 06 19 01 41 5D 52 57 52 58 4B 5F 54 50 48 49 55 4A 4A 47 4E 44 5F 32 31 41 4E 41 46 47 7A 79 7D 7A 7D 78 7C 7D 72 73 70 75 75 6A 11 2B 31 35 37 2E 30 72 6C 6D 66 61 69 7C 6E 67 61 67 98 86 9B 9D 96 9D 95 80 E3 E2 90 99 90 E3 C1 C3 DB CE D4 CD 9E CC C8 CF DB DD D7 9C 9C 9A 84 85 B9 B8 B9 A4 BF BF BC BD B2 AE B0 B1 B6 B7 B5 A8 DB DA A9 A0 AC D9 FD F4 FE B3 E4 FE B6 F4 FB FB 84 8E 8B 9D CE 9B 83 CD 8D A2 95 95 8E C7 CC 97 9F 88 8C 96 8C 9A DC 89 9D 98 95 9F DF CD D4 BC AE AE A6 BD A7 BB B5 ED B1 A6 B2 B7 A3 B5 E4 AC A9 FB AD B7 BF A9 BD B4 BE B2 B2 BD B3 F7 BA BA 5D 6D 49 40 42 4A 48 0D 56 4C 00 53 43 54 50 4A 48 5E 18 4A 5B 4C 4F 54 5D 5D 0A 11 5E 43 40 45 79 31 27 26 69 6E 78 68 75 62 79 2F 67 64 67 6A 6F 75 6C 6A 30 6E 69 7C 7C 67 7F 66 73 65 3A 76 05 06 47 08 1E 06 43 1B 53 4C 07 00 12 02 13 04 03 54 11 1D 1B 11 08 14 06 0A 2F 14 18 13 04 1A 23 25 3C 1D 3C 36 6C 39 2D 63 27 24 32 67 2D 21 3F 35 2C 30 2A 26 7C 38 3C 37 20 3E 3F 39 20 75 CC D9 C7 C4 8E C3 C3 CE C3 CF C8 CE D5 D3 C5 D5 D3 94 CE 88 91 D8 DD C9 D7 C4 D1 C8 99 D0 D1 C1 D5 EE E6 ED FE E0 E5 E3 F6 F0 D4 F3 FF A7 F0 EA BA FC FD ED BE FA F2 F9 E2 FC F9 FF E2 E4 B4 F3 98 84 85 C9 82 80 8F 8C 8E 8B 8F 92 92 8B 8D 86 9F 95 9B 9C 9F 8F 95 D2 84 C2 DF 83 83 9B 91 86 9E B9 B1 E9 BA A0 EC AA A7 B7 E0 AD AF A4 A1 AB B9 BE AB F9 B8 AD B3 B0 F2 BF BF B2 B7 BB BC BA 59 5F 40 4C 4F 43 58 45 6B 47 45 4F 52 4E 50 5C 1A 53 5D 58 52 4B 54 07 12 7F 59 52 53 59 57 50 47 6A 66 68 69 6A 7E 2D 77 70 65 73 26 54 6D 62 74 7E 7C 56 6B 6B 3C 7F 6B 33 63 74 64 61 71 67 26 02 0B 0C 00 0C 09 4D 0F 02 0E 00 01 02 16 45 1D 1E 0C 59 0C 0A 10 18 01 53 15 03 04 18 06 4F 6A 07 21 2A 2B 21 2F 28 62 0E 21 2F 27 20 21 37 60 7B 34 30 2D 2B 39 33 37 21 70 21 39 25 20 75 C5 DB CD C7 C7 CB DC DF CD C5 C9 CD C3 C8 C2 C3 D6 D2 D6 DC E1 DE DF DE D7 C0 C3 FD DF D4 D1 DB E9 EE DB EC FC F9 E5 EE E7 D2 F5 E0 E8 F3 EB F2 FF E9 CC FC EC F2 F5 F3 F3 FF A6 F3 F2 F2 A5 A7 89 DA C5 DE 88 D8 8E C0 D6 D3 82 D7 CB 85 81 87 9B D6 CE 9A CE CC 9F 9E C2 91 C9 C0 97 C3 A0 87 B3 EB BC A6 EE A8 A9 B9 E2 AF A9 A2 A3 A9 A7 A0 A9 FB BE AB B1 B2 FC AE B7 A1 A6 B4 A4 F7 A3 BC 5E 43 08 5A 4B 43 4A 0D 51 4A 47 4F 43 43 04 46 5F 49 4C 72 5B 4C 48 4F 57 5F 10 5D 5F 44 40 50 64 62 66 6E 2E 7A 7E 61 38 23 3C 69 37 39 5D 6A 6F 3B 7B 78 70 3F 72 72 65 33 62 74 62 62 66 7B 4A 1F 07 49 1A 07 09 4D 03 13 10 0D 0F 04 05 11 13 14 16 57 42 50 14 4C 4C 34 35 25 39 27 20 3C 05 05 1B 19 01 1C 18 2C 32 33 2C 28 25 26 30 2C 35 35 77 21 73 28 2B 2A 7F 35 3F 23 3B 7A 21 27 C6 CE C6 CA C1 CB C9 C9 CE CC C3 C0 CA CF CB D6 CE F9 CA D6 C9 CC D9 CF 92 C1 D5 C2 C3 DB C0 95 B0 AB CD E4 FE FB F5 AD F0 E6 F3 F1 E9 E9 F7 E0 B4 B5 B8 DC F0 EB F5 E9 EB B3 AD B1 DB F2 F9 F7 8F 99 C8 CE C9 CF 81 84 91 90 89 8F 81 A4 DE B9 BD 92 8C 95 9F 9D D1 AF 87 9D 9E 94 84 AB 96 80 A3 A7 AC BA 92 FD AF 95 F7 81 8E 8D 96 9B F4 99 B9 B7 B1 BC B0 AB 80 A9 B7 A1 BD B8 B8 B6 B8 89 4E 4E 5E 4C 42 40 5C 40 47 4D 54 7D 64 52 57 4C 54 5E 4B 4A 72 5E 45 58 40 6F 64 43 57 53 5D 5B 6D 5B 64 68 7A 69 63 7F 6F 2D 42 74 75 6E 6A 60 69 68 54 78 67 7A 6E 41 56 72 64 70 54 7E 7A 71 03 05 0F 35 2D 00 02 1B 07 11 14 04 14 14 38 36 0E 09 11 17 19 2B 13 31 1D 10 11 1D 1F 0D 11 11 19 3F 3A 20 20 28 0F 22 2C 35 25 33 32 22 36 6B 39 28 3B 36 30 29 39 2F 26 17 35 3D 33 30 35 21 CF FF CD C5 CB C8 DE CC CF E6 CD C0 CF CB E9 C0 C9 C8 DD D7 D9 DA CE CE FF D2 DE D0 D1 D2 C6 8F AA E2 E6 E0 FA E6 ED E1 EB F9 E1 F5 EF E8 EA AB B4 B5 D5 FC ED EC F9 F3 F5 F6 E2 D2 F7 F9 B3 E1 CA 88 9A 8C 8F 9B 89 CD AB AE 85 92 95 82 8A 82 9F 89 D8 9F 8C 90 91 DD 86 8A 80 94 D6 BA 91 86 B9 AE A6 AE AB BD EC BA AB B7 A8 E1 A8 A6 A9 A0 FA FB B9 B5 AC BA BD B9 AB F3 B5 A9 BF A4 A0 A6 04 66 4D 5A 5D 4A 42 4A 47 51 53 6C 47 49 45 42 5F 49 02 19 1E 52 59 4E 41 56 5E 56 53 45 47 15 7D 6E 7A 6C 2E 63 63 6C 66 66 64 2F 4B 62 77 76 7F 75 7F 7C 6C 6C 51 7C 7C 72 77 74 64 2D 34 7C 04 02 1C 00 0F 03 05 17 03 17 09 0E 08 47 02 0C 14 12 0B 11 1B 1B 52 3C 01 00 15 05 05 32 0C 16 22 2A 26 2E 2B 3C 0D 2E 21 2C 35 2F 32 34 17 3C 37 39 37 35 2D 10 2C 29 3B 3C 3E 02 33 25 3D 30 D9 EF C9 D0 EC CE DE DE E1 D1 D9 D1 D2 C8 E5 C6 D9 D4 CD D7 CA CC FD CE C1 D6 C4 F3 D7 DB D5 DB E9 EE FB C6 FE EA E2 C2 F0 E7 E5 F3 F5 CA E1 F6 E9 FA FF FC ED CF F3 EE FB E7 F9 FE F8 DA F1 E6 99 8A 8F 8C 9D A0 9C 88 8C A7 85 8D 8F 91 81 97 9F 9F B9 8A 8D 9A 88 B0 97 80 83 90 91 92 87 A6 AF B8 BB A0 A1 A1 BF 8E AD AD B4 A0 AF A9 A1 B7 A9 88 B6 B8 AE AC B4 B2 A6 97 B1 A5 B7 FB F4 9C 6E 11 08 05 0E 61 4D 40 47 19 00 0D 06 65 45 49 5B 55 5B 5C 04 1F 71 58 41 40 51 56 53 76 57 56 65 7E 66 7D 4F 7C 7F 68 76 4A 64 43 67 6B 65 6B 79 7E 56 7C 6A 6B 75 73 75 47 69 61 73 56 77 76 05 1E 06 1D 2F 0B 08 04 16 0A 0F 0F 07 0B 2D 0B 1C 14 3C 1C 0D 1C 0E 14 02 07 19 1E 18 3A 1D 1B 23 26 3D 24 0D 27 2D 23 25 26 09 12 09 06 27 26 35 2E 36 2D 17 3B 08 32 26 32 3C 13 37 3B 35 3B C9 CE E9 DF CF C6 C0 CC C0 CF C5 E3 C7 CB C5 CB D9 DE EA DC CD DA CE CB D7 D7 F2 D0 DA D6 DA D6 EF DF E7 FD EF E3 C5 E3 D7 D0 C4 D5 E9 F3 E5 E9 D3 F5 DA CD DD DB F9 FF E6 D6 E1 E4 FF E3 ED D0 9B 9E 81 9D 97 A6 82 AF B6 A0 CC C1 A8 86 89 80 DA B6 9D 8A 8D 9E 9B 98 B7 8B 93 99 97 99 93 90 8F B3 AB A1 AF A1 AB A8 8B A7 85 B9 A5 AF A5 AB BD BE 96 B8 B3 BA 8F B8 A1 A0 B9 BE B8 A4 97 BA 44 5F 49 40 40 4A 5E 64 46 6E 45 52 55 46 43 40 75 4B 5D 57 7A 5A 50 54 44 56 42 54 52 76 47 46 6F 7F 5B 70 63 6D 63 61 4B 67 53 75 67 73 71 76 59 69 7D 78 6A 76 73 73 46 7A 7D 74 3A 37 47 6C 07 09 07 05 54 4F 40 4D 32 11 09 02 03 5D 44 49 5A 28 11 1D 1B 45 5C 51 52 27 09 01 13 4D 54 38 2F 38 3B 28 29 2A 03 3D 27 2D 0F 33 22 22 36 0A 28 3F 3D 2B 17 3B 1B 2F 3D 26 20 18 32 07 3B 26 C3 DF C1 C6 C0 E6 C8 F9 CD D7 C1 CD F7 D2 C5 CB CE D2 CC C0 F8 D6 D0 D1 D7 D7 E1 C4 D7 D9 C0 DC FE F2 DB E0 EA EA CF E2 EF EE E5 EF F2 CB E5 F6 EE CE E8 FD FF EB F9 C9 FB FE F5 DE E4 F3 F1 E7 BE 92 98 8C A7 8B B8 84 8F 86 A9 8F A0 88 96 86 9F BE 80 89 97 8D 9D 89 9B 9C 9E A5 9F 9A 91 A1 B8 A2 AF AE AB BD 9C BF AB A0 A5 95 B4 A6 AD A9 95 BD BE AA BB AB 93 AF BB B4 B9 BF B7 BB 87 A1 4B 5F 5D 5A 6F 4B 48 44 56 4A 4F 4F 47 4B 6D 4B 5C 54 71 4D 5B 52 4F 11 12 7C 40 54 58 17 44 47 63 68 6D 33 2E 42 69 7E 71 62 67 64 49 77 61 6B 4A 74 6B 70 6A 76 73 73 5D 63 75 7F 46 65 7D 76 0F 24 18 0C 00 20 1E 09 07 11 29 05 2A 0E 15 10 13 1F 19 0D 17 10 12 2D 00 1A 13 14 25 0E 19 17 25 27 72 69 6E 0A 34 3D 06 22 34 24 7C 67 64 0B 3B 36 3D 63 7E 12 39 2E 21 32 37 34 19 27 20 3C C5 C5 FB CC DC C6 C9 E8 DA D3 C9 D3 C7 D3 CD CA D4 FF D9 CD DB EC D9 CF DB D6 E4 C8 C6 D2 98 95 DC EA E4 FC EB B5 AC C5 ED EF E9 E5 E7 FE F7 D6 FF E8 EB F0 F1 F1 EF CE F7 E7 E3 DC F3 E4 E7 F4 8D 8E BB 8C 9D 9C 85 82 8C 90 A3 8E 88 93 85 8C 94 9E 8A B5 91 8B AF 89 97 83 BD 98 98 BB 9B 81 87 AA B0 85 A1 BB 99 A3 A6 A6 B2 AD AF A2 B6 8B BB B6 BD 98 A8 BE B5 B1 B3 B1 BC B4 90 A2 A0 A0 58 4E 5B 68 58 4E 45 41 43 41 4C 44 69 57 50 4C 55 55 4B 76 4E 4B 55 52 5C 60 55 43 5F 52 7D 51 45 7B 7C 60 61 61 58 74 72 66 53 75 74 6E 6F 60 4A 69 71 7A 7B 53 7D 6E 66 47 62 70 72 7E 7A 72 2E 0A 1C 0C 38 0E 1E 04 03 01 0C 04 32 0E 07 0E 36 12 0B 0D 2A 0D 1D 19 17 49 50 5D 56 26 00 0C 70 6B 64 69 01 3D 28 28 30 63 29 25 7C 67 17 2C 3D 35 39 35 64 7F 11 34 3C 07 22 30 32 32 02 3A C6 DE C5 CC E3 C6 C2 8D D6 D1 C1 C5 C3 87 D2 CA D6 CE D5 DC FD 85 E0 FA DB C7 DC D0 D4 9A E6 C0 E4 E5 ED FB D2 ED F9 E4 EE E7 F3 DD B4 E4 DC B0 D8 D5 D4 C9 C2 AF C0 FE FE FA F5 FF E2 CB E0 F0 98 86 81 87 8F 83 B0 89 87 95 85 8D 89 97 89 80 94 8F A4 BB 8B 8C 95 93 97 80 83 BD 97 8E 91 87 96 9F BA A8 AA A6 A2 AA 92 AF A1 B5 A0 A8 B6 A8 F4 99 AD AA B7 B1 B9 AE A1 9F B1 A8 B3 A5 88 9D 43 58 5C 46 5C 56 70 6C 45 44 52 44 41 46 50 4C 55 55 4B 65 76 56 4F 49 5D 41 49 70 51 50 46 50 6D 6A 7C 60 61 61 5C 62 75 66 72 55 74 66 60 60 69 4B 79 6B 7F 72 79 69 77 61 63 3F 75 64 59 74 12 3F 1A 08 0A 0A 3A 02 0E 16 0D 04 2B 06 1C 45 0E 09 19 1D 1B 5F 0A 12 1E 06 1D 14 22 18 00 14 26 1D 27 25 3B 22 29 19 2D 37 21 2D 66 31 2B 29 2F 36 3D 0D 37 32 39 14 3C 27 35 23 20 36 38 01 C3 C6 CD 89 C7 C1 D8 C8 D0 D5 C1 CD 8A 87 D7 C0 D9 F9 D9 CA D7 CC EA D2 DE C6 DD D4 FF D9 C0 D0 F8 FD E9 E5 CC EE FF E4 F1 A3 F6 EE EA F2 E9 E0 BA F2 F6 ED FB ED EA FC FE BF B0 E2 F3 F4 D0 F0 86 9F 89 AF 87 83 98 88 90 A5 89 8D 92 82 96 C5 98 82 D8 BD 9B 93 88 9C DE D3 D5 B3 97 84 9D 86 98 AA BC A0 A1 89 A5 A1 B6 A6 B2 87 AF AB B0 A0 A8 FB BA A0 FE 9D BD AE BB A0 F0 A3 B7 A3 BD BA 06 0B 0D 64 4F 57 76 42 4C 46 68 44 4F 40 4C 51 77 5A 40 19 44 50 52 58 12 5B 55 58 51 5F 40 19 2A 7F 61 6A 65 7C 41 64 6C 59 6F 6F 63 4F 61 6C 7D 73 6C 54 77 71 3C 67 7D 7D 75 31 7E 72 7D 72 02 1F 44 49 1A 06 0F 06 11 20 15 12 12 08 09 31 13 18 13 2A 17 05 19 3E 07 00 04 1E 1B 57 00 1C 29 20 68 3A 27 35 29 0F 23 31 10 33 2F 24 21 11 23 2B 3D 0A 2A 3B 1F 3C 3E 30 25 3D 37 23 3D 3A C4 FF D1 D9 CB 8F D0 8D F6 CC D4 C0 CA 87 C6 C4 D6 DA D6 DA DB 85 9C E9 DD C7 D1 DD F4 D6 D8 D4 E4 E8 ED A9 FE EA FE EE E7 ED F4 BE AF B8 D7 E0 F6 FE FB ED FB FB BC E9 FB FE F5 B1 FF F9 B4 F3 85 99 8B 8C CE 81 83 99 C2 82 8C 8D 89 90 81 81 DA 9D 97 8B DE DF 93 8F 96 96 82 D1 82 8E 84 90 83 A5 AB A6 BC BD A9 AE B6 E3 93 8D E9 93 94 E5 AA A9 B1 BA BB FF B1 B8 B3 A0 A5 A3 B3 BA B1 BB 5E 11 08 0E 09 0F 41 48 43 50 55 53 43 4A 41 4B 4E 1B 59 55 52 50 4B 58 56 1F 10 53 43 43 14 12 2D 2B 65 6C 6F 7C 79 7F 67 6E 65 6F 72 27 77 60 76 7E 7B 6D 7B 7B 32 3D 42 7F 75 70 65 72 38 35 09 04 1A 1B 0B 0C 18 4D 31 2F 4F 35 36 47 14 04 08 1A 15 1C 0A 1A 0E 0E 31 1C 1E 1F 13 14 00 1C 25 25 07 3B 2A 2A 3E 6D 0B 07 0F 33 22 22 36 65 2E 22 28 3C 0A 16 1A 0E 26 3C 20 71 3A 38 27 26 8A F0 FC DB 80 8F FF E1 82 CC C6 C7 D5 C2 D0 85 E1 E8 CC D6 CE 9F D0 D2 C1 C0 E4 C3 98 97 E7 F9 AA E4 EE EF FD EA F8 D9 E3 E8 E5 A1 F6 F5 EB E3 F3 EF B8 C2 CA FE F7 F8 B2 E3 E2 FE F0 FE E0 D1 8B 9F 8D C6 BA 86 81 88 B1 8C 95 93 85 82 B0 8C 97 9E D8 90 90 DF 9A 92 80 90 95 B2 CC AB B3 9C BE A7 A9 AB E3 9D B9 A3 AC A6 B2 9D A4 B2 AD A9 BE A8 84 EB BD 87 E9 9F 9C 9F 80 8D E6 8B B7 B9 43 4E 46 5D 72 5B 49 5F 4F 4A 4E 40 4A 7B 40 40 4C 5E 54 56 4E 52 59 53 46 6F 72 44 45 5E 5A 50 79 78 44 68 77 6A 7E 51 56 71 61 65 6F 69 63 55 76 7A 6C 7F 71 6D 71 33 50 66 63 78 78 72 67 66 26 0A 11 0C 1C 33 2E 18 11 0A 0E 04 15 14 2B 07 10 1E 1B 0D 0D 23 33 0F 16 16 02 25 0F 07 11 06 16 04 3A 2D 2B 3D 18 34 32 26 6E 22 35 02 3C 35 33 29 39 2D 37 30 32 1F 27 2A 03 34 3A 3B 38 3A DE D8 FA C0 DD C4 80 8D 86 F1 C9 D2 CD 8B 84 80 9F 9B E9 CD C7 85 9C 9D E6 C1 9E C2 C2 D8 C4 8F AA AB DB C5 4C 2F E3 EB E4 F0 E5 F5 BC A7 46 25 EA E9 F1 FA FB A5 BC BD FD F5 F6 E2 F3 E3 AE B5 CA BF B8 C9 9E 9D 85 8E 87 D9 C0 C9 C6 81 8B 97 DA DB D0 B6 BD B0 D5 DD DA BF 9F 92 97 9B DD 9D A3 B8 BC A6 BC B6 9E A8 B3 B6 A5 B2 B2 97 A5 B7 BB B6 BD AD BB AD AF 9B E2 E3 E0 E1 E6 E7 84 E5 6A 0B 5C 46 0E 0F 7F 59 52 19 00 68 55 64 56 5C 4A 4F 57 17 46 52 50 6E 4B 5E 52 5E 5A 63 4D 45 6F 4D 7D 7D 7B 7D 69 7E 41 6C 6E 75 74 66 67 71 4E 62 68 7C 4C 70 73 69 41 6A 7D 73 79 7B 34 62 0B 18 48 07 01 1B 4C 0B 0D 16 0E 05 46 01 0B 17 5A 16 1D 0A 0D 1E 1B 18 52 5E 4E 51 56 04 0D 18 28 24 24 00 2A 6F 71 6D 65 22 33 32 2F 20 2A 28 3F 35 2C 2A 3B 2C 2F 34 3D 3D 38 3E 3A 3E 30 34 D3 D8 CD DA DD C6 C3 C3 E1 CC CE D5 C7 CE CA C0 C8 FF DD D5 CA DE 9C DF D3 C1 C3 F5 D3 DB C0 D4 AA FD E9 E5 FB EA AC E1 ED F7 F3 C0 E1 E0 F6 E0 FD FA EC FC FA BF D8 D2 DF D0 F1 FD F5 E2 F8 F4 9E 82 87 87 CE 8D 8D 9E 8B 90 B0 93 8F 84 81 C5 96 9E 8E 9C 92 8C DC 91 9B 9E 99 85 B8 98 80 D5 B9 BE B8 B9 A1 BD B8 A8 A6 E3 AC A4 B0 A2 A8 B6 9E 94 95 F9 BC A6 FC A9 BB BE B5 95 99 9A F4 B7 53 0B 5C 40 4D 44 5F 0D 41 4C 55 4F 52 73 4D 46 51 48 18 5A 51 4A 52 49 7A 56 59 5A 5F 59 14 74 79 63 61 45 6F 7C 78 40 63 71 6B 43 6F 63 45 76 71 56 71 7D 6E 70 75 73 66 50 2A 4D 51 7E 60 79 0B 09 45 3B 1B 01 02 08 10 3F 02 14 0F 0B 00 16 26 49 1B 21 4B 3D 32 31 22 2F 40 2D 15 1B 1D 10 24 3F 14 3D 2B 3D 21 24 2C 22 2C 1D 22 22 32 20 36 34 28 34 3B 31 28 01 10 26 23 38 38 32 27 26 E6 CA D1 CC DC F3 F8 DF C3 C7 C9 CF C1 F7 C8 C4 CE DD D7 CB D3 91 FE C8 C1 DA DE D4 C5 C4 F8 D4 F3 EE FA D5 C6 E6 FF F9 ED F1 F9 DD C7 E0 E3 F7 FF FC F9 ED F7 F0 F2 EE CE DB F9 E2 E2 F8 E6 EC AB 8C 8F 9B 8B 88 8D 99 8B 8C 8E A9 83 8E 8F 80 94 BA 8B 91 97 D1 9F 8E 81 9C 85 83 95 92 B6 80 A3 A7 AC E9 A8 BD A3 A0 8A AA B3 B5 A9 B5 BD E5 AE A2 A8 BC 92 BA AA B8 BE E1 80 A3 BF B4 B1 F5 49 43 49 47 49 4A 5F 0D 41 4C 55 4F 52 07 46 44 48 48 6A 58 50 58 59 1D 50 52 42 42 62 5E 57 5E 79 59 6D 7F 6B 7D 7F 6C 6E 4F 65 6F 61 73 6C 57 7F 6D 7D 6B 6D 7E 70 3D 5E 76 7E 76 62 7F 57 74 06 08 1D 05 0F 1B 05 02 0C 43 34 18 16 02 27 5F 26 3C 11 0D 12 1E 1E 50 20 06 1E 1F 13 05 28 17 3F 22 24 2D 3D 13 7E 2E 1A 76 02 0F 0A 17 18 75 06 38 34 30 3B 31 28 01 26 36 22 3C 3F 39 35 39 F6 CF CD DF CB C3 C3 DD CF C6 CE D5 FA E5 D1 D6 D3 D5 DD CA CD F3 DD C4 D7 C1 EC E5 C4 D6 D0 DC E4 EC D8 E5 EF FB EA E2 F0 EE AE C3 F3 F4 ED EB FF E8 EB D5 FF E6 F9 EF CE DB F9 E2 E2 F8 E6 EC B6 AA 8F 8E 9C 8A 8B 8C 96 8A 8F 8F 95 BB AC 8C 89 8F 97 8B 87 BE 9B 9A 80 96 97 90 82 9E 9B 9B 98 AE BE AC BC BC AD A1 EC A0 B3 83 AF A3 E4 84 A9 B0 9A B0 BA 9E AF B6 93 B4 B7 A3 B3 B0 B5 A1 4F 4F 08 5D 47 4C 47 5E 02 0B 6C 40 55 53 0D 71 53 56 5D 7D 5B 53 5D 44 66 5A 5D 54 1A 17 59 46 49 31 54 4E 67 7B 60 6C 60 2E 52 74 68 69 61 77 46 79 6D 70 72 7B 6F 41 20 70 48 24 54 59 58 45 36 5B 34 0A 02 06 09 03 16 3F 14 04 14 0A 0D 0B 1B 17 24 1D 1B 09 19 11 1D 03 1D 14 18 03 28 37 3F 38 21 27 2B 3C 3F 01 23 3A 25 33 1A 13 36 24 3E 32 36 3E 0E 33 3D 29 34 3C 22 3C 78 15 21 26 C3 C5 CD DA DD E3 CD D4 C7 D1 FC E9 CF D4 D0 CA C8 C2 E4 F8 D9 D8 CE D8 D5 D2 C4 D8 D9 D9 C7 E9 C2 E2 FB FD E1 FD F5 CC E5 E4 F2 E4 E1 E6 F0 EC F5 F5 CC F0 FD F4 D0 FC E1 E7 D1 F6 F1 E5 F1 F2 8B 9F 8D 8D C0 8C 9F B9 8B 8E 85 B5 8F 8A 81 C5 89 8F 99 8D 97 8C 88 94 91 80 A6 9E 9A 82 99 90 EA BB BA A6 A8 A6 A0 A8 94 AC AC B4 AB A2 E4 B3 BB B7 AD BC 88 88 9D 8D 9B BD A6 B0 BA BE B0 F5 7E 43 41 5A 0E 67 45 5E 56 4C 52 48 45 46 48 61 5B 4F 59 7A 4B 4C 48 52 5F 13 59 42 16 56 40 41 6B 68 60 6C 6A 2F 78 62 22 6A 6E 65 6F 64 65 71 75 69 38 3B 3C 31 3C 4B 73 7F 65 74 65 37 77 7A 1F 05 1C 49 19 06 00 01 42 01 05 41 15 1E 0A 06 12 09 17 17 17 05 19 19 52 04 19 05 1E 57 1D 1B 2E 22 2B 28 3A 20 3E 2D 31 63 23 2E 33 29 30 6B 7A 18 39 35 32 7F 0F 38 26 05 31 3D 23 32 74 3C C4 D8 DC CC CF CB 80 8D CD D1 80 C2 D4 C2 C5 D1 DF 9B D6 DC C9 9F 9C CA DB C7 D8 DE C3 C3 94 D4 FE FF E9 EA E6 E6 E2 EA A2 F7 EF A1 EF E9 E0 EC F9 FA EC F6 EC D6 F2 FE FD E1 E2 F4 F5 E3 B4 FA 8C 8D 9B 8C 9A CF B8 84 81 88 93 C1 DB C7 C4 BE A7 DB B7 D9 D3 DF DC B5 D2 DE D0 D1 BA D7 D9 D5 EA 88 E8 E4 EE 8B A3 BA AC 96 B0 E1 BA E7 88 A4 A9 AF F8 E4 FE FF A0 FD 84 BC BC A4 BB B2 F4 E8 0A 6F 49 50 6C 4E 5E 6C 51 48 73 48 5C 42 66 4C 5E 68 51 43 5B 73 5D 4E 46 60 59 4B 53 78 44 50 64 43 61 6E 66 43 63 7A 52 71 65 77 6F 68 71 76 59 77 77 6A 7B 4B 6E 7C 76 76 63 40 63 78 60 70 2B 18 1B 0C 1A 39 03 01 17 0E 05 20 15 0C 44 27 13 1F 58 55 5E 2C 15 07 17 49 50 5D 56 3E 10 4F 6A 67 68 0A 22 20 3F 28 26 79 60 6D 66 05 2D 21 60 7B 74 79 1F 2C 37 67 72 7F 70 13 3F 33 07 3C D0 CE 92 89 82 8F ED DE C9 F0 C9 DB C3 9D 84 E1 DB CF D9 99 CD DA CE D4 D7 C0 90 92 CD 87 C9 F6 B0 D7 CF E0 FA E3 ED EF AF D1 F5 EF E8 E2 F6 D9 F8 EE F1 F5 FA EC C0 AF F1 CB A5 D3 D8 DB C4 C9 DA B7 8B 85 87 8A 82 99 BE 97 85 93 8B 8E 8A 84 96 A7 9C 9C 88 9A 90 92 82 9E 95 9F 82 AB B6 80 B9 A2 A6 AC BD BC 80 AC BB A6 B2 9D 92 B5 A5 A1 B3 B5 BF 89 B2 BE A8 BB BD A1 BD FF 94 A2 A7 BC 44 4E 5B 5A 62 4E 55 48 50 7F 6D 4E 42 52 48 40 49 67 71 57 5A 56 5F 5C 46 5C 42 42 6A 7E 5A 51 63 68 69 7D 61 7D 22 6E 71 4F 69 6F 63 58 23 7E 2A 66 3F 39 7A 7E 68 7C 32 60 75 63 7F 72 67 35 1A 19 07 19 0B 1D 18 04 07 10 2C 04 10 02 08 45 1E 1A 0C 18 5E 0C 19 0F 1B 16 03 51 55 0C 44 08 06 2E 3E 2C 22 10 03 23 62 37 29 22 2D 08 2A 65 38 3A 2A 79 3D 33 33 2E 37 06 20 35 37 23 31 01 D3 DB CD C5 C7 C1 C9 FE C7 D1 C9 C4 D5 CB CD CB DF F7 DD CF DB D3 F5 D3 D6 DA D3 D0 C2 D8 C6 95 EB E7 FA EC EF EB F5 AD E3 E7 E4 E4 E2 EB ED EB FF D2 F6 FD FB E7 F4 F4 E1 E7 FF E3 FF F4 F5 F9 AE 8A 9C 88 D4 CF A3 83 AB 8D 89 95 DC C7 AB 8B AF 8B 9C 98 8A 9A C6 DD BD 9D B3 9D 93 96 86 CF EA 84 A6 9D BC B6 8B A8 B6 8E A9 AF 8B A6 BC A6 AF A8 AC B6 B3 97 B5 AE A6 BC A2 B8 B5 B6 B8 91 4B 5F 49 6A 5B 5C 58 42 4F 03 48 48 55 53 4B 57 53 58 59 55 1E 5B 5D 49 53 13 51 5D 44 52 55 51 73 2B 69 6D 6A 6A 68 59 6B 6E 65 21 75 6F 6D 63 6E 48 70 76 69 3F 70 74 7C 76 30 7C 77 65 7F 70 18 27 01 07 0B 3C 09 1F 0B 06 13 28 02 08 02 03 09 1E 0C 10 10 0C 08 1C 1C 10 15 3F 17 1A 11 3C 24 38 3C 28 20 2C 29 6D 2C 22 2D 24 05 7D 18 02 33 2F 34 38 3C 72 0E 28 3C 3D 35 23 0A 35 21 3C C6 CF DB F5 9C CC F4 98 E0 ED EC F1 FA 97 F8 C6 D6 D2 DD D7 CA E3 C8 D8 C0 DE D9 DF D7 DB E8 D1 EF FD ED E5 E1 FF E1 E8 EC F7 DC C3 F3 F4 ED EB FF E8 EB D5 FF E6 F9 EF CE C7 E2 F0 F2 FE FA F2 BA 87 89 9D 88 80 9E 80 CC A1 95 92 8F 89 81 96 89 B7 99 80 9B 8D A0 B0 9D 97 85 9D 93 84 A8 A6 BE B9 A9 BD AB A8 A5 A8 B1 9F 93 B5 B4 A6 B0 A0 BD A2 F6 BA AD 98 B9 B3 B7 A1 B1 BD 95 B6 BA F2 5E 0B 4B 41 4F 41 4B 48 02 50 54 53 47 53 41 42 43 1B 4B 5C 4A 4B 55 53 55 40 10 46 5E 5E 58 50 2A 78 7C 7B 6F 7B 69 6A 7B 23 73 75 67 73 61 25 73 68 38 6E 71 6D 77 74 7C 74 7C 7E 71 64 47 61 18 0A 1C 0C 09 16 5D 43 52 22 0E 41 03 1F 07 00 0A 0F 11 16 10 5F 14 1C 01 53 1F 12 15 02 06 07 2F 2F 68 3E 26 26 20 28 62 30 34 33 27 33 21 22 23 7B 3B 2B 3B 3E 28 34 3C 34 7E 71 13 2F 37 30 DA DF C1 C6 C0 95 8C 97 82 EC CE E8 C8 CE D0 CC DB D7 D1 C3 DB F2 D9 C9 C0 DA D3 C2 E5 C3 C6 D4 FE EE EF F0 AE F8 ED FE A2 E0 F2 E4 E7 F3 E1 E1 B4 B5 B6 A3 BE D0 F2 DE E0 F6 F1 E5 F3 F3 C7 E1 98 8A 9C 8C 89 96 CC 9E 96 82 92 95 83 83 CA CB D4 BA 96 D9 9B 87 9F 98 82 87 99 9E 98 D7 9C 94 B9 EB A7 AA AD BA BE BF A7 A7 E0 B6 AE AE A8 A0 FA A8 AC AB BF AB B9 BA AB F3 A2 A4 B8 B9 BD BB 4D 05 08 6C 56 4C 49 5D 56 4A 4F 4F 1C 07 1E 05 68 4E 56 6A 4A 4D 5D 49 57 54 49 11 41 56 47 15 79 7F 67 79 7E 6A 68 23 2C 2D 41 6F 26 62 7C 66 7F 6B 6C 70 71 71 3C 75 73 60 30 7E 75 74 61 67 18 0E 0C 49 19 07 05 01 07 43 13 15 14 06 10 00 1D 02 58 0A 0A 10 0C 0D 1B 1D 17 5F 56 32 0C 16 2F 3B 3C 20 21 21 76 6D 78 63 13 35 29 37 05 2B 7A 3E 20 3A 3B 2F 28 34 3D 3D 70 39 37 24 74 3A C9 C8 DD DB DC CA C8 8D D5 CB C9 CD C3 87 D7 D1 C8 DA CC DC D9 C6 9C D9 D3 C7 D1 91 D2 D2 D8 D0 FE E2 E6 EE A0 AF C9 F5 E1 E6 F0 F5 EF E8 EA BF BA A1 B8 CB FB F2 F3 EB F7 C0 E4 E3 F7 E3 F1 F2 93 CB 9F 88 9D CF 9E 88 8F 8C 96 84 82 C9 CA CB BB 95 D8 9C 86 9C 99 8D 86 9A 9F 9F D6 9F 95 86 EA A4 AB AA BB BD BE A8 A6 E3 B7 A9 AF AB A1 E5 A9 AF AA B8 AA BA BB A4 F2 A1 B5 BC B9 A1 BD BB 4D 05 08 6C 56 4C 49 5D 56 4A 4F 4F 1C 07 1E 05 7D 5E 4C 74 5B 4B 4E 54 51 40 62 44 58 17 70 54 7E 6E 27 5D 67 62 69 5A 6D 71 6B 68 68 60 24 71 73 76 7D 4A 6A 7E 68 78 32 5C 62 75 73 65 2E 35 4A 04 1A 0D 0B 1D 4C 0E 03 0D 03 04 0A 47 16 00 0B 0E 1D 0A 0A 3C 1D 13 11 16 1C 51 19 05 10 10 38 6B 0B 26 20 21 29 2E 36 2A 2F 2F 7C 67 05 26 39 34 2D 37 2A 65 7C 0C 27 32 3E 25 3F 23 2D 6F 8A E4 DA CD CB DD 8C E4 E6 99 80 F2 CF C3 C1 9F 9A F4 CA DD DB CD 9C C9 CB C3 D5 8B 96 E3 C6 DC ED EC ED FB AE FF FE E4 E1 E6 BA A1 D2 F5 E5 EC F6 F2 F6 FE BE F0 FA FB E1 F6 E4 AB B6 C4 E0 FA 9A CB 84 86 9D 9C D6 CD B6 82 8B 84 C6 97 96 8A 9C 92 8C C3 DE BB 9D 89 97 DC A4 98 9B 92 CE D5 99 A4 BD BB AD AA F6 ED 90 A6 B1 B4 A3 B4 B0 8C BE E1 F8 F9 9D B3 B3 AE B7 F3 A1 A5 AF ED F4 85 45 58 41 5D 47 40 42 0D 41 4F 4F 52 43 07 56 40 4B 4E 5D 4A 4A 6F 53 4E 5B 47 59 5E 58 17 7D 71 30 2B 44 60 60 64 2C 42 41 4C 20 73 63 76 71 60 69 6F 54 70 70 74 3C 52 51 5C 3E 31 44 72 65 60 0F 18 1C 20 0A 55 4C 22 10 07 05 13 34 02 15 10 1F 08 0C 29 1F 0D 1D 10 17 07 15 03 05 26 01 14 24 3F 21 3D 37 0B 29 2B 2B 2D 29 35 2F 28 2A 16 3F 2F 2C 30 30 38 12 3C 3F 36 03 3D 3F 27 24 34 CD CE FB DD C1 DF E0 C2 D1 D0 E9 D5 C3 CA D7 F1 DB D0 DD E9 CC D0 DA D4 C6 FA C4 D4 DB C4 F5 D1 EE E2 FC E0 E1 E1 ED E1 D2 E2 F2 E0 EB E2 F0 E0 E8 E8 D7 EB FA FA EE EE B2 F4 E2 FE E3 E7 B4 E5 86 8A 8B 80 80 88 CC 9F 87 92 95 84 95 93 AB 97 9E 9E 8A 8A DE 98 8E 92 87 83 DE D1 A4 92 85 80 AF B8 BC 80 AA F5 EC 99 A7 BB B4 92 A3 B3 B0 AC B4 BC 91 AD BB B2 9D BE B1 BC A5 BF A2 84 B1 A1 5E 42 46 4E 67 5B 49 40 60 4C 4F 4D 43 46 4A 76 5F 4F 4C 50 50 58 75 49 57 5E 79 5F 42 52 53 50 78 58 6D 7D 7A 66 62 6A 4B 77 65 6C 44 68 6B 69 7F 7A 76 4A 69 76 68 7E 7A 76 62 42 73 63 60 7C 04 0C 21 1D 0B 02 38 04 0F 06 3A 0E 08 02 29 04 14 1A 1F 1C 0C 2C 19 09 06 1A 1E 16 3F 03 11 18 1E 22 25 2C 08 3D 2D 20 27 00 2F 2F 20 2E 23 16 3F 2F 2C 30 30 38 15 29 37 3E 14 30 22 32 00 3C C7 CE FB CC DA DB C5 C3 C5 EA D4 C4 CB F7 C5 D6 C9 CC D7 CB DA EC D9 C9 C6 DA DE D6 FF C3 D1 D8 D9 EE E4 EC ED FB E3 FF D1 E6 F4 F5 EF E9 E3 CC EE FE F5 CD F7 F2 F9 C7 FD FD F5 C2 F3 E3 E0 FC 84 8C A1 9D 8B 82 B8 88 9A 97 A1 93 83 86 B7 80 8E 8F 91 97 99 B6 88 98 9F A0 89 9C 94 98 98 A6 AF BF BC A0 A0 A8 85 B9 A7 AE 90 A4 B4 AE AB A1 89 BE AC AD B7 B1 BB 94 A6 B6 BD 82 A2 A5 BD BB 4D 78 4D 5D 5A 46 42 4A 6B 57 45 4C 67 44 50 4C 55 55 6B 5C 4A 4B 55 53 55 5A 44 54 5B 67 5B 5C 64 7F 7B 5A 6B 7B 78 64 6C 64 49 75 63 6A 40 6A 6F 79 74 7C 4D 7A 68 69 7B 7D 77 58 62 72 79 46 06 02 0C 0C 1C 3C 09 19 16 0A 0E 06 2F 13 01 08 29 1E 14 1C 1D 0B 13 0F 3E 1C 13 10 1A 1E 0E 10 2E 18 2D 3D 3A 26 22 2A 0B 37 25 2C 00 2E 28 20 09 3E 2C 2D 37 31 3B 14 26 36 3D 17 39 39 20 06 CF DF DC C0 C0 C8 E5 D9 C7 CE EC CE C8 C0 F7 C0 CE CF D1 D7 D9 F6 C8 D8 DF F4 C2 DE C3 C7 E7 D0 FE FF E1 E7 E9 C6 F8 E8 EF C0 EF ED E9 F5 D7 E0 EE EF F1 F7 F9 D6 E8 F8 FF C0 FF E4 F8 F3 C7 F0 9E 9F 81 87 89 A6 98 88 8F A2 8C 84 94 93 B7 80 8E 8F 91 97 99 B6 88 98 9F BC B1 84 82 9F A7 90 BE BF A1 A7 A9 86 B8 A8 AF 91 A1 A5 AF A8 88 AA B9 BA B4 B0 A4 BA B8 8E B7 A7 A4 B8 B8 B0 9D A1 4F 46 6C 46 5B 4D 40 48 75 4A 54 49 6A 4E 4A 4E 69 5E 4C 4D 57 51 5B 74 46 56 5D 63 45 44 67 50 7E 7F 61 67 69 46 78 68 6F 42 6C 68 61 69 69 60 74 6F 4B 7C 6A 6B 75 73 75 5A 64 74 7B 47 75 7C 18 28 07 05 01 1D 3F 08 16 17 09 0F 01 2E 10 00 17 38 17 17 1A 16 08 14 1D 1D 23 14 02 03 1D 1B 2D 02 3C 2C 23 03 25 23 27 0C 30 35 2F 28 2A 36 09 3E 2C 2D 37 31 3B 14 26 36 3D 13 3F 30 00 30 D2 DF E9 DB CB CE FF C8 D6 D7 C9 CF C1 EE D0 C0 D7 FD D1 DB D1 D1 DD DE D1 DA FC D4 C0 D2 D8 FA FA FF E1 E6 E0 FC DF E8 F6 F7 E9 EF E1 CE F0 E0 F7 D6 F1 F7 F1 EB FD E8 E0 FC D6 F8 F4 F8 FA F4 89 88 81 A5 8B 99 89 81 AD 93 94 88 89 89 97 B6 9F 8F 8C 90 90 98 B5 89 97 9E A2 90 98 90 91 A6 AF A7 AD AA BA A0 BE 9E A7 B7 B4 A8 A8 A0 8D B1 BF B6 9A B6 B1 B3 B9 BC BC 9F BF B2 B7 BB BD AF 4F 4F 7B 4C 5A 5B 45 43 45 6A 54 44 4B 64 48 50 49 4F 5D 4B 7D 50 50 52 40 5A 5E 56 7A 52 42 50 66 58 6D 7D 7A 66 62 6A 4B 77 65 6C 49 75 60 60 68 49 7D 68 6B 7A 6F 69 42 72 62 70 7B 72 60 70 18 18 3B 0C 1A 1B 05 03 05 2A 14 04 0B 2E 07 0A 14 1E 1C 38 1D 0B 15 12 1C 53 26 10 1A 02 11 4F 6A 22 3B 1D 2B 22 3C 22 30 22 32 38 04 26 36 16 32 34 2F 1C 26 2B 39 33 21 3A 3F 3F 05 3F 3B 22 EF D3 DC CC C0 DC C5 C2 CC EF C9 CF C3 F4 CC CA CD F9 D9 CA DB F3 D9 CB D7 DF F5 C9 C2 D2 DA C6 E3 E4 E6 C5 EB F9 E9 E1 C7 FB F4 E4 E8 F4 ED EA F4 D9 F9 FA F5 DC F3 F1 FD E1 D5 E9 E2 F2 FA E6 83 84 86 AB 81 9D 88 88 90 A0 8F 8D 89 95 A1 9D 8E 9E 96 8A 97 90 92 B1 93 91 95 9D B4 96 87 90 86 AE BE AC A2 9B A9 B5 B6 8F AF A2 A7 AB 97 B1 B5 A9 B9 BE BB AC 89 AE B7 A1 84 A3 B7 B3 B1 A6 69 4A 46 0E 5A 0F 4A 44 4C 47 00 40 48 5E 04 56 4E 54 4A 58 59 5A 7F 5C 5C 14 44 11 55 45 51 54 7E 6E 28 7A 7A 60 7E 6C 65 66 20 6E 60 27 70 7C 6A 7E 22 39 51 6D 78 78 60 60 58 78 65 63 7B 67 13 28 1D 1A 1A 00 01 4D 11 17 12 08 08 00 27 0A 14 1F 11 0D 17 10 12 32 02 16 02 10 18 13 37 00 39 3F 27 24 6E 2B 2D 39 27 15 21 2D 33 22 10 3C 2A 3E 1B 2C 2D 2B 33 30 72 20 29 3C 34 38 38 16 DF D8 DC C6 C3 8F CD CE C1 CC D5 CF D2 E4 D1 D6 CE D4 D5 99 CD DA D0 D8 D1 C7 DF C3 E5 D2 D8 D0 E9 FF ED ED C7 FB E9 E0 CD F1 E4 E4 F4 A7 F4 E9 FB F8 F1 F7 F9 BF EF E9 E0 F2 E4 F4 F1 EE B4 E2 98 84 86 8E CE 8C 99 9F 90 86 8E 95 C6 94 90 84 8E 9E AB 8D 8C 9E 88 98 95 8A D0 97 9F 99 9D 86 A2 AE AC F2 E7 EF EC AC B6 E3 A6 AE B4 E7 8D 8B 89 8F 8A 8C 93 9A 92 89 81 8C 83 94 9A 92 97 81 63 64 66 76 67 6B 78 44 4F 46 4F 54 52 07 4B 43 1A 4C 59 50 4A 56 52 5A 12 52 53 52 53 44 47 15 7E 64 63 6C 60 43 63 6E 63 6F 53 75 69 75 65 62 7F 68 44 4F 71 73 69 70 77 52 7E 70 7A 6E 67 7C 19 3B 1A 06 0A 1A 0F 19 2B 27 31 14 09 13 0D 0B 1D 38 0D 0B 0C 1A 12 1E 0B 3A 34 20 03 18 00 10 0E 2E 24 28 37 1E 39 22 36 2A 2E 26 12 3E 34 20 16 34 2C 0A 37 25 39 13 3D 27 39 3E 38 36 38 03 CB C7 DD CC FD DB C9 DD EA CA D3 D5 C9 D5 DD F1 C3 CB DD EF D1 D3 C9 D0 D7 E7 C9 C1 D3 F3 D1 D9 FE EA CB E8 E2 EC F9 E1 E3 F7 E9 EE E8 D3 FD F5 FF D6 F1 F7 C8 F0 F0 E8 FF F6 D1 FF F7 FB ED E6 83 98 BC 80 8D 84 BF 84 98 86 A1 8D 8A 88 93 A6 9B 97 9B 8C 92 9E 88 98 A0 96 91 9D 82 9E 99 90 9E A2 AB A2 BD 8E A0 A1 AD B4 83 A0 AA A4 B1 A9 BB AF BD 8B BB BE B0 A9 BB BE B5 85 A4 B6 B0 B0 59 6A 44 45 41 58 6F 4C 4E 40 55 4D 47 53 41 77 5F 5A 54 4D 57 52 59 6B 5D 5F 45 5C 53 76 58 59 65 7C 4B 68 62 6C 79 61 63 77 65 53 63 66 68 71 73 76 7D 5A 76 7E 72 7A 77 52 7C 7D 79 60 55 77 08 19 0D 1F 07 0E 18 08 32 11 09 02 03 25 1D 31 13 18 13 2A 17 05 19 30 13 07 05 03 1F 03 0D 31 2B 3F 2D 0F 3B 3B 39 3F 27 00 2F 2F 32 35 25 26 2E 0F 21 29 3B 16 32 2E 26 21 25 3C 33 39 20 14 CE CF C1 DD C7 C0 C2 CC CE EA CE C7 C9 E8 C2 C3 97 FE C0 DA D6 DE D2 DA D7 E5 D5 DF D2 D8 C6 95 E2 EA FB A9 E0 E0 F8 AD F1 F6 F0 F1 E9 F5 F0 DC F5 EE EA B9 F2 F6 FF F8 FC E0 F5 B1 F2 F8 F1 E6 CA 85 87 9D CE 8E 80 81 8D 94 C0 95 8E 8E 97 C5 99 94 96 97 9B 9C 88 94 9D 9D A5 82 93 85 B0 90 A7 A4 9A AC AF A3 80 A2 A1 A2 AC 92 B2 A8 B6 A4 BD BE AB 85 96 B6 AF A9 BD A1 A9 81 B9 A4 9D B1 10 0B 04 09 69 5D 43 58 52 6A 44 1B 06 0B 04 66 55 56 55 5C 50 4B 06 1D 62 41 10 0C 16 63 46 1B 7A 79 28 34 2E 5B 7E 23 6D 65 66 72 63 73 24 38 3A 58 6D 6A 6A 70 71 5E 41 47 5C 5C 42 54 2E 49 2D 02 1C 05 0F 0D 41 3F 17 0D 0E 04 14 3B 06 10 13 17 1C 0A 22 4D 1F 25 47 31 3E 3D 26 2B 44 29 29 27 21 2C 20 3B 10 39 27 31 2D 28 28 26 28 19 3E 3E 2E 3C 32 30 2C 30 37 3D 24 0D 14 22 27 3C C4 CE DB DA E2 CE D5 C8 D0 FF F4 D3 C7 C3 CD CB DD EB D4 D8 CA D9 D3 CF DF 9D F2 C4 C5 DE DA D0 F9 F8 C4 E8 F7 EA FE D1 C0 F6 F3 E8 E8 E2 F7 F6 D5 F9 F2 FC FD EB EF C1 DD E1 F4 F4 E4 C3 ED E5 8F 98 B4 A5 87 82 85 99 AD 91 84 84 94 B3 9D 95 9F D5 9B 8A DE DF B1 92 96 9A 96 88 D6 98 86 91 AF B9 E8 EA 9D BB A3 BD E2 AF AF B2 B5 E7 B4 B7 B3 B8 BD F9 AD B7 B3 A8 BE B7 F0 B3 B3 F7 B8 B0 59 58 08 5D 46 4E 42 0D 4E 4A 4D 48 52 07 54 57 53 58 5D 6D 5F 54 59 1D 42 41 5F 57 5F 43 14 45 78 62 6B 6C 2E 7C 64 62 77 6F 64 21 64 62 24 68 75 69 7D 39 6A 77 7D 73 32 7F 79 7C 7F 63 34 65 18 02 0B 0C 3D 1B 03 1D 42 0F 0F 12 15 47 14 17 13 18 1D 59 0D 17 13 08 1E 17 50 13 13 57 19 1A 38 2E 68 3D 26 2E 22 6D 2E 2A 2D 28 32 67 34 37 33 38 3D 0D 3F 34 39 7D 22 21 3F 37 3F 23 74 25 D8 C2 CB CC 8E DC C4 C2 D7 CF C4 81 C4 C2 84 C9 DF C8 CB 99 CA D7 DD D3 92 DF D9 DC DF C3 94 C5 F8 E2 EB EC C3 C4 D8 DE F6 EC F0 A1 EA E8 F7 F6 BA EB EA F0 FD FA BC EE FA FC E5 FD F2 B7 F6 F0 CA 87 8D 9A 9D CF 98 85 83 8D C0 8C 87 95 8F 80 8E DB 99 8A 95 DF 8C 8F 9B 90 95 B2 CC AB B3 9C BE A7 A9 AB E3 9D B9 A3 AC A6 B2 9D A4 B2 AD A9 BE A8 84 EB BD 87 E9 9F 9C 9F 80 8D E6 8B B7 B9 43 4E 46 5D 72 5B 49 5F 4F 4A 4E 40 4A 7B 40 40 4C 5E 54 56 4E 52 59 53 46 6F 72 44 45 5E 5A 50 79 78 44 68 77 6A 7E 51 56 71 61 65 6F 69 63 55 76 7A 6C 7F 71 6D 71 33 50 66 63 78 78 72 67 66 26 0A 11 0C 1C 33 2E 18 11 0A 0E 04 15 14 2B 07 10 1E 1B 0D 0D 23 33 0F 16 16 02 25 0F 07 11 06 16 06 29 3B 25 2A 38 02 30 27 25 33 12 3E 34 20 74 38 2B 0D 3F 34 39 7D 22 21 3F 37 3F 23 74 25 D8 C2 CB CC 8E DC C4 C2 D7 CF C4 81 C4 C2 84 C8 D5 C9 DD 99 CA D7 DD D3 92 DE D1 C3 DD D2 C0 95 EB F8 E3 A9 FE FD E5 EE E7 D0 F4 EE F6 A7 E8 EA E9 E8 B8 E9 EC F6 FF F8 B2 E0 F8 FE E3 FB F0 B5 88 8E C8 84 81 9D 89 CD 96 8B 81 8F C6 8A 85 97 91 9E 8C D9 9C 96 98 DD 82 81 99 92 93 A3 95 9E AF EB B8 BB A1 A9 A5 B9 E2 B3 B2 A8 A5 A2 E4 B6 B2 B4 AD B5 BA FF BE B8 F2 BF B5 A2 A5 F7 A0 BD 4B 45 08 44 4F 5D 47 48 56 03 42 48 42 07 54 57 53 58 5D 6A 6A 6F 68 4F 5B 54 57 54 44 17 44 47 63 68 6D 4A 34 53 4B 64 76 6F 61 63 2B 55 71 6B 74 7E 6A 45 7C 6A 75 71 76 60 4C 23 75 4F 21 57 24 27 38 35 5E 33 0F 01 0B 06 0E 15 3A 13 01 17 17 12 16 18 12 23 18 18 04 16 1C 1E 06 1A 11 1B 3E 17 0A 3C 3D 26 22 28 31 30 0C 20 3F 22 36 19 0E 29 39 3D 37 31 3B 0D 3E 32 24 37 39 25 39 7B E8 DE DB C0 C0 CA DF DE EE C2 D9 C4 D4 FB E6 D0 C9 D2 D6 DC CD CC F3 DF D8 D6 D3 C5 C5 EB FB C7 EE EE FA DD F7 FF E9 FE DE D0 F4 EE F6 C8 F6 E1 FF E9 CC E0 EE FA B2 FE E1 C0 E4 FE E6 B7 F8 FA 99 98 C8 99 9C 86 8F 88 C2 90 88 8E 93 8B 80 C5 98 9E D8 95 9B 8C 8F DD 86 9B 91 9F D6 83 86 9C AD AC AD BB EE BF BE A4 A1 A6 94 A0 AD A2 E4 B5 A8 B4 BE B0 AA FF AC AF BB B0 B5 F1 A5 BF BB A0 46 4F 08 4B 4B 0F 41 42 50 46 00 55 4E 46 4A 05 4E 49 51 5E 59 5A 4E 1D 42 41 59 52 53 64 40 5A 7A 2B 64 66 7D 7C 2C 7D 70 6A 63 64 26 74 6C 6A 6F 77 7C 39 7C 7A 3C 70 7D 61 75 31 62 7F 75 7B 4A 1F 1A 00 09 08 09 1F 42 13 12 08 05 02 30 04 11 1E 58 09 0C 10 1A 14 06 53 00 03 1F 14 11 55 39 23 27 3C 22 2B 6C 2F 27 63 2C 24 35 34 64 31 32 3A 36 79 2A 2D 35 3A 35 36 22 71 26 25 3D 36 CF FF DA C8 C7 C3 C5 C3 C5 83 F3 D5 C9 D7 F0 D7 97 E8 EC CB DF D6 D0 D4 DC D4 90 DE D0 D1 C7 D0 FE C8 B2 D5 C9 E6 F8 E1 E3 E1 AD D3 F3 E9 EA E0 E8 C7 FA EC F7 F3 F8 EE CE A1 F3 C9 A3 D5 DA D9 BA B7 D8 B5 8D 83 85 88 8C 97 BC 95 83 95 89 8C 94 9A 94 A5 9A 9A 8A 98 9E 9C 80 9C 93 99 80 A9 88 BE BB A0 A0 AA BF BE 8E A2 B9 A4 B4 9B 90 B7 BB BF B1 B7 B9 8F B0 BC A6 B5 BF A3 BB F9 96 A0 59 42 46 4C 5D 5C 60 4C 5B 46 52 7D 64 52 57 4C 54 5E 4B 4A 71 5D 56 58 51 47 43 6D 79 45 50 50 78 5F 71 79 6B 7C 50 59 70 62 69 6D 6F 69 63 56 6E 74 68 56 6C 7B 79 6F 46 6A 60 74 38 74 67 3C 43 45 48 20 0A 4F 51 4D 29 02 07 08 2D 00 48 45 36 12 16 1C 5E 3D 0E 18 13 18 3C 18 18 12 54 17 38 2E 29 22 6E 23 25 23 27 30 6C 61 16 28 2D 2B 2E 28 78 7F 7E 19 35 3A 27 21 35 22 15 6D 08 12 C3 DF C4 C8 CC 82 FE D8 CC CD C5 D3 FA C5 D1 CC D6 DF CB E5 8C DC E4 88 F0 FD FC E1 EA 87 E8 D6 E6 E2 ED E7 FA D3 F8 E8 F0 EE E9 EF E7 EB D8 E1 FF ED FD F5 F1 EF F1 F8 FC E7 CC D3 E3 E4 FD FB 8F 98 9B A5 8F 96 89 9F BE B7 92 80 82 8E 8A 82 AA 97 99 8D 98 90 8E 90 DC B1 85 82 9F 99 91 86 B9 87 A9 B0 AB BD 90 85 AB B0 B4 AE B4 BE 98 84 BD BC AA BC B9 BE A8 B4 BD BD A3 8D 9E BE A7 A1 45 59 51 68 49 48 5E 48 45 42 54 48 49 49 74 4A 53 55 4C 4A 7F 51 58 7B 5B 54 45 43 53 44 1A 56 79 49 67 71 5D 66 76 68 40 6C 78 21 75 6E 7E 60 4A 3D 5E 39 33 3F 36 55 5E 50 42 74 78 7C 7B 5D 03 0C 00 46 22 00 1B 2C 06 15 4E 41 25 0B 05 16 09 12 1B 38 1A 09 52 5D 3A 1A 17 19 59 3B 1B 02 08 39 21 2A 25 6F 3F 24 38 26 01 26 21 35 21 22 3B 2F 31 36 30 7F 2F 29 2B 3F 35 14 2E 23 31 3B D9 C2 C7 C7 82 8F 89 E4 CC D5 C5 D3 D5 CE CB CB 96 9B 9D EA D6 D0 CB 9D C5 DA D3 DA C5 F5 C1 DC E6 EF A8 EA FB FD FE E8 EC F7 A0 E3 E7 F5 C5 C6 DB D3 D4 BF C9 DD F9 FA FB FD AA B1 B6 EB B4 D0 84 8F D2 C9 CE 80 9E 89 87 91 C0 8C 89 83 8D 83 83 DB 8A 9C 8F 8A 99 8E 86 D3 9F 83 92 92 86 D5 BA A7 A9 AA A7 A1 AB ED B0 A6 B1 B4 A3 B4 B0 87 BB A8 BD 94 BF A7 88 AF B3 B7 B9 BF B1 86 A1 B4 44 5F 41 5D 57 7E 59 42 56 4A 4E 46 6B 46 5C 71 48 5A 5C 50 50 58 6D 48 53 5D 44 58 42 4E 75 47 68 62 7C 7B 6F 68 69 5E 7B 6E 62 6E 6A 74 47 6D 7F 78 73 7C 7A 5E 70 71 7D 64 54 78 65 76 76 79 0F 28 07 05 01 1D 2A 02 10 0E 01 15 2D 0E 0A 01 0F 0F 1B 3F 17 1D 13 13 13 10 13 18 3A 12 02 10 26 38 0A 28 3D 2A 1C 28 30 2A 2F 25 66 24 2B 2B 2E 3A 31 37 2D 7F 35 33 72 16 28 32 3A 22 30 30 CE F8 DC D0 C2 CA DF E0 C3 DB C9 CC D3 CA E9 CC D4 D2 D5 CC D3 F6 D2 DE C0 D6 DD D4 D8 C3 F0 DC E7 EE E6 FA E7 E0 E2 CC EE EF EF F6 C2 EE F7 E4 F8 F7 FD DA F1 F3 F3 EF A3 D2 FC FD F9 E0 D0 FC 99 8A 8A 85 8B AC 83 81 8D 91 D2 B1 83 95 8D 8A 9E B6 8D 95 8A 96 8C 91 9B 96 82 D1 9F 84 D4 99 AF B8 BB E9 BA A7 AD A3 E2 8E B5 AD B2 AE B4 A9 B3 BE AA 94 B7 B1 B5 B0 A7 BE F0 B8 A5 F7 B9 BA 58 4E 08 5D 46 4E 42 0D 6F 56 4C 55 4F 57 48 4C 5F 49 75 58 46 56 51 48 5F 71 51 42 53 67 51 47 63 64 6C 29 6D 60 62 79 63 6A 6E 72 26 6E 6A 25 5F 63 7B 75 6B 7B 79 79 42 76 62 78 79 73 67 45 04 07 29 05 0B 1D 18 1E 21 0C 0E 15 07 0E 0A 00 08 2B 16 15 3F 13 19 0F 06 27 11 03 11 12 00 23 2B 27 3D 2C 18 2E 20 38 27 30 16 20 2A 32 21 0C 2E 3E 35 2A 08 3E 30 28 37 1A 24 34 3B 1E 20 30 C7 D8 FB DD CB DF DF EE CD D6 CE D5 E3 C9 C5 C7 D6 DE EB D6 CB D1 D8 CE E6 DA DD D4 FF D9 E0 C7 EB EF ED CA E1 E1 F8 EC EB ED E5 F3 D2 EE E9 E0 D3 F5 CC EB FF FB F9 C9 FB FE F5 D8 F8 C4 F1 F6 85 85 8C 9A BE A3 A8 84 90 86 83 95 8F 88 8A B1 93 96 9D A3 91 91 99 B4 9C 95 9F B8 92 B5 95 86 AF 9E BC AA 81 A9 AA BE A7 B7 84 A8 B5 B7 A8 A4 A3 95 B9 B4 BB 8C A8 BC BC B7 B1 A3 B2 93 BD A6 5A 47 49 50 60 4E 41 48 71 42 56 44 06 55 41 44 56 4F 51 54 5B 1F 48 4F 53 57 55 11 41 5E 40 5D 2A 78 7C 7B 6F 61 6B 68 22 77 69 6C 63 3D 24 51 68 7A 7C 7C 57 7B 3C 20 32 33 44 78 7B 72 34 28 4A 12 11 10 17 42 21 20 4F 07 04 41 2E 2F 5E 08 17 41 0B 0A 50 19 1A 1B 52 1F 11 02 02 23 06 14 2E 2E 0C 28 3A 2A 6C 70 62 10 21 37 23 67 36 20 3B 37 2C 30 33 3A 7C 29 20 32 34 34 76 20 3D 21 C2 8B DB DD DC CE C2 CA C7 83 D4 C8 CB C2 9E 85 DF C3 D1 CA CA DA D8 E9 C0 D2 D4 D4 C5 F4 DB C0 E4 FF A8 A9 FA FD ED E9 E7 F0 D4 EE D5 E6 F2 E0 BA CF F0 FC EC FA BC F4 E1 B3 FE FE B6 F8 FA F0 CA 88 80 80 82 8B CC 9B 87 8D 84 8E 94 AA 91 89 8E 92 D8 8F 9B 91 98 92 80 DD D0 B2 9E 9E 98 91 EA BD AD A7 AA A0 BE ED B5 AA B4 A9 E6 AC A1 BC FA E6 F8 F9 AC BA A8 A8 A0 BD F0 B5 BF A4 B7 BA 44 45 4D 4A 5A 4A 48 0D 52 4A 4E 46 06 55 41 56 4F 57 4C 6D 4C 5E 58 54 5C 54 10 47 53 59 50 5A 78 2B 69 65 7C 6A 6D 69 7B 23 72 64 61 6E 77 71 7F 69 7D 7D 30 3F 53 73 7E 6A 30 7E 78 72 34 61 18 0A 0C 00 00 08 4C 1B 07 0D 04 0E 14 47 07 04 14 5B 1A 1C 5E 0D 19 1A 1B 00 04 14 04 12 10 5B 3E 39 29 2D 27 21 2B 1B 27 2D 24 2E 34 31 21 2B 3E 34 2A 1A 32 30 2F 38 36 73 20 3E 25 3E 20 3C C5 C5 88 CA CF C1 8B D9 82 C1 C5 81 C5 CB CB D6 DF DF 98 D8 D9 DE D5 D3 FD D5 D6 91 9B 97 F1 CD E9 E3 E9 E7 E9 EA DC EC F6 EB D4 EE C2 E6 F0 E4 D8 FA EB FC CE ED F3 F9 E7 F0 E4 D0 E5 E4 F1 E1 BB 9E 87 9D 87 81 8B AC 91 90 85 95 AB 82 97 96 9B 9C 9D AA 87 92 9E 92 9E 9D 95 86 B8 96 99 90 EA A2 BB E9 A0 BA A0 A1 E2 AC B2 E1 A3 AA B4 B1 A3 B5 BD AE 97 AB B9 B0 A1 88 F0 FA F6 98 BA B9 53 0B 65 48 5C 44 49 59 02 4C 52 45 43 55 04 51 43 4B 5D 19 57 4C 1C 5C 5E 5F 5F 46 53 53 44 47 63 68 6D 44 61 6B 65 6B 6B 60 61 75 69 75 50 7C 6A 7E 7E 76 6C 7C 79 48 61 76 44 78 75 7C 67 53 05 19 20 00 1D 1B 03 1F 1B 24 12 0E 13 17 37 00 0E 0F 11 17 19 0C 2F 04 1C 07 18 14 02 1E 17 3C 3E 2E 25 05 27 22 25 39 0B 25 14 2E 33 24 2C 20 3E 17 31 34 37 2B 7C 34 34 73 24 3E 23 34 3C 30 CE E7 E5 FD FA EC 96 F1 E5 CA D4 CD C7 C5 89 F7 CF D5 D6 DC CC E3 DE C8 DB DF D4 C2 EA 85 D7 ED BF C9 C6 C5 DE D3 BC D1 E1 EF E9 E4 E8 F3 D8 F1 FF E9 F5 F0 F0 FE F0 C1 F6 F6 E6 F4 FA F8 E4 F8 8F 85 9C B5 AC 9A 9F 84 8C 86 93 92 AA 86 9D 80 88 A7 AC 8B 9F 9B 95 93 95 A3 9C 90 82 91 9B 87 A7 E5 8A BC BD A6 A2 A8 B1 B0 8C A0 BF A2 B6 99 98 AE AB B0 B0 BA AF AE 9D B1 BA B4 B5 A3 A7 89 65 59 4C 4C 5C 7B 55 5D 47 50 7C 6D 4F 4A 4D 51 73 5D 6C 56 4B 5C 54 58 56 7C 42 55 53 45 60 4C 7A 6E 26 6A 7D 78 65 79 6A 23 74 73 6F 60 63 60 68 3B 68 6B 77 7C 79 3D 73 67 30 5C 77 65 7F 70 1E 22 0E 3D 01 1A 0F 05 07 07 2D 00 14 0C 01 11 5A 12 1E 59 0A 10 09 1E 1A 16 14 3C 3D 23 20 26 3E 24 38 69 22 26 21 24 36 10 14 0D 05 7D 18 02 33 2F 34 38 3C 72 0E 28 3C 3D 35 23 0A 35 21 3C C6 CF DB F5 9C CC F4 98 E0 ED EC F1 FA 97 F8 C6 D6 D2 DD D7 CA E3 C8 D8 C0 DE D9 DF D7 DB E8 D1 EF FD ED E5 E1 FF E1 E8 EC F7 DC C3 F3 F4 ED EB FF E8 EB D5 FF E6 F9 EF CE C7 E2 F0 F2 FE FA F2 BA 87 89 9D 88 80 9E 80 CC A1 95 92 8F 89 81 96 89 B7 99 80 9B 8D A0 BF 87 80 99 9F 93 84 87 BA A8 A1 AD AA BA BC 90 82 B0 A7 A5 B3 92 BE B4 A0 A9 87 8B AD B1 AF 90 B4 BF BA A4 9E A4 B3 B1 A7 7E 52 58 4C 00 4C 5F 5E 52 4C 54 72 5F 4A 46 4A 56 72 5C) */; + + internal static byte[] 4 = new byte[39059] + { + 249, 223, 201, 219, 218, 202, 222, 131, 199, 219, + 197, 154, 134, 135, 153, 133, 239, 213, 203, 204, + 206, 207, 211, 207, 198, 214, 212, 145, 196, 194, + 216, 208, 170, 253, 233, 229, 251, 234, 172, 249, + 251, 243, 229, 192, 234, 235, 235, 242, 186, 239, + 234, 248, 250, 246, 242, 250, 211, 255, 252, 254, + 225, 183, 199, 217, 171, 135, 132, 134, 153, 207, + 184, 189, 163, 143, 140, 142, 145, 199, 183, 169, + 218, 175, 138, 152, 151, 147, 149, 147, 149, 178, + 156, 157, 153, 128, 212, 152, 165, 175, 161, 175, + 183, 239, 163, 191, 166, 166, 178, 128, 170, 171, + 171, 178, 250, 182, 183, 189, 183, 185, 165, 253, + 179, 190, 191, 164, 184, 163, 149, 185, 70, 68, + 95, 9, 67, 64, 72, 68, 68, 90, 0, 81, + 84, 78, 71, 64, 123, 87, 84, 86, 73, 31, + 81, 82, 86, 90, 86, 72, 22, 67, 93, 83, + 70, 78, 94, 76, 66, 61, 83, 68, 81, 92, + 65, 70, 65, 85, 65, 66, 91, 79, 93, 93, + 95, 115, 112, 114, 101, 51, 96, 112, 100, 99, + 125, 116, 6, 75, 11, 5, 1, 28, 9, 77, + 18, 12, 19, 8, 18, 14, 11, 11, 59, 23, + 20, 22, 9, 95, 25, 5, 2, 28, 2, 5, + 55, 59, 56, 58, 29, 20, 30, 6, 2, 26, + 1, 8, 29, 2, 14, 0, 10, 30, 23, 12, + 9, 4, 30, 11, 17, 18, 3, 9, 27, 16, + 27, 14, 30, 30, 7, 1, 229, 249, 241, 232, + 226, 227, 229, 227, 237, 237, 229, 254, 246, 230, + 231, 238, 251, 252, 253, 247, 145, 254, 206, 200, + 222, 214, 254, 208, 219, 210, 213, 214, 233, 228, + 253, 231, 250, 252, 245, 224, 224, 236, 236, 192, + 229, 228, 235, 240, 244, 239, 184, 248, 240, 251, + 188, 238, 235, 254, 242, 254, 250, 183, 249, 224, + 153, 159, 200, 139, 139, 207, 138, 159, 141, 142, + 192, 146, 135, 138, 129, 197, 153, 148, 150, 151, + 155, 156, 136, 148, 157, 157, 159, 131, 146, 146, + 134, 161, 179, 187, 173, 136, 173, 172, 163, 184, + 172, 183, 224, 160, 168, 163, 228, 170, 168, 191, + 189, 171, 254, 171, 165, 173, 183, 243, 189, 164, + 165, 163, 244, 183, 79, 11, 78, 91, 65, 66, + 12, 94, 67, 78, 69, 1, 69, 72, 74, 75, + 95, 88, 76, 80, 81, 81, 108, 79, 91, 80, + 85, 11, 22, 23, 103, 92, 112, 110, 50, 41, + 52, 47, 36, 36, 34, 57, 58, 33, 78, 110, + 119, 113, 117, 105, 97, 88, 121, 120, 110, 120, + 117, 114, 100, 120, 121, 121, 89, 116, 4, 10, + 15, 12, 28, 85, 76, 4, 12, 10, 20, 8, + 7, 11, 13, 31, 27, 15, 17, 22, 16, 81, + 82, 83, 58, 26, 3, 5, 25, 5, 13, 37, + 56, 36, 43, 44, 61, 60, 35, 63, 49, 11, + 41, 50, 50, 40, 54, 60, 10, 41, 55, 58, + 59, 44, 47, 50, 32, 20, 53, 37, 31, 57, + 50, 58, 138, 134, 136, 207, 207, 198, 192, 141, + 214, 204, 128, 211, 195, 211, 214, 204, 223, 205, + 221, 153, 215, 209, 218, 210, 146, 210, 210, 222, + 195, 195, 148, 212, 237, 236, 250, 236, 233, 238, + 248, 228, 237, 237, 160, 172, 166, 225, 229, 236, + 246, 187, 236, 246, 190, 252, 238, 248, 243, 231, + 245, 177, 247, 240, 243, 231, 143, 140, 137, 157, + 135, 128, 130, 205, 141, 129, 138, 132, 133, 147, + 196, 200, 218, 154, 216, 159, 155, 136, 220, 137, + 139, 131, 149, 130, 214, 128, 157, 129, 162, 235, + 188, 161, 171, 239, 191, 172, 175, 166, 224, 175, + 167, 170, 161, 141, 179, 168, 172, 182, 172, 166, + 157, 186, 181, 161, 181, 182, 183, 163, 189, 186, + 68, 102, 73, 71, 79, 72, 73, 95, 24, 3, + 73, 79, 79, 83, 77, 68, 86, 82, 66, 92, + 90, 31, 79, 72, 81, 80, 85, 66, 69, 81, + 65, 89, 102, 114, 120, 104, 124, 110, 97, 104, + 118, 102, 114, 64, 97, 96, 118, 96, 125, 122, + 108, 112, 113, 113, 95, 124, 124, 115, 100, 49, + 112, 126, 122, 113, 74, 10, 15, 14, 28, 10, + 11, 12, 22, 12, 18, 65, 17, 14, 16, 13, + 90, 8, 8, 28, 29, 22, 26, 20, 23, 23, + 80, 31, 23, 26, 17, 85, 26, 121, 13, 49, + 62, 32, 34, 40, 44, 55, 41, 32, 42, 103, + 9, 42, 44, 50, 54, 62, 126, 30, 42, 56, + 32, 50, 55, 52, 27, 56, 34, 60, 196, 204, + 136, 200, 216, 202, 222, 204, 197, 198, 211, 241, + 195, 213, 205, 202, 222, 155, 215, 223, 158, 250, + 196, 205, 221, 221, 213, 223, 194, 222, 213, 217, + 170, 198, 231, 255, 231, 225, 235, 173, 195, 245, + 229, 243, 231, 224, 225, 214, 245, 238, 234, 250, + 251, 236, 188, 237, 224, 250, 243, 244, 229, 183, + 242, 250, 152, 203, 165, 168, 173, 142, 128, 142, + 151, 143, 129, 149, 143, 136, 138, 197, 142, 130, + 136, 156, 178, 150, 146, 152, 147, 129, 156, 136, + 214, 160, 145, 156, 173, 163, 188, 172, 170, 239, + 129, 162, 180, 170, 174, 166, 230, 134, 178, 160, + 168, 186, 191, 188, 142, 186, 174, 180, 189, 183, + 240, 190, 176, 247, 152, 130, 103, 106, 123, 70, + 91, 93, 79, 72, 81, 3, 80, 83, 79, 68, + 65, 86, 26, 93, 87, 75, 30, 115, 107, 112, + 115, 96, 89, 92, 70, 91, 81, 21, 71, 100, + 126, 96, 96, 104, 44, 76, 116, 102, 114, 96, + 97, 98, 84, 96, 104, 114, 119, 125, 62, 112, + 122, 61, 65, 122, 125, 97, 122, 114, 52, 88, + 5, 29, 1, 7, 9, 79, 45, 27, 7, 17, + 1, 6, 3, 52, 9, 10, 21, 15, 16, 28, + 26, 95, 49, 18, 4, 26, 30, 22, 86, 54, + 2, 16, 56, 42, 47, 44, 30, 42, 62, 36, + 45, 39, 96, 46, 32, 103, 23, 40, 53, 52, + 44, 49, 59, 59, 124, 16, 61, 37, 57, 63, + 49, 119, 21, 35, 207, 217, 201, 206, 203, 255, + 197, 219, 205, 215, 128, 241, 201, 206, 202, 209, + 154, 246, 215, 207, 215, 209, 219, 157, 243, 197, + 213, 195, 215, 208, 209, 229, 239, 249, 225, 230, + 234, 175, 227, 235, 162, 211, 208, 204, 199, 180, + 201, 196, 201, 242, 255, 247, 255, 243, 207, 245, + 253, 225, 228, 177, 219, 248, 226, 252, 132, 140, + 200, 168, 152, 138, 158, 140, 133, 134, 192, 177, + 131, 149, 141, 138, 158, 182, 145, 157, 154, 147, + 153, 221, 191, 156, 134, 152, 152, 144, 212, 180, + 188, 174, 186, 168, 169, 170, 236, 157, 167, 177, + 169, 174, 162, 139, 171, 171, 189, 251, 149, 182, + 168, 182, 178, 186, 242, 146, 166, 180, 164, 182, + 179, 176, 10, 123, 77, 91, 71, 64, 72, 108, + 79, 76, 85, 79, 82, 7, 75, 67, 26, 89, + 89, 75, 77, 31, 76, 92, 65, 64, 85, 85, + 22, 85, 81, 83, 101, 121, 109, 41, 97, 127, + 105, 99, 107, 109, 103, 33, 118, 104, 119, 108, + 110, 114, 119, 119, 92, 112, 112, 113, 123, 125, + 119, 116, 100, 55, 86, 116, 4, 15, 27, 42, + 6, 14, 2, 3, 7, 15, 19, 49, 3, 21, + 13, 10, 30, 91, 23, 31, 94, 50, 61, 93, + 20, 28, 2, 81, 19, 25, 2, 16, 38, 36, + 56, 44, 61, 25, 45, 33, 55, 38, 96, 46, + 32, 103, 39, 42, 52, 61, 49, 61, 59, 49, + 63, 56, 114, 58, 62, 37, 51, 37, 34, 52, + 198, 255, 209, 217, 203, 143, 195, 203, 130, 206, + 207, 215, 207, 201, 195, 133, 219, 205, 221, 203, + 223, 216, 217, 254, 221, 222, 221, 222, 210, 222, + 192, 204, 170, 200, 224, 232, 224, 225, 233, 225, + 162, 202, 238, 229, 227, 255, 203, 246, 249, 242, + 244, 245, 255, 235, 243, 239, 225, 195, 245, 227, + 255, 248, 240, 193, 147, 155, 141, 201, 129, 137, + 204, 160, 141, 149, 137, 143, 129, 199, 165, 147, + 159, 137, 153, 158, 155, 178, 147, 153, 155, 149, + 153, 148, 146, 215, 185, 154, 188, 162, 166, 174, + 238, 142, 186, 168, 176, 162, 167, 164, 150, 162, + 182, 172, 181, 191, 248, 182, 184, 255, 145, 178, + 182, 186, 182, 184, 179, 179, 244, 152, 69, 93, + 65, 71, 73, 15, 109, 91, 71, 81, 65, 70, + 67, 117, 65, 66, 72, 94, 75, 74, 87, 80, + 82, 29, 126, 90, 94, 84, 102, 82, 70, 92, + 101, 111, 40, 102, 104, 47, 64, 100, 108, 102, + 97, 115, 38, 85, 97, 98, 104, 126, 107, 106, + 119, 112, 114, 78, 125, 102, 98, 114, 115, 100, + 52, 101, 24, 2, 11, 12, 29, 79, 10, 2, + 16, 67, 20, 9, 3, 71, 22, 0, 29, 9, + 29, 10, 13, 22, 19, 19, 82, 31, 25, 31, + 19, 39, 6, 28, 41, 46, 104, 10, 38, 46, + 34, 35, 39, 47, 16, 36, 52, 46, 43, 33, + 122, 52, 62, 121, 46, 45, 53, 62, 55, 115, + 51, 57, 55, 57, 58, 48, 198, 234, 221, 221, + 193, 221, 201, 202, 208, 198, 211, 210, 207, 209, + 193, 133, 252, 210, 214, 208, 202, 218, 156, 244, + 223, 195, 197, 221, 197, 210, 148, 231, 239, 248, + 248, 230, 224, 252, 233, 173, 207, 236, 246, 232, + 232, 224, 164, 196, 236, 254, 234, 248, 249, 250, + 212, 244, 246, 247, 245, 255, 193, 254, 250, 241, + 133, 156, 200, 185, 139, 157, 133, 130, 134, 176, + 143, 148, 148, 132, 129, 150, 218, 139, 138, 144, + 157, 154, 143, 221, 148, 156, 130, 209, 130, 159, + 145, 213, 139, 173, 161, 187, 163, 174, 236, 161, + 171, 173, 165, 150, 175, 169, 160, 170, 173, 178, + 182, 190, 254, 185, 169, 179, 177, 167, 185, 190, + 184, 155, 177, 180, 89, 95, 5, 90, 95, 90, + 77, 95, 71, 80, 0, 76, 67, 83, 76, 74, + 94, 105, 93, 85, 95, 75, 85, 75, 87, 19, + 99, 69, 68, 82, 90, 82, 126, 99, 40, 64, + 96, 107, 105, 117, 80, 80, 73, 33, 118, 98, + 118, 108, 117, 127, 75, 118, 107, 109, 127, 120, + 97, 51, 96, 99, 127, 116, 113, 102, 74, 13, + 7, 27, 78, 27, 4, 8, 66, 49, 51, 40, + 70, 11, 13, 11, 31, 54, 23, 29, 27, 95, + 26, 18, 0, 83, 4, 25, 19, 87, 38, 38, + 3, 107, 36, 32, 32, 42, 31, 32, 45, 44, + 52, 41, 47, 41, 35, 101, 42, 62, 42, 48, + 49, 59, 17, 62, 21, 58, 62, 61, 51, 46, + 116, 17, 211, 197, 201, 196, 199, 204, 232, 212, + 204, 194, 205, 200, 197, 135, 208, 215, 219, 216, + 211, 208, 208, 216, 156, 219, 211, 208, 196, 222, + 196, 228, 219, 192, 248, 232, 237, 169, 254, 253, + 229, 238, 231, 206, 239, 247, 239, 233, 227, 165, + 219, 237, 253, 235, 255, 248, 249, 189, 215, 253, + 230, 244, 250, 248, 228, 240, 191, 155, 138, 136, + 128, 139, 204, 137, 135, 149, 137, 128, 146, 142, + 139, 139, 218, 146, 150, 217, 219, 187, 147, 138, + 156, 145, 145, 159, 146, 215, 144, 144, 188, 162, + 169, 189, 167, 160, 162, 237, 171, 173, 224, 228, + 150, 166, 182, 164, 184, 180, 180, 176, 189, 255, + 143, 156, 128, 135, 162, 180, 184, 179, 135, 161, + 79, 91, 8, 70, 72, 15, 92, 76, 80, 66, + 66, 78, 74, 78, 71, 5, 105, 122, 106, 25, + 77, 70, 79, 73, 87, 94, 125, 80, 78, 94, + 89, 64, 103, 43, 126, 104, 98, 122, 105, 45, + 100, 108, 114, 33, 114, 111, 97, 37, 123, 120, + 123, 124, 114, 122, 110, 124, 102, 122, 127, 127, + 54, 113, 117, 118, 30, 4, 26, 40, 25, 10, + 31, 2, 15, 6, 64, 46, 21, 4, 13, 9, + 22, 26, 12, 22, 12, 60, 20, 28, 28, 23, + 21, 81, 59, 24, 25, 16, 36, 63, 61, 36, + 110, 0, 63, 46, 43, 47, 44, 32, 50, 40, + 54, 19, 53, 55, 57, 45, 55, 51, 53, 41, + 43, 9, 57, 54, 12, 54, 51, 5, 207, 217, + 203, 204, 192, 219, 140, 233, 199, 213, 201, 192, + 210, 206, 203, 203, 251, 201, 215, 214, 208, 254, + 238, 242, 253, 253, 144, 225, 211, 197, 221, 218, + 238, 216, 252, 232, 224, 235, 237, 255, 230, 163, + 196, 228, 240, 238, 229, 241, 243, 244, 246, 212, + 241, 233, 245, 243, 245, 179, 209, 231, 243, 229, + 245, 242, 143, 203, 171, 134, 128, 153, 137, 159, + 133, 134, 142, 130, 131, 200, 160, 140, 140, 158, + 138, 158, 155, 145, 159, 152, 162, 150, 130, 152, + 153, 147, 212, 154, 172, 235, 174, 168, 189, 187, + 236, 136, 143, 130, 144, 164, 180, 174, 171, 161, + 250, 180, 190, 249, 173, 179, 179, 170, 242, 150, + 157, 144, 134, 178, 166, 188, 69, 79, 8, 70, + 72, 15, 95, 68, 69, 77, 65, 77, 6, 98, + 105, 100, 113, 90, 81, 75, 87, 31, 110, 88, + 94, 82, 68, 88, 64, 82, 20, 124, 100, 111, + 109, 113, 76, 96, 96, 97, 107, 109, 103, 100, + 116, 39, 70, 100, 116, 127, 107, 57, 88, 115, + 125, 105, 86, 118, 102, 120, 119, 99, 125, 122, + 4, 57, 9, 29, 11, 79, 3, 11, 66, 32, + 8, 0, 8, 0, 1, 53, 31, 9, 17, 22, + 26, 95, 19, 27, 82, 30, 31, 28, 19, 25, + 0, 0, 39, 6, 39, 36, 43, 33, 56, 56, + 47, 19, 37, 51, 47, 40, 32, 101, 60, 52, + 42, 121, 19, 48, 49, 56, 60, 39, 37, 60, + 5, 56, 33, 39, 201, 206, 219, 137, 222, 221, + 197, 206, 199, 208, 128, 199, 201, 213, 132, 232, + 213, 214, 221, 215, 202, 202, 209, 152, 224, 147, + 252, 208, 196, 197, 205, 149, 221, 226, 228, 229, + 231, 238, 225, 254, 210, 241, 233, 226, 227, 167, + 203, 246, 249, 242, 244, 245, 255, 235, 243, 239, + 194, 246, 226, 248, 249, 243, 180, 250, 140, 203, + 165, 168, 223, 191, 137, 159, 139, 140, 132, 193, + 137, 129, 196, 168, 187, 201, 181, 150, 136, 150, + 146, 154, 210, 178, 134, 148, 132, 150, 147, 144, + 234, 164, 174, 233, 129, 188, 175, 164, 174, 175, + 161, 181, 169, 181, 139, 171, 250, 153, 185, 181, + 191, 177, 191, 184, 242, 133, 191, 189, 163, 186, + 177, 131, 69, 71, 93, 68, 75, 127, 67, 94, + 75, 87, 73, 87, 67, 7, 114, 74, 86, 78, + 85, 92, 30, 118, 82, 89, 87, 75, 125, 94, + 88, 82, 77, 21, 76, 103, 103, 126, 46, 70, + 98, 105, 103, 123, 77, 71, 79, 39, 84, 96, + 104, 114, 119, 125, 95, 124, 127, 120, 126, 118, + 98, 112, 98, 126, 123, 123, 74, 36, 27, 10, + 7, 3, 0, 12, 22, 12, 18, 32, 16, 2, + 22, 4, 29, 30, 88, 45, 12, 10, 25, 93, + 32, 18, 30, 22, 19, 39, 17, 7, 35, 36, + 44, 105, 33, 41, 108, 0, 45, 53, 41, 47, + 33, 103, 5, 51, 63, 41, 57, 62, 59, 20, + 61, 40, 52, 62, 49, 63, 118, 22, 48, 52, + 218, 223, 193, 223, 203, 143, 225, 194, 212, 202, + 206, 198, 134, 230, 210, 192, 200, 218, 223, 220, + 157, 249, 221, 206, 198, 144, 227, 221, 217, 192, + 229, 198, 254, 226, 235, 226, 221, 248, 229, 227, + 229, 163, 201, 239, 226, 226, 252, 193, 243, 237, + 241, 253, 251, 237, 200, 239, 231, 246, 176, 194, + 226, 229, 241, 251, 141, 159, 128, 201, 167, 129, + 136, 136, 154, 165, 137, 147, 149, 147, 196, 168, + 187, 219, 136, 156, 140, 150, 147, 153, 161, 150, + 147, 158, 152, 147, 212, 184, 139, 235, 184, 172, + 188, 166, 163, 169, 131, 181, 165, 179, 167, 160, + 161, 229, 158, 178, 170, 188, 189, 171, 181, 178, + 188, 178, 188, 241, 159, 185, 176, 176, 82, 96, + 77, 69, 90, 65, 73, 95, 2, 96, 72, 64, + 72, 73, 65, 73, 106, 94, 74, 80, 81, 91, + 28, 82, 84, 19, 125, 112, 22, 81, 91, 71, + 42, 64, 109, 101, 122, 97, 105, 127, 37, 112, + 32, 66, 110, 102, 106, 107, 127, 119, 91, 118, + 123, 121, 122, 116, 113, 122, 117, 127, 98, 55, + 123, 115, 74, 8, 0, 8, 0, 1, 9, 1, + 69, 16, 64, 22, 15, 3, 16, 13, 42, 30, + 10, 26, 27, 17, 8, 28, 21, 22, 80, 33, + 4, 30, 23, 16, 106, 4, 59, 42, 39, 35, + 32, 44, 54, 44, 50, 7, 39, 52, 48, 101, + 31, 22, 25, 121, 14, 58, 46, 52, 61, 55, + 3, 61, 57, 32, 116, 16, 231, 234, 136, 249, + 203, 221, 197, 194, 198, 240, 201, 198, 200, 198, + 200, 133, 255, 246, 249, 153, 238, 218, 206, 212, + 221, 215, 227, 197, 217, 212, 220, 212, 249, 255, + 225, 234, 174, 220, 224, 226, 245, 208, 237, 238, + 233, 243, 236, 236, 244, 252, 220, 246, 235, 253, + 240, 248, 178, 224, 253, 254, 249, 227, 252, 252, + 132, 140, 188, 144, 158, 138, 204, 130, 132, 195, + 147, 140, 137, 136, 144, 141, 147, 149, 159, 217, + 173, 139, 147, 158, 154, 146, 131, 133, 159, 148, + 167, 129, 165, 168, 160, 168, 189, 187, 165, 174, + 226, 187, 224, 147, 163, 171, 165, 177, 179, 173, + 189, 249, 141, 171, 174, 184, 188, 180, 164, 185, + 246, 158, 186, 177, 79, 83, 122, 122, 103, 15, + 124, 72, 80, 74, 79, 69, 3, 108, 4, 117, + 95, 73, 81, 86, 90, 26, 120, 29, 98, 86, + 66, 88, 89, 83, 125, 86, 98, 98, 101, 102, + 101, 122, 88, 104, 108, 104, 97, 111, 38, 84, + 97, 107, 81, 114, 114, 108, 112, 63, 79, 120, + 124, 64, 117, 127, 125, 120, 97, 53, 57, 27, + 9, 7, 78, 45, 40, 4, 16, 6, 3, 21, + 15, 8, 10, 4, 22, 91, 53, 22, 8, 26, + 17, 24, 28, 7, 80, 56, 24, 19, 17, 13, + 11, 39, 36, 32, 41, 46, 56, 34, 48, 23, + 57, 49, 35, 103, 43, 35, 122, 17, 57, 46, + 126, 18, 51, 43, 59, 61, 55, 113, 23, 33, + 49, 39, 203, 204, 205, 250, 193, 218, 222, 206, + 199, 131, 208, 211, 207, 196, 193, 133, 220, 212, + 202, 153, 244, 222, 203, 157, 255, 220, 198, 216, + 216, 208, 148, 244, 252, 238, 250, 232, 233, 234, + 220, 232, 240, 234, 239, 229, 166, 232, 226, 165, + 208, 250, 239, 185, 211, 240, 234, 244, 252, 244, + 176, 208, 224, 242, 230, 244, 141, 142, 187, 129, + 135, 137, 152, 205, 141, 133, 192, 171, 135, 144, + 196, 168, 149, 141, 145, 151, 153, 223, 189, 139, + 151, 129, 145, 150, 147, 163, 141, 133, 175, 235, + 167, 175, 238, 155, 169, 168, 182, 171, 224, 140, + 169, 177, 173, 171, 189, 251, 153, 175, 187, 173, + 189, 186, 183, 128, 191, 164, 164, 180, 177, 245, + 90, 89, 65, 74, 75, 15, 74, 66, 80, 3, + 116, 68, 67, 83, 76, 5, 119, 84, 78, 80, + 80, 88, 28, 124, 68, 86, 66, 80, 81, 82, + 100, 80, 120, 98, 103, 109, 46, 96, 106, 45, + 86, 102, 101, 117, 110, 39, 73, 106, 108, 114, + 118, 126, 62, 94, 106, 120, 96, 114, 119, 116, + 69, 127, 125, 115, 30, 75, 7, 15, 78, 59, + 9, 8, 22, 11, 64, 44, 9, 17, 13, 11, + 29, 91, 57, 15, 27, 13, 29, 26, 23, 39, + 9, 1, 19, 87, 27, 19, 106, 7, 33, 57, + 61, 111, 1, 34, 52, 42, 46, 38, 102, 6, + 50, 32, 40, 58, 63, 60, 13, 48, 41, 47, + 49, 54, 112, 33, 36, 62, 55, 48, 138, 205, + 199, 219, 142, 227, 197, 221, 209, 131, 237, 206, + 208, 206, 202, 194, 154, 250, 206, 220, 204, 222, + 219, 216, 226, 214, 194, 216, 217, 211, 148, 218, + 236, 171, 196, 224, 254, 252, 172, 192, 237, 245, + 233, 239, 225, 167, 197, 243, 255, 233, 249, 254, + 251, 204, 244, 244, 244, 231, 176, 254, 240, 183, + 216, 252, 154, 152, 200, 164, 129, 153, 133, 131, + 133, 195, 161, 151, 131, 149, 133, 130, 159, 179, + 145, 138, 138, 144, 142, 148, 145, 146, 156, 209, + 160, 152, 152, 148, 190, 162, 164, 160, 186, 182, + 159, 153, 134, 147, 165, 179, 175, 168, 160, 147, + 181, 183, 185, 173, 183, 179, 181, 169, 171, 131, + 181, 163, 191, 184, 176, 134, 69, 94, 90, 74, + 75, 92, 12, 93, 80, 74, 67, 68, 85, 7, + 66, 74, 72, 27, 112, 111, 127, 83, 80, 29, + 90, 90, 67, 69, 89, 69, 77, 125, 99, 120, + 124, 102, 124, 118, 44, 125, 103, 113, 105, 110, + 98, 67, 109, 118, 106, 119, 121, 96, 62, 114, + 115, 121, 119, 51, 61, 49, 54, 107, 52, 86, + 5, 7, 7, 27, 78, 82, 76, 36, 12, 7, + 9, 2, 7, 19, 11, 23, 55, 26, 22, 24, + 25, 26, 14, 71, 82, 26, 30, 24, 2, 30, + 21, 25, 35, 49, 41, 61, 39, 32, 34, 99, + 108, 109, 9, 47, 34, 46, 39, 36, 46, 52, + 42, 20, 63, 49, 61, 58, 55, 33, 106, 113, + 63, 57, 61, 33, 195, 202, 196, 192, 212, 202, + 200, 141, 209, 214, 195, 194, 195, 212, 215, 195, + 207, 215, 212, 192, 215, 209, 216, 212, 209, 210, + 196, 222, 196, 249, 213, 216, 239, 219, 228, 232, + 237, 234, 195, 255, 230, 230, 242, 210, 242, 245, + 229, 241, 255, 252, 225, 212, 255, 241, 253, 250, + 247, 225, 170, 177, 255, 249, 253, 225, 131, 138, + 132, 128, 148, 142, 152, 132, 141, 141, 206, 207, + 200, 183, 136, 132, 153, 158, 183, 139, 154, 154, + 142, 174, 134, 129, 145, 133, 147, 144, 141, 184, + 171, 165, 169, 174, 171, 189, 246, 237, 171, 173, + 169, 181, 175, 166, 168, 172, 160, 190, 188, 249, + 173, 170, 191, 190, 183, 160, 163, 183, 163, 187, + 184, 172, 108, 74, 65, 69, 75, 75, 12, 89, + 77, 3, 73, 79, 79, 83, 77, 68, 86, 82, + 66, 92, 30, 76, 95, 79, 91, 67, 68, 17, + 17, 16, 72, 105, 36, 111, 100, 101, 104, 125, + 99, 96, 82, 98, 116, 105, 114, 104, 84, 100, + 110, 115, 126, 112, 114, 122, 79, 105, 96, 114, + 100, 116, 113, 110, 89, 116, 4, 10, 15, 12, + 28, 85, 76, 4, 12, 10, 20, 8, 7, 11, + 13, 31, 27, 15, 17, 22, 16, 81, 82, 83, + 33, 7, 2, 16, 2, 18, 19, 12, 7, 42, + 38, 40, 41, 42, 62, 119, 98, 42, 46, 40, + 50, 46, 37, 41, 51, 33, 61, 61, 126, 44, + 41, 62, 49, 54, 35, 34, 48, 34, 56, 57, + 211, 216, 220, 219, 207, 219, 201, 202, 219, 237, + 193, 204, 195, 212, 208, 215, 219, 207, 221, 222, + 199, 214, 210, 219, 221, 157, 200, 220, 218, 252, + 209, 204, 170, 249, 237, 248, 251, 234, 255, 249, + 172, 163, 210, 228, 247, 242, 225, 246, 238, 210, + 252, 185, 163, 191, 167, 189, 193, 246, 254, 245, + 255, 249, 243, 181, 153, 132, 157, 155, 141, 138, + 204, 208, 194, 183, 136, 132, 148, 130, 196, 140, + 137, 219, 150, 150, 222, 143, 157, 143, 151, 157, + 132, 209, 152, 150, 153, 144, 174, 174, 184, 172, + 160, 171, 169, 163, 182, 138, 180, 164, 171, 183, + 165, 183, 191, 181, 172, 144, 170, 186, 177, 174, + 242, 178, 162, 182, 163, 186, 177, 187, 94, 11, + 69, 92, 93, 91, 12, 78, 77, 77, 84, 64, + 79, 73, 87, 5, 91, 79, 24, 85, 91, 94, + 79, 73, 18, 92, 94, 84, 22, 82, 88, 80, + 103, 110, 102, 125, 74, 106, 111, 100, 111, 98, + 108, 81, 106, 102, 103, 96, 105, 77, 121, 117, + 107, 122, 72, 111, 115, 119, 121, 127, 113, 55, + 91, 101, 15, 25, 9, 29, 7, 0, 2, 87, + 66, 32, 1, 15, 5, 2, 8, 69, 21, 9, + 28, 28, 12, 12, 82, 93, 33, 22, 30, 21, + 31, 25, 19, 85, 57, 36, 61, 59, 45, 42, + 108, 112, 98, 23, 50, 32, 34, 46, 42, 34, + 122, 20, 40, 60, 44, 62, 40, 52, 61, 61, + 106, 113, 21, 54, 58, 54, 207, 199, 136, 198, + 220, 203, 201, 223, 209, 141, 128, 238, 212, 195, + 193, 215, 201, 155, 219, 214, 203, 209, 200, 157, + 143, 147, 144, 226, 211, 217, 208, 220, 228, 236, + 168, 250, 225, 250, 254, 238, 231, 163, 189, 161, + 210, 245, 229, 225, 243, 245, 255, 185, 209, 239, + 249, 239, 243, 231, 249, 254, 248, 173, 180, 214, + 139, 133, 139, 140, 130, 207, 131, 159, 134, 134, + 146, 146, 200, 199, 183, 156, 151, 153, 151, 149, + 222, 194, 220, 169, 128, 146, 148, 152, 152, 144, + 212, 186, 186, 174, 186, 168, 186, 166, 163, 163, + 248, 227, 131, 160, 168, 164, 161, 169, 250, 180, + 170, 189, 187, 173, 175, 243, 242, 146, 179, 178, + 185, 162, 186, 161, 10, 22, 8, 18, 14, 110, + 79, 78, 77, 86, 78, 85, 6, 26, 4, 30, + 26, 104, 81, 93, 91, 31, 1, 29, 102, 65, + 81, 85, 95, 89, 83, 21, 69, 123, 109, 123, + 111, 123, 101, 98, 108, 57, 32, 66, 103, 105, + 103, 96, 118, 59, 119, 107, 122, 122, 110, 110, + 60, 51, 67, 120, 114, 114, 52, 40, 74, 80, + 72, 61, 7, 2, 9, 77, 11, 13, 64, 7, + 9, 21, 7, 0, 90, 70, 88, 45, 12, 30, + 24, 20, 28, 20, 80, 62, 6, 18, 6, 20, + 62, 34, 39, 39, 116, 111, 15, 44, 44, 32, + 37, 45, 102, 40, 54, 33, 63, 41, 43, 119, + 126, 11, 53, 48, 55, 115, 57, 63, 118, 49, + 59, 39, 201, 206, 136, 148, 142, 148, 140, 226, + 208, 199, 197, 211, 134, 211, 221, 213, 223, 155, + 133, 153, 133, 159, 243, 207, 214, 214, 194, 145, + 194, 206, 196, 208, 170, 233, 237, 225, 239, 249, + 229, 226, 240, 163, 189, 161, 210, 245, 229, 225, + 243, 245, 255, 185, 209, 239, 249, 239, 243, 231, + 249, 254, 248, 173, 180, 214, 139, 133, 139, 140, + 130, 207, 131, 159, 134, 134, 146, 146, 200, 199, + 171, 151, 158, 158, 138, 217, 138, 134, 140, 152, + 210, 145, 149, 153, 151, 129, 157, 154, 184, 235, + 245, 233, 143, 163, 160, 162, 181, 227, 131, 160, + 168, 164, 161, 169, 155, 183, 180, 150, 174, 186, + 178, 146, 160, 183, 181, 163, 165, 152, 186, 134, + 83, 70, 74, 70, 66, 110, 64, 65, 77, 84, + 0, 98, 71, 73, 71, 64, 86, 122, 84, 85, + 113, 79, 89, 83, 125, 65, 84, 84, 68, 68, + 123, 91, 75, 104, 107, 102, 123, 97, 120, 76, + 110, 111, 111, 118, 38, 68, 101, 107, 121, 126, + 116, 88, 114, 115, 83, 109, 119, 125, 95, 99, + 114, 114, 102, 102, 37, 5, 59, 16, 3, 13, + 3, 1, 35, 13, 4, 32, 5, 4, 11, 16, + 20, 15, 44, 11, 31, 27, 21, 19, 21, 83, + 63, 1, 19, 5, 21, 1, 35, 36, 38, 115, + 110, 12, 32, 34, 49, 38, 96, 49, 41, 52, + 45, 49, 51, 52, 54, 42, 112, 127, 15, 56, + 60, 55, 57, 63, 49, 119, 39, 58, 223, 217, + 203, 204, 142, 146, 140, 249, 208, 194, 196, 200, + 200, 192, 132, 234, 202, 222, 202, 216, 202, 214, + 211, 211, 136, 147, 243, 221, 217, 196, 209, 149, + 250, 228, 251, 224, 250, 230, 227, 227, 241, 173, + 160, 210, 255, 234, 230, 234, 246, 187, 165, 185, + 202, 237, 253, 249, 251, 253, 247, 177, 217, 231, + 241, 231, 139, 159, 129, 134, 128, 213, 204, 174, + 142, 140, 147, 132, 198, 151, 139, 150, 147, 143, + 145, 150, 144, 140, 210, 221, 179, 144, 147, 158, + 131, 153, 128, 213, 247, 235, 156, 187, 175, 171, + 165, 163, 165, 227, 143, 177, 163, 181, 165, 177, + 179, 180, 182, 227, 254, 156, 176, 178, 161, 182, + 240, 161, 185, 164, 189, 161, 67, 68, 70, 90, + 0, 15, 127, 68, 70, 70, 0, 28, 6, 115, + 86, 68, 94, 82, 86, 94, 30, 112, 76, 88, + 64, 82, 68, 88, 89, 89, 14, 21, 73, 103, + 103, 122, 107, 47, 124, 98, 113, 106, 116, 104, + 112, 98, 36, 117, 117, 104, 113, 109, 119, 112, + 114, 110, 60, 51, 67, 116, 120, 115, 125, 123, + 13, 75, 27, 6, 27, 29, 15, 8, 66, 94, + 64, 53, 20, 6, 0, 12, 20, 28, 88, 54, + 14, 26, 14, 28, 6, 26, 31, 31, 76, 87, + 55, 25, 37, 56, 45, 105, 62, 32, 63, 36, + 54, 42, 54, 36, 102, 55, 43, 54, 51, 47, + 49, 54, 48, 44, 114, 125, 1, 42, 61, 51, + 57, 59, 116, 104, 138, 255, 218, 200, 202, 198, + 194, 202, 130, 236, 208, 196, 212, 198, 208, 204, + 213, 213, 130, 153, 253, 211, 211, 206, 215, 147, + 222, 212, 209, 214, 192, 220, 252, 238, 168, 249, + 225, 252, 229, 249, 235, 236, 238, 242, 168, 167, + 215, 224, 244, 255, 241, 247, 249, 191, 239, 242, + 231, 225, 243, 244, 182, 170, 180, 193, 152, 138, + 140, 128, 128, 136, 204, 162, 146, 134, 146, 128, + 146, 142, 139, 139, 192, 219, 187, 149, 145, 140, + 153, 221, 156, 150, 151, 144, 130, 158, 130, 144, + 234, 187, 167, 186, 167, 187, 165, 162, 172, 176, + 238, 225, 149, 190, 169, 167, 181, 183, 248, 228, + 254, 139, 174, 188, 182, 186, 190, 182, 246, 152, + 164, 176, 88, 74, 92, 64, 65, 65, 22, 13, + 112, 70, 86, 68, 84, 84, 65, 5, 74, 84, + 75, 80, 74, 86, 83, 83, 65, 29, 16, 98, + 83, 89, 80, 92, 100, 108, 40, 122, 97, 122, + 126, 110, 103, 35, 61, 33, 82, 117, 101, 97, + 115, 117, 127, 57, 81, 111, 121, 111, 115, 103, + 121, 126, 120, 45, 52, 71, 15, 29, 13, 27, + 29, 10, 76, 29, 13, 16, 9, 21, 15, 8, + 10, 22, 84, 91, 43, 0, 19, 29, 19, 17, + 82, 78, 80, 37, 4, 22, 16, 28, 36, 44, + 104, 6, 62, 42, 62, 44, 54, 42, 47, 47, + 124, 103, 22, 32, 44, 62, 42, 42, 59, 127, + 44, 50, 33, 58, 36, 56, 57, 57, 39, 123, + 138, 234, 203, 202, 193, 218, 194, 217, 130, 158, + 128, 245, 212, 198, 192, 204, 212, 220, 152, 246, + 206, 218, 206, 220, 198, 218, 223, 223, 140, 151, + 242, 217, 235, 255, 252, 236, 224, 161, 172, 222, + 231, 237, 228, 232, 232, 224, 164, 246, 245, 238, + 234, 250, 251, 191, 161, 189, 198, 225, 241, 245, + 255, 249, 243, 181, 165, 155, 141, 155, 143, 155, + 133, 130, 140, 217, 192, 167, 138, 134, 144, 145, + 159, 149, 214, 217, 173, 134, 145, 159, 157, 159, + 208, 204, 214, 177, 152, 148, 190, 191, 173, 167, + 244, 239, 163, 191, 166, 166, 178, 178, 230, 176, + 161, 183, 191, 251, 182, 182, 170, 255, 191, 188, + 188, 176, 181, 189, 186, 178, 176, 245, 75, 77, + 92, 76, 92, 15, 25, 13, 81, 70, 67, 78, + 72, 67, 87, 9, 26, 93, 87, 75, 93, 90, + 28, 77, 93, 64, 89, 69, 95, 88, 90, 21, + 105, 103, 103, 122, 103, 97, 107, 35, 86, 113, + 97, 101, 111, 105, 99, 37, 85, 107, 125, 107, + 127, 107, 117, 114, 124, 41, 48, 83, 100, 114, + 117, 126, 15, 29, 13, 7, 64, 79, 60, 2, + 17, 10, 20, 8, 9, 9, 68, 88, 90, 64, + 88, 54, 24, 25, 15, 24, 6, 83, 77, 81, + 77, 87, 53, 17, 46, 34, 60, 32, 33, 33, + 45, 33, 98, 51, 33, 51, 39, 42, 33, 49, + 63, 41, 43, 121, 61, 48, 41, 51, 38, 115, + 109, 113, 38, 56, 39, 60, 222, 194, 199, 199, + 237, 206, 194, 138, 214, 131, 198, 200, 200, 195, + 132, 246, 246, 155, 215, 203, 218, 218, 206, 242, + 220, 214, 144, 193, 217, 196, 221, 193, 227, 228, + 230, 169, 224, 234, 248, 249, 235, 237, 231, 161, + 242, 254, 244, 224, 186, 233, 253, 232, 235, 246, + 238, 248, 246, 192, 228, 254, 230, 183, 251, 231, + 142, 142, 154, 201, 154, 150, 156, 136, 194, 145, + 133, 144, 147, 142, 150, 128, 158, 180, 136, 156, + 144, 154, 152, 221, 130, 156, 131, 152, 130, 158, + 155, 155, 234, 185, 173, 184, 187, 166, 190, 168, + 166, 151, 169, 172, 163, 168, 177, 177, 136, 190, + 190, 172, 173, 186, 159, 188, 188, 244, 164, 241, + 176, 190, 186, 177, 10, 74, 70, 80, 14, 92, + 88, 66, 82, 11, 83, 8, 6, 70, 74, 65, + 26, 79, 89, 82, 91, 23, 79, 20, 18, 92, + 66, 85, 83, 69, 71, 97, 120, 106, 108, 96, + 96, 104, 44, 66, 114, 102, 114, 96, 114, 110, + 107, 107, 32, 59, 89, 125, 116, 106, 111, 105, + 50, 64, 92, 62, 66, 71, 58, 53, 58, 4, + 27, 0, 26, 6, 3, 3, 66, 94, 64, 40, + 8, 17, 5, 9, 19, 31, 88, 10, 10, 16, + 12, 93, 30, 28, 3, 2, 86, 22, 16, 31, + 63, 56, 60, 36, 43, 33, 56, 109, 48, 38, + 51, 52, 42, 51, 13, 43, 44, 58, 52, 48, + 58, 127, 40, 60, 57, 54, 112, 33, 36, 56, + 50, 60, 222, 139, 201, 205, 196, 218, 223, 217, + 207, 198, 206, 213, 134, 213, 193, 214, 207, 215, + 204, 248, 210, 211, 211, 202, 146, 255, 217, 223, + 221, 151, 251, 246, 197, 223, 250, 232, 234, 230, + 226, 234, 162, 204, 240, 228, 244, 230, 240, 236, + 245, 245, 162, 185, 223, 251, 246, 232, 225, 231, + 176, 226, 226, 248, 228, 181, 134, 132, 155, 154, + 192, 207, 188, 130, 145, 138, 148, 136, 137, 137, + 196, 216, 218, 192, 216, 170, 138, 144, 140, 142, + 200, 211, 203, 209, 191, 153, 157, 129, 163, 170, + 164, 233, 189, 187, 163, 189, 226, 175, 175, 178, + 181, 253, 228, 145, 168, 186, 188, 176, 176, 184, + 252, 146, 162, 182, 162, 176, 162, 190, 187, 187, + 16, 11, 105, 77, 68, 90, 95, 89, 2, 87, + 65, 74, 67, 7, 84, 87, 85, 93, 81, 77, + 16, 31, 108, 82, 65, 90, 68, 88, 89, 89, + 20, 8, 42, 48, 40, 93, 111, 100, 105, 126, + 56, 35, 59, 33, 79, 105, 109, 113, 115, 122, + 116, 57, 106, 126, 119, 120, 50, 99, 98, 126, + 112, 126, 96, 47, 74, 34, 6, 10, 1, 29, + 30, 8, 1, 23, 64, 21, 7, 21, 3, 0, + 14, 91, 12, 24, 21, 26, 92, 13, 0, 26, + 19, 20, 49, 5, 27, 0, 58, 31, 58, 40, + 42, 38, 34, 42, 13, 51, 37, 51, 39, 51, + 45, 42, 52, 123, 35, 121, 10, 38, 44, 56, + 114, 110, 112, 125, 118, 17, 61, 57, 222, 206, + 218, 218, 142, 146, 140, 221, 195, 209, 193, 204, + 195, 211, 193, 215, 201, 239, 202, 216, 218, 214, + 210, 218, 146, 220, 192, 212, 196, 214, 192, 220, + 229, 229, 251, 169, 231, 252, 172, 225, 237, 224, + 235, 228, 226, 211, 246, 228, 254, 242, 246, 254, + 190, 240, 236, 248, 224, 242, 228, 248, 249, 249, + 231, 181, 131, 152, 200, 133, 129, 140, 135, 136, + 134, 195, 134, 142, 148, 199, 133, 134, 153, 148, + 141, 151, 138, 170, 146, 150, 156, 156, 135, 159, + 214, 131, 134, 148, 174, 162, 166, 174, 238, 160, + 188, 168, 176, 162, 180, 168, 169, 169, 180, 164, + 168, 186, 181, 188, 170, 186, 174, 174, 158, 186, + 163, 165, 134, 182, 166, 176, 68, 95, 8, 70, + 92, 75, 73, 95, 2, 76, 82, 1, 86, 72, + 87, 76, 78, 82, 87, 87, 30, 86, 79, 29, + 92, 70, 92, 93, 120, 88, 20, 90, 120, 111, + 109, 123, 46, 123, 117, 125, 103, 112, 32, 103, + 105, 117, 36, 102, 118, 116, 107, 112, 112, 120, + 60, 114, 96, 119, 117, 99, 101, 68, 109, 120, + 8, 4, 4, 73, 15, 1, 8, 77, 3, 0, + 3, 14, 19, 9, 16, 69, 27, 9, 29, 89, + 16, 10, 16, 17, 61, 1, 20, 20, 4, 87, + 28, 20, 57, 107, 38, 38, 58, 111, 41, 53, + 43, 48, 52, 17, 41, 52, 45, 49, 51, 52, + 54, 121, 54, 62, 47, 125, 60, 60, 36, 113, + 51, 47, 61, 38, 222, 198, 219, 202, 193, 221, + 192, 196, 192, 247, 210, 192, 194, 206, 202, 194, + 234, 215, 217, 205, 216, 208, 206, 208, 156, 241, + 197, 194, 223, 217, 209, 198, 249, 199, 233, 240, + 235, 253, 206, 228, 236, 231, 233, 239, 225, 213, + 225, 225, 243, 233, 253, 250, 234, 177, 228, 240, + 254, 221, 241, 252, 243, 197, 241, 241, 131, 153, + 141, 138, 154, 191, 141, 153, 138, 165, 129, 136, + 138, 199, 144, 138, 218, 139, 138, 150, 157, 154, + 143, 142, 210, 177, 153, 159, 146, 158, 154, 146, + 152, 174, 172, 160, 188, 170, 175, 185, 236, 187, + 173, 173, 230, 161, 173, 169, 191, 241, 246, 189, + 178, 179, 143, 164, 161, 167, 181, 188, 149, 162, + 167, 161, 69, 70, 102, 72, 67, 74, 96, 66, + 65, 72, 69, 69, 104, 115, 102, 104, 81, 27, + 27, 21, 14, 17, 31, 30, 17, 16, 19, 18, + 21, 20, 23, 22, 41, 39, 56, 39, 62, 44, + 44, 68, 108, 109, 101, 115, 38, 98, 124, 102, + 127, 107, 108, 112, 113, 113, 38, 61, 123, 103, + 117, 124, 101, 94, 122, 118, 5, 25, 26, 12, + 13, 27, 76, 15, 16, 2, 3, 10, 3, 19, + 23, 69, 10, 26, 10, 24, 19, 26, 8, 24, + 0, 0, 94, 81, 34, 24, 0, 20, 38, 107, + 43, 40, 34, 44, 57, 33, 35, 55, 37, 37, + 102, 54, 49, 36, 52, 47, 49, 45, 39, 127, + 116, 116, 114, 55, 63, 52, 37, 119, 58, 58, + 222, 139, 197, 200, 218, 204, 196, 141, 205, 209, + 196, 196, 212, 135, 213, 208, 219, 213, 204, 208, + 202, 198, 156, 149, 155, 157, 249, 223, 213, 216, + 198, 199, 239, 232, 252, 169, 236, 253, 237, 238, + 233, 230, 244, 242, 166, 247, 229, 247, 251, 246, + 253, 237, 251, 237, 239, 179, 178, 209, 226, 240, + 245, 252, 241, 225, 202, 154, 157, 136, 128, 155, + 133, 153, 155, 195, 131, 128, 136, 199, 138, 138, + 142, 219, 154, 156, 222, 207, 210, 141, 147, 135, + 152, 189, 147, 129, 145, 153, 185, 159, 141, 167, + 187, 162, 236, 160, 183, 176, 180, 225, 164, 162, + 228, 164, 180, 251, 189, 183, 171, 178, 185, 175, + 179, 167, 181, 181, 246, 163, 173, 165, 79, 127, + 90, 72, 74, 70, 66, 74, 113, 90, 77, 67, + 73, 75, 67, 9, 118, 84, 95, 94, 91, 77, + 127, 82, 92, 85, 89, 86, 122, 88, 83, 82, + 111, 121, 70, 104, 99, 106, 44, 48, 34, 47, + 32, 78, 115, 115, 116, 112, 110, 93, 119, 117, + 122, 122, 110, 77, 115, 103, 120, 49, 43, 55, + 56, 53, 57, 8, 7, 25, 11, 79, 81, 77, + 46, 12, 7, 6, 3, 21, 23, 41, 21, 28, + 31, 28, 12, 62, 12, 13, 30, 26, 19, 16, + 2, 30, 27, 27, 100, 101, 20, 103, 96, 19, + 0, 34, 37, 48, 19, 36, 52, 46, 40, 42, + 61, 55, 55, 62, 57, 62, 62, 49, 55, 0, + 36, 48, 36, 35, 116, 49, 207, 199, 205, 221, + 199, 193, 203, 141, 205, 207, 196, 129, 202, 200, + 195, 133, 220, 210, 212, 220, 205, 145, 146, 147, + 246, 214, 220, 212, 194, 222, 218, 210, 170, 237, + 225, 231, 231, 252, 228, 232, 230, 173, 204, 238, + 225, 224, 225, 247, 160, 187, 220, 252, 242, 250, + 232, 248, 178, 255, 255, 246, 182, 241, 253, 249, + 143, 152, 198, 166, 163, 138, 159, 158, 131, 132, + 133, 219, 198, 162, 156, 134, 159, 139, 140, 144, + 145, 145, 198, 221, 209, 155, 153, 149, 146, 146, + 154, 214, 137, 164, 186, 172, 130, 160, 175, 172, + 176, 170, 186, 164, 180, 171, 171, 166, 187, 183, + 189, 247, 179, 176, 185, 179, 255, 134, 131, 157, + 185, 180, 181, 185, 67, 81, 77, 91, 0, 102, + 66, 68, 86, 102, 110, 98, 71, 83, 69, 73, + 85, 92, 23, 23, 74, 75, 116, 117, 8, 94, + 93, 89, 94, 13, 89, 88, 42, 127, 124, 65, + 70, 53, 97, 96, 56, 112, 115, 105, 110, 61, + 105, 104, 32, 104, 107, 57, 106, 107, 72, 116, + 127, 118, 69, 101, 127, 123, 103, 47, 74, 2, + 6, 0, 26, 6, 13, 1, 11, 25, 1, 21, + 15, 8, 10, 75, 84, 85, 44, 16, 19, 26, + 41, 9, 27, 31, 3, 75, 86, 30, 26, 28, + 62, 34, 41, 37, 39, 53, 41, 41, 98, 48, + 53, 34, 37, 34, 55, 54, 60, 46, 52, 53, + 39, 24, 56, 46, 33, 32, 35, 107, 48, 49, + 50, 33, 206, 133, 229, 135, 215, 214, 200, 201, + 140, 238, 237, 143, 223, 222, 192, 193, 148, 246, + 245, 151, 199, 198, 197, 196, 214, 148, 159, 150, + 251, 144, 155, 146, 243, 242, 236, 237, 169, 160, + 171, 192, 207, 164, 175, 166, 255, 254, 224, 225, + 189, 180, 191, 212, 211, 184, 179, 186, 235, 234, + 233, 232, 219, 185, 240, 187, 147, 146, 165, 164, + 192, 139, 136, 195, 155, 154, 173, 172, 200, 131, + 128, 203, 131, 130, 129, 128, 179, 216, 211, 218, + 150, 212, 223, 214, 143, 142, 185, 184, 237, 228, + 239, 173, 170, 232, 227, 234, 187, 186, 141, 140, + 225, 232, 227, 161, 190, 252, 247, 254, 167, 166, + 165, 164, 145, 178, 190, 246, 162, 247, 167, 176, + 94, 11, 91, 89, 75, 76, 69, 75, 75, 64, + 0, 85, 79, 74, 65, 127, 85, 85, 93, 112, + 80, 89, 83, 29, 66, 82, 66, 80, 91, 82, + 64, 80, 120, 43, 127, 96, 122, 103, 44, 65, + 109, 96, 97, 109, 38, 115, 125, 117, 127, 79, + 112, 124, 62, 75, 117, 112, 119, 73, 127, 127, + 115, 94, 122, 115, 5, 75, 1, 26, 78, 1, + 25, 1, 14, 47, 15, 2, 7, 11, 49, 49, + 57, 91, 80, 44, 42, 60, 85, 81, 82, 83, + 0, 3, 31, 20, 17, 85, 38, 46, 62, 44, + 34, 60, 26, 2, 14, 22, 13, 4, 7, 9, + 5, 9, 3, 8, 17, 10, 1, 15, 29, 30, + 25, 18, 23, 20, 27, 2, 24, 1, 227, 244, + 233, 250, 253, 234, 248, 242, 242, 226, 227, 234, + 231, 224, 225, 230, 232, 226, 232, 237, 241, 224, + 236, 252, 241, 248, 241, 246, 243, 238, 219, 192, + 248, 171, 228, 224, 237, 234, 226, 254, 231, 163, + 228, 238, 227, 244, 234, 162, 238, 187, 249, 245, + 242, 240, 235, 189, 196, 252, 252, 228, 251, 242, + 180, 212, 132, 138, 132, 144, 157, 134, 159, 180, + 141, 150, 146, 193, 138, 142, 135, 128, 148, 136, + 157, 217, 159, 147, 144, 146, 133, 128, 208, 158, + 152, 155, 141, 213, 251, 235, 191, 172, 171, 164, + 236, 162, 164, 227, 150, 174, 170, 178, 169, 160, + 250, 154, 182, 184, 178, 166, 175, 180, 161, 154, + 190, 167, 183, 187, 189, 177, 10, 89, 77, 90, + 94, 64, 66, 94, 71, 3, 70, 83, 73, 74, + 4, 104, 85, 95, 93, 3, 30, 106, 82, 86, + 92, 92, 71, 95, 101, 78, 89, 88, 111, 127, + 122, 96, 109, 47, 77, 110, 118, 106, 118, 100, + 85, 126, 105, 104, 127, 111, 106, 112, 125, 63, + 76, 124, 97, 122, 102, 116, 85, 123, 125, 112, + 4, 31, 59, 12, 28, 25, 9, 31, 32, 17, + 15, 0, 2, 4, 5, 22, 14, 118, 114, 53, + 17, 28, 29, 17, 82, 7, 25, 28, 19, 77, + 84, 120, 64, 7, 39, 42, 47, 35, 108, 14, + 46, 44, 35, 42, 102, 8, 34, 35, 41, 62, + 44, 99, 126, 127, 49, 46, 95, 89, 32, 62, + 57, 59, 122, 59, 222, 219, 134, 198, 220, 200, + 216, 196, 207, 198, 142, 214, 207, 201, 192, 202, + 205, 200, 150, 218, 209, 210, 200, 212, 223, 214, + 158, 214, 217, 216, 211, 217, 239, 165, 235, 230, + 227, 251, 229, 224, 231, 173, 238, 232, 245, 243, + 170, 226, 245, 237, 204, 240, 243, 250, 188, 234, + 243, 224, 176, 226, 239, 249, 247, 253, 152, 132, + 134, 128, 148, 138, 136, 195, 194, 160, 149, 147, + 148, 130, 138, 145, 218, 148, 158, 159, 141, 154, + 136, 221, 218, 158, 131, 216, 204, 215, 167, 128, + 185, 187, 173, 170, 186, 170, 168, 237, 171, 173, + 163, 174, 180, 181, 161, 166, 174, 251, 183, 191, + 184, 172, 185, 169, 242, 181, 162, 190, 187, 247, + 167, 176, 88, 93, 77, 91, 20, 15, 127, 72, + 78, 70, 67, 85, 67, 67, 4, 74, 88, 81, + 93, 90, 74, 31, 95, 92, 92, 20, 68, 17, + 84, 82, 20, 70, 111, 121, 97, 104, 98, 102, + 118, 104, 102, 85, 97, 115, 111, 102, 102, 105, + 127, 59, 111, 112, 106, 119, 60, 110, 98, 118, + 115, 120, 112, 126, 113, 113, 74, 5, 9, 4, + 11, 79, 2, 2, 22, 67, 5, 25, 15, 20, + 16, 22, 29, 23, 23, 27, 31, 19, 42, 28, + 0, 26, 17, 19, 26, 18, 7, 3, 43, 57, + 33, 40, 44, 35, 41, 35, 35, 46, 37, 55, + 39, 43, 49, 32, 51, 40, 22, 44, 50, 51, + 27, 49, 61, 49, 49, 61, 0, 54, 38, 60, + 203, 201, 196, 204, 221, 129, 200, 204, 214, 247, + 210, 212, 195, 243, 203, 202, 154, 217, 209, 222, + 158, 208, 222, 215, 215, 208, 196, 243, 195, 209, + 210, 208, 248, 238, 236, 217, 252, 224, 239, 232, + 241, 240, 239, 243, 209, 238, 240, 237, 202, 233, + 241, 246, 236, 246, 232, 228, 188, 195, 226, 254, + 245, 242, 231, 230, 167, 138, 134, 144, 186, 142, + 159, 134, 145, 217, 192, 160, 136, 199, 129, 151, + 136, 148, 138, 217, 145, 156, 159, 136, 128, 150, + 148, 203, 214, 181, 129, 147, 172, 174, 186, 172, + 170, 159, 190, 162, 161, 166, 179, 178, 169, 181, + 147, 172, 174, 179, 136, 171, 183, 176, 174, 180, + 166, 170, 254, 129, 163, 164, 188, 239, 10, 106, + 70, 9, 75, 93, 94, 66, 80, 3, 79, 66, + 69, 82, 86, 64, 94, 1, 24, 112, 80, 73, + 93, 81, 91, 87, 16, 65, 68, 94, 91, 71, + 99, 127, 113, 121, 98, 122, 107, 32, 107, 109, + 115, 47, 40, 91, 42, 43, 70, 53, 54, 69, + 86, 118, 111, 105, 125, 97, 105, 71, 121, 123, + 97, 120, 15, 42, 6, 8, 2, 22, 31, 4, + 17, 54, 19, 4, 20, 51, 22, 4, 30, 30, + 11, 58, 31, 28, 20, 24, 33, 22, 4, 5, + 31, 25, 19, 6, 25, 40, 58, 32, 62, 59, + 63, 30, 33, 49, 41, 49, 50, 52, 0, 36, + 46, 58, 17, 55, 58, 54, 63, 60, 38, 60, + 34, 34, 5, 35, 38, 52, 222, 206, 207, 192, + 203, 220, 252, 193, 195, 192, 197, 238, 212, 195, + 193, 215, 233, 207, 202, 216, 202, 218, 219, 212, + 215, 192, 230, 212, 216, 211, 219, 199, 249, 233, + 225, 231, 218, 234, 225, 253, 207, 230, 228, 232, + 231, 202, 225, 246, 233, 254, 246, 254, 251, 237, + 239, 212, 252, 231, 245, 227, 224, 246, 248, 175, + 202, 134, 137, 145, 170, 138, 139, 159, 135, 134, + 175, 135, 182, 134, 150, 132, 150, 151, 157, 149, + 151, 140, 145, 190, 157, 157, 158, 148, 149, 131, + 157, 154, 164, 235, 174, 160, 160, 166, 191, 165, + 167, 167, 131, 174, 168, 169, 161, 166, 174, 178, + 183, 183, 254, 179, 179, 174, 166, 156, 162, 181, + 179, 165, 244, 182, 88, 78, 73, 93, 75, 75, + 3, 78, 67, 77, 67, 68, 74, 66, 64, 10, + 72, 94, 72, 85, 95, 92, 89, 89, 125, 65, + 84, 84, 68, 23, 82, 92, 102, 103, 109, 109, + 65, 125, 104, 104, 112, 35, 114, 100, 108, 98, + 103, 113, 127, 127, 72, 118, 109, 118, 104, 116, + 125, 125, 48, 114, 122, 120, 103, 112, 14, 47, + 13, 15, 15, 26, 0, 25, 66, 2, 12, 4, + 20, 19, 49, 21, 30, 26, 12, 28, 94, 62, + 10, 28, 27, 31, 17, 19, 26, 18, 23, 26, + 36, 37, 45, 42, 58, 38, 35, 35, 4, 42, + 46, 40, 53, 47, 33, 33, 116, 44, 57, 47, + 61, 48, 50, 51, 55, 48, 36, 56, 57, 57, + 24, 58, 217, 223, 134, 222, 207, 217, 227, 223, + 198, 198, 210, 226, 212, 194, 197, 209, 223, 223, + 150, 206, 223, 201, 211, 207, 214, 214, 194, 247, + 223, 219, 216, 208, 238, 165, 255, 232, 248, 224, + 254, 233, 231, 241, 210, 228, 236, 226, 231, 241, + 255, 255, 182, 238, 255, 233, 204, 242, 225, 250, + 228, 248, 249, 249, 215, 249, 133, 152, 141, 141, + 192, 152, 141, 155, 166, 134, 134, 128, 147, 139, + 144, 164, 150, 158, 138, 141, 208, 136, 157, 139, + 167, 131, 148, 144, 130, 146, 218, 130, 171, 189, + 147, 230, 229, 242, 145, 180, 226, 167, 156, 165, + 154, 231, 172, 153, 178, 179, 132, 177, 130, 255, + 177, 129, 191, 190, 189, 141, 236, 164, 167, 166, + 118, 88, 76, 9, 70, 15, 65, 13, 81, 111, + 73, 66, 67, 73, 71, 64, 113, 94, 65, 106, + 74, 94, 78, 73, 118, 82, 68, 84, 98, 94, + 87, 94, 121, 78, 102, 109, 74, 110, 120, 104, + 86, 106, 99, 106, 117, 78, 106, 115, 123, 119, + 113, 125, 62, 107, 115, 118, 119, 125, 48, 101, + 111, 103, 113, 47, 74, 41, 41, 58, 39, 44, + 51, 61, 35, 32, 43, 32, 33, 34, 41, 44, + 40, 41, 55, 43, 33, 43, 46, 60, 54, 58, + 62, 54, 39, 34, 53, 59, 30, 4, 31, 12, + 28, 16, 0, 4, 22, 6, 3, 19, 31, 23, + 16, 10, 5, 18, 22, 29, 23, 30, 3, 13, + 19, 16, 27, 16, 17, 18, 4, 7, 239, 230, + 225, 252, 227, 240, 252, 225, 247, 240, 255, 241, + 231, 228, 239, 228, 253, 254, 232, 246, 233, 250, + 238, 233, 224, 242, 244, 244, 229, 232, 228, 244, + 201, 192, 201, 206, 203, 223, 222, 200, 207, 202, + 213, 204, 217, 215, 197, 198, 209, 218, 223, 220, + 209, 207, 200, 212, 221, 221, 195, 206, 198, 214, + 215, 222, 171, 172, 173, 189, 190, 160, 175, 165, + 163, 177, 180, 190, 182, 166, 167, 174, 187, 188, + 189, 173, 172, 190, 184, 180, 188, 180, 175, 162, + 191, 176, 186, 180, 134, 148, 152, 136, 141, 132, + 141, 138, 135, 135, 143, 140, 149, 146, 150, 131, + 155, 152, 157, 134, 142, 158, 159, 150, 147, 148, + 149, 158, 132, 147, 145, 135, 108, 103, 103, 126, + 113, 127, 109, 110, 105, 98, 103, 100, 114, 117, + 113, 96, 126, 122, 108, 120, 97, 105, 121, 113, + 125, 112, 121, 101, 111, 116, 97, 102, 94, 68, + 69, 76, 92, 95, 94, 66, 82, 92, 76, 72, + 69, 66, 74, 86, 95, 74, 77, 88, 80, 75, + 83, 74, 87, 65, 79, 80, 82, 65, 85, 91, + 41, 46, 44, 54, 43, 62, 57, 36, 54, 58, + 49, 52, 39, 41, 48, 42, 45, 62, 42, 38, + 63, 59, 42, 60, 60, 48, 53, 53, 41, 62, + 58, 49, 3, 8, 13, 26, 31, 26, 13, 3, + 22, 12, 23, 4, 20, 24, 5, 1, 12, 26, + 22, 26, 27, 27, 3, 30, 29, 30, 29, 30, + 18, 30, 0, 12, 251, 254, 233, 231, 250, 224, + 251, 232, 240, 252, 225, 229, 240, 230, 234, 230, + 255, 255, 231, 252, 239, 234, 245, 233, 235, 236, + 243, 254, 251, 250, 251, 241, 195, 223, 193, 204, + 221, 204, 201, 201, 208, 204, 205, 192, 212, 204, + 193, 209, 222, 218, 204, 216, 193, 207, 221, 222, + 217, 210, 215, 212, 212, 246, 231, 252, 137, 168, + 154, 144, 158, 155, 131, 205, 178, 130, 131, 138, + 135, 128, 129, 168, 143, 151, 140, 144, 211, 158, + 143, 142, 151, 135, 208, 161, 151, 148, 159, 148, + 173, 174, 137, 173, 184, 174, 162, 174, 167, 167, + 224, 135, 163, 166, 176, 176, 168, 190, 171, 137, + 172, 186, 177, 180, 167, 190, 240, 129, 186, 162, + 167, 148, 70, 71, 8, 64, 64, 15, 67, 67, + 71, 117, 79, 77, 83, 74, 65, 5, 123, 85, + 89, 85, 71, 76, 85, 78, 98, 92, 71, 84, + 68, 23, 96, 71, 107, 111, 109, 122, 74, 64, + 65, 45, 113, 118, 114, 103, 103, 100, 97, 74, + 104, 127, 125, 107, 62, 89, 112, 114, 101, 71, + 64, 94, 54, 84, 124, 116, 24, 31, 39, 25, + 26, 6, 3, 3, 66, 23, 18, 0, 2, 14, + 10, 2, 57, 14, 11, 13, 17, 18, 25, 15, + 34, 1, 31, 1, 59, 30, 6, 7, 37, 57, + 104, 29, 60, 46, 40, 36, 44, 36, 20, 51, + 39, 35, 45, 43, 61, 123, 11, 32, 45, 43, + 57, 48, 33, 2, 37, 48, 56, 35, 59, 34, + 207, 217, 136, 229, 199, 219, 201, 252, 215, 194, + 206, 213, 201, 208, 193, 215, 154, 250, 220, 207, + 223, 209, 223, 216, 214, 147, 157, 145, 243, 198, + 193, 220, 254, 242, 220, 251, 251, 234, 172, 201, + 227, 247, 225, 161, 208, 226, 232, 234, 249, 242, + 236, 224, 207, 234, 253, 243, 230, 252, 231, 244, + 228, 183, 213, 241, 156, 138, 134, 138, 139, 139, + 204, 192, 194, 170, 142, 133, 143, 132, 129, 150, + 218, 211, 177, 151, 154, 154, 132, 221, 180, 213, + 191, 216, 167, 130, 149, 155, 190, 164, 191, 172, + 188, 239, 141, 169, 180, 162, 174, 162, 163, 163, + 228, 237, 153, 180, 181, 180, 177, 187, 181, 169, + 171, 250, 129, 164, 183, 185, 160, 186, 93, 78, + 90, 9, 111, 75, 90, 76, 76, 64, 69, 69, + 6, 10, 4, 96, 75, 78, 81, 77, 71, 31, + 26, 29, 113, 92, 93, 92, 89, 83, 93, 65, + 115, 72, 109, 109, 124, 96, 44, 64, 99, 113, + 107, 100, 114, 39, 96, 100, 110, 122, 91, 120, + 112, 124, 121, 113, 50, 100, 113, 120, 98, 55, + 117, 118, 9, 14, 27, 26, 78, 27, 3, 6, + 7, 13, 5, 15, 2, 20, 1, 22, 9, 18, + 23, 23, 88, 33, 90, 30, 31, 23, 95, 18, + 86, 4, 0, 20, 56, 63, 104, 49, 42, 40, + 97, 34, 50, 38, 46, 46, 54, 34, 42, 2, + 63, 47, 30, 43, 59, 58, 12, 50, 32, 39, + 25, 63, 4, 54, 58, 50, 207, 135, 136, 230, + 219, 219, 140, 194, 196, 131, 208, 206, 212, 211, + 215, 214, 207, 217, 221, 212, 223, 214, 208, 216, + 220, 199, 217, 197, 207, 134, 209, 219, 254, 226, + 252, 240, 188, 161, 172, 206, 237, 237, 246, 228, + 244, 243, 225, 247, 233, 187, 165, 185, 221, 240, + 242, 243, 247, 240, 228, 248, 249, 249, 221, 241, + 173, 153, 135, 156, 158, 194, 174, 132, 140, 130, + 142, 130, 131, 165, 141, 139, 155, 149, 155, 156, + 222, 172, 140, 146, 134, 177, 153, 159, 151, 153, + 151, 144, 234, 158, 155, 139, 167, 161, 173, 163, + 161, 166, 224, 146, 182, 168, 176, 229, 143, 136, + 154, 176, 176, 190, 178, 190, 183, 243, 150, 164, + 162, 162, 166, 176, 89, 105, 65, 71, 79, 65, + 79, 72, 2, 118, 115, 101, 114, 10, 105, 5, + 124, 78, 76, 76, 76, 90, 79, 21, 31, 26, + 24, 28, 74, 19, 29, 21, 118, 43, 40, 117, + 46, 76, 99, 120, 108, 119, 32, 60, 38, 39, + 120, 37, 78, 116, 108, 120, 114, 63, 112, 120, + 100, 118, 124, 98, 54, 42, 52, 67, 15, 25, + 27, 0, 1, 1, 63, 8, 16, 10, 1, 13, + 15, 29, 1, 23, 64, 91, 30, 24, 23, 19, + 92, 9, 29, 83, 2, 20, 5, 3, 27, 7, + 47, 107, 33, 61, 43, 34, 98, 62, 39, 55, + 52, 40, 40, 32, 55, 49, 51, 56, 51, 42, + 31, 10, 24, 114, 17, 18, 20, 16, 3, 19, + 123, 22, 226, 237, 233, 252, 234, 128, 230, 253, + 251, 226, 245, 229, 137, 237, 244, 252, 154, 147, + 239, 252, 251, 244, 249, 243, 246, 154, 241, 228, + 242, 152, 252, 254, 206, 202, 221, 205, 161, 193, + 214, 201, 195, 214, 196, 174, 213, 192, 192, 196, + 207, 223, 183, 204, 205, 219, 221, 200, 214, 188, + 197, 194, 210, 183, 188, 194, 175, 174, 163, 172, + 160, 171, 197, 174, 163, 167, 207, 162, 174, 161, + 167, 164, 190, 212, 176, 178, 186, 188, 189, 185, + 221, 185, 160, 168, 181, 182, 176, 218, 153, 140, + 140, 138, 134, 137, 227, 133, 137, 135, 131, 137, + 128, 232, 142, 149, 131, 152, 144, 159, 241, 133, + 157, 143, 151, 134, 130, 254, 151, 130, 144, 144, + 127, 121, 7, 106, 111, 107, 105, 120, 112, 12, + 99, 105, 96, 98, 113, 119, 21, 120, 98, 114, + 123, 106, 110, 18, 118, 120, 123, 116, 99, 101, + 27, 114, 72, 91, 77, 92, 92, 32, 68, 70, + 70, 70, 85, 83, 41, 79, 81, 67, 95, 78, + 74, 54, 84, 79, 69, 88, 71, 65, 63, 92, + 78, 89, 81, 64, 56, 68, 38, 38, 37, 42, + 57, 63, 77, 45, 58, 37, 35, 50, 54, 74, + 42, 55, 54, 60, 43, 45, 83, 47, 61, 61, + 53, 36, 36, 88, 38, 32, 8, 14, 29, 27, + 97, 28, 9, 6, 7, 22, 18, 110, 21, 0, + 0, 0, 15, 9, 119, 13, 12, 6, 25, 8, + 0, 124, 5, 2, 18, 18, 1, 7, 133, 254, + 251, 237, 142, 135, 251, 232, 231, 232, 229, 239, + 226, 142, 225, 240, 232, 148, 226, 248, 236, 248, + 254, 237, 157, 242, 229, 245, 241, 245, 228, 154, + 201, 202, 204, 206, 204, 223, 163, 206, 202, 197, + 199, 195, 214, 168, 199, 223, 209, 220, 218, 201, + 177, 219, 215, 214, 213, 209, 192, 190, 222, 220, + 208, 210, 168, 187, 199, 161, 187, 169, 171, 175, + 178, 204, 170, 177, 191, 160, 166, 181, 213, 182, + 160, 183, 185, 189, 172, 210, 188, 188, 187, 182, + 180, 167, 219, 187, 144, 143, 143, 139, 158, 224, + 156, 129, 140, 132, 130, 145, 233, 148, 129, 142, + 157, 153, 136, 246, 141, 152, 152, 154, 144, 131, + 255, 133, 132, 142, 147, 151, 122, 4, 125, 122, + 106, 104, 110, 125, 13, 118, 115, 101, 6, 15, + 115, 96, 127, 112, 125, 119, 122, 22, 123, 127, + 98, 28, 106, 112, 100, 127, 127, 113, 37, 65, + 88, 80, 64, 64, 71, 34, 81, 70, 75, 79, + 92, 67, 43, 70, 91, 95, 86, 67, 90, 48, + 95, 85, 84, 93, 74, 85, 57, 95, 95, 81, + 36, 49, 44, 70, 36, 63, 53, 35, 56, 39, + 79, 50, 33, 35, 42, 63, 62, 84, 45, 42, + 58, 44, 59, 57, 93, 48, 56, 55, 37, 48, + 48, 90, 2, 0, 12, 26, 9, 11, 99, 7, + 18, 26, 20, 19, 31, 104, 14, 21, 3, 14, + 11, 29, 113, 28, 29, 25, 7, 0, 20, 126, + 21, 31, 18, 0, 249, 239, 135, 234, 230, 233, + 140, 133, 245, 230, 229, 234, 227, 233, 224, 140, + 239, 232, 252, 150, 253, 241, 244, 232, 225, 247, + 159, 242, 236, 252, 225, 230, 206, 164, 204, 194, + 197, 218, 223, 201, 173, 203, 203, 197, 211, 212, + 192, 170, 211, 213, 202, 204, 205, 219, 179, 213, + 199, 213, 197, 194, 210, 184, 221, 217, 185, 190, + 187, 173, 193, 165, 188, 180, 183, 176, 164, 206, + 172, 183, 189, 197, 210, 172, 189, 188, 181, 186, + 178, 185, 219, 166, 163, 181, 217, 186, 172, 187, + 159, 152, 140, 230, 128, 128, 135, 152, 145, 135, + 239, 145, 138, 137, 145, 150, 158, 244, 138, 150, + 144, 138, 143, 153, 253, 129, 133, 147, 131, 132, + 144, 250, 121, 106, 122, 124, 125, 107, 3, 126, + 103, 104, 117, 114, 98, 8, 119, 98, 126, 110, + 107, 125, 17, 107, 116, 127, 103, 96, 116, 30, + 98, 101, 109, 96, 89, 79, 39, 83, 79, 93, + 86, 76, 80, 44, 74, 81, 95, 64, 72, 65, + 53, 88, 86, 81, 77, 83, 74, 50, 81, 93, + 88, 86, 89, 91, 80, 58, 43, 62, 44, 46, + 33, 35, 40, 66, 33, 34, 36, 38, 41, 43, + 32, 74, 57, 51, 62, 62, 49, 51, 56, 82, + 55, 38, 34, 54, 57, 59, 48, 90, 13, 9, + 24, 14, 1, 3, 8, 98, 10, 8, 4, 6, + 9, 11, 0, 106, 16, 11, 1, 30, 17, 19, + 24, 114, 28, 9, 20, 22, 25, 27, 16, 122, + 249, 236, 236, 238, 225, 227, 232, 130, 241, 234, + 236, 247, 227, 245, 247, 236, 246, 237, 253, 235, + 145, 254, 233, 249, 225, 250, 252, 231, 243, 229, + 155, 246, 203, 207, 219, 192, 194, 217, 201, 223, + 173, 192, 200, 199, 213, 206, 200, 211, 223, 201, + 183, 220, 203, 205, 207, 212, 222, 197, 213, 195, + 185, 208, 214, 197, 185, 162, 164, 191, 171, 189, + 195, 165, 169, 167, 179, 168, 170, 177, 161, 183, + 213, 177, 168, 160, 173, 182, 176, 171, 183, 161, + 223, 191, 172, 179, 167, 188, 134, 157, 141, 155, + 225, 156, 139, 137, 154, 130, 135, 238, 135, 146, + 128, 157, 155, 156, 247, 140, 141, 155, 132, 156, + 135, 252, 145, 132, 146, 143, 149, 128, 5, 110, + 125, 123, 118, 110, 121, 2, 119, 112, 100, 121, + 118, 99, 11, 112, 105, 127, 96, 105, 106, 16, + 105, 110, 118, 114, 101, 98, 4, 7, 4, 116, + 95, 88, 92, 91, 79, 67, 69, 76, 34, 49, + 48, 49, 69, 79, 77, 75, 91, 59, 89, 44, + 46, 92, 83, 77, 66, 86, 66, 84, 69, 71, + 39, 32, 47, 62, 58, 38, 62, 42, 76, 88, + 82, 38, 53, 50, 50, 63, 81, 85, 60, 41, + 57, 77, 78, 57, 46, 60, 60, 48, 53, 81, + 66, 71, 51, 48, 24, 120, 120, 14, 11, 29, + 1, 12, 12, 26, 96, 114, 118, 0, 1, 23, + 23, 26, 22, 0, 126, 108, 108, 125, 122, 30, + 25, 31, 31, 126, 19, 16, 248, 230, 233, 231, + 247, 143, 159, 157, 130, 139, 247, 228, 227, 236, + 225, 235, 254, 146, 240, 242, 249, 140, 143, 245, + 253, 253, 247, 145, 253, 248, 250, 242, 170, 184, + 187, 193, 193, 193, 203, 173, 201, 204, 206, 198, + 166, 178, 180, 204, 212, 223, 209, 216, 190, 170, + 172, 212, 198, 210, 164, 161, 220, 199, 218, 167, + 216, 222, 162, 168, 190, 174, 162, 205, 208, 209, + 213, 171, 167, 183, 165, 171, 218, 201, 202, 204, + 222, 215, 171, 184, 183, 184, 181, 191, 178, 222, + 186, 180, 153, 250, 248, 249, 128, 138, 136, 255, + 247, 141, 133, 149, 142, 130, 150, 137, 155, 149, + 156, 138, 254, 237, 233, 142, 155, 157, 151, 144, + 134, 152, 134, 144, 10, 24, 24, 122, 126, 110, + 101, 99, 2, 16, 21, 114, 118, 127, 17, 21, + 10, 104, 109, 112, 12, 15, 111, 106, 119, 0, + 0, 98, 97, 126, 103, 102, 42, 57, 56, 93, + 79, 70, 91, 76, 76, 35, 73, 79, 66, 66, + 92, 80, 81, 42, 40, 41, 75, 84, 60, 44, + 34, 35, 69, 90, 54, 38, 36, 76, 74, 44, + 33, 37, 58, 58, 63, 94, 82, 54, 51, 65, + 40, 38, 55, 69, 75, 75, 72, 44, 45, 95, + 46, 40, 33, 32, 80, 67, 70, 71, 68, 32, + 25, 107, 27, 25, 22, 111, 121, 125, 114, 22, + 19, 97, 21, 23, 28, 101, 111, 107, 104, 121, + 118, 18, 21, 19, 27, 122, 5, 2, 118, 3, + 17, 22, 226, 139, 153, 153, 158, 250, 255, 141, + 246, 230, 227, 233, 134, 150, 148, 149, 154, 147, + 245, 240, 240, 246, 149, 232, 225, 147, 231, 240, + 250, 251, 148, 230, 222, 171, 187, 185, 217, 206, + 192, 193, 162, 208, 212, 211, 195, 194, 208, 165, + 169, 171, 207, 216, 210, 211, 188, 206, 198, 193, + 213, 212, 194, 183, 167, 165, 202, 195, 165, 160, + 160, 166, 197, 190, 173, 186, 166, 163, 180, 162, + 170, 177, 218, 184, 170, 172, 186, 186, 220, 178, + 187, 191, 179, 190, 164, 185, 179, 186, 134, 143, + 143, 134, 130, 139, 236, 229, 145, 147, 143, 149, + 239, 128, 139, 137, 158, 251, 240, 138, 142, 144, + 136, 253, 159, 154, 158, 152, 255, 144, 155, 153, + 110, 11, 0, 122, 126, 96, 120, 4, 2, 11, + 119, 100, 99, 108, 97, 107, 126, 18, 107, 112, + 114, 105, 121, 111, 97, 122, 124, 103, 115, 101, + 20, 29, 89, 91, 71, 93, 39, 92, 69, 65, + 84, 70, 82, 33, 46, 84, 84, 74, 78, 59, + 85, 80, 80, 86, 53, 83, 85, 82, 67, 95, + 87, 67, 65, 71, 43, 39, 72, 46, 47, 60, + 60, 44, 46, 47, 33, 37, 47, 50, 41, 53, + 54, 58, 44, 48, 48, 42, 49, 46, 61, 42, + 50, 52, 55, 57, 39, 38, 31, 12, 9, 27, + 27, 4, 108, 15, 16, 6, 14, 21, 102, 111, + 23, 21, 21, 15, 113, 12, 13, 127, 31, 15, + 7, 23, 21, 113, 126, 4, 4, 26, 254, 130, + 253, 250, 142, 236, 254, 248, 230, 230, 128, 137, + 245, 247, 235, 241, 147, 155, 144, 238, 251, 250, + 247, 248, 252, 247, 153, 228, 229, 151, 250, 244, + 222, 222, 218, 200, 194, 175, 203, 204, 209, 163, + 168, 210, 214, 200, 208, 172, 207, 200, 215, 208, + 210, 202, 215, 210, 219, 223, 199, 212, 197, 195, + 180, 193, 175, 179, 169, 186, 206, 160, 165, 161, + 181, 171, 165, 160, 178, 164, 172, 171, 207, 203, + 201, 201, 171, 172, 178, 178, 166, 182, 197, 164, + 165, 185, 187, 161, 143, 137, 157, 135, 138, 155, + 142, 130, 140, 135, 138, 145, 136, 133, 139, 139, + 158, 142, 147, 155, 145, 145, 152, 136, 129, 243, + 225, 225, 143, 247, 128, 248, 100, 100, 124, 108, + 123, 124, 12, 31, 123, 3, 116, 12, 104, 104, + 112, 96, 111, 104, 24, 12, 103, 31, 104, 16, + 124, 124, 100, 116, 99, 100, 20, 97, 39, 73, + 71, 71, 74, 90, 95, 73, 77, 79, 76, 64, + 84, 95, 70, 81, 53, 78, 75, 93, 70, 90, + 72, 50, 71, 64, 84, 73, 84, 89, 59, 64, + 57, 47, 48, 37, 45, 64, 57, 62, 38, 59, + 50, 49, 73, 50, 55, 33, 59, 14, 11, 13, + 12, 30, 16, 20, 19, 29, 80, 53, 25, 27, + 24, 20, 56, 107, 62, 58, 96, 111, 15, 44, + 44, 34, 36, 40, 39, 41, 100, 1, 53, 55, + 52, 56, 44, 30, 41, 46, 38, 33, 49, 61, + 63, 54, 58, 117, 238, 196, 196, 197, 207, 221, + 140, 219, 209, 141, 128, 242, 209, 206, 215, 214, + 154, 253, 202, 216, 208, 220, 253, 200, 193, 199, + 194, 208, 218, 222, 213, 219, 170, 207, 231, 229, + 226, 238, 254, 173, 244, 240, 174, 161, 204, 230, + 244, 228, 244, 254, 235, 252, 190, 198, 249, 243, + 211, 230, 227, 229, 228, 246, 248, 252, 139, 133, + 200, 173, 129, 131, 128, 140, 144, 195, 150, 146, + 200, 199, 174, 132, 138, 154, 150, 156, 141, 154, + 220, 164, 151, 157, 208, 217, 161, 146, 145, 158, + 175, 165, 172, 224, 143, 186, 191, 185, 176, 162, + 172, 168, 167, 169, 228, 129, 181, 183, 180, 184, + 172, 255, 170, 174, 252, 243, 152, 190, 184, 176, + 244, 158, 69, 69, 79, 9, 106, 64, 64, 65, + 67, 81, 97, 84, 85, 83, 86, 68, 86, 82, + 89, 87, 30, 123, 83, 81, 94, 82, 66, 17, + 64, 68, 26, 21, 68, 110, 127, 41, 84, 106, + 109, 97, 99, 109, 100, 33, 66, 104, 104, 105, + 123, 105, 89, 108, 109, 107, 110, 124, 126, 122, + 113, 127, 54, 83, 123, 121, 6, 10, 26, 73, + 24, 28, 66, 77, 49, 10, 14, 6, 7, 23, + 11, 23, 31, 91, 60, 22, 18, 19, 29, 15, + 51, 6, 3, 5, 4, 22, 24, 28, 43, 37, + 104, 13, 33, 35, 32, 44, 48, 99, 54, 50, + 104, 103, 17, 22, 122, 31, 55, 53, 50, 62, + 46, 28, 39, 32, 36, 35, 55, 59, 61, 52, + 196, 139, 236, 198, 194, 195, 205, 223, 130, 213, + 211, 143, 134, 242, 247, 133, 254, 212, 212, 213, + 223, 205, 156, 149, 229, 214, 213, 218, 211, 217, + 208, 156, 201, 234, 230, 232, 234, 230, 237, 227, + 162, 199, 239, 237, 234, 230, 246, 165, 236, 232, + 182, 185, 205, 232, 245, 238, 225, 179, 214, 227, + 247, 249, 247, 214, 139, 133, 137, 141, 135, 142, + 130, 205, 166, 140, 140, 141, 135, 149, 196, 147, + 137, 213, 216, 177, 145, 145, 155, 221, 185, 156, + 158, 150, 214, 179, 155, 153, 166, 170, 186, 138, + 175, 161, 173, 169, 171, 162, 174, 225, 130, 168, + 168, 169, 187, 169, 248, 175, 173, 241, 252, 151, + 179, 163, 177, 191, 179, 164, 177, 245, 115, 78, + 70, 106, 79, 65, 77, 73, 75, 66, 78, 1, + 98, 72, 72, 73, 91, 73, 24, 79, 77, 17, + 28, 110, 91, 93, 87, 80, 70, 88, 70, 80, + 42, 79, 103, 101, 98, 110, 126, 94, 117, 106, + 115, 114, 38, 65, 118, 100, 116, 120, 56, 111, + 109, 49, 60, 85, 125, 125, 119, 49, 93, 120, + 122, 114, 74, 47, 7, 5, 2, 14, 30, 62, + 21, 10, 19, 18, 70, 33, 22, 4, 20, 24, + 88, 15, 13, 81, 92, 55, 19, 3, 17, 31, + 19, 4, 17, 85, 19, 46, 38, 26, 57, 38, + 63, 62, 98, 5, 50, 32, 40, 36, 100, 51, + 41, 117, 120, 10, 49, 42, 40, 53, 114, 18, + 54, 35, 63, 52, 53, 59, 138, 249, 201, 199, + 202, 234, 217, 223, 205, 131, 214, 210, 136, 135, + 229, 208, 201, 207, 202, 216, 210, 214, 221, 211, + 146, 247, 223, 221, 218, 214, 198, 240, 255, 249, + 231, 169, 248, 252, 162, 173, 193, 226, 238, 224, + 226, 238, 229, 235, 186, 223, 247, 245, 242, 254, + 238, 216, 231, 225, 255, 177, 224, 228, 186, 181, + 185, 156, 129, 154, 157, 207, 170, 159, 131, 141, + 131, 164, 147, 149, 139, 197, 140, 136, 214, 217, + 189, 133, 153, 158, 154, 211, 187, 158, 132, 130, + 154, 148, 143, 190, 186, 166, 238, 185, 191, 227, + 226, 135, 161, 175, 175, 180, 172, 229, 145, 169, + 183, 183, 187, 154, 169, 175, 189, 243, 166, 162, + 248, 247, 150, 167, 67, 95, 65, 90, 70, 15, + 124, 66, 87, 77, 68, 100, 83, 85, 75, 5, + 76, 72, 22, 25, 118, 80, 82, 90, 18, 120, + 95, 95, 81, 23, 112, 90, 102, 103, 105, 123, + 75, 122, 126, 98, 34, 117, 115, 47, 38, 79, + 113, 107, 125, 122, 106, 112, 127, 113, 60, 91, + 125, 97, 121, 127, 98, 82, 97, 103, 5, 75, + 30, 26, 64, 79, 38, 12, 18, 2, 14, 4, + 21, 2, 68, 60, 31, 21, 61, 12, 12, 16, + 92, 11, 1, 93, 80, 60, 19, 15, 29, 22, + 43, 37, 104, 25, 43, 60, 35, 8, 55, 49, + 47, 97, 48, 52, 106, 101, 20, 52, 42, 46, + 59, 56, 53, 60, 60, 115, 27, 35, 57, 57, + 49, 16, 223, 217, 199, 137, 216, 220, 130, 141, + 236, 198, 215, 129, 252, 194, 197, 201, 219, 213, + 220, 153, 250, 208, 208, 209, 211, 193, 245, 196, + 196, 216, 148, 195, 249, 165, 168, 217, 225, 227, + 229, 254, 234, 163, 218, 237, 233, 243, 253, 192, + 239, 233, 247, 185, 232, 236, 178, 189, 192, 252, + 253, 240, 248, 254, 245, 251, 202, 167, 141, 156, + 171, 154, 158, 130, 194, 149, 147, 207, 198, 181, + 145, 150, 137, 146, 153, 151, 222, 173, 137, 159, + 158, 150, 181, 132, 132, 152, 212, 131, 185, 229, + 232, 154, 185, 170, 168, 164, 177, 171, 224, 138, + 180, 168, 170, 164, 159, 174, 170, 182, 254, 169, + 175, 243, 242, 128, 185, 191, 177, 182, 164, 186, + 88, 78, 8, 109, 65, 67, 64, 76, 80, 102, + 85, 83, 73, 7, 82, 86, 20, 27, 108, 76, + 76, 84, 85, 78, 90, 19, 124, 88, 68, 86, + 113, 64, 120, 100, 40, 127, 125, 33, 44, 88, + 81, 35, 68, 110, 106, 107, 101, 119, 95, 110, + 106, 118, 62, 105, 111, 51, 50, 70, 67, 49, + 82, 120, 120, 121, 11, 25, 72, 65, 57, 10, + 9, 6, 7, 13, 4, 72, 35, 18, 22, 10, + 90, 13, 11, 87, 94, 44, 19, 8, 6, 27, + 80, 48, 16, 5, 29, 22, 43, 37, 104, 27, + 47, 33, 40, 15, 48, 42, 52, 40, 53, 47, + 100, 21, 53, 46, 54, 61, 126, 41, 47, 115, + 114, 18, 37, 34, 34, 37, 53, 57, 195, 202, + 198, 137, 234, 192, 192, 193, 195, 209, 226, 211, + 207, 211, 205, 214, 210, 155, 232, 214, 203, 209, + 216, 157, 196, 192, 158, 145, 245, 214, 218, 212, + 238, 226, 233, 231, 174, 203, 227, 225, 238, 226, + 242, 195, 244, 238, 240, 236, 233, 243, 184, 201, + 241, 234, 242, 249, 178, 229, 227, 191, 182, 196, + 227, 252, 153, 152, 200, 175, 156, 142, 130, 142, + 160, 145, 137, 149, 143, 148, 140, 197, 170, 148, + 141, 151, 154, 223, 138, 142, 220, 211, 179, 139, + 147, 148, 156, 213, 129, 164, 186, 188, 160, 174, + 142, 191, 171, 183, 169, 178, 174, 231, 148, 170, + 175, 181, 188, 249, 168, 172, 242, 253, 150, 178, + 190, 184, 165, 191, 244, 158, 88, 68, 70, 76, + 108, 93, 69, 89, 75, 80, 72, 1, 118, 72, + 81, 75, 94, 27, 78, 74, 16, 31, 116, 82, + 92, 84, 16, 122, 89, 89, 83, 21, 78, 100, + 100, 101, 111, 125, 78, 127, 107, 119, 105, 114, + 110, 39, 84, 106, 111, 117, 124, 57, 104, 108, + 50, 61, 90, 102, 126, 118, 119, 101, 125, 116, + 4, 75, 46, 6, 28, 6, 2, 25, 32, 17, + 9, 21, 15, 20, 12, 69, 42, 20, 13, 23, + 26, 95, 10, 14, 92, 83, 58, 16, 6, 22, + 26, 16, 57, 46, 104, 16, 43, 33, 14, 63, + 43, 55, 41, 50, 46, 103, 20, 42, 47, 53, + 60, 121, 40, 44, 114, 125, 31, 54, 40, 56, + 53, 54, 58, 117, 250, 206, 219, 198, 236, 221, + 197, 217, 203, 208, 200, 129, 246, 200, 209, 203, + 222, 155, 206, 202, 144, 159, 242, 210, 192, 196, + 213, 214, 223, 214, 218, 149, 193, 249, 231, 231, + 235, 205, 254, 228, 246, 234, 243, 233, 166, 215, + 235, 240, 244, 255, 184, 239, 237, 177, 188, 211, + 247, 228, 176, 203, 243, 246, 248, 244, 132, 143, + 200, 173, 129, 131, 128, 140, 144, 161, 146, 136, + 146, 142, 151, 141, 218, 171, 151, 140, 144, 155, + 220, 139, 129, 221, 208, 161, 153, 155, 157, 134, + 162, 235, 146, 165, 161, 187, 181, 143, 176, 170, + 180, 168, 181, 175, 228, 149, 181, 174, 182, 189, + 254, 169, 175, 243, 242, 128, 167, 180, 178, 190, + 167, 189, 10, 96, 90, 70, 64, 78, 110, 95, + 75, 87, 73, 82, 78, 7, 116, 74, 79, 85, + 92, 25, 72, 76, 18, 29, 97, 90, 94, 86, + 87, 71, 91, 71, 111, 43, 76, 102, 98, 99, + 109, 127, 64, 113, 105, 117, 111, 116, 108, 37, + 74, 116, 109, 119, 122, 63, 106, 110, 60, 51, + 68, 100, 100, 124, 125, 102, 2, 75, 36, 0, + 28, 14, 46, 31, 11, 23, 9, 18, 14, 71, + 52, 10, 15, 21, 28, 89, 8, 12, 82, 93, + 39, 32, 80, 53, 25, 27, 24, 20, 56, 9, + 58, 32, 58, 38, 63, 37, 98, 19, 47, 52, + 40, 35, 100, 51, 41, 117, 120, 12, 13, 127, + 24, 50, 62, 63, 49, 35, 118, 127, 3, 48, + 207, 192, 205, 199, 202, 134, 238, 223, 203, 215, + 201, 210, 206, 135, 244, 202, 207, 213, 220, 153, + 200, 204, 146, 157, 225, 220, 197, 197, 222, 151, + 245, 211, 248, 226, 235, 232, 224, 175, 222, 236, + 236, 231, 200, 238, 232, 224, 164, 206, 245, 245, + 255, 185, 218, 240, 240, 241, 243, 225, 176, 231, + 229, 185, 180, 223, 139, 155, 137, 135, 139, 156, + 137, 205, 187, 134, 142, 175, 137, 149, 147, 128, + 157, 146, 153, 151, 222, 180, 142, 146, 156, 150, + 208, 135, 133, 217, 212, 166, 189, 174, 172, 160, + 189, 167, 236, 134, 176, 172, 174, 160, 136, 162, + 179, 229, 128, 190, 185, 181, 191, 177, 184, 253, + 150, 188, 188, 189, 183, 165, 244, 163, 89, 5, + 8, 106, 79, 65, 77, 73, 75, 66, 78, 1, + 98, 72, 72, 73, 91, 73, 118, 92, 73, 31, + 102, 88, 83, 95, 81, 95, 82, 23, 112, 90, + 102, 103, 105, 123, 46, 121, 127, 35, 34, 80, + 119, 104, 117, 116, 36, 67, 104, 122, 118, 122, + 80, 122, 107, 61, 72, 118, 113, 125, 119, 121, + 112, 53, 46, 4, 4, 5, 15, 29, 76, 27, + 17, 77, 64, 41, 9, 9, 3, 69, 49, 20, + 22, 30, 94, 59, 19, 17, 30, 18, 2, 63, + 19, 0, 84, 47, 47, 42, 36, 40, 32, 43, + 108, 9, 45, 47, 44, 32, 52, 103, 50, 54, + 116, 123, 18, 56, 46, 62, 50, 56, 33, 54, + 112, 8, 51, 57, 26, 48, 221, 139, 242, 204, + 207, 195, 205, 195, 198, 131, 228, 206, 202, 203, + 197, 215, 154, 205, 203, 151, 158, 236, 213, 211, + 213, 210, 192, 222, 196, 210, 148, 241, 229, 231, + 228, 232, 252, 193, 233, 250, 162, 217, 229, 224, + 234, 230, 234, 225, 186, 223, 247, 245, 242, 254, + 238, 189, 228, 224, 190, 177, 195, 196, 180, 209, + 133, 135, 132, 136, 156, 188, 133, 131, 133, 130, + 144, 142, 148, 130, 196, 161, 149, 151, 148, 152, + 140, 223, 138, 142, 220, 211, 163, 134, 159, 132, + 135, 213, 140, 185, 169, 167, 173, 156, 165, 163, + 165, 162, 176, 174, 180, 162, 228, 129, 181, 183, + 180, 184, 172, 255, 170, 174, 252, 243, 152, 190, + 184, 176, 244, 158, 69, 69, 79, 9, 106, 64, + 64, 65, 67, 81, 115, 72, 72, 64, 69, 85, + 85, 73, 93, 25, 122, 80, 80, 81, 83, 65, + 16, 71, 69, 25, 20, 127, 107, 123, 105, 103, + 107, 124, 105, 45, 91, 102, 110, 85, 115, 117, + 111, 108, 105, 115, 56, 85, 119, 109, 125, 61, + 100, 96, 62, 49, 92, 118, 100, 116, 4, 14, + 27, 12, 78, 54, 9, 3, 55, 48, 64, 37, + 9, 11, 8, 4, 8, 91, 14, 10, 80, 95, + 63, 28, 28, 18, 20, 24, 23, 25, 84, 49, + 37, 39, 36, 40, 60, 26, 31, 109, 6, 44, + 44, 45, 39, 53, 100, 51, 41, 117, 120, 10, + 41, 54, 47, 46, 114, 21, 34, 48, 56, 52, + 1, 6, 138, 239, 199, 197, 194, 206, 222, 141, + 212, 208, 142, 129, 245, 208, 205, 214, 201, 155, + 254, 203, 223, 209, 223, 157, 154, 228, 213, 212, + 221, 210, 218, 209, 163, 222, 219, 169, 202, 224, + 224, 225, 227, 241, 160, 247, 245, 169, 164, 198, + 242, 242, 246, 252, 237, 250, 188, 196, 231, 242, + 254, 196, 197, 183, 208, 250, 134, 135, 137, 155, + 206, 153, 159, 195, 194, 160, 154, 132, 133, 143, + 196, 174, 149, 137, 141, 151, 159, 170, 175, 221, + 182, 156, 156, 157, 151, 133, 212, 131, 185, 229, + 232, 141, 175, 161, 165, 190, 170, 227, 139, 179, + 169, 169, 161, 144, 137, 251, 156, 182, 178, 179, + 189, 175, 242, 165, 163, 255, 246, 159, 187, 187, + 77, 11, 99, 70, 64, 72, 12, 105, 77, 79, + 76, 64, 84, 114, 119, 5, 126, 84, 84, 85, + 95, 77, 28, 75, 65, 29, 16, 120, 88, 83, + 93, 84, 100, 43, 90, 124, 126, 106, 105, 88, + 81, 35, 68, 110, 106, 107, 101, 119, 58, 109, + 107, 55, 62, 87, 105, 115, 117, 114, 98, 120, + 119, 121, 52, 83, 5, 25, 1, 7, 26, 58, + 63, 77, 38, 12, 12, 13, 7, 21, 68, 19, + 9, 85, 88, 48, 13, 13, 29, 24, 30, 26, + 80, 63, 19, 0, 84, 38, 34, 46, 57, 44, + 34, 26, 31, 109, 6, 44, 44, 45, 39, 53, + 100, 51, 41, 117, 120, 19, 63, 47, 61, 51, + 55, 32, 53, 113, 15, 50, 58, 0, 249, 139, + 236, 198, 194, 195, 205, 223, 130, 213, 211, 143, + 134, 237, 197, 213, 219, 213, 221, 202, 219, 159, + 229, 216, 220, 147, 152, 230, 211, 210, 223, 208, + 228, 239, 161, 220, 221, 175, 200, 226, 238, 239, + 225, 243, 166, 241, 247, 171, 186, 214, 253, 225, + 247, 252, 253, 243, 178, 195, 245, 226, 249, 194, + 199, 181, 174, 132, 132, 133, 143, 157, 204, 155, + 145, 205, 192, 175, 137, 149, 147, 128, 157, 146, + 153, 151, 222, 180, 142, 146, 156, 150, 165, 162, + 214, 179, 155, 153, 166, 170, 186, 233, 184, 188, + 226, 237, 146, 172, 172, 168, 181, 175, 228, 159, + 182, 180, 172, 160, 139, 172, 252, 153, 189, 191, + 188, 176, 164, 247, 162, 166, 4, 11, 122, 70, + 67, 78, 66, 68, 67, 77, 0, 109, 67, 82, + 113, 118, 26, 127, 87, 85, 82, 94, 78, 29, + 68, 64, 30, 17, 100, 66, 71, 70, 99, 106, + 102, 41, 92, 122, 110, 97, 103, 86, 83, 33, + 66, 104, 104, 105, 123, 105, 56, 111, 109, 49, + 60, 78, 115, 102, 116, 120, 54, 86, 102, 116, + 8, 2, 9, 7, 78, 61, 5, 20, 3, 15, + 53, 50, 70, 35, 11, 9, 22, 26, 10, 89, + 8, 12, 82, 93, 33, 4, 21, 21, 31, 4, + 28, 85, 1, 57, 39, 39, 47, 26, 31, 109, + 6, 44, 44, 45, 39, 53, 100, 51, 41, 117, + 120, 10, 55, 49, 59, 60, 34, 60, 34, 52, + 118, 19, 59, 57, 198, 202, 218, 252, 253, 143, + 232, 194, 206, 207, 193, 211, 134, 209, 215, 139, + 154, 239, 208, 216, 215, 159, 254, 220, 218, 199, + 229, 226, 150, 243, 219, 217, 230, 234, 250, 169, + 248, 252, 162, 173, 214, 246, 242, 234, 239, 244, + 236, 165, 214, 242, 234, 248, 203, 204, 188, 217, + 253, 255, 252, 240, 228, 183, 226, 230, 196, 203, + 187, 134, 155, 155, 132, 205, 163, 133, 146, 136, + 133, 134, 138, 197, 168, 154, 150, 157, 173, 144, + 137, 137, 154, 211, 177, 151, 132, 158, 151, 148, + 164, 235, 154, 168, 160, 171, 236, 187, 177, 237, + 224, 139, 167, 183, 165, 171, 191, 168, 189, 249, + 135, 186, 178, 154, 189, 191, 180, 241, 160, 164, + 250, 245, 105, 67, 65, 71, 75, 92, 73, 13, + 123, 86, 65, 79, 117, 78, 72, 83, 95, 73, + 24, 79, 77, 17, 28, 126, 90, 90, 94, 84, + 69, 82, 20, 108, 127, 106, 102, 78, 97, 99, + 104, 45, 116, 112, 46, 33, 71, 114, 119, 113, + 104, 122, 116, 112, 127, 113, 60, 89, 125, 127, + 124, 112, 100, 80, 123, 121, 14, 75, 30, 26, + 64, 79, 47, 12, 12, 2, 4, 8, 7, 9, + 68, 33, 21, 23, 20, 24, 12, 56, 19, 17, + 22, 83, 6, 2, 88, 87, 39, 2, 35, 56, + 59, 105, 8, 61, 45, 35, 33, 4, 47, 45, + 34, 103, 50, 54, 116, 123, 29, 44, 44, 48, + 27, 50, 62, 55, 112, 39, 37, 121, 116, 23, + 216, 194, 220, 192, 221, 199, 140, 253, 205, 214, + 206, 197, 225, 200, 200, 193, 154, 205, 203, 151, + 158, 247, 211, 211, 213, 147, 251, 222, 216, 208, + 148, 241, 229, 231, 228, 232, 252, 200, 227, 225, + 230, 163, 246, 242, 168, 167, 206, 228, 234, 250, + 246, 252, 237, 250, 188, 196, 247, 253, 215, 254, + 250, 243, 180, 227, 153, 197, 200, 167, 139, 152, + 204, 183, 135, 130, 140, 128, 136, 131, 196, 161, + 149, 151, 148, 152, 140, 184, 147, 145, 150, 211, + 134, 130, 216, 215, 167, 156, 164, 172, 169, 185, + 161, 189, 169, 237, 134, 172, 172, 173, 167, 181, + 131, 170, 182, 191, 248, 175, 173, 241, 252, 142, + 187, 191, 166, 180, 164, 132, 189, 185, 92, 78, + 90, 9, 88, 92, 2, 13, 99, 86, 83, 85, + 84, 70, 72, 76, 91, 85, 24, 125, 81, 83, + 80, 92, 64, 96, 89, 93, 64, 82, 70, 21, + 124, 120, 38, 41, 77, 110, 98, 108, 102, 106, + 97, 111, 38, 67, 107, 105, 118, 122, 106, 74, + 119, 115, 106, 120, 96, 51, 102, 98, 56, 55, + 82, 103, 11, 5, 11, 58, 7, 3, 26, 8, + 16, 67, 22, 18, 72, 71, 33, 16, 8, 20, + 43, 16, 18, 9, 25, 15, 82, 5, 3, 95, + 86, 39, 27, 0, 36, 47, 27, 32, 34, 57, + 41, 63, 98, 53, 51, 111, 102, 15, 43, 43, + 61, 123, 19, 54, 48, 56, 124, 25, 61, 63, + 60, 48, 36, 4, 61, 57, 220, 206, 218, 137, + 216, 220, 130, 141, 232, 194, 208, 192, 200, 194, + 215, 192, 154, 226, 221, 215, 237, 214, 208, 203, + 215, 193, 144, 199, 197, 153, 148, 251, 239, 252, + 168, 211, 235, 238, 224, 236, 236, 231, 160, 197, + 233, 235, 232, 228, 232, 200, 241, 245, 232, 250, + 238, 189, 228, 224, 190, 177, 197, 254, 250, 242, + 139, 155, 135, 155, 139, 207, 168, 130, 142, 143, + 129, 147, 181, 151, 139, 145, 218, 168, 145, 149, + 136, 154, 142, 174, 130, 156, 132, 209, 177, 152, + 152, 145, 153, 187, 167, 189, 238, 159, 173, 161, + 174, 162, 164, 168, 179, 170, 151, 181, 181, 175, + 248, 137, 178, 190, 168, 180, 188, 166, 189, 130, + 240, 135, 251, 148, 121, 115, 8, 64, 64, 75, + 73, 85, 2, 76, 70, 1, 103, 82, 87, 81, + 72, 90, 84, 80, 95, 81, 28, 81, 91, 64, + 68, 84, 82, 23, 71, 93, 107, 121, 109, 122, + 79, 92, 84, 45, 81, 83, 73, 33, 52, 55, + 52, 37, 95, 106, 109, 112, 106, 102, 60, 84, + 124, 119, 117, 105, 54, 84, 82, 81, 74, 40, + 7, 7, 26, 29, 13, 14, 22, 32, 8, 8, + 8, 6, 68, 36, 79, 75, 88, 16, 16, 27, + 25, 5, 82, 28, 22, 81, 53, 31, 29, 27, + 47, 56, 45, 105, 34, 38, 63, 57, 39, 39, + 96, 50, 46, 38, 54, 32, 41, 24, 55, 41, + 46, 58, 46, 125, 27, 61, 52, 52, 46, 30, + 22, 16, 242, 139, 155, 156, 142, 198, 194, 201, + 199, 219, 128, 206, 192, 135, 247, 213, 219, 213, + 209, 202, 214, 159, 208, 212, 193, 199, 213, 213, + 150, 196, 220, 212, 248, 238, 251, 218, 218, 192, + 212, 213, 183, 179, 197, 161, 195, 246, 241, 236, + 238, 226, 184, 208, 240, 251, 249, 229, 178, 208, + 214, 213, 182, 212, 251, 251, 158, 153, 137, 138, + 154, 170, 153, 159, 141, 195, 179, 149, 137, 159, + 156, 197, 207, 203, 216, 144, 144, 155, 153, 133, + 210, 156, 150, 209, 179, 130, 134, 154, 186, 174, + 169, 167, 238, 163, 165, 190, 182, 166, 164, 225, + 181, 175, 165, 183, 191, 168, 155, 152, 157, 255, + 232, 237, 242, 186, 190, 181, 179, 175, 244, 186, + 76, 11, 110, 91, 75, 65, 79, 69, 2, 79, + 73, 82, 82, 66, 64, 5, 73, 83, 89, 75, + 91, 76, 127, 124, 113, 19, 4, 1, 22, 114, + 69, 64, 99, 127, 113, 41, 71, 97, 104, 104, + 122, 35, 67, 71, 66, 39, 71, 106, 116, 111, + 106, 120, 125, 107, 88, 92, 74, 51, 121, 127, + 114, 114, 108, 53, 5, 13, 72, 46, 11, 29, + 1, 12, 12, 67, 12, 8, 21, 19, 1, 1, + 90, 8, 16, 24, 12, 26, 15, 57, 51, 43, + 80, 66, 70, 87, 49, 4, 63, 34, 60, 48, + 110, 6, 34, 41, 39, 59, 96, 2, 0, 3, + 100, 6, 53, 53, 44, 43, 63, 60, 40, 25, + 19, 11, 112, 98, 102, 119, 17, 36, 223, 194, + 220, 208, 142, 230, 194, 201, 199, 219, 128, 236, + 207, 201, 205, 133, 249, 253, 252, 153, 253, 208, + 210, 201, 192, 210, 211, 197, 242, 246, 236, 149, + 185, 187, 168, 204, 255, 250, 229, 249, 251, 163, + 201, 239, 226, 226, 252, 165, 217, 221, 220, 185, + 221, 240, 242, 233, 224, 242, 243, 229, 182, 191, + 195, 240, 143, 128, 141, 135, 138, 198, 164, 140, + 140, 132, 192, 178, 131, 137, 131, 197, 147, 149, + 156, 156, 134, 223, 147, 155, 210, 187, 159, 159, + 145, 215, 191, 154, 164, 172, 232, 165, 167, 188, + 184, 168, 166, 227, 179, 169, 167, 181, 161, 182, + 146, 186, 182, 190, 254, 140, 185, 179, 181, 243, + 185, 191, 178, 178, 172, 245, 69, 77, 8, 97, + 65, 65, 75, 13, 105, 76, 78, 70, 6, 75, + 77, 86, 78, 94, 92, 25, 77, 87, 93, 79, + 87, 64, 16, 114, 112, 115, 124, 84, 100, 108, + 40, 90, 107, 97, 107, 45, 71, 114, 117, 104, + 114, 126, 36, 76, 116, 127, 125, 97, 62, 92, + 90, 89, 50, 80, 127, 127, 98, 101, 117, 118, + 30, 34, 6, 13, 7, 14, 76, 88, 82, 67, + 9, 15, 2, 2, 28, 69, 21, 29, 88, 48, + 16, 27, 21, 28, 28, 83, 28, 24, 5, 3, + 17, 17, 106, 56, 32, 40, 60, 42, 63, 11, + 22, 16, 5, 97, 11, 14, 6, 101, 51, 53, + 60, 60, 38, 127, 51, 59, 114, 26, 36, 48, + 58, 62, 53, 59, 138, 199, 193, 218, 218, 202, + 200, 141, 209, 203, 193, 211, 195, 212, 234, 204, + 209, 208, 221, 208, 158, 141, 142, 136, 146, 218, + 222, 213, 211, 207, 148, 218, 236, 171, 194, 232, + 254, 238, 226, 232, 241, 230, 160, 237, 239, 244, + 240, 224, 254, 187, 235, 241, 255, 237, 249, 238, + 220, 250, 251, 250, 243, 254, 180, 167, 216, 222, + 200, 172, 159, 154, 133, 153, 155, 195, 169, 143, + 130, 130, 156, 197, 185, 189, 188, 217, 189, 144, + 146, 137, 128, 146, 147, 133, 184, 158, 159, 158, + 175, 162, 232, 251, 252, 250, 236, 136, 179, 182, + 169, 181, 191, 231, 141, 171, 190, 190, 160, 249, + 157, 153, 152, 253, 145, 188, 190, 165, 164, 182, + 183, 161, 10, 3, 127, 76, 75, 68, 73, 67, + 70, 10, 116, 100, 101, 111, 4, 20, 10, 11, + 24, 80, 80, 91, 89, 69, 18, 92, 86, 17, + 99, 100, 20, 89, 99, 120, 124, 108, 106, 47, + 127, 101, 99, 113, 101, 114, 72, 98, 96, 96, + 104, 119, 121, 119, 122, 63, 46, 40, 50, 80, + 113, 98, 126, 55, 93, 123, 14, 14, 16, 40, + 43, 55, 76, 4, 12, 7, 5, 25, 70, 8, + 2, 69, 50, 20, 20, 21, 31, 17, 24, 90, + 1, 83, 28, 24, 5, 3, 17, 17, 106, 56, + 32, 40, 60, 42, 63, 109, 1, 5, 4, 8, + 40, 35, 33, 61, 122, 52, 62, 121, 42, 48, + 44, 125, 1, 20, 8, 113, 37, 63, 53, 39, + 207, 216, 136, 234, 232, 235, 229, 239, 231, 251, + 128, 146, 147, 135, 225, 212, 207, 210, 204, 192, + 158, 246, 210, 217, 215, 203, 144, 242, 240, 243, + 148, 246, 229, 229, 252, 251, 239, 236, 248, 222, + 164, 211, 160, 180, 182, 183, 164, 236, 244, 255, + 253, 225, 190, 240, 250, 189, 199, 192, 176, 253, + 255, 228, 224, 240, 142, 203, 155, 129, 143, 157, + 137, 158, 177, 148, 137, 146, 149, 199, 169, 132, + 136, 144, 157, 141, 222, 182, 146, 153, 151, 139, + 208, 158, 144, 215, 167, 130, 163, 184, 187, 233, + 162, 166, 191, 185, 167, 167, 224, 178, 174, 166, + 182, 160, 169, 148, 149, 129, 254, 140, 168, 178, + 177, 184, 184, 190, 186, 186, 244, 230, 26, 11, + 97, 71, 74, 74, 84, 126, 111, 106, 0, 103, + 83, 83, 81, 87, 95, 72, 24, 122, 120, 123, + 104, 92, 91, 68, 81, 95, 22, 94, 90, 81, + 111, 115, 40, 102, 104, 47, 88, 108, 107, 116, + 97, 111, 99, 116, 97, 37, 118, 114, 107, 109, + 123, 123, 60, 110, 122, 114, 98, 116, 101, 81, + 64, 70, 47, 75, 89, 89, 94, 79, 5, 3, + 6, 6, 24, 65, 9, 1, 68, 48, 49, 91, + 20, 16, 13, 11, 25, 25, 82, 0, 24, 16, + 4, 18, 7, 51, 30, 24, 13, 105, 127, 127, + 124, 109, 7, 50, 53, 40, 50, 62, 100, 12, + 52, 63, 61, 33, 126, 28, 26, 25, 114, 16, + 63, 63, 34, 37, 53, 54, 222, 231, 199, 199, + 201, 143, 235, 196, 206, 215, 128, 231, 211, 211, + 209, 215, 223, 200, 152, 250, 248, 251, 245, 211, + 214, 214, 200, 145, 217, 209, 148, 193, 229, 251, + 168, 186, 190, 175, 255, 229, 227, 241, 229, 242, + 166, 232, 234, 165, 205, 250, 244, 245, 190, 204, + 232, 239, 247, 246, 228, 223, 215, 196, 208, 212, + 187, 203, 217, 217, 222, 207, 133, 131, 134, 134, + 152, 193, 137, 129, 196, 176, 169, 219, 148, 144, + 141, 139, 153, 153, 210, 128, 152, 144, 132, 146, + 135, 213, 137, 141, 140, 155, 187, 188, 191, 168, + 174, 175, 224, 243, 246, 247, 244, 229, 147, 181, + 188, 188, 166, 255, 145, 180, 188, 186, 240, 151, + 163, 163, 161, 167, 79, 88, 8, 106, 104, 107, + 127, 11, 114, 3, 21, 17, 22, 7, 97, 84, + 79, 82, 76, 64, 30, 118, 82, 89, 87, 75, + 16, 114, 112, 115, 20, 118, 101, 101, 124, 123, + 111, 108, 120, 94, 36, 83, 32, 52, 54, 55, + 36, 64, 107, 110, 113, 109, 103, 63, 85, 115, + 118, 118, 104, 49, 91, 126, 122, 124, 74, 40, + 46, 45, 78, 44, 3, 3, 22, 17, 1, 2, + 18, 41, 5, 22, 30, 26, 9, 89, 79, 79, + 76, 93, 55, 2, 5, 24, 2, 14, 84, 60, + 36, 47, 45, 49, 110, 12, 10, 9, 98, 0, + 47, 47, 50, 53, 37, 38, 46, 21, 57, 42, + 58, 62, 45, 125, 99, 99, 96, 113, 19, 38, + 33, 60, 222, 210, 136, 224, 192, 203, 201, 213, + 130, 238, 201, 207, 207, 135, 231, 227, 254, 155, + 251, 214, 208, 203, 206, 220, 209, 199, 249, 223, + 210, 210, 204, 149, 229, 237, 168, 253, 230, 234, + 172, 249, 237, 243, 160, 242, 238, 230, 246, 224, + 233, 187, 247, 247, 190, 200, 253, 241, 254, 179, + 195, 229, 228, 242, 241, 225, 202, 168, 174, 173, + 170, 128, 155, 205, 168, 140, 142, 132, 149, 199, + 215, 213, 218, 190, 137, 140, 151, 139, 133, 221, + 187, 157, 148, 148, 142, 215, 183, 179, 142, 235, + 139, 166, 160, 187, 190, 172, 161, 183, 132, 174, + 177, 231, 142, 170, 180, 190, 171, 249, 237, 239, + 252, 152, 163, 166, 185, 165, 175, 247, 157, 187, + 78, 78, 80, 9, 99, 70, 66, 68, 2, 96, + 102, 101, 6, 100, 75, 75, 78, 73, 89, 90, + 74, 108, 83, 68, 80, 86, 81, 95, 117, 69, + 65, 81, 111, 43, 71, 96, 98, 47, 36, 79, + 112, 102, 110, 117, 47, 68, 107, 119, 116, 59, + 126, 108, 106, 106, 110, 120, 97, 51, 83, 87, + 82, 80, 123, 121, 14, 75, 59, 25, 1, 27, + 43, 2, 14, 7, 64, 50, 22, 8, 16, 69, + 60, 35, 88, 58, 17, 17, 8, 15, 19, 16, + 4, 54, 25, 27, 16, 85, 25, 59, 39, 61, + 110, 2, 37, 35, 43, 99, 6, 25, 102, 4, + 43, 43, 46, 41, 57, 58, 42, 24, 51, 49, + 54, 115, 3, 33, 57, 35, 116, 19, 242, 139, + 235, 198, 192, 219, 222, 204, 193, 215, 128, 137, + 241, 194, 193, 206, 223, 213, 220, 144, 237, 214, + 208, 203, 215, 193, 144, 226, 198, 216, 192, 230, + 227, 231, 254, 236, 252, 175, 223, 253, 237, 247, + 160, 199, 222, 167, 199, 234, 244, 239, 234, 248, + 253, 235, 207, 244, 254, 229, 245, 227, 182, 196, + 228, 250, 158, 203, 165, 128, 128, 134, 204, 171, + 186, 195, 163, 142, 136, 147, 150, 132, 153, 143, + 171, 137, 145, 139, 220, 179, 147, 135, 133, 131, + 151, 155, 212, 178, 171, 184, 134, 168, 186, 186, + 190, 172, 174, 227, 135, 160, 181, 231, 162, 176, + 174, 174, 170, 188, 173, 255, 159, 155, 150, 131, + 177, 189, 186, 182, 176, 188, 95, 70, 8, 95, + 93, 1, 12, 120, 113, 3, 100, 78, 74, 75, + 69, 87, 106, 87, 89, 77, 87, 81, 73, 80, + 18, 69, 67, 31, 22, 98, 103, 21, 78, 100, + 100, 101, 111, 125, 95, 98, 123, 97, 101, 96, + 104, 116, 36, 99, 111, 111, 109, 107, 123, 108, + 60, 94, 84, 87, 67, 100, 113, 118, 102, 53, + 12, 30, 28, 28, 28, 10, 31, 77, 33, 37, + 36, 52, 45, 71, 38, 23, 31, 21, 12, 89, + 45, 15, 19, 9, 82, 53, 40, 81, 53, 24, + 26, 1, 56, 42, 43, 61, 27, 28, 108, 14, + 48, 54, 36, 36, 102, 20, 52, 42, 46, 123, + 30, 1, 126, 28, 51, 51, 38, 33, 49, 50, + 34, 2, 7, 117, 233, 217, 221, 205, 203, 143, + 255, 221, 205, 215, 128, 231, 254, 135, 231, 202, + 212, 207, 202, 216, 221, 203, 156, 149, 229, 214, + 213, 218, 211, 217, 208, 156, 223, 216, 168, 199, + 239, 251, 249, 255, 227, 239, 160, 198, 231, 244, + 164, 214, 234, 244, 236, 185, 216, 199, 188, 222, + 253, 253, 228, 227, 247, 244, 224, 198, 154, 132, + 156, 201, 187, 188, 204, 174, 144, 150, 132, 132, + 198, 168, 141, 137, 169, 139, 151, 141, 222, 170, + 183, 221, 177, 129, 133, 149, 147, 215, 187, 156, + 166, 136, 186, 188, 170, 170, 236, 130, 171, 175, + 224, 233, 145, 147, 141, 236, 141, 179, 189, 184, + 170, 255, 186, 168, 166, 166, 162, 180, 165, 247, + 151, 147, 110, 104, 64, 64, 64, 78, 12, 108, + 23, 19, 0, 104, 72, 67, 65, 93, 111, 104, + 24, 8, 14, 31, 101, 88, 83, 65, 67, 17, + 98, 69, 81, 84, 121, 126, 122, 112, 46, 65, + 99, 121, 103, 86, 83, 33, 51, 39, 93, 96, + 123, 105, 107, 57, 74, 109, 121, 124, 97, 102, + 98, 104, 54, 89, 123, 97, 15, 46, 29, 27, + 1, 79, 46, 24, 12, 7, 53, 50, 70, 84, + 84, 69, 35, 30, 25, 11, 13, 95, 40, 15, + 23, 18, 3, 4, 4, 14, 84, 55, 37, 37, + 44, 58, 4, 46, 60, 44, 44, 99, 20, 51, + 35, 38, 55, 48, 40, 34, 120, 23, 49, 43, + 57, 8, 25, 115, 4, 35, 51, 54, 39, 32, + 216, 210, 136, 231, 193, 219, 201, 249, 199, 205, + 141, 216, 195, 198, 214, 133, 239, 149, 235, 151, + 158, 235, 206, 216, 211, 192, 197, 195, 207, 151, + 250, 218, 254, 238, 168, 202, 200, 203, 216, 250, + 237, 174, 249, 228, 231, 245, 164, 208, 180, 200, + 182, 185, 202, 237, 249, 252, 225, 230, 226, 232, + 182, 217, 251, 225, 143, 203, 171, 175, 170, 169, + 133, 155, 135, 206, 153, 132, 135, 149, 196, 176, + 212, 168, 214, 217, 170, 141, 153, 156, 129, 134, + 130, 136, 214, 185, 155, 129, 175, 235, 139, 143, + 138, 154, 226, 158, 236, 227, 148, 179, 163, 166, + 183, 176, 168, 162, 248, 155, 177, 177, 184, 253, + 145, 149, 148, 132, 133, 247, 144, 186, 70, 71, + 73, 91, 14, 102, 66, 73, 71, 91, 98, 72, + 82, 68, 75, 76, 84, 27, 78, 74, 30, 106, + 111, 29, 118, 92, 92, 93, 87, 69, 113, 65, + 98, 110, 122, 108, 123, 98, 44, 123, 113, 35, + 85, 82, 38, 67, 107, 105, 118, 122, 106, 91, + 119, 107, 114, 114, 102, 118, 48, 103, 101, 55, + 65, 70, 74, 47, 7, 5, 2, 14, 30, 33, + 7, 21, 9, 0, 20, 71, 18, 22, 90, 46, + 43, 89, 58, 16, 16, 17, 19, 1, 34, 24, + 6, 7, 24, 16, 106, 107, 62, 58, 110, 26, + 31, 109, 6, 44, 44, 45, 39, 53, 106, 101, + 31, 41, 42, 54, 44, 127, 43, 53, 59, 63, + 53, 113, 38, 62, 58, 50, 195, 197, 207, 137, + 198, 192, 223, 217, 152, 131, 246, 196, 200, 195, + 203, 215, 247, 218, 214, 216, 217, 218, 206, 135, + 146, 218, 222, 216, 194, 222, 213, 217, 227, 241, + 233, 253, 231, 224, 226, 163, 172, 173, 214, 228, + 232, 227, 235, 247, 204, 254, 246, 253, 241, 237, + 209, 252, 252, 242, 247, 244, 228, 173, 180, 243, + 139, 130, 132, 201, 154, 128, 204, 129, 141, 130, + 132, 193, 176, 130, 138, 129, 149, 137, 216, 141, + 135, 143, 153, 211, 210, 186, 158, 152, 130, 158, + 149, 153, 163, 177, 169, 189, 167, 160, 162, 237, + 177, 168, 169, 177, 182, 162, 160, 235, 140, 190, + 182, 189, 177, 173, 145, 188, 188, 178, 183, 180, + 164, 237, 244, 245, 92, 78, 70, 77, 65, 93, + 12, 68, 86, 70, 77, 82, 6, 80, 69, 86, + 26, 93, 87, 76, 80, 91, 123, 88, 70, 101, + 85, 95, 82, 88, 70, 120, 111, 127, 105, 77, + 111, 123, 109, 91, 103, 109, 100, 110, 116, 74, + 101, 107, 123, 124, 125, 107, 36, 63, 106, 120, + 124, 119, 127, 99, 54, 122, 113, 97, 11, 15, + 9, 29, 15, 79, 5, 30, 66, 13, 15, 21, + 70, 4, 11, 23, 8, 30, 27, 13, 80, 95, + 40, 4, 2, 22, 80, 76, 86, 33, 17, 27, + 46, 36, 58, 4, 47, 33, 45, 42, 39, 49, + 122, 97, 48, 34, 42, 33, 53, 41, 120, 48, + 45, 127, 61, 49, 32, 54, 49, 53, 47, 119, + 53, 49, 206, 206, 204, 137, 218, 192, 140, 206, + 195, 192, 200, 196, 136, 135, 234, 196, 215, 222, + 152, 132, 158, 159, 202, 216, 220, 215, 223, 195, + 150, 192, 213, 198, 170, 226, 230, 224, 250, 230, + 237, 225, 235, 249, 229, 229, 166, 244, 241, 230, + 249, 254, 235, 234, 248, 234, 240, 241, 235, 179, + 189, 177, 240, 246, 253, 249, 202, 159, 135, 201, + 156, 138, 152, 159, 139, 134, 150, 132, 198, 142, + 138, 131, 149, 219, 153, 155, 145, 138, 136, 221, + 132, 150, 158, 149, 153, 133, 162, 144, 164, 175, + 167, 187, 131, 174, 162, 172, 165, 166, 178, 251, + 230, 174, 170, 172, 174, 178, 185, 181, 183, 165, + 185, 185, 242, 160, 165, 178, 181, 178, 167, 166, + 76, 94, 68, 69, 87, 99, 69, 64, 75, 87, + 112, 68, 84, 78, 75, 65, 26, 6, 24, 21, + 30, 105, 93, 81, 71, 86, 16, 12, 22, 27, + 20, 124, 100, 127, 109, 123, 120, 110, 96, 45, + 63, 35, 44, 33, 84, 98, 117, 112, 127, 104, + 108, 77, 103, 111, 121, 110, 50, 46, 48, 89, + 127, 100, 96, 122, 24, 18, 72, 27, 11, 30, + 25, 8, 17, 23, 64, 58, 15, 3, 89, 56, + 64, 91, 42, 28, 10, 13, 21, 24, 4, 26, + 30, 22, 86, 19, 21, 1, 43, 107, 46, 59, + 33, 34, 108, 46, 35, 32, 40, 36, 104, 105, + 106, 24, 96, 123, 10, 60, 42, 45, 53, 56, + 36, 58, 62, 54, 118, 51, 53, 33, 203, 139, + 206, 219, 193, 194, 140, 206, 195, 192, 200, 196, + 134, 193, 205, 203, 211, 200, 208, 220, 218, 145, + 156, 230, 251, 199, 213, 220, 197, 151, 215, 218, + 255, 229, 252, 179, 174, 210, 209, 183, 162, 207, + 239, 224, 226, 238, 234, 226, 186, 255, 249, 237, + 255, 191, 250, 239, 253, 254, 176, 226, 243, 229, + 226, 240, 152, 197, 198, 199, 179, 213, 204, 161, + 141, 130, 132, 136, 136, 128, 196, 129, 155, 143, + 153, 217, 152, 141, 147, 144, 210, 128, 149, 131, + 128, 146, 134, 213, 172, 162, 166, 160, 189, 167, + 169, 169, 236, 227, 155, 136, 178, 162, 169, 182, + 250, 184, 183, 172, 176, 171, 230, 253, 135, 189, + 163, 164, 166, 167, 187, 167, 94, 78, 76, 9, + 79, 72, 75, 95, 71, 68, 65, 85, 79, 72, + 74, 31, 26, 27, 89, 94, 89, 77, 89, 90, + 83, 71, 89, 94, 88, 23, 90, 90, 126, 43, + 123, 124, 126, 127, 99, 127, 118, 102, 100, 69, + 53, 70, 48, 48, 44, 88, 42, 46, 41, 92, + 40, 94, 35, 34, 35, 38, 33, 37, 38, 80, + 92, 93, 42, 90, 92, 91, 41, 46, 87, 33, + 87, 89, 34, 33, 38, 39, 59, 77, 74, 76, + 78, 79, 72, 73, 48, 70, 64, 64, 55, 64, + 76, 68, 11, 8, 13, 8, 124, 14, 121, 126, + 114, 119, 1, 7, 113, 119, 2, 125, 105, 108, + 106, 111, 110, 29, 107, 106, 103, 18, 104, 28, + 55, 62, 58, 17, 207, 205, 201, 220, 194, 219, + 255, 200, 209, 208, 201, 206, 200, 212, 231, 202, + 212, 207, 217, 208, 208, 218, 206, 240, 215, 192, + 195, 208, 209, 210, 245, 198, 249, 238, 252, 192, + 234, 200, 254, 226, 247, 243, 201, 239, 224, 232, + 215, 234, 232, 239, 209, 247, 250, 250, 228, 211, + 243, 254, 245, 218, 243, 238, 192, 250, 133, 135, + 188, 128, 158, 164, 137, 148, 166, 130, 148, 128, + 178, 158, 148, 128, 188, 148, 138, 148, 159, 139, + 149, 147, 149, 167, 137, 129, 147, 180, 129, 134, + 190, 164, 165, 136, 189, 188, 169, 185, 139, 135, + 150, 168, 181, 174, 166, 169, 191, 146, 171, 149, + 183, 177, 183, 148, 182, 243, 237, 241, 250, 247, + 147, 167, 69, 94, 88, 9, 19, 15, 0, 13, + 116, 74, 83, 72, 68, 75, 65, 5, 7, 27, + 20, 25, 118, 86, 88, 89, 87, 93, 16, 12, + 22, 96, 85, 92, 126, 98, 102, 110, 46, 105, + 99, 127, 34, 112, 116, 96, 116, 115, 36, 113, + 115, 118, 125, 90, 113, 115, 112, 120, 113, 103, + 48, 120, 98, 114, 121, 102, 74, 31, 7, 73, + 12, 26, 10, 11, 7, 17, 64, 50, 7, 17, + 1, 1, 90, 91, 17, 13, 27, 18, 15, 83, + 10, 32, 9, 28, 20, 24, 24, 54, 37, 46, + 46, 47, 39, 44, 37, 40, 44, 55, 20, 51, + 39, 35, 33, 23, 59, 47, 49, 54, 15, 42, + 61, 51, 38, 58, 36, 40, 4, 62, 39, 62, + 248, 194, 219, 194, 142, 223, 201, 223, 193, 198, + 206, 213, 239, 201, 199, 202, 215, 210, 214, 222, + 158, 222, 206, 218, 199, 222, 213, 223, 194, 151, + 220, 212, 249, 171, 255, 251, 225, 225, 235, 173, + 246, 250, 240, 228, 168, 167, 193, 253, 234, 254, + 251, 237, 251, 251, 188, 186, 181, 179, 228, 232, + 230, 242, 220, 250, 134, 130, 140, 136, 151, 166, + 130, 139, 141, 167, 129, 149, 131, 180, 129, 150, + 137, 146, 151, 151, 177, 143, 153, 147, 166, 154, + 157, 148, 162, 142, 132, 144, 131, 184, 152, 187, + 167, 162, 173, 191, 187, 128, 172, 174, 181, 162, + 144, 172, 183, 190, 139, 188, 173, 172, 181, 178, + 188, 160, 148, 176, 175, 164, 144, 180, 83, 100, + 78, 126, 75, 74, 71, 110, 71, 81, 84, 64, + 79, 73, 96, 68, 78, 94, 75, 123, 75, 76, + 85, 83, 87, 64, 67, 126, 84, 93, 81, 86, + 126, 66, 102, 111, 97, 78, 111, 110, 109, 118, + 110, 117, 82, 126, 116, 96, 58, 117, 119, 109, + 62, 108, 105, 109, 98, 124, 98, 101, 115, 115, + 80, 112, 25, 8, 26, 0, 30, 27, 5, 2, + 12, 89, 64, 65, 93, 36, 5, 11, 26, 15, + 88, 31, 23, 17, 24, 93, 30, 26, 3, 5, + 86, 0, 29, 1, 34, 107, 59, 57, 43, 44, + 37, 43, 43, 38, 36, 97, 40, 38, 41, 32, + 122, 102, 120, 63, 42, 47, 114, 44, 39, 50, + 62, 37, 57, 32, 49, 39, 132, 194, 198, 203, + 207, 204, 199, 216, 210, 208, 205, 192, 200, 198, + 195, 192, 200, 254, 213, 255, 200, 209, 212, 252, + 245, 128, 211, 200, 217, 205, 213, 140, 219, 179, + 222, 254, 197, 226, 229, 254, 225, 240, 249, 236, + 228, 232, 232, 246, 197, 247, 241, 234, 234, 236, + 232, 228, 226, 246, 195, 221, 194, 199, 228, 231, + 131, 136, 141, 152, 155, 142, 130, 153, 139, 151, + 153, 145, 148, 142, 135, 128, 183, 158, 153, 138, + 139, 141, 153, 144, 151, 157, 132, 176, 148, 132, + 155, 153, 191, 191, 173, 134, 168, 169, 191, 168, + 182, 170, 179, 149, 180, 166, 173, 169, 179, 181, + 191, 168, 171, 190, 178, 169, 187, 167, 169, 129, + 179, 165, 183, 176, 68, 95, 73, 78, 75, 127, + 94, 68, 65, 70, 112, 83, 79, 68, 65, 104, + 95, 90, 75, 76, 76, 90, 81, 88, 92, 71, + 121, 66, 98, 69, 85, 92, 102, 98, 102, 110, + 95, 122, 109, 99, 118, 106, 116, 120, 86, 98, + 118, 102, 127, 117, 108, 120, 121, 122, 32, 61, + 46, 46, 48, 71, 119, 101, 125, 116, 8, 7, + 13, 61, 7, 12, 7, 33, 7, 5, 20, 35, + 9, 21, 0, 0, 8, 41, 17, 30, 22, 11, + 62, 18, 0, 23, 21, 3, 63, 25, 23, 25, + 63, 47, 45, 5, 43, 41, 56, 15, 45, 49, + 36, 36, 52, 19, 45, 38, 49, 8, 49, 35, + 59, 11, 53, 62, 57, 16, 63, 34, 34, 7, + 38, 48, 201, 194, 219, 192, 193, 193, 237, 193, + 208, 198, 193, 197, 223, 135, 199, 202, 212, 213, + 221, 218, 202, 214, 210, 218, 146, 221, 223, 198, + 242, 222, 199, 214, 229, 229, 230, 236, 237, 251, + 229, 227, 229, 163, 238, 238, 241, 167, 231, 234, + 244, 245, 253, 250, 234, 246, 242, 250, 188, 189, + 190, 177, 245, 248, 250, 251, 143, 136, 156, 128, + 128, 136, 204, 139, 131, 138, 140, 132, 130, 201, + 196, 183, 159, 154, 139, 150, 144, 197, 220, 177, + 157, 146, 148, 152, 152, 144, 212, 134, 175, 184, + 187, 160, 161, 161, 191, 227, 236, 237, 131, 251, + 154, 128, 173, 177, 182, 186, 186, 244, 140, 170, + 178, 179, 183, 161, 140, 179, 163, 190, 184, 177, + 89, 119, 26, 74, 118, 26, 110, 99, 110, 115, + 124, 17, 122, 68, 72, 76, 95, 85, 76, 101, + 74, 90, 78, 80, 91, 93, 81, 93, 106, 83, + 81, 67, 111, 103, 103, 121, 99, 106, 98, 121, + 94, 65, 117, 114, 111, 105, 97, 118, 105, 87, + 121, 96, 123, 109, 64, 73, 96, 114, 116, 120, + 120, 112, 68, 121, 11, 31, 14, 6, 28, 2, + 66, 47, 23, 16, 9, 15, 3, 20, 23, 41, + 27, 2, 29, 11, 34, 60, 19, 19, 28, 22, + 19, 5, 31, 24, 26, 6, 22, 8, 39, 39, + 32, 42, 47, 57, 43, 44, 46, 111, 37, 52, + 8, 42, 59, 63, 49, 55, 57, 127, 57, 37, + 49, 59, 49, 63, 49, 50, 39, 123, 132, 133, + 228, 198, 207, 203, 197, 195, 197, 131, 211, 216, + 203, 197, 203, 201, 154, 220, 202, 214, 203, 207, + 207, 147, 156, 157, 252, 222, 215, 211, 221, 219, + 237, 171, 231, 251, 234, 234, 254, 173, 246, 250, + 240, 228, 245, 169, 170, 171, 214, 244, 249, 253, + 247, 241, 251, 189, 243, 224, 227, 244, 226, 228, + 186, 187, 196, 167, 135, 136, 138, 134, 130, 138, + 194, 130, 131, 130, 137, 146, 138, 145, 137, 213, + 214, 215, 178, 144, 157, 153, 155, 157, 151, 209, + 153, 135, 128, 156, 165, 165, 232, 186, 171, 189, + 165, 168, 177, 237, 238, 239, 138, 168, 165, 161, + 179, 181, 191, 249, 173, 166, 177, 191, 189, 191, + 163, 255, 248, 249, 152, 186, 75, 79, 65, 71, + 73, 15, 94, 88, 78, 70, 83, 15, 8, 9, + 104, 74, 91, 95, 81, 87, 89, 31, 76, 82, + 65, 90, 68, 88, 89, 89, 71, 27, 36, 37, + 68, 102, 111, 107, 101, 99, 101, 35, 99, 109, + 105, 116, 97, 97, 58, 107, 119, 106, 119, 107, + 117, 114, 124, 96, 62, 63, 56, 91, 123, 116, + 14, 2, 6, 14, 78, 29, 9, 29, 13, 17, + 20, 18, 72, 73, 74, 41, 21, 26, 28, 16, + 16, 24, 92, 18, 0, 23, 21, 3, 5, 89, + 90, 91, 6, 36, 41, 45, 39, 33, 43, 109, + 35, 32, 35, 46, 51, 41, 48, 101, 53, 43, + 61, 43, 63, 43, 53, 50, 60, 32, 126, 127, + 120, 27, 59, 52, 206, 194, 198, 206, 142, 219, + 222, 204, 198, 202, 206, 198, 134, 212, 205, 194, + 212, 218, 212, 202, 144, 145, 146, 237, 192, 220, + 211, 212, 197, 196, 221, 219, 237, 171, 229, 236, + 253, 252, 237, 234, 231, 240, 174, 175, 168, 239, + 237, 246, 238, 244, 234, 224, 176, 251, 254, 235, + 253, 255, 229, 252, 243, 186, 245, 251, 139, 135, + 145, 154, 135, 156, 194, 137, 128, 150, 147, 132, + 148, 202, 144, 151, 155, 159, 157, 138, 208, 155, + 158, 178, 130, 150, 130, 144, 130, 158, 155, 155, + 234, 188, 169, 186, 238, 172, 173, 163, 161, 166, + 172, 173, 163, 163, 228, 166, 181, 181, 182, 188, + 189, 171, 185, 185, 242, 160, 165, 178, 181, 178, + 167, 166, 76, 94, 68, 69, 87, 76, 67, 67, + 76, 70, 67, 85, 67, 67, 103, 74, 84, 85, + 93, 90, 74, 86, 83, 83, 18, 68, 81, 66, + 22, 83, 93, 70, 105, 100, 102, 103, 107, 108, + 120, 104, 102, 35, 100, 116, 99, 39, 112, 106, + 58, 111, 112, 124, 62, 115, 125, 126, 121, 51, + 127, 119, 54, 123, 125, 118, 15, 5, 27, 12, + 55, 0, 25, 77, 10, 2, 22, 4, 70, 5, + 1, 0, 20, 91, 27, 22, 16, 17, 25, 30, + 6, 22, 20, 81, 5, 2, 23, 22, 47, 56, + 59, 47, 59, 35, 32, 52, 13, 55, 40, 36, + 52, 103, 50, 32, 52, 63, 55, 43, 45, 127, + 43, 56, 32, 54, 112, 53, 63, 36, 55, 58, + 196, 197, 205, 202, 218, 202, 200, 141, 198, 214, + 197, 129, 210, 200, 132, 209, 210, 222, 152, 213, + 223, 220, 215, 157, 221, 213, 144, 221, 223, 212, + 209, 219, 249, 238, 203, 230, 224, 225, 233, 238, + 246, 234, 239, 239, 193, 245, 235, 240, 234, 244, + 217, 236, 234, 247, 188, 242, 226, 231, 249, 254, + 248, 228, 180, 226, 139, 152, 200, 135, 129, 155, + 204, 158, 135, 151, 166, 128, 143, 139, 196, 145, + 149, 219, 159, 156, 144, 154, 142, 156, 134, 150, + 208, 131, 151, 153, 144, 154, 167, 235, 184, 166, + 188, 187, 164, 185, 182, 179, 250, 238, 233, 171, + 171, 166, 187, 183, 176, 182, 173, 171, 230, 190, + 134, 161, 177, 181, 179, 165, 183, 185, 67, 78, + 70, 93, 113, 70, 72, 78, 78, 74, 69, 79, + 82, 120, 87, 64, 89, 73, 93, 77, 76, 90, + 90, 79, 87, 64, 88, 110, 66, 88, 95, 80, + 100, 108, 122, 104, 96, 123, 83, 121, 123, 115, + 101, 64, 101, 100, 97, 118, 105, 79, 119, 114, + 123, 113, 78, 120, 116, 97, 117, 98, 126, 67, + 123, 126, 15, 5, 45, 17, 30, 6, 30, 8, + 17, 42, 14, 34, 9, 9, 10, 0, 25, 15, + 17, 22, 16, 69, 92, 46, 23, 7, 80, 35, + 19, 17, 6, 16, 57, 35, 28, 38, 37, 42, + 34, 31, 39, 48, 53, 45, 50, 103, 52, 55, + 53, 43, 61, 43, 42, 54, 57, 46, 49, 60, + 52, 52, 53, 56, 48, 48, 138, 207, 199, 204, + 221, 143, 194, 194, 214, 131, 197, 217, 207, 212, + 208, 215, 223, 223, 209, 203, 219, 220, 200, 226, + 199, 193, 217, 208, 195, 195, 220, 218, 248, 226, + 242, 232, 250, 230, 227, 227, 221, 224, 239, 229, + 227, 227, 237, 246, 249, 244, 246, 247, 251, 252, + 232, 244, 252, 244, 176, 245, 255, 228, 247, 250, + 132, 133, 141, 138, 154, 134, 130, 138, 204, 205, + 206, 193, 130, 142, 151, 134, 149, 149, 150, 156, + 157, 139, 153, 153, 210, 144, 159, 159, 152, 146, + 151, 129, 163, 164, 166, 233, 162, 160, 191, 185, + 226, 130, 181, 181, 169, 231, 182, 160, 185, 184, + 183, 183, 187, 188, 168, 180, 189, 189, 240, 184, + 165, 247, 176, 188, 89, 74, 74, 69, 75, 75, + 111, 66, 76, 77, 69, 66, 82, 78, 75, 75, + 26, 82, 75, 25, 80, 80, 72, 29, 81, 92, + 94, 95, 83, 84, 64, 80, 110, 72, 103, 103, + 96, 106, 111, 121, 107, 108, 110, 33, 111, 116, + 36, 80, 116, 112, 118, 118, 105, 113, 60, 114, + 96, 119, 117, 99, 54, 99, 109, 101, 15, 36, + 26, 13, 11, 29, 76, 29, 3, 17, 1, 12, + 3, 19, 1, 23, 9, 91, 17, 10, 94, 26, + 17, 13, 6, 10, 35, 8, 27, 21, 27, 25, + 57, 107, 46, 59, 33, 34, 108, 41, 43, 37, + 38, 36, 52, 34, 42, 49, 122, 56, 55, 55, + 48, 58, 63, 41, 59, 60, 62, 34, 23, 59, + 56, 58, 221, 139, 230, 204, 217, 143, 227, 238, + 237, 243, 204, 192, 197, 194, 132, 234, 249, 244, + 152, 215, 209, 203, 156, 220, 222, 223, 223, 198, + 211, 211, 243, 208, 254, 197, 231, 231, 200, 230, + 244, 232, 230, 208, 249, 236, 228, 232, 232, 165, + 232, 254, 233, 236, 251, 236, 232, 189, 230, 250, + 253, 244, 182, 248, 225, 225, 202, 152, 145, 132, + 140, 128, 128, 205, 139, 135, 192, 220, 198, 171, + 139, 132, 158, 146, 150, 158, 222, 223, 154, 143, + 157, 158, 202, 209, 214, 131, 155, 207, 234, 235, + 174, 160, 160, 166, 191, 165, 167, 167, 224, 167, + 167, 174, 168, 182, 175, 184, 187, 188, 173, 172, + 240, 253, 144, 178, 162, 162, 236, 247, 248, 245, + 110, 94, 90, 72, 90, 70, 67, 67, 24, 3, + 110, 19, 6, 84, 65, 70, 79, 75, 92, 88, + 74, 90, 125, 94, 70, 90, 95, 95, 22, 84, + 91, 64, 102, 111, 40, 103, 97, 123, 44, 111, + 103, 35, 110, 116, 106, 107, 103, 100, 118, 119, + 122, 120, 125, 116, 114, 114, 50, 114, 115, 101, + 127, 97, 113, 53, 5, 25, 12, 12, 28, 28, + 76, 12, 1, 23, 9, 23, 3, 71, 11, 23, + 30, 30, 10, 81, 13, 86, 92, 85, 28, 28, + 80, 1, 25, 4, 29, 1, 35, 36, 38, 58, + 110, 63, 35, 62, 43, 55, 41, 46, 40, 111, + 55, 108, 122, 115, 120, 46, 55, 43, 52, 125, + 114, 50, 62, 53, 118, 26, 49, 38, 217, 202, + 207, 204, 225, 223, 201, 195, 237, 209, 196, 196, + 212, 135, 204, 196, 204, 222, 152, 215, 209, 159, + 253, 222, 209, 220, 197, 223, 194, 254, 208, 153, + 170, 219, 231, 250, 231, 251, 229, 226, 236, 202, + 228, 161, 187, 167, 201, 224, 233, 232, 249, 254, + 251, 208, 236, 248, 252, 220, 226, 245, 243, 229, + 180, 253, 139, 157, 141, 201, 128, 128, 204, 190, + 155, 142, 130, 142, 138, 174, 128, 201, 218, 171, + 151, 138, 151, 139, 149, 146, 156, 186, 148, 209, + 203, 215, 185, 144, 185, 184, 169, 174, 171, 128, + 188, 168, 172, 147, 175, 178, 175, 179, 173, 170, + 180, 251, 176, 184, 168, 186, 252, 179, 189, 243, + 145, 178, 181, 184, 161, 187, 94, 98, 76, 5, + 14, 127, 67, 94, 75, 87, 73, 78, 72, 110, + 64, 5, 7, 27, 117, 92, 77, 76, 93, 90, + 87, 124, 64, 84, 88, 103, 91, 70, 99, 127, + 97, 102, 96, 47, 100, 108, 116, 102, 32, 111, + 105, 39, 87, 124, 119, 121, 119, 117, 87, 123, + 48, 61, 66, 124, 99, 120, 98, 126, 123, 123, + 35, 15, 72, 84, 78, 34, 9, 30, 17, 2, + 7, 4, 37, 11, 11, 22, 31, 31, 40, 22, + 13, 22, 8, 20, 29, 29, 80, 25, 23, 1, + 17, 85, 36, 36, 104, 8, 45, 44, 35, 56, + 44, 55, 9, 37, 106, 103, 20, 42, 41, 50, + 44, 48, 49, 49, 21, 57, 114, 110, 112, 28, + 51, 36, 39, 52, 205, 206, 235, 197, 193, 220, + 201, 201, 242, 204, 211, 200, 210, 206, 203, 203, + 154, 211, 217, 207, 219, 159, 210, 210, 146, 224, + 201, 220, 212, 216, 216, 252, 238, 167, 168, 217, + 225, 252, 229, 249, 235, 236, 238, 200, 226, 167, + 185, 165, 215, 254, 235, 234, 255, 248, 249, 222, + 224, 234, 224, 229, 249, 214, 231, 230, 143, 159, + 170, 136, 130, 142, 130, 142, 135, 144, 192, 137, + 135, 145, 129, 197, 148, 148, 216, 184, 157, 156, + 147, 136, 156, 135, 185, 149, 187, 146, 135, 134, + 171, 172, 173, 138, 188, 182, 188, 185, 173, 130, + 179, 178, 163, 179, 134, 164, 182, 186, 182, 186, + 187, 172, 252, 181, 179, 165, 181, 241, 184, 184, + 244, 148, 89, 88, 77, 93, 103, 75, 111, 95, + 91, 83, 84, 78, 103, 68, 71, 74, 79, 85, + 76, 25, 87, 76, 28, 79, 87, 66, 69, 88, + 68, 82, 80, 21, 108, 100, 122, 41, 67, 106, + 127, 126, 99, 100, 101, 66, 116, 126, 116, 113, + 117, 90, 107, 106, 123, 107, 94, 124, 126, 114, + 126, 114, 115, 100, 58, 53, 43, 8, 11, 6, + 27, 1, 24, 77, 11, 7, 64, 92, 70, 36, + 5, 11, 26, 15, 88, 31, 23, 17, 24, 93, + 19, 16, 19, 30, 3, 25, 0, 85, 61, 34, + 60, 33, 110, 38, 40, 109, 127, 99, 3, 46, + 40, 41, 33, 38, 46, 50, 55, 55, 126, 49, + 61, 48, 55, 5, 53, 63, 50, 56, 38, 27, + 203, 198, 205, 224, 221, 233, 205, 219, 205, 214, + 210, 200, 210, 194, 231, 202, 212, 213, 221, 218, + 202, 214, 211, 211, 225, 199, 209, 197, 211, 244, + 198, 208, 235, 255, 225, 230, 224, 219, 245, 253, + 231, 205, 225, 236, 227, 189, 164, 165, 204, 254, + 246, 253, 241, 237, 166, 189, 178, 213, 241, 231, + 249, 229, 253, 225, 143, 209, 200, 170, 129, 129, + 130, 136, 129, 151, 137, 142, 136, 148, 222, 197, + 147, 149, 145, 141, 151, 158, 144, 148, 136, 146, + 132, 152, 153, 153, 218, 219, 228, 136, 167, 167, + 160, 170, 175, 185, 171, 172, 174, 178, 252, 231, + 173, 171, 179, 175, 177, 184, 178, 182, 166, 184, + 182, 243, 163, 164, 181, 180, 177, 166, 89, 77, + 93, 69, 66, 86, 90, 72, 76, 71, 79, 83, + 104, 70, 73, 64, 121, 90, 86, 30, 74, 31, + 90, 84, 92, 87, 16, 85, 83, 81, 85, 64, + 102, 127, 40, 106, 97, 97, 98, 104, 97, 119, + 105, 110, 104, 39, 109, 107, 124, 116, 56, 127, + 113, 109, 60, 107, 119, 125, 116, 126, 100, 55, + 41, 53, 74, 10, 6, 13, 78, 8, 30, 2, + 23, 19, 64, 92, 70, 36, 22, 0, 27, 15, + 29, 89, 29, 10, 15, 9, 29, 30, 80, 18, + 25, 25, 26, 16, 41, 63, 33, 38, 32, 60, + 108, 36, 49, 99, 36, 36, 40, 46, 33, 33, + 122, 61, 55, 43, 126, 41, 57, 51, 54, 60, + 34, 113, 107, 119, 55, 58, 196, 197, 205, 202, + 218, 198, 195, 195, 235, 205, 198, 206, 231, 195, + 192, 133, 206, 222, 219, 209, 208, 214, 223, 220, + 222, 147, 243, 222, 216, 217, 209, 214, 254, 226, + 231, 231, 199, 225, 234, 226, 162, 234, 243, 161, + 226, 226, 234, 236, 255, 255, 246, 252, 233, 209, + 253, 240, 247, 208, 255, 227, 243, 173, 180, 252, + 132, 130, 156, 128, 143, 131, 133, 151, 131, 151, + 137, 142, 136, 201, 202, 203, 182, 148, 159, 158, + 155, 141, 198, 221, 155, 157, 153, 133, 159, 150, + 152, 156, 176, 174, 172, 233, 189, 186, 175, 174, + 167, 176, 179, 167, 179, 171, 168, 188, 153, 180, + 170, 188, 228, 255, 181, 179, 187, 167, 185, 176, + 186, 190, 174, 176, 78, 11, 91, 92, 77, 76, + 73, 94, 81, 69, 85, 77, 74, 94, 69, 70, + 89, 84, 77, 87, 74, 118, 82, 91, 93, 112, + 101, 98, 98, 120, 121, 106, 89, 82, 69, 75, + 65, 67, 83, 78, 77, 77, 78, 68, 69, 83, + 77, 74, 84, 83, 81, 74, 74, 80, 78, 84, + 81, 82, 92, 78, 69, 78, 89, 87, 37, 39, + 55, 42, 33, 33, 34, 40, 33, 55, 41, 46, + 40, 56, 45, 33, 35, 20, 13, 89, 22, 30, + 10, 24, 82, 30, 31, 3, 19, 87, 0, 29, + 43, 37, 104, 38, 32, 42, 108, 44, 33, 55, + 41, 55, 35, 103, 39, 42, 52, 53, 61, 58, + 42, 54, 51, 51, 126, 115, 41, 62, 35, 119, + 39, 61, 197, 222, 196, 205, 142, 220, 220, 200, + 193, 202, 198, 216, 134, 196, 203, 203, 212, 222, + 219, 205, 215, 208, 210, 244, 214, 147, 192, 208, + 196, 214, 217, 208, 254, 238, 250, 169, 250, 224, + 172, 234, 231, 247, 160, 242, 255, 234, 230, 234, + 246, 232, 225, 244, 252, 240, 240, 212, 252, 245, + 255, 227, 243, 230, 225, 240, 153, 159, 184, 136, + 156, 142, 129, 136, 150, 134, 146, 146, 191, 136, + 145, 197, 151, 142, 139, 141, 222, 140, 140, 152, + 145, 154, 150, 136, 214, 165, 155, 154, 190, 235, + 167, 187, 238, 186, 162, 169, 167, 177, 172, 168, + 163, 181, 157, 170, 175, 251, 176, 184, 168, 186, + 252, 176, 189, 161, 181, 241, 162, 191, 181, 187, + 10, 68, 70, 76, 14, 78, 79, 89, 75, 85, + 69, 1, 69, 72, 74, 75, 95, 88, 76, 80, + 81, 81, 16, 29, 75, 92, 69, 17, 69, 95, + 91, 64, 102, 111, 40, 122, 126, 106, 111, 100, + 100, 122, 32, 98, 105, 105, 106, 96, 121, 111, + 113, 118, 112, 86, 120, 61, 98, 114, 98, 112, + 123, 114, 96, 112, 24, 75, 28, 6, 78, 8, + 9, 25, 66, 5, 21, 21, 19, 21, 1, 69, + 25, 20, 22, 13, 12, 30, 31, 9, 1, 38, + 30, 21, 19, 5, 24, 28, 47, 57, 1, 45, + 29, 42, 62, 36, 39, 10, 36, 14, 52, 35, + 33, 55, 122, 46, 40, 61, 63, 43, 57, 18, + 32, 55, 53, 35, 118, 37, 49, 56, 197, 221, + 205, 198, 220, 203, 201, 223, 246, 218, 208, 196, + 239, 195, 253, 202, 207, 155, 208, 216, 200, 218, + 156, 208, 221, 193, 213, 145, 194, 223, 213, 219, + 170, 228, 230, 236, 174, 238, 239, 249, 235, 245, + 229, 161, 229, 232, 234, 235, 255, 248, 236, 240, + 241, 241, 176, 189, 235, 252, 229, 177, 229, 255, + 251, 224, 134, 143, 200, 154, 158, 138, 143, 132, + 132, 154, 192, 130, 137, 137, 138, 128, 153, 143, + 145, 150, 144, 182, 152, 221, 130, 146, 130, 144, + 155, 146, 128, 144, 184, 235, 188, 166, 238, 168, + 169, 185, 226, 140, 178, 165, 163, 181, 144, 188, + 170, 190, 150, 182, 254, 178, 189, 169, 177, 187, + 185, 191, 177, 247, 183, 186, 68, 69, 77, 74, + 90, 70, 67, 67, 118, 81, 65, 69, 67, 9, + 4, 106, 72, 95, 93, 75, 30, 86, 82, 91, + 93, 9, 16, 82, 87, 89, 19, 65, 42, 109, + 97, 103, 106, 47, 99, 127, 102, 102, 114, 78, + 116, 99, 97, 119, 58, 115, 113, 106, 106, 112, + 110, 100, 65, 103, 127, 97, 69, 99, 123, 101, + 38, 2, 5, 0, 26, 59, 30, 67, 17, 23, + 15, 17, 43, 6, 22, 14, 31, 15, 10, 28, + 15, 10, 25, 14, 6, 1, 21, 0, 3, 18, + 7, 1, 57, 10, 36, 37, 33, 56, 108, 42, + 48, 44, 53, 49, 102, 40, 54, 33, 63, 41, + 43, 54, 44, 59, 57, 47, 33, 42, 61, 51, + 57, 59, 39, 25, 195, 216, 220, 231, 207, 194, + 201, 222, 219, 206, 194, 206, 202, 212, 202, 192, + 205, 232, 193, 212, 220, 208, 208, 206, 254, 218, + 195, 197, 248, 214, 217, 208, 200, 249, 233, 231, + 234, 230, 226, 234, 199, 238, 245, 237, 231, 243, + 235, 247, 215, 250, 234, 242, 251, 235, 188, 207, + 247, 227, 252, 240, 239, 195, 230, 244, 142, 130, + 134, 142, 206, 188, 133, 128, 151, 143, 129, 149, + 137, 149, 182, 128, 139, 142, 157, 138, 138, 223, + 142, 152, 152, 150, 147, 133, 147, 147, 212, 145, + 191, 174, 232, 189, 161, 239, 184, 191, 163, 167, + 169, 175, 161, 231, 180, 183, 181, 175, 189, 186, + 170, 182, 179, 179, 242, 160, 169, 162, 162, 178, + 185, 251, 10, 104, 64, 76, 77, 68, 12, 84, + 77, 86, 82, 1, 85, 66, 80, 81, 83, 85, + 95, 74, 30, 23, 123, 88, 92, 86, 66, 80, + 90, 23, 71, 80, 126, 127, 97, 103, 105, 124, + 44, 32, 60, 35, 84, 115, 103, 99, 109, 107, + 125, 59, 104, 107, 113, 107, 121, 126, 102, 122, + 127, 127, 63, 84, 46, 73, 45, 2, 28, 5, + 15, 13, 65, 63, 23, 13, 14, 4, 20, 59, + 6, 16, 19, 23, 28, 10, 34, 77, 31, 37, + 71, 49, 62, 61, 38, 43, 68, 41, 41, 39, + 33, 44, 32, 59, 16, 57, 39, 49, 45, 40, + 40, 38, 40, 25, 62, 62, 46, 60, 50, 48, + 44, 48, 55, 61, 36, 13, 20, 34, 39, 60, + 196, 206, 219, 218, 226, 206, 213, 200, 208, 255, + 244, 211, 199, 195, 205, 203, 221, 235, 212, 216, + 202, 217, 211, 207, 223, 157, 242, 196, 197, 222, + 218, 208, 249, 248, 196, 232, 247, 234, 254, 209, + 193, 236, 242, 228, 168, 228, 247, 202, 232, 255, + 253, 235, 190, 237, 249, 236, 231, 246, 227, 229, + 182, 229, 241, 255, 143, 136, 156, 140, 138, 207, + 136, 152, 135, 195, 148, 142, 198, 192, 167, 138, + 148, 157, 145, 139, 147, 223, 136, 143, 147, 151, + 153, 159, 145, 215, 155, 155, 234, 185, 173, 168, + 162, 239, 175, 162, 172, 173, 165, 162, 178, 174, + 171, 171, 250, 172, 177, 173, 182, 255, 174, 168, + 188, 189, 185, 191, 177, 247, 167, 188, 71, 94, + 68, 72, 90, 64, 94, 10, 2, 80, 69, 85, + 82, 78, 74, 66, 20, 27, 123, 81, 91, 92, + 87, 29, 75, 92, 69, 67, 22, 68, 81, 65, + 126, 98, 102, 110, 125, 47, 36, 74, 103, 109, + 101, 115, 103, 107, 36, 118, 127, 111, 108, 112, + 112, 120, 111, 61, 63, 45, 48, 82, 121, 121, + 114, 124, 24, 6, 9, 29, 7, 0, 2, 30, + 66, 69, 64, 54, 7, 21, 10, 12, 20, 28, + 11, 80, 23, 12, 61, 30, 6, 26, 6, 20, + 18, 22, 0, 16, 37, 59, 45, 39, 1, 41, + 42, 62, 39, 55, 35, 45, 41, 52, 33, 10, + 60, 61, 43, 60, 42, 59, 61, 36, 33, 60, + 32, 52, 56, 3, 61, 56, 207, 200, 196, 198, + 221, 202, 248, 196, 207, 198, 201, 197, 197, 200, + 202, 203, 223, 216, 204, 208, 209, 209, 245, 217, + 215, 203, 211, 217, 215, 217, 211, 208, 195, 239, + 251, 240, 227, 237, 227, 225, 203, 231, 227, 238, + 232, 243, 229, 236, 244, 254, 234, 208, 250, 235, + 245, 240, 247, 201, 255, 255, 243, 227, 253, 248, + 143, 177, 135, 135, 139, 166, 130, 139, 141, 144, + 133, 146, 149, 142, 139, 139, 137, 147, 151, 149, + 151, 155, 157, 132, 129, 128, 149, 130, 133, 158, + 155, 155, 137, 164, 166, 189, 175, 166, 162, 168, + 176, 176, 161, 178, 181, 174, 163, 171, 183, 190, + 182, 173, 173, 156, 189, 179, 178, 167, 240, 183, + 191, 185, 176, 245, 75, 76, 79, 91, 75, 72, + 77, 89, 75, 76, 78, 1, 81, 78, 80, 77, + 26, 72, 72, 92, 93, 86, 90, 84, 87, 87, + 16, 95, 87, 90, 81, 21, 89, 127, 105, 123, + 122, 47, 124, 127, 109, 96, 101, 114, 117, 110, + 106, 98, 52, 53, 54, 57, 69, 76, 104, 120, + 98, 51, 62, 63, 56, 55, 79, 72, 80, 75, + 59, 29, 11, 31, 76, 67, 66, 34, 7, 6, + 20, 2, 3, 4, 14, 18, 23, 23, 94, 23, + 21, 14, 6, 28, 2, 8, 88, 89, 90, 85, + 57, 36, 61, 59, 45, 42, 108, 37, 43, 48, + 52, 46, 52, 62, 100, 38, 53, 46, 54, 45, + 126, 113, 124, 28, 53, 52, 34, 52, 49, 54, + 32, 60, 197, 197, 136, 193, 199, 220, 216, 194, + 208, 218, 128, 199, 207, 201, 205, 214, 210, 222, + 220, 151, 158, 228, 245, 201, 215, 222, 195, 145, + 213, 216, 193, 219, 254, 177, 168, 169, 254, 253, + 227, 238, 231, 240, 243, 228, 226, 169, 208, 236, + 249, 240, 200, 235, 241, 252, 249, 238, 225, 250, + 254, 246, 182, 241, 253, 251, 131, 152, 128, 140, + 138, 193, 204, 182, 182, 140, 148, 128, 138, 199, + 148, 151, 149, 152, 157, 138, 141, 150, 146, 154, + 210, 135, 153, 156, 147, 205, 212, 213, 185, 229, + 232, 157, 161, 187, 173, 161, 226, 179, 178, 174, + 165, 162, 183, 182, 191, 191, 248, 176, 170, 186, + 177, 174, 232, 243, 254, 241, 132, 178, 167, 160, + 70, 95, 8, 72, 73, 72, 94, 72, 69, 66, + 84, 68, 66, 7, 77, 81, 95, 86, 75, 3, + 30, 124, 93, 83, 21, 71, 16, 87, 95, 89, + 80, 21, 99, 101, 108, 96, 109, 110, 120, 98, + 112, 35, 119, 104, 114, 111, 36, 98, 115, 109, + 125, 119, 62, 113, 125, 112, 119, 80, 113, 127, + 118, 99, 52, 115, 3, 5, 12, 73, 15, 8, + 11, 31, 7, 4, 1, 21, 9, 21, 68, 3, + 21, 9, 88, 10, 27, 19, 25, 30, 6, 22, + 20, 81, 6, 22, 6, 20, 39, 46, 60, 44, + 60, 60, 39, 40, 59, 21, 33, 45, 51, 34, + 100, 40, 47, 40, 44, 121, 60, 58, 124, 58, + 32, 54, 49, 37, 51, 37, 116, 33, 194, 202, + 198, 137, 158, 223, 201, 223, 203, 204, 196, 236, + 211, 203, 208, 204, 202, 215, 209, 220, 204, 234, + 210, 214, 220, 220, 199, 223, 150, 213, 213, 198, + 239, 171, 248, 236, 252, 230, 227, 233, 193, 185, + 220, 198, 239, 243, 232, 228, 248, 182, 202, 236, + 240, 241, 249, 239, 206, 241, 229, 248, 250, 243, + 231, 201, 216, 136, 176, 220, 172, 161, 160, 189, + 190, 211, 188, 130, 138, 142, 129, 139, 142, 167, + 140, 156, 140, 146, 149, 147, 147, 159, 172, 149, + 147, 129, 145, 153, 165, 187, 165, 172, 160, 187, + 144, 143, 183, 176, 169, 175, 163, 180, 183, 137, + 187, 162, 189, 171, 130, 139, 174, 188, 182, 186, + 190, 182, 134, 187, 181, 161, 76, 68, 90, 68, + 0, 109, 89, 94, 75, 77, 69, 82, 85, 107, + 69, 92, 95, 73, 100, 113, 87, 76, 72, 82, + 64, 74, 108, 97, 83, 69, 93, 90, 110, 37, + 107, 122, 99, 71, 72, 90, 91, 65, 97, 114, + 99, 87, 97, 119, 115, 116, 124, 73, 123, 109, + 117, 114, 118, 94, 101, 125, 98, 126, 100, 121, + 19, 14, 26, 32, 0, 31, 25, 25, 66, 19, + 1, 19, 7, 10, 1, 17, 31, 9, 11, 58, + 68, 35, 59, 20, 6, 31, 17, 19, 91, 37, + 1, 27, 36, 46, 58, 21, 44, 58, 37, 33, + 38, 48, 28, 115, 37, 31, 113, 7, 20, 23, + 8, 5, 110, 3, 63, 49, 59, 54, 62, 37, + 10, 35, 49, 39, 199, 194, 198, 200, 194, 243, + 200, 200, 212, 198, 204, 206, 214, 202, 193, 203, + 206, 231, 250, 204, 205, 214, 210, 216, 193, 192, + 252, 208, 207, 210, 198, 233, 222, 249, 233, 237, + 231, 225, 235, 221, 238, 226, 244, 231, 233, 245, + 233, 171, 216, 238, 235, 240, 240, 250, 239, 238, + 222, 242, 233, 244, 228, 203, 217, 250, 142, 158, + 132, 140, 157, 179, 169, 149, 135, 128, 149, 149, + 143, 136, 138, 160, 148, 143, 145, 141, 135, 209, + 159, 142, 187, 157, 128, 132, 130, 167, 149, 135, + 171, 166, 173, 189, 171, 189, 191, 237, 239, 227, + 176, 160, 180, 166, 169, 160, 174, 190, 170, 249, + 252, 253, 252, 188, 190, 161, 181, 176, 178, 174, + 244, 176, 82, 66, 91, 93, 93, 124, 79, 95, + 75, 83, 84, 106, 67, 94, 109, 75, 89, 84, + 74, 75, 91, 92, 72, 29, 94, 86, 94, 86, + 66, 95, 20, 90, 108, 43, 94, 104, 124, 102, + 109, 99, 118, 112, 46, 33, 79, 115, 36, 104, + 111, 104, 108, 57, 124, 122, 60, 120, 100, 118, + 126, 49, 62, 124, 113, 108, 74, 70, 72, 31, + 15, 3, 25, 8, 66, 19, 1, 8, 20, 20, + 77, 40, 31, 22, 26, 28, 12, 95, 8, 4, + 2, 22, 80, 28, 3, 4, 0, 85, 40, 46, + 104, 0, 13, 32, 33, 61, 35, 49, 33, 35, + 42, 34, 11, 39, 48, 62, 59, 45, 45, 127, + 40, 36, 34, 54, 112, 62, 48, 119, 2, 52, + 216, 194, 201, 199, 218, 220, 130, 141, 235, 215, + 128, 204, 211, 212, 208, 133, 216, 222, 152, 240, + 253, 208, 209, 205, 211, 193, 209, 211, 218, 210, + 226, 212, 248, 226, 233, 231, 250, 252, 172, 228, + 246, 230, 237, 161, 226, 232, 225, 246, 186, 245, + 247, 237, 190, 235, 244, 248, 178, 224, 241, 252, + 243, 183, 224, 236, 154, 142, 200, 157, 134, 142, + 152, 205, 131, 151, 148, 147, 143, 133, 145, 145, + 159, 159, 216, 154, 146, 158, 143, 142, 210, 158, + 149, 156, 148, 146, 134, 219, 234, 130, 188, 233, + 163, 186, 191, 185, 226, 161, 165, 225, 136, 168, + 176, 229, 169, 174, 168, 169, 177, 173, 168, 184, + 182, 243, 185, 191, 166, 162, 160, 245, 90, 74, + 90, 72, 67, 74, 88, 72, 80, 3, 84, 88, + 86, 66, 4, 13, 83, 85, 92, 80, 93, 94, + 72, 82, 64, 122, 94, 85, 95, 84, 85, 65, + 101, 121, 40, 96, 125, 47, 109, 97, 112, 102, + 97, 101, 127, 39, 101, 97, 126, 126, 124, 85, + 119, 113, 121, 91, 125, 97, 125, 112, 98, 99, + 113, 113, 60, 10, 4, 28, 11, 32, 30, 9, + 7, 17, 19, 41, 15, 20, 16, 10, 8, 2, + 42, 28, 15, 10, 25, 14, 6, 35, 17, 3, + 23, 26, 17, 1, 47, 57, 59, 47, 60, 32, + 33, 57, 45, 23, 50, 32, 34, 34, 55, 13, + 51, 40, 44, 54, 44, 38, 14, 56, 35, 38, + 53, 34, 34, 7, 53, 39, 203, 198, 205, 221, + 203, 221, 223, 203, 205, 209, 195, 196, 244, 194, + 200, 202, 219, 223, 247, 248, 203, 203, 212, 239, + 215, 192, 197, 221, 194, 242, 218, 214, 248, 242, + 248, 253, 235, 235, 222, 232, 228, 241, 229, 242, + 238, 211, 235, 238, 255, 245, 205, 234, 251, 204, + 253, 235, 247, 247, 196, 254, 253, 242, 250, 230, + 166, 130, 134, 130, 186, 138, 148, 153, 178, 130, + 147, 146, 145, 136, 150, 129, 178, 148, 148, 157, + 155, 141, 172, 156, 129, 128, 135, 158, 132, 147, + 167, 148, 188, 174, 152, 168, 189, 188, 187, 162, + 176, 167, 180, 179, 167, 163, 165, 167, 182, 190, + 139, 160, 179, 189, 179, 177, 163, 166, 191, 165, + 179, 164, 135, 172, 71, 73, 71, 69, 90, 70, + 79, 70, 106, 74, 83, 85, 73, 85, 93, 118, + 67, 86, 90, 86, 82, 82, 85, 83, 71, 71, + 85, 121, 95, 68, 64, 90, 120, 114, 91, 112, + 99, 109, 99, 97, 102, 98, 121, 73, 111, 116, + 112, 106, 104, 98, 75, 96, 115, 125, 115, 113, + 100, 124, 124, 100, 123, 114, 85, 123, 11, 7, + 17, 26, 7, 28, 63, 20, 15, 1, 15, 13, + 21, 30, 9, 7, 21, 23, 53, 24, 14, 12, + 5, 16, 16, 28, 28, 60, 23, 7, 61, 17, + 30, 57, 41, 45, 47, 45, 32, 40, 17, 58, + 45, 35, 41, 43, 23, 60, 55, 57, 55, 53, + 126, 50, 61, 45, 114, 53, 63, 35, 118, 119, + 53, 57, 216, 206, 201, 205, 215, 143, 201, 213, + 203, 208, 212, 210, 242, 213, 197, 193, 219, 217, + 212, 220, 158, 222, 210, 217, 146, 194, 197, 222, + 194, 210, 199, 149, 249, 242, 229, 235, 225, 227, + 172, 236, 240, 230, 160, 245, 238, 226, 164, 246, + 251, 246, 253, 183, 190, 210, 253, 237, 226, 250, + 254, 246, 182, 254, 231, 181, 140, 132, 154, 139, + 135, 139, 136, 136, 140, 195, 148, 142, 198, 142, + 144, 150, 159, 151, 158, 173, 140, 158, 152, 156, + 144, 159, 149, 209, 151, 153, 144, 213, 190, 162, + 171, 162, 189, 239, 164, 164, 177, 183, 175, 179, + 191, 231, 183, 188, 183, 185, 183, 181, 254, 190, + 174, 184, 242, 167, 184, 180, 246, 164, 181, 184, + 79, 5, 8, 100, 79, 95, 92, 68, 76, 68, + 0, 72, 85, 7, 66, 74, 72, 89, 81, 93, + 90, 90, 82, 29, 70, 92, 16, 88, 66, 68, + 81, 89, 108, 95, 122, 104, 106, 110, 110, 97, + 103, 35, 97, 111, 98, 39, 105, 108, 116, 110, + 108, 124, 109, 63, 116, 116, 97, 103, 127, 99, + 111, 55, 103, 108, 7, 9, 7, 5, 78, 14, + 30, 8, 66, 23, 8, 4, 70, 20, 5, 8, + 31, 85, 88, 52, 31, 15, 12, 20, 28, 20, + 80, 24, 5, 87, 18, 26, 56, 41, 33, 45, + 42, 42, 34, 109, 54, 44, 96, 40, 50, 52, + 33, 41, 60, 15, 42, 56, 58, 62, 62, 49, + 55, 115, 49, 63, 50, 119, 48, 52, 211, 216, + 136, 193, 199, 220, 216, 194, 208, 218, 128, 210, + 223, 202, 198, 202, 214, 155, 217, 203, 219, 159, + 200, 213, 215, 147, 195, 208, 219, 210, 154, 149, + 199, 234, 248, 249, 231, 225, 235, 173, 235, 240, + 160, 231, 233, 245, 230, 236, 254, 255, 253, 247, + 190, 235, 243, 189, 251, 231, 227, 244, 250, 241, + 192, 231, 139, 143, 137, 139, 130, 138, 204, 140, + 140, 135, 192, 151, 137, 139, 145, 136, 159, 219, + 153, 151, 159, 147, 133, 142, 155, 128, 208, 130, + 143, 154, 150, 154, 166, 235, 169, 187, 171, 239, + 184, 165, 167, 227, 179, 160, 171, 162, 234, 229, + 151, 186, 168, 169, 183, 177, 187, 253, 187, 160, + 240, 183, 185, 165, 182, 188, 78, 79, 77, 71, + 14, 91, 67, 13, 75, 87, 83, 68, 74, 65, + 4, 8, 4, 27, 97, 86, 75, 31, 84, 92, + 68, 86, 16, 95, 89, 67, 20, 69, 101, 120, + 123, 96, 108, 102, 96, 100, 118, 122, 32, 117, + 105, 39, 103, 119, 127, 122, 108, 124, 62, 108, + 101, 112, 112, 124, 124, 98, 54, 122, 117, 101, + 26, 2, 6, 14, 78, 13, 9, 14, 3, 22, + 19, 4, 70, 14, 16, 69, 29, 20, 12, 89, + 10, 16, 92, 30, 27, 1, 19, 29, 19, 87, + 7, 12, 39, 41, 39, 37, 61, 111, 33, 44, + 50, 51, 41, 47, 33, 103, 108, 22, 35, 54, + 58, 54, 50, 30, 63, 62, 61, 38, 62, 37, + 6, 54, 61, 39, 249, 210, 197, 203, 193, 195, + 140, 144, 130, 143, 128, 224, 197, 196, 203, 208, + 212, 207, 152, 132, 158, 238, 201, 220, 220, 199, + 223, 198, 211, 197, 118, 28, 170, 218, 253, 232, + 224, 251, 227, 250, 231, 241, 160, 205, 202, 196, + 168, 165, 168, 171, 169, 161, 176, 191, 221, 241, + 254, 179, 226, 248, 241, 255, 224, 230, 202, 153, + 141, 154, 139, 157, 154, 136, 134, 139, 148, 149, + 150, 148, 222, 202, 213, 138, 141, 152, 144, 139, + 147, 138, 151, 129, 222, 146, 153, 154, 219, 133, + 184, 162, 190, 168, 173, 182, 164, 185, 182, 179, + 179, 251, 233, 232, 179, 178, 173, 245, 169, 172, + 191, 177, 168, 178, 165, 182, 162, 255, 181, 184, + 185, 250, 94, 78, 90, 68, 93, 2, 67, 75, + 15, 86, 83, 68, 78, 83, 80, 85, 73, 1, + 23, 22, 79, 74, 93, 83, 70, 92, 71, 84, + 68, 25, 87, 90, 103, 36, 96, 125, 122, 127, + 127, 55, 45, 44, 118, 51, 40, 125, 107, 117, + 115, 118, 54, 122, 113, 114, 51, 106, 123, 119, + 119, 116, 98, 56, 120, 124, 28, 14, 11, 1, + 15, 27, 66, 5, 22, 14, 12, 94, 7, 23, + 13, 58, 25, 26, 20, 21, 13, 66, 89, 72, + 48, 86, 69, 53, 80, 31, 27, 6, 62, 37, + 41, 36, 43, 114, 61, 56, 35, 45, 52, 46, + 49, 34, 54, 107, 57, 52, 53, 127, 53, 58, + 37, 96, 103, 4, 30, 53, 27, 39, 99, 103, + 157, 232, 223, 232, 204, 247, 234, 226, 237, 249, + 212, 219, 234, 200, 239, 213, 226, 207, 129, 242, + 230, 201, 244, 251, 148, 223, 209, 223, 209, 138, + 209, 219, 172, 227, 252, 253, 254, 252, 182, 162, + 173, 246, 240, 229, 231, 243, 225, 246, 180, 234, + 237, 248, 240, 235, 243, 234, 247, 225, 190, 242, + 249, 250, 187, 196, 159, 138, 134, 157, 129, 152, + 137, 159, 138, 151, 148, 145, 149, 221, 203, 202, + 139, 142, 153, 151, 138, 144, 139, 152, 128, 221, + 147, 158, 155, 216, 132, 135, 163, 168, 161, 167, + 169, 167, 184, 185, 178, 176, 250, 238, 233, 166, + 167, 166, 181, 174, 182, 173, 173, 241, 173, 168, + 179, 189, 164, 190, 161, 178, 166, 251, 73, 68, + 69, 126, 75, 15, 68, 76, 84, 70, 0, 82, + 67, 83, 4, 80, 74, 27, 76, 81, 91, 31, + 88, 88, 84, 82, 69, 93, 66, 23, 64, 71, + 107, 111, 97, 103, 105, 47, 105, 99, 116, 106, + 114, 110, 104, 106, 97, 107, 110, 59, 126, 118, + 108, 63, 101, 114, 103, 51, 103, 120, 98, 127, + 52, 87, 3, 5, 9, 7, 13, 10, 76, 36, + 12, 5, 15, 65, 11, 8, 0, 0, 84, 71, + 26, 11, 64, 67, 30, 15, 76, 42, 31, 4, + 86, 26, 21, 12, 106, 40, 39, 39, 32, 42, + 47, 57, 98, 55, 47, 97, 52, 34, 37, 41, + 122, 57, 42, 54, 53, 58, 46, 125, 37, 59, + 53, 63, 118, 46, 59, 32, 138, 202, 218, 204, + 142, 221, 201, 204, 198, 218, 128, 213, 201, 135, + 215, 209, 219, 201, 204, 153, 202, 205, 221, 217, + 219, 221, 215, 159, 245, 216, 193, 217, 238, 171, + 230, 230, 250, 175, 224, 226, 227, 231, 160, 243, + 227, 246, 241, 236, 232, 254, 252, 185, 255, 236, + 239, 248, 255, 241, 252, 232, 182, 246, 225, 225, + 133, 134, 137, 157, 135, 140, 141, 129, 142, 154, + 192, 175, 135, 138, 129, 223, 218, 219, 170, 156, + 143, 138, 153, 142, 134, 154, 158, 150, 183, 132, + 135, 144, 167, 169, 164, 176, 244, 239, 142, 164, + 172, 167, 169, 175, 161, 231, 182, 160, 190, 178, + 170, 188, 189, 171, 252, 170, 179, 160, 240, 176, + 166, 167, 184, 188, 79, 79, 8, 93, 65, 15, + 98, 76, 79, 70, 26, 1, 6, 117, 65, 65, + 83, 73, 93, 90, 74, 111, 93, 73, 90, 9, + 16, 127, 87, 90, 81, 21, 105, 106, 102, 41, + 96, 96, 120, 45, 96, 102, 32, 100, 107, 119, + 112, 124, 78, 115, 125, 57, 119, 107, 121, 112, + 50, 100, 121, 101, 126, 55, 103, 116, 7, 14, + 72, 7, 15, 2, 9, 77, 3, 15, 18, 4, + 7, 3, 29, 69, 31, 3, 17, 10, 10, 12, + 41, 86, 60, 18, 29, 20, 86, 20, 27, 0, + 38, 47, 104, 42, 33, 33, 56, 44, 43, 45, + 51, 123, 102, 10, 37, 44, 54, 29, 42, 54, + 51, 30, 56, 57, 32, 54, 35, 34, 118, 62, + 39, 117, 196, 222, 196, 197, 142, 192, 222, 141, + 199, 206, 208, 213, 223, 211, 193, 221, 206, 148, + 200, 213, 223, 214, 210, 129, 240, 225, 142, 187, + 138, 245, 230, 139, 170, 206, 229, 235, 235, 235, + 232, 232, 230, 163, 233, 236, 231, 224, 225, 165, + 166, 242, 245, 254, 190, 236, 238, 254, 175, 240, + 249, 245, 172, 244, 251, 248, 154, 138, 134, 144, + 130, 128, 139, 130, 220, 223, 162, 179, 216, 147, + 129, 157, 142, 212, 144, 141, 147, 147, 159, 146, + 159, 131, 145, 159, 143, 155, 155, 146, 165, 152, + 173, 189, 186, 166, 162, 170, 177, 142, 161, 175, + 167, 160, 161, 183, 244, 150, 185, 176, 178, 140, + 185, 175, 164, 182, 162, 255, 155, 182, 189, 185, + 127, 88, 77, 122, 125, 99, 111, 66, 76, 77, + 69, 66, 82, 78, 75, 75, 111, 72, 93, 25, + 109, 108, 112, 29, 81, 92, 94, 95, 83, 84, + 64, 92, 101, 101, 91, 108, 122, 123, 101, 99, + 101, 112, 77, 96, 104, 102, 99, 96, 104, 53, + 85, 120, 119, 115, 79, 120, 96, 101, 117, 99, + 56, 90, 117, 124, 6, 39, 7, 14, 7, 1, + 45, 24, 22, 11, 5, 15, 18, 14, 7, 4, + 14, 18, 23, 23, 94, 19, 19, 26, 27, 29, + 35, 20, 2, 3, 29, 27, 45, 56, 5, 40, + 32, 46, 43, 40, 48, 109, 13, 32, 47, 43, + 23, 32, 40, 45, 61, 43, 112, 18, 61, 52, + 62, 3, 49, 34, 37, 32, 59, 39, 206, 234, + 221, 221, 198, 202, 194, 217, 203, 192, 193, 213, + 207, 200, 202, 133, 202, 218, 203, 202, 201, 208, + 206, 217, 225, 214, 196, 197, 223, 217, 211, 198, + 199, 234, 230, 232, 233, 234, 254, 163, 207, 226, + 233, 237, 213, 226, 246, 243, 255, 233, 182, 212, + 255, 246, 240, 206, 223, 199, 192, 194, 243, 229, + 226, 240, 152, 191, 129, 132, 139, 128, 153, 153, + 177, 174, 180, 177, 198, 148, 129, 151, 140, 158, + 138, 217, 138, 150, 145, 152, 157, 134, 132, 221, + 214, 154, 135, 166, 175, 191, 188, 160, 160, 168, + 191, 128, 163, 173, 161, 166, 163, 181, 234, 136, + 187, 178, 180, 138, 187, 173, 170, 184, 160, 253, + 157, 176, 191, 187, 135, 152, 126, 123, 123, 76, + 92, 89, 73, 95, 113, 110, 116, 113, 6, 84, + 65, 87, 76, 94, 74, 106, 91, 75, 72, 84, + 92, 84, 67, 124, 87, 89, 85, 82, 111, 121, + 38, 68, 111, 102, 96, 94, 103, 113, 118, 100, + 116, 41, 73, 100, 115, 119, 75, 84, 74, 79, + 76, 114, 96, 103, 67, 92, 66, 71, 52, 101, + 5, 25, 28, 57, 15, 6, 30, 46, 13, 15, + 15, 19, 37, 8, 8, 10, 8, 74, 59, 22, + 18, 16, 14, 79, 33, 10, 29, 19, 25, 27, + 7, 85, 38, 34, 59, 61, 110, 33, 45, 32, + 39, 99, 35, 32, 40, 103, 42, 42, 46, 123, + 58, 60, 126, 58, 49, 45, 38, 42, 3, 48, + 59, 50, 116, 38, 211, 198, 202, 198, 194, 220, + 140, 193, 203, 208, 212, 129, 200, 198, 201, 192, + 154, 218, 212, 203, 219, 222, 216, 196, 146, 214, + 200, 216, 197, 195, 154, 149, 197, 249, 236, 236, + 252, 175, 197, 233, 184, 163, 160, 211, 227, 246, + 241, 224, 233, 239, 209, 253, 164, 191, 200, 239, + 243, 247, 249, 255, 241, 183, 251, 229, 143, 153, + 137, 157, 135, 128, 130, 205, 144, 134, 147, 148, + 138, 147, 192, 179, 149, 151, 141, 148, 155, 223, + 157, 147, 147, 159, 137, 130, 159, 132, 212, 150, + 171, 167, 171, 188, 162, 174, 184, 164, 173, 173, + 224, 167, 180, 168, 169, 229, 174, 178, 187, 178, + 173, 255, 180, 180, 161, 167, 191, 163, 175, 247, + 189, 166, 10, 69, 71, 93, 14, 78, 64, 65, + 77, 84, 69, 69, 6, 65, 75, 87, 26, 27, + 89, 91, 81, 77, 72, 88, 86, 29, 16, 98, + 79, 90, 86, 90, 102, 43, 53, 41, 97, 127, + 120, 100, 109, 109, 85, 111, 98, 98, 118, 105, + 115, 126, 106, 80, 106, 122, 113, 92, 113, 103, + 121, 126, 120, 86, 115, 114, 24, 14, 27, 26, + 1, 29, 42, 1, 3, 4, 35, 0, 10, 4, + 17, 9, 27, 15, 23, 11, 68, 95, 61, 17, + 23, 1, 4, 52, 24, 22, 22, 25, 47, 47, + 1, 58, 13, 32, 32, 34, 48, 42, 46, 38, + 7, 43, 33, 55, 46, 29, 49, 53, 42, 58, + 46, 28, 62, 54, 34, 37, 24, 50, 49, 49, + 233, 196, 198, 207, 199, 221, 193, 249, 208, 194, + 196, 200, 200, 192, 225, 221, 202, 210, 202, 220, + 251, 199, 204, 212, 192, 202, 228, 216, 219, 210, + 208, 209, 199, 198, 241, 240, 247, 246, 172, 197, + 202, 185, 237, 236, 188, 244, 247, 171, 252, 253, + 254, 255, 248, 249, 206, 248, 226, 246, 241, 229, + 215, 251, 241, 231, 158, 170, 139, 157, 135, 128, + 130, 158, 176, 134, 144, 132, 135, 147, 169, 132, + 130, 184, 151, 140, 144, 139, 174, 152, 130, 150, + 145, 133, 166, 146, 134, 156, 165, 175, 133, 160, + 160, 186, 184, 168, 177, 144, 165, 160, 180, 164, + 172, 132, 182, 190, 170, 173, 151, 155, 159, 178, + 188, 183, 185, 165, 191, 184, 186, 146, 88, 68, + 93, 89, 93, 110, 79, 89, 75, 76, 78, 82, + 101, 72, 74, 65, 83, 79, 81, 86, 80, 76, + 105, 83, 86, 86, 86, 88, 88, 82, 80, 102, + 115, 102, 106, 102, 98, 32, 78, 120, 113, 106, + 110, 100, 117, 116, 75, 103, 112, 126, 123, 109, + 87, 113, 122, 114, 83, 112, 115, 126, 99, 121, + 96, 58, 40, 30, 27, 0, 0, 10, 31, 30, + 45, 1, 10, 4, 5, 19, 45, 11, 28, 20, + 49, 10, 45, 26, 16, 24, 17, 7, 21, 21, + 53, 24, 25, 24, 35, 56, 59, 32, 33, 33, + 13, 63, 32, 42, 52, 51, 39, 32, 33, 22, + 35, 54, 58, 54, 50, 11, 53, 48, 55, 21, + 34, 48, 59, 50, 23, 58, 196, 205, 193, 206, + 199, 219, 201, 192, 246, 202, 195, 202, 134, 138, + 132, 241, 211, 216, 211, 153, 147, 159, 141, 201, + 219, 208, 219, 194, 226, 222, 215, 222, 170, 233, + 233, 251, 253, 204, 224, 248, 241, 247, 229, 243, + 197, 242, 247, 241, 245, 246, 219, 246, 242, 240, + 238, 209, 247, 229, 245, 253, 223, 228, 215, 253, + 143, 136, 131, 140, 138, 187, 137, 149, 150, 160, + 143, 141, 137, 149, 166, 132, 153, 144, 159, 139, + 145, 138, 146, 154, 177, 156, 156, 158, 132, 180, + 155, 153, 165, 185, 155, 189, 183, 163, 169, 154, + 171, 183, 168, 130, 169, 171, 171, 183, 137, 175, + 161, 181, 187, 136, 181, 185, 166, 187, 147, 190, + 186, 162, 185, 187, 105, 68, 70, 77, 71, 91, + 69, 66, 76, 106, 84, 68, 75, 100, 75, 75, + 94, 82, 76, 80, 81, 81, 104, 68, 66, 86, + 115, 94, 88, 83, 93, 65, 99, 100, 102, 95, + 111, 99, 121, 104, 65, 108, 108, 116, 107, 105, + 53, 74, 124, 125, 107, 124, 106, 92, 115, 113, + 103, 126, 126, 35, 89, 113, 114, 102, 15, 31, + 43, 6, 2, 26, 1, 3, 80, 49, 1, 15, + 1, 2, 55, 0, 22, 30, 27, 13, 17, 13, + 46, 28, 28, 20, 21, 37, 15, 7, 17, 48, + 36, 47, 7, 47, 40, 60, 41, 57, 4, 49, + 47, 44, 18, 40, 2, 44, 56, 52, 54, 56, + 61, 60, 53, 17, 55, 37, 53, 61, 26, 50, + 34, 48, 198, 254, 219, 204, 237, 218, 223, 217, + 205, 206, 233, 210, 227, 201, 197, 199, 214, 222, + 220, 250, 223, 207, 200, 212, 221, 221, 246, 222, + 216, 195, 247, 218, 230, 228, 250, 202, 239, 255, + 248, 228, 237, 237, 198, 238, 232, 243, 194, 228, + 247, 242, 244, 224, 208, 254, 241, 248, 209, 242, + 224, 229, 255, 248, 250, 211, 133, 133, 156, 186, + 135, 149, 137, 189, 141, 138, 142, 149, 170, 142, + 138, 128, 181, 139, 140, 144, 145, 145, 143, 170, + 155, 135, 152, 178, 158, 146, 151, 158, 136, 164, + 176, 158, 167, 187, 164, 131, 183, 174, 165, 179, + 175, 164, 147, 172, 174, 179, 155, 182, 178, 176, + 174, 155, 189, 189, 164, 156, 183, 175, 189, 184, + 95, 70, 127, 64, 74, 91, 68, 97, 75, 77, + 69, 114, 82, 94, 72, 64, 104, 72, 75, 112, + 74, 90, 81, 78, 96, 64, 67, 98, 83, 67, + 64, 92, 100, 108, 123, 75, 123, 124, 101, 99, + 103, 112, 115, 33, 72, 98, 115, 118, 58, 73, + 125, 108, 106, 122, 110, 110, 122, 103, 100, 97, + 44, 56, 59, 115, 15, 14, 12, 26, 64, 29, + 9, 24, 22, 6, 18, 18, 72, 4, 11, 8, + 85, 9, 29, 12, 10, 26, 14, 14, 93, 17, + 5, 2, 31, 25, 17, 6, 57, 37, 45, 62, + 61, 13, 14, 14, 98, 22, 11, 41, 50, 51, + 52, 127, 117, 116, 62, 60, 59, 59, 47, 115, + 48, 49, 51, 56, 120, 52, 59, 123, 223, 192, + 135, 199, 203, 216, 223, 130, 214, 198, 195, 201, + 200, 200, 200, 202, 221, 194, 151, 203, 205, 204, + 146, 197, 223, 223, 143, 212, 210, 222, 192, 220, + 229, 229, 181, 252, 229, 194, 237, 255, 233, 230, + 244, 241, 243, 235, 247, 224, 242, 239, 236, 233, + 164, 176, 179, 251, 247, 246, 244, 226, 184, 250, + 245, 231, 129, 142, 156, 158, 143, 155, 143, 133, + 204, 128, 143, 140, 201, 138, 133, 151, 145, 158, + 140, 142, 159, 139, 159, 149, 221, 158, 145, 131, + 157, 146, 128, 133, 191, 167, 187, 172, 225, 157, + 191, 190, 139, 183, 165, 172, 143, 180, 133, 166, + 174, 178, 174, 188, 139, 173, 176, 184, 188, 178, + 178, 189, 179, 179, 151, 239, 118, 108, 65, 93, + 66, 78, 78, 0, 112, 86, 78, 79, 67, 85, + 120, 71, 79, 82, 84, 93, 77, 99, 14, 94, + 106, 6, 114, 127, 122, 103, 104, 5, 86, 104, + 100, 96, 107, 97, 120, 81, 118, 102, 114, 108, + 111, 105, 101, 105, 70, 127, 125, 111, 123, 115, + 115, 109, 127, 118, 126, 101, 74, 85, 97, 102, + 3, 5, 13, 26, 29, 35, 13, 20, 7, 17, + 60, 53, 20, 6, 0, 12, 20, 28, 40, 21, + 31, 11, 26, 18, 0, 30, 94, 51, 3, 4, + 29, 27, 47, 56, 59, 5, 47, 54, 41, 63, + 30, 22, 52, 40, 42, 52, 24, 17, 40, 58, + 60, 48, 48, 56, 12, 47, 61, 39, 53, 50, + 34, 62, 59, 59, 246, 255, 218, 200, 202, 198, + 194, 202, 242, 209, 207, 213, 195, 196, 208, 202, + 200, 149, 219, 202, 206, 218, 206, 212, 221, 215, + 220, 216, 219, 222, 192, 250, 248, 239, 237, 251, + 253, 175, 224, 228, 239, 234, 244, 210, 227, 243, + 240, 236, 244, 252, 235, 212, 255, 241, 253, 250, + 247, 225, 190, 197, 228, 246, 240, 252, 132, 140, + 184, 155, 129, 155, 137, 142, 150, 138, 143, 143, + 200, 168, 150, 129, 159, 137, 139, 181, 151, 146, + 149, 137, 147, 135, 153, 158, 152, 217, 164, 144, + 184, 162, 167, 173, 157, 170, 184, 185, 171, 173, + 167, 178, 139, 166, 170, 164, 189, 190, 170, 247, + 138, 173, 189, 185, 187, 189, 183, 129, 164, 184, + 160, 176, 73, 95, 65, 70, 64, 1, 99, 95, + 70, 70, 82, 82, 106, 78, 73, 76, 78, 90, + 76, 80, 81, 81, 18, 113, 91, 94, 89, 69, + 117, 66, 70, 71, 111, 101, 124, 89, 111, 123, + 100, 94, 109, 118, 110, 101, 79, 115, 97, 104, + 105, 111, 119, 107, 127, 120, 121, 89, 115, 103, + 113, 66, 98, 120, 102, 116, 13, 14, 72, 0, + 29, 79, 8, 4, 17, 19, 15, 18, 3, 3, + 43, 49, 42, 51, 23, 21, 26, 26, 14, 50, + 38, 35, 38, 16, 26, 2, 17, 54, 37, 37, + 44, 32, 58, 38, 35, 35, 6, 34, 52, 32, + 9, 55, 33, 55, 59, 53, 60, 104, 17, 47, + 57, 47, 51, 61, 52, 99, 21, 56, 58, 49, + 195, 223, 193, 198, 192, 230, 216, 200, 207, 208, + 239, 209, 195, 213, 197, 203, 222, 248, 205, 202, + 202, 208, 209, 238, 198, 193, 217, 223, 209, 248, + 196, 208, 248, 234, 230, 237, 205, 250, 255, 249, + 237, 238, 211, 248, 235, 229, 235, 233, 213, 235, + 253, 235, 255, 241, 248, 222, 231, 224, 228, 254, + 251, 211, 245, 225, 143, 164, 152, 140, 156, 142, + 130, 137, 161, 150, 147, 149, 137, 138, 165, 134, + 153, 148, 141, 151, 138, 176, 140, 152, 128, 146, + 158, 149, 181, 130, 135, 129, 165, 166, 155, 172, + 162, 170, 175, 185, 173, 177, 143, 177, 163, 181, + 165, 171, 190, 148, 186, 179, 187, 188, 168, 141, + 160, 188, 160, 180, 164, 163, 173, 154, 90, 78, + 90, 72, 64, 75, 99, 79, 72, 70, 67, 85, + 118, 85, 75, 85, 95, 73, 76, 64, 109, 90, + 80, 88, 81, 71, 95, 67, 101, 67, 85, 71, + 126, 43, 122, 108, 125, 123, 99, 127, 103, 35, + 114, 100, 96, 117, 97, 118, 114, 59, 108, 118, + 117, 122, 114, 91, 115, 122, 124, 116, 114, 55, + 96, 122, 74, 25, 13, 26, 26, 0, 30, 8, + 66, 19, 18, 4, 16, 14, 11, 16, 9, 91, + 11, 28, 13, 12, 21, 18, 28, 93, 76, 51, + 36, 73, 36, 25, 47, 42, 59, 44, 110, 35, + 35, 42, 43, 45, 96, 32, 33, 38, 45, 43, + 116, 29, 57, 48, 50, 127, 40, 50, 114, 55, + 53, 50, 36, 46, 36, 33, 138, 228, 233, 252, + 250, 231, 140, 223, 199, 208, 212, 206, 212, 194, + 132, 209, 213, 208, 221, 215, 251, 209, 216, 157, + 192, 214, 195, 197, 217, 197, 209, 149, 248, 238, + 238, 251, 235, 252, 228, 173, 246, 236, 235, 228, + 232, 198, 241, 241, 242, 244, 234, 240, 234, 230, + 188, 200, 192, 223, 176, 249, 247, 228, 180, 251, + 133, 159, 200, 143, 129, 154, 130, 137, 164, 130, + 137, 141, 198, 147, 139, 197, 153, 148, 150, 151, + 155, 156, 136, 221, 134, 156, 208, 158, 183, 130, + 128, 157, 234, 241, 232, 143, 175, 166, 160, 237, + 182, 172, 224, 166, 163, 179, 228, 176, 169, 190, + 170, 249, 183, 177, 186, 178, 242, 233, 240, 157, + 191, 180, 177, 187, 73, 78, 8, 90, 75, 93, + 90, 68, 65, 70, 0, 116, 116, 107, 4, 77, + 91, 72, 24, 87, 81, 75, 28, 91, 93, 70, + 94, 85, 112, 86, 93, 89, 111, 111, 40, 125, + 97, 47, 111, 98, 108, 109, 101, 98, 114, 61, + 36, 55, 43, 45, 41, 43, 43, 44, 36, 45, + 34, 35, 32, 37, 34, 36, 57, 64, 4, 0, + 6, 6, 25, 1, 65, 93, 82, 87, 82, 88, + 75, 95, 84, 80, 72, 73, 85, 74, 74, 71, + 78, 68, 95, 50, 49, 65, 78, 65, 70, 71, + 122, 121, 125, 122, 125, 120, 124, 125, 114, 115, + 112, 117, 117, 106, 17, 43, 49, 53, 55, 46, + 48, 114, 108, 109, 102, 97, 105, 124, 110, 103, + 97, 103, 152, 134, 155, 157, 150, 157, 149, 128, + 227, 226, 144, 153, 144, 227, 193, 195, 219, 206, + 212, 205, 158, 204, 200, 207, 219, 221, 215, 156, + 156, 154, 132, 133, 185, 184, 185, 164, 191, 191, + 188, 189, 178, 174, 176, 177, 182, 183, 181, 168, + 219, 218, 169, 160, 172, 217, 253, 244, 254, 179, + 228, 254, 182, 244, 251, 251, 132, 142, 139, 157, + 206, 155, 131, 205, 141, 162, 149, 149, 142, 199, + 204, 151, 159, 136, 140, 150, 140, 154, 220, 137, + 157, 152, 149, 159, 223, 205, 212, 188, 174, 174, + 166, 189, 167, 187, 181, 237, 177, 166, 178, 183, + 163, 181, 228, 172, 169, 251, 173, 183, 191, 169, + 189, 180, 190, 178, 178, 189, 179, 247, 186, 186, + 93, 109, 73, 64, 66, 74, 72, 13, 86, 76, + 0, 83, 67, 84, 80, 74, 72, 94, 24, 74, + 91, 76, 79, 84, 93, 93, 10, 17, 94, 67, + 64, 69, 121, 49, 39, 38, 105, 110, 120, 104, + 117, 98, 121, 47, 103, 100, 103, 106, 111, 117, + 108, 106, 48, 110, 105, 124, 124, 103, 127, 102, + 115, 101, 58, 118, 5, 6, 71, 8, 30, 6, + 67, 27, 83, 76, 7, 0, 18, 2, 19, 4, + 3, 84, 17, 29, 27, 17, 8, 20, 6, 10, + 47, 20, 24, 19, 4, 26, 35, 37, 60, 29, + 60, 54, 108, 57, 45, 99, 39, 36, 50, 103, + 45, 33, 63, 53, 44, 48, 42, 38, 124, 56, + 60, 55, 32, 62, 63, 57, 32, 117, 204, 217, + 199, 196, 142, 195, 195, 206, 195, 207, 200, 206, + 213, 211, 197, 213, 211, 148, 206, 136, 145, 216, + 221, 201, 215, 196, 209, 200, 153, 208, 209, 193, + 213, 238, 230, 237, 254, 224, 229, 227, 246, 240, + 212, 243, 255, 167, 240, 234, 186, 252, 253, 237, + 190, 250, 242, 249, 226, 252, 249, 255, 226, 228, + 180, 243, 152, 132, 133, 201, 130, 128, 143, 140, + 142, 139, 143, 146, 146, 139, 141, 134, 159, 149, + 155, 156, 159, 143, 149, 210, 132, 194, 223, 131, + 131, 155, 145, 134, 158, 185, 177, 233, 186, 160, + 236, 170, 167, 183, 224, 173, 175, 164, 161, 171, + 185, 190, 171, 249, 184, 173, 179, 176, 242, 191, + 191, 178, 183, 187, 188, 186, 89, 95, 64, 76, + 79, 67, 88, 69, 107, 71, 69, 79, 82, 78, + 80, 92, 26, 83, 93, 88, 82, 75, 84, 7, + 18, 127, 89, 82, 83, 89, 87, 80, 71, 106, + 102, 104, 105, 106, 126, 45, 119, 112, 101, 115, + 38, 84, 109, 98, 116, 126, 124, 86, 107, 107, + 60, 127, 107, 51, 99, 116, 100, 97, 113, 103, + 38, 2, 11, 12, 0, 12, 9, 77, 15, 2, + 14, 0, 1, 2, 22, 69, 29, 30, 12, 89, + 12, 10, 16, 24, 1, 83, 21, 3, 4, 24, + 6, 79, 106, 7, 33, 42, 43, 33, 47, 40, + 98, 14, 33, 47, 39, 32, 33, 55, 96, 123, + 52, 48, 45, 43, 57, 51, 55, 33, 112, 33, + 57, 37, 32, 117, 197, 219, 205, 199, 199, 203, + 220, 223, 205, 197, 201, 205, 195, 200, 194, 195, + 214, 210, 214, 220, 225, 222, 223, 222, 215, 192, + 195, 253, 223, 212, 209, 219, 233, 238, 219, 236, + 252, 249, 229, 238, 231, 210, 245, 224, 232, 243, + 235, 242, 255, 233, 204, 252, 236, 242, 245, 243, + 243, 255, 166, 243, 242, 242, 165, 167, 137, 218, + 197, 222, 136, 216, 142, 192, 214, 211, 130, 215, + 203, 133, 129, 135, 155, 214, 206, 154, 206, 204, + 159, 158, 194, 145, 201, 192, 151, 195, 160, 135, + 179, 235, 188, 166, 238, 168, 169, 185, 226, 175, + 169, 162, 163, 169, 167, 160, 169, 251, 190, 171, + 177, 178, 252, 174, 183, 161, 166, 180, 164, 247, + 163, 188, 94, 67, 8, 90, 75, 67, 74, 13, + 81, 74, 71, 79, 67, 67, 4, 70, 95, 73, + 76, 114, 91, 76, 72, 79, 87, 95, 16, 93, + 95, 68, 64, 80, 100, 98, 102, 110, 46, 122, + 126, 97, 56, 35, 60, 105, 55, 57, 93, 106, + 111, 59, 123, 120, 112, 63, 114, 114, 101, 51, + 98, 116, 98, 98, 102, 123, 74, 31, 7, 73, + 26, 7, 9, 77, 3, 19, 16, 13, 15, 4, + 5, 17, 19, 20, 22, 87, 66, 80, 20, 76, + 76, 52, 53, 37, 57, 39, 32, 60, 5, 5, + 27, 25, 1, 28, 24, 44, 50, 51, 44, 40, + 37, 38, 48, 44, 53, 53, 119, 33, 115, 40, + 43, 42, 127, 53, 63, 35, 59, 122, 33, 39, + 198, 206, 198, 202, 193, 203, 201, 201, 206, 204, + 195, 192, 202, 207, 203, 214, 206, 249, 202, 214, + 201, 204, 217, 207, 146, 193, 213, 194, 195, 219, + 192, 149, 176, 171, 205, 228, 254, 251, 245, 173, + 240, 230, 243, 241, 233, 233, 247, 224, 180, 181, + 184, 220, 240, 235, 245, 233, 235, 179, 173, 177, + 219, 242, 249, 247, 143, 153, 200, 206, 201, 207, + 129, 132, 145, 144, 137, 143, 129, 164, 222, 185, + 189, 146, 140, 149, 159, 157, 209, 175, 135, 157, + 158, 148, 132, 171, 150, 128, 163, 167, 172, 186, + 146, 253, 175, 149, 247, 129, 142, 141, 150, 155, + 244, 153, 185, 183, 177, 188, 176, 171, 128, 169, + 183, 161, 189, 184, 184, 182, 184, 137, 78, 78, + 94, 76, 66, 64, 92, 64, 71, 77, 84, 125, + 100, 82, 87, 76, 84, 94, 75, 74, 114, 94, + 69, 88, 64, 111, 100, 67, 87, 83, 93, 91, + 109, 91, 100, 104, 122, 105, 99, 127, 111, 45, + 66, 116, 117, 110, 106, 96, 105, 104, 84, 120, + 103, 122, 110, 65, 86, 114, 100, 112, 84, 126, + 122, 113, 3, 5, 15, 53, 45, 0, 2, 27, + 7, 17, 20, 4, 20, 20, 56, 54, 14, 9, + 17, 23, 25, 43, 19, 49, 29, 16, 17, 29, + 31, 13, 17, 17, 25, 63, 58, 32, 32, 40, + 15, 34, 44, 53, 37, 51, 50, 34, 54, 107, + 57, 40, 59, 54, 48, 41, 57, 47, 38, 23, + 53, 61, 51, 48, 53, 33, 207, 255, 205, 197, + 203, 200, 222, 204, 207, 230, 205, 192, 207, 203, + 233, 192, 201, 200, 221, 215, 217, 218, 206, 206, + 255, 210, 222, 208, 209, 210, 198, 143, 170, 226, + 230, 224, 250, 230, 237, 225, 235, 249, 225, 245, + 239, 232, 234, 171, 180, 181, 213, 252, 237, 236, + 249, 243, 245, 246, 226, 210, 247, 249, 179, 225, + 202, 136, 154, 140, 143, 155, 137, 205, 171, 174, + 133, 146, 149, 130, 138, 130, 159, 137, 216, 159, + 140, 144, 145, 221, 134, 138, 128, 148, 214, 186, + 145, 134, 185, 174, 166, 174, 171, 189, 236, 186, + 171, 183, 168, 225, 168, 166, 169, 160, 250, 251, + 185, 181, 172, 186, 189, 185, 171, 243, 181, 169, + 191, 164, 160, 166, 4, 102, 77, 90, 93, 74, + 66, 74, 71, 81, 83, 108, 71, 73, 69, 66, + 95, 73, 2, 25, 30, 82, 89, 78, 65, 86, + 94, 86, 83, 69, 71, 21, 125, 110, 122, 108, + 46, 99, 99, 108, 102, 102, 100, 47, 75, 98, + 119, 118, 127, 117, 127, 124, 108, 108, 81, 124, + 124, 114, 119, 116, 100, 45, 52, 124, 4, 2, + 28, 0, 15, 3, 5, 23, 3, 23, 9, 14, + 8, 71, 2, 12, 20, 18, 11, 17, 27, 27, + 82, 60, 1, 0, 21, 5, 5, 50, 12, 22, + 34, 42, 38, 46, 43, 60, 13, 46, 33, 44, + 53, 47, 50, 52, 23, 60, 55, 57, 55, 53, + 45, 16, 44, 41, 59, 60, 62, 2, 51, 37, + 61, 48, 217, 239, 201, 208, 236, 206, 222, 222, + 225, 209, 217, 209, 210, 200, 229, 198, 217, 212, + 205, 215, 202, 204, 253, 206, 193, 214, 196, 243, + 215, 219, 213, 219, 233, 238, 251, 198, 254, 234, + 226, 194, 240, 231, 229, 243, 245, 202, 225, 246, + 233, 250, 255, 252, 237, 207, 243, 238, 251, 231, + 249, 254, 248, 218, 241, 230, 153, 138, 143, 140, + 157, 160, 156, 136, 140, 167, 133, 141, 143, 145, + 129, 151, 159, 159, 185, 138, 141, 154, 136, 176, + 151, 128, 131, 144, 145, 146, 135, 166, 175, 184, + 187, 160, 161, 161, 191, 142, 173, 173, 180, 160, + 175, 169, 161, 183, 169, 136, 182, 184, 174, 172, + 180, 178, 166, 151, 177, 165, 183, 251, 244, 156, + 110, 17, 8, 5, 14, 97, 77, 64, 71, 25, + 0, 13, 6, 101, 69, 73, 91, 85, 91, 92, + 4, 31, 113, 88, 65, 64, 81, 86, 83, 118, + 87, 86, 101, 126, 102, 125, 79, 124, 127, 104, + 118, 74, 100, 67, 103, 107, 101, 107, 121, 126, + 86, 124, 106, 107, 117, 115, 117, 71, 105, 97, + 115, 86, 119, 118, 5, 30, 6, 29, 47, 11, + 8, 4, 22, 10, 15, 15, 7, 11, 45, 11, + 28, 20, 60, 28, 13, 28, 14, 20, 2, 7, + 25, 30, 24, 58, 29, 27, 35, 38, 61, 36, + 13, 39, 45, 35, 37, 38, 9, 18, 9, 6, + 39, 38, 53, 46, 54, 45, 23, 59, 8, 50, + 38, 50, 60, 19, 55, 59, 53, 59, 201, 206, + 233, 223, 207, 198, 192, 204, 192, 207, 197, 227, + 199, 203, 197, 203, 217, 222, 234, 220, 205, 218, + 206, 203, 215, 215, 242, 208, 218, 214, 218, 214, + 239, 223, 231, 253, 239, 227, 197, 227, 215, 208, + 196, 213, 233, 243, 229, 233, 211, 245, 218, 205, + 221, 219, 249, 255, 230, 214, 225, 228, 255, 227, + 237, 208, 155, 158, 129, 157, 151, 166, 130, 175, + 182, 160, 204, 193, 168, 134, 137, 128, 218, 182, + 157, 138, 141, 158, 155, 152, 183, 139, 147, 153, + 151, 153, 147, 144, 143, 179, 171, 161, 175, 161, + 171, 168, 139, 167, 133, 185, 165, 175, 165, 171, + 189, 190, 150, 184, 179, 186, 143, 184, 161, 160, + 185, 190, 184, 164, 151, 186, 68, 95, 73, 64, + 64, 74, 94, 100, 70, 110, 69, 82, 85, 70, + 67, 64, 117, 75, 93, 87, 122, 90, 80, 84, + 68, 86, 66, 84, 82, 118, 71, 70, 111, 127, + 91, 112, 99, 109, 99, 97, 75, 103, 83, 117, + 103, 115, 113, 118, 89, 105, 125, 120, 106, 118, + 115, 115, 70, 122, 125, 116, 58, 55, 71, 108, + 7, 9, 7, 5, 84, 79, 64, 77, 50, 17, + 9, 2, 3, 93, 68, 73, 90, 40, 17, 29, + 27, 69, 92, 81, 82, 39, 9, 1, 19, 77, + 84, 56, 47, 56, 59, 40, 41, 42, 3, 61, + 39, 45, 15, 51, 34, 34, 54, 10, 40, 63, + 61, 43, 23, 59, 27, 47, 61, 38, 32, 24, + 50, 7, 59, 38, 195, 223, 193, 198, 192, 230, + 200, 249, 205, 215, 193, 205, 247, 210, 197, 203, + 206, 210, 204, 192, 248, 214, 208, 209, 215, 215, + 225, 196, 215, 217, 192, 220, 254, 242, 219, 224, + 234, 234, 207, 226, 239, 238, 229, 239, 242, 203, + 229, 246, 238, 206, 232, 253, 255, 235, 249, 201, + 251, 254, 245, 222, 228, 243, 241, 231, 190, 146, + 152, 140, 167, 139, 184, 132, 143, 134, 169, 143, + 160, 136, 150, 134, 159, 190, 128, 137, 151, 141, + 157, 137, 155, 156, 158, 165, 159, 154, 145, 161, + 184, 162, 175, 174, 171, 189, 156, 191, 171, 160, + 165, 149, 180, 166, 173, 169, 149, 189, 190, 170, + 187, 171, 147, 175, 187, 180, 185, 191, 183, 187, + 135, 161, 75, 95, 93, 90, 111, 75, 72, 68, + 86, 74, 79, 79, 71, 75, 109, 75, 92, 84, + 113, 77, 91, 82, 79, 17, 18, 124, 64, 84, + 88, 23, 68, 71, 99, 104, 109, 51, 46, 66, + 105, 126, 113, 98, 103, 100, 73, 119, 97, 107, + 74, 116, 107, 112, 106, 118, 115, 115, 93, 99, + 117, 127, 70, 101, 125, 118, 15, 36, 24, 12, + 0, 32, 30, 9, 7, 17, 41, 5, 42, 14, + 21, 16, 19, 31, 25, 13, 23, 16, 18, 45, + 0, 26, 19, 20, 37, 14, 25, 23, 37, 39, + 114, 105, 110, 10, 52, 61, 6, 34, 52, 36, + 124, 103, 100, 11, 59, 54, 61, 99, 126, 18, + 57, 46, 33, 50, 55, 52, 25, 39, 32, 60, + 197, 197, 251, 204, 220, 198, 201, 232, 218, 211, + 201, 211, 199, 211, 205, 202, 212, 255, 217, 205, + 219, 236, 217, 207, 219, 214, 228, 200, 198, 210, + 152, 149, 220, 234, 228, 252, 235, 181, 172, 197, + 237, 239, 233, 229, 231, 254, 247, 214, 255, 232, + 235, 240, 241, 241, 239, 206, 247, 231, 227, 220, + 243, 228, 231, 244, 141, 142, 187, 140, 157, 156, + 133, 130, 140, 144, 163, 142, 136, 147, 133, 140, + 148, 158, 138, 181, 145, 139, 175, 137, 151, 131, + 189, 152, 152, 187, 155, 129, 135, 170, 176, 133, + 161, 187, 153, 163, 166, 166, 178, 173, 175, 162, + 182, 139, 187, 182, 189, 152, 168, 190, 181, 177, + 179, 177, 188, 180, 144, 162, 160, 160, 88, 78, + 91, 104, 88, 78, 69, 65, 67, 65, 76, 68, + 105, 87, 80, 76, 85, 85, 75, 118, 78, 75, + 85, 82, 92, 96, 85, 67, 95, 82, 125, 81, + 69, 123, 124, 96, 97, 97, 88, 116, 114, 102, + 83, 117, 116, 110, 111, 96, 74, 105, 113, 122, + 123, 83, 125, 110, 102, 71, 98, 112, 114, 126, + 122, 114, 46, 10, 28, 12, 56, 14, 30, 4, + 3, 1, 12, 4, 50, 14, 7, 14, 54, 18, + 11, 13, 42, 13, 29, 25, 23, 73, 80, 93, + 86, 38, 0, 12, 112, 107, 100, 105, 1, 61, + 40, 40, 48, 99, 41, 37, 124, 103, 23, 44, + 61, 53, 57, 53, 100, 127, 17, 52, 60, 7, + 34, 48, 50, 50, 2, 58, 198, 222, 197, 204, + 227, 198, 194, 141, 214, 209, 193, 197, 195, 135, + 210, 202, 214, 206, 213, 220, 253, 133, 224, 250, + 219, 199, 220, 208, 212, 154, 230, 192, 228, 229, + 237, 251, 210, 237, 249, 228, 238, 231, 243, 221, + 180, 228, 220, 176, 216, 213, 212, 201, 194, 175, + 192, 254, 254, 250, 245, 255, 226, 203, 224, 240, + 152, 134, 129, 135, 143, 131, 176, 137, 135, 149, + 133, 141, 137, 151, 137, 128, 148, 143, 164, 187, + 139, 140, 149, 147, 151, 128, 131, 189, 151, 142, + 145, 135, 150, 159, 186, 168, 170, 166, 162, 170, + 146, 175, 161, 181, 160, 168, 182, 168, 244, 153, + 173, 170, 183, 177, 185, 174, 161, 159, 177, 168, + 179, 165, 136, 157, 67, 88, 92, 70, 92, 86, + 112, 108, 69, 68, 82, 68, 65, 70, 80, 76, + 85, 85, 75, 101, 118, 86, 79, 73, 93, 65, + 73, 112, 81, 80, 70, 80, 109, 106, 124, 96, + 97, 97, 92, 98, 117, 102, 114, 85, 116, 102, + 96, 96, 105, 75, 121, 107, 127, 114, 121, 105, + 119, 97, 99, 63, 117, 100, 89, 116, 18, 63, + 26, 8, 10, 10, 58, 2, 14, 22, 13, 4, + 43, 6, 28, 69, 14, 9, 25, 29, 27, 95, + 10, 18, 30, 6, 29, 20, 34, 24, 0, 20, + 38, 29, 39, 37, 59, 34, 41, 25, 45, 55, + 33, 45, 102, 49, 43, 41, 47, 54, 61, 13, + 55, 50, 57, 20, 60, 39, 53, 35, 32, 54, + 56, 1, 195, 198, 205, 137, 199, 193, 216, 200, + 208, 213, 193, 205, 138, 135, 215, 192, 217, 249, + 217, 202, 215, 204, 234, 210, 222, 198, 221, 212, + 255, 217, 192, 208, 248, 253, 233, 229, 204, 238, + 255, 228, 241, 163, 246, 238, 234, 242, 233, 224, + 186, 242, 246, 237, 251, 237, 234, 252, 254, 191, + 176, 226, 243, 244, 208, 240, 134, 159, 137, 175, + 135, 131, 152, 136, 144, 165, 137, 141, 146, 130, + 150, 197, 152, 130, 216, 189, 155, 147, 136, 156, + 222, 211, 213, 179, 151, 132, 157, 134, 152, 170, + 188, 160, 161, 137, 165, 161, 182, 166, 178, 135, + 175, 171, 176, 160, 168, 251, 186, 160, 254, 157, + 189, 174, 187, 160, 240, 163, 183, 163, 189, 186, + 6, 11, 13, 100, 79, 87, 118, 66, 76, 70, + 104, 68, 79, 64, 76, 81, 119, 90, 64, 25, + 68, 80, 82, 88, 18, 91, 85, 88, 81, 95, + 64, 25, 42, 127, 97, 106, 101, 124, 65, 100, + 108, 89, 111, 111, 99, 79, 97, 108, 125, 115, + 108, 84, 119, 113, 60, 103, 125, 125, 117, 49, + 126, 114, 125, 114, 2, 31, 68, 73, 26, 6, + 15, 6, 17, 32, 21, 18, 18, 8, 9, 49, + 19, 24, 19, 42, 23, 5, 25, 62, 7, 0, + 4, 30, 27, 87, 0, 28, 41, 32, 104, 58, + 39, 53, 41, 15, 35, 49, 16, 51, 47, 36, + 33, 17, 35, 43, 61, 10, 42, 59, 31, 60, + 62, 48, 37, 61, 55, 35, 61, 58, 196, 255, + 209, 217, 203, 143, 208, 141, 246, 204, 212, 192, + 202, 135, 198, 196, 214, 218, 214, 218, 219, 133, + 156, 233, 221, 199, 209, 221, 244, 214, 216, 212, + 228, 232, 237, 169, 254, 234, 254, 238, 231, 237, + 244, 190, 175, 184, 215, 224, 246, 254, 251, 237, + 251, 251, 188, 233, 251, 254, 245, 177, 255, 249, + 180, 243, 133, 153, 139, 140, 206, 129, 131, 153, + 194, 130, 140, 141, 137, 144, 129, 129, 218, 157, + 151, 139, 222, 223, 147, 143, 150, 150, 130, 209, + 130, 142, 132, 144, 131, 165, 171, 166, 188, 189, + 169, 174, 182, 227, 147, 141, 233, 147, 148, 229, + 170, 169, 177, 186, 187, 255, 177, 184, 179, 160, + 165, 163, 179, 186, 177, 187, 94, 17, 8, 14, + 9, 15, 65, 72, 67, 80, 85, 83, 67, 74, + 65, 75, 78, 27, 89, 85, 82, 80, 75, 88, + 86, 31, 16, 83, 67, 67, 20, 18, 45, 43, + 101, 108, 111, 124, 121, 127, 103, 110, 101, 111, + 114, 39, 119, 96, 118, 126, 123, 109, 123, 123, + 50, 61, 66, 127, 117, 112, 101, 114, 56, 53, + 9, 4, 26, 27, 11, 12, 24, 77, 49, 47, + 79, 53, 54, 71, 20, 4, 8, 26, 21, 28, + 10, 26, 14, 14, 49, 28, 30, 31, 19, 20, + 0, 28, 37, 37, 7, 59, 42, 42, 62, 109, + 11, 7, 15, 51, 34, 34, 54, 101, 46, 34, + 40, 60, 10, 22, 26, 14, 38, 60, 32, 113, + 58, 56, 39, 38, 138, 240, 252, 219, 128, 143, + 255, 225, 130, 204, 198, 199, 213, 194, 208, 133, + 225, 232, 204, 214, 206, 159, 208, 210, 193, 192, + 228, 195, 152, 151, 231, 249, 170, 228, 238, 239, + 253, 234, 248, 217, 227, 232, 229, 161, 246, 245, + 235, 227, 243, 239, 184, 194, 202, 254, 247, 248, + 178, 227, 226, 254, 240, 254, 224, 209, 139, 159, + 141, 198, 186, 134, 129, 136, 177, 140, 149, 147, + 133, 130, 176, 140, 151, 158, 216, 144, 144, 223, + 154, 146, 128, 144, 149, 178, 204, 171, 179, 156, + 190, 167, 169, 171, 227, 157, 185, 163, 172, 166, + 178, 157, 164, 178, 173, 169, 190, 168, 132, 235, + 189, 135, 233, 159, 156, 159, 128, 141, 230, 139, + 183, 185, 67, 78, 70, 93, 114, 91, 73, 95, + 79, 74, 78, 64, 74, 123, 64, 64, 76, 94, + 84, 86, 78, 82, 89, 83, 70, 111, 114, 68, + 69, 94, 90, 80, 121, 120, 68, 104, 119, 106, + 126, 81, 86, 113, 97, 101, 111, 105, 99, 85, + 118, 122, 108, 127, 113, 109, 113, 51, 80, 102, + 99, 120, 120, 114, 103, 102, 38, 10, 17, 12, + 28, 51, 46, 24, 17, 10, 14, 4, 21, 20, + 43, 7, 16, 30, 27, 13, 13, 35, 51, 15, + 22, 22, 2, 37, 15, 7, 17, 6, 22, 4, + 58, 45, 43, 61, 24, 52, 50, 38, 110, 34, + 53, 2, 60, 53, 51, 41, 57, 45, 55, 48, + 50, 31, 39, 42, 3, 52, 58, 59, 56, 58, + 222, 216, 250, 192, 221, 196, 128, 141, 134, 241, + 201, 210, 205, 139, 132, 128, 159, 155, 233, 205, + 199, 133, 156, 157, 230, 193, 158, 194, 194, 216, + 196, 143, 170, 171, 219, 197, 76, 47, 227, 235, + 228, 240, 229, 245, 188, 167, 70, 37, 234, 233, + 241, 250, 251, 165, 188, 189, 253, 245, 246, 226, + 243, 227, 174, 181, 202, 191, 184, 201, 158, 157, + 133, 142, 135, 217, 192, 201, 198, 129, 139, 151, + 218, 219, 208, 182, 189, 176, 213, 221, 218, 191, + 159, 146, 151, 155, 221, 157, 163, 184, 188, 166, + 188, 182, 158, 168, 179, 182, 165, 178, 178, 151, + 165, 183, 187, 182, 189, 173, 187, 173, 175, 155, + 226, 227, 224, 225, 230, 231, 132, 229, 106, 11, + 92, 70, 14, 15, 127, 89, 82, 25, 0, 104, + 85, 100, 86, 92, 74, 79, 87, 23, 70, 82, + 80, 110, 75, 94, 82, 94, 90, 99, 77, 69, + 111, 77, 125, 125, 123, 125, 105, 126, 65, 108, + 110, 117, 116, 102, 103, 113, 78, 98, 104, 124, + 76, 112, 115, 105, 65, 106, 125, 115, 121, 123, + 52, 98, 11, 24, 72, 7, 1, 27, 76, 11, + 13, 22, 14, 5, 70, 1, 11, 23, 90, 22, + 29, 10, 13, 30, 27, 24, 82, 94, 78, 81, + 86, 4, 13, 24, 40, 36, 36, 0, 42, 111, + 113, 109, 101, 34, 51, 50, 47, 32, 42, 40, + 63, 53, 44, 42, 59, 44, 47, 52, 61, 61, + 56, 62, 58, 62, 48, 52, 211, 216, 205, 218, + 221, 198, 195, 195, 225, 204, 206, 213, 199, 206, + 202, 192, 200, 255, 221, 213, 202, 222, 156, 223, + 211, 193, 195, 245, 211, 219, 192, 212, 170, 253, + 233, 229, 251, 234, 172, 225, 237, 247, 243, 192, + 225, 224, 246, 224, 253, 250, 236, 252, 250, 191, + 216, 210, 223, 208, 241, 253, 245, 226, 248, 244, + 158, 130, 135, 135, 206, 141, 141, 158, 139, 144, + 176, 147, 143, 132, 129, 197, 150, 158, 142, 156, + 146, 140, 220, 145, 155, 158, 153, 133, 184, 152, + 128, 213, 185, 190, 184, 185, 161, 189, 184, 168, + 166, 227, 172, 164, 176, 162, 168, 182, 158, 148, + 149, 249, 188, 166, 252, 169, 187, 190, 181, 149, + 153, 154, 244, 183, 83, 11, 92, 64, 77, 68, + 95, 13, 65, 76, 85, 79, 82, 115, 77, 70, + 81, 72, 24, 90, 81, 74, 82, 73, 122, 86, + 89, 90, 95, 89, 20, 116, 121, 99, 97, 69, + 111, 124, 120, 64, 99, 113, 107, 67, 111, 99, + 69, 118, 113, 86, 113, 125, 110, 112, 117, 115, + 102, 80, 42, 77, 81, 126, 96, 121, 11, 9, + 69, 59, 27, 1, 2, 8, 16, 63, 2, 20, + 15, 11, 0, 22, 38, 73, 27, 33, 75, 61, + 50, 49, 34, 47, 64, 45, 21, 27, 29, 16, + 36, 63, 20, 61, 43, 61, 33, 36, 44, 34, + 44, 29, 34, 34, 50, 32, 54, 52, 40, 52, + 59, 49, 40, 1, 16, 38, 35, 56, 56, 50, + 39, 38, 230, 202, 209, 204, 220, 243, 248, 223, + 195, 199, 201, 207, 193, 247, 200, 196, 206, 221, + 215, 203, 211, 145, 254, 200, 193, 218, 222, 212, + 197, 196, 248, 212, 243, 238, 250, 213, 198, 230, + 255, 249, 237, 241, 249, 221, 199, 224, 227, 247, + 255, 252, 249, 237, 247, 240, 242, 238, 206, 219, + 249, 226, 226, 248, 230, 236, 171, 140, 143, 155, + 139, 136, 141, 153, 139, 140, 142, 169, 131, 142, + 143, 128, 148, 186, 139, 145, 151, 209, 159, 142, + 129, 156, 133, 131, 149, 146, 182, 128, 163, 167, + 172, 233, 168, 189, 163, 160, 138, 170, 179, 181, + 169, 181, 189, 229, 174, 162, 168, 188, 146, 186, + 170, 184, 190, 225, 128, 163, 191, 180, 177, 245, + 73, 67, 73, 71, 73, 74, 95, 13, 65, 76, + 85, 79, 82, 7, 70, 68, 72, 72, 106, 88, + 80, 88, 89, 29, 80, 82, 66, 66, 98, 94, + 87, 94, 121, 89, 109, 127, 107, 125, 127, 108, + 110, 79, 101, 111, 97, 115, 108, 87, 127, 109, + 125, 107, 109, 126, 112, 61, 94, 118, 126, 118, + 98, 127, 87, 116, 6, 8, 29, 5, 15, 27, + 5, 2, 12, 67, 52, 24, 22, 2, 39, 95, + 38, 60, 17, 13, 18, 30, 30, 80, 32, 6, + 30, 31, 19, 5, 40, 23, 63, 34, 36, 45, + 61, 19, 126, 46, 26, 118, 2, 15, 10, 23, + 24, 117, 6, 56, 52, 48, 59, 49, 40, 1, + 38, 54, 34, 60, 63, 57, 53, 57, 246, 207, + 205, 223, 203, 195, 195, 221, 207, 198, 206, 213, + 250, 229, 209, 214, 211, 213, 221, 202, 205, 243, + 221, 196, 215, 193, 236, 229, 196, 214, 208, 220, + 228, 236, 216, 229, 239, 251, 234, 226, 240, 238, + 174, 195, 243, 244, 237, 235, 255, 232, 235, 213, + 255, 230, 249, 239, 206, 219, 249, 226, 226, 248, + 230, 236, 182, 170, 143, 142, 156, 138, 139, 140, + 150, 138, 143, 143, 149, 187, 172, 140, 137, 143, + 151, 139, 135, 190, 155, 154, 128, 150, 151, 144, + 130, 158, 155, 155, 152, 174, 190, 172, 188, 188, + 173, 161, 236, 160, 179, 131, 175, 163, 228, 132, + 169, 176, 154, 176, 186, 158, 175, 182, 147, 180, + 183, 163, 179, 176, 181, 161, 79, 79, 8, 93, + 71, 76, 71, 94, 2, 11, 108, 64, 85, 83, + 13, 113, 83, 86, 93, 125, 91, 83, 93, 68, + 102, 90, 93, 84, 26, 23, 89, 70, 73, 49, + 84, 78, 103, 123, 96, 108, 96, 46, 82, 116, + 104, 105, 97, 119, 70, 121, 109, 112, 114, 123, + 111, 65, 32, 112, 72, 36, 84, 89, 88, 69, + 54, 91, 52, 10, 2, 6, 9, 3, 22, 63, + 20, 4, 20, 10, 13, 11, 27, 23, 36, 29, + 27, 9, 25, 17, 29, 3, 29, 20, 24, 3, + 40, 55, 63, 56, 33, 39, 43, 60, 63, 1, + 35, 58, 37, 51, 26, 19, 54, 36, 62, 50, + 54, 62, 14, 51, 61, 41, 52, 60, 34, 60, + 120, 21, 33, 38, 195, 197, 205, 218, 221, 227, + 205, 212, 199, 209, 252, 233, 207, 212, 208, 202, + 200, 194, 228, 248, 217, 216, 206, 216, 213, 210, + 196, 216, 217, 217, 199, 233, 194, 226, 251, 253, + 225, 253, 245, 204, 229, 228, 242, 228, 225, 230, + 240, 236, 245, 245, 204, 240, 253, 244, 208, 252, + 225, 231, 209, 246, 241, 229, 241, 242, 139, 159, + 141, 141, 192, 140, 159, 185, 139, 142, 133, 181, + 143, 138, 129, 197, 137, 143, 153, 141, 151, 140, + 136, 148, 145, 128, 166, 158, 154, 130, 153, 144, + 234, 187, 186, 166, 168, 166, 160, 168, 148, 172, + 172, 180, 171, 162, 228, 179, 187, 183, 173, 188, + 136, 136, 157, 141, 155, 189, 166, 176, 186, 190, + 176, 245, 126, 67, 65, 90, 14, 103, 69, 94, + 86, 76, 82, 72, 69, 70, 72, 97, 91, 79, + 89, 122, 75, 76, 72, 82, 95, 19, 89, 66, + 22, 86, 64, 65, 107, 104, 96, 108, 106, 47, + 120, 98, 34, 106, 110, 101, 111, 100, 101, 113, + 117, 105, 56, 59, 60, 49, 60, 75, 115, 127, + 101, 116, 101, 55, 119, 122, 31, 5, 28, 73, + 25, 6, 0, 1, 66, 1, 5, 65, 21, 30, + 10, 6, 18, 9, 23, 23, 23, 5, 25, 25, + 82, 4, 25, 5, 30, 87, 29, 27, 46, 34, + 43, 40, 58, 32, 62, 45, 49, 99, 35, 46, + 51, 41, 48, 107, 122, 24, 57, 53, 50, 127, + 15, 56, 38, 5, 49, 61, 35, 50, 116, 60, + 196, 216, 220, 204, 207, 203, 128, 141, 205, 209, + 128, 194, 212, 194, 197, 209, 223, 155, 214, 220, + 201, 159, 156, 202, 219, 199, 216, 222, 195, 195, + 148, 212, 254, 255, 233, 234, 230, 230, 226, 234, + 162, 247, 239, 161, 239, 233, 224, 236, 249, 250, + 236, 246, 236, 214, 242, 254, 253, 225, 226, 244, + 245, 227, 180, 250, 140, 141, 155, 140, 154, 207, + 184, 132, 129, 136, 147, 193, 219, 199, 196, 190, + 167, 219, 183, 217, 211, 223, 220, 181, 210, 222, + 208, 209, 186, 215, 217, 213, 234, 136, 232, 228, + 238, 139, 163, 186, 172, 150, 176, 225, 186, 231, + 136, 164, 169, 175, 248, 228, 254, 255, 160, 253, + 132, 188, 188, 164, 187, 178, 244, 232, 10, 111, + 73, 80, 108, 78, 94, 108, 81, 72, 115, 72, + 92, 66, 102, 76, 94, 104, 81, 67, 91, 115, + 93, 78, 70, 96, 89, 75, 83, 120, 68, 80, + 100, 67, 97, 110, 102, 67, 99, 122, 82, 113, + 101, 119, 111, 104, 113, 118, 89, 119, 119, 106, + 123, 75, 110, 124, 118, 118, 99, 64, 99, 120, + 96, 112, 43, 24, 27, 12, 26, 57, 3, 1, + 23, 14, 5, 32, 21, 12, 68, 39, 19, 31, + 88, 85, 94, 44, 21, 7, 23, 73, 80, 93, + 86, 62, 16, 79, 106, 103, 104, 10, 34, 32, + 63, 40, 38, 121, 96, 109, 102, 5, 45, 33, + 96, 123, 116, 121, 31, 44, 55, 103, 114, 127, + 112, 19, 63, 51, 7, 60, 208, 206, 146, 137, + 130, 143, 237, 222, 201, 240, 201, 219, 195, 157, + 132, 225, 219, 207, 217, 153, 205, 218, 206, 212, + 215, 192, 144, 146, 205, 135, 201, 246, 176, 215, + 207, 224, 250, 227, 237, 239, 175, 209, 245, 239, + 232, 226, 246, 217, 248, 238, 241, 245, 250, 236, + 192, 175, 241, 203, 165, 211, 216, 219, 196, 201, + 218, 183, 139, 133, 135, 138, 130, 153, 190, 151, + 133, 147, 139, 142, 138, 132, 150, 167, 156, 156, + 136, 154, 144, 146, 130, 158, 149, 159, 130, 171, + 182, 128, 185, 162, 166, 172, 189, 188, 128, 172, + 187, 166, 178, 157, 146, 181, 165, 161, 179, 181, + 191, 137, 178, 190, 168, 187, 189, 161, 189, 255, + 148, 162, 167, 188, 68, 78, 91, 90, 98, 78, + 85, 72, 80, 127, 109, 78, 66, 82, 72, 64, + 73, 103, 113, 87, 90, 86, 95, 92, 70, 92, + 66, 66, 106, 126, 90, 81, 99, 104, 105, 125, + 97, 125, 34, 110, 113, 79, 105, 111, 99, 88, + 35, 126, 42, 102, 63, 57, 122, 126, 104, 124, + 50, 96, 117, 99, 127, 114, 103, 53, 26, 25, + 7, 25, 11, 29, 24, 4, 7, 16, 44, 4, + 16, 2, 8, 69, 30, 26, 12, 24, 94, 12, + 25, 15, 27, 22, 3, 81, 85, 12, 68, 8, + 6, 46, 62, 44, 34, 16, 3, 35, 98, 55, + 41, 34, 45, 8, 42, 101, 56, 58, 42, 121, + 61, 51, 51, 46, 55, 6, 32, 53, 55, 35, + 49, 1, 211, 219, 205, 197, 199, 193, 201, 254, + 199, 209, 201, 196, 213, 203, 205, 203, 223, 247, + 221, 207, 219, 211, 245, 211, 214, 218, 211, 208, + 194, 216, 198, 149, 235, 231, 250, 236, 239, 235, + 245, 173, 227, 231, 228, 228, 226, 235, 237, 235, + 255, 210, 246, 253, 251, 231, 244, 244, 225, 231, + 255, 227, 255, 244, 245, 249, 174, 138, 156, 136, + 212, 207, 163, 131, 171, 141, 137, 149, 220, 199, + 171, 139, 175, 139, 156, 152, 138, 154, 198, 221, + 189, 157, 179, 157, 147, 150, 134, 207, 234, 132, + 166, 157, 188, 182, 139, 168, 182, 142, 169, 175, + 139, 166, 188, 166, 175, 168, 172, 182, 179, 151, + 181, 174, 166, 188, 162, 184, 181, 182, 184, 145, + 75, 95, 73, 106, 91, 92, 88, 66, 79, 3, + 72, 72, 85, 83, 75, 87, 83, 88, 89, 85, + 30, 91, 93, 73, 83, 19, 81, 93, 68, 82, + 85, 81, 115, 43, 105, 109, 106, 106, 104, 89, + 107, 110, 101, 33, 117, 111, 109, 99, 110, 72, + 112, 118, 105, 63, 112, 116, 124, 118, 48, 124, + 119, 101, 127, 112, 24, 39, 1, 7, 11, 60, + 9, 31, 11, 6, 19, 40, 2, 8, 2, 3, + 9, 30, 12, 16, 16, 12, 8, 28, 28, 16, + 21, 63, 23, 26, 17, 60, 36, 56, 60, 40, + 32, 44, 41, 109, 44, 34, 45, 36, 5, 125, + 24, 2, 51, 47, 52, 56, 60, 114, 14, 40, + 60, 61, 53, 35, 10, 53, 33, 60, 198, 207, + 219, 245, 156, 204, 244, 152, 224, 237, 236, 241, + 250, 151, 248, 198, 214, 210, 221, 215, 202, 227, + 200, 216, 192, 222, 217, 223, 215, 219, 232, 209, + 239, 253, 237, 229, 225, 255, 225, 232, 236, 247, + 220, 195, 243, 244, 237, 235, 255, 232, 235, 213, + 255, 230, 249, 239, 206, 199, 226, 240, 242, 254, + 250, 242, 186, 135, 137, 157, 136, 128, 158, 128, + 204, 161, 149, 146, 143, 137, 129, 150, 137, 183, + 153, 128, 155, 141, 160, 176, 157, 151, 133, 157, + 147, 132, 168, 166, 190, 185, 169, 189, 171, 168, + 165, 168, 177, 159, 147, 181, 180, 166, 176, 160, + 189, 162, 246, 186, 173, 152, 185, 179, 183, 161, + 177, 189, 149, 182, 186, 242, 94, 11, 75, 65, + 79, 65, 75, 72, 2, 80, 84, 83, 71, 83, + 65, 66, 67, 27, 75, 92, 74, 75, 85, 83, + 85, 64, 16, 70, 94, 94, 88, 80, 42, 120, + 124, 123, 111, 123, 105, 106, 123, 35, 115, 117, + 103, 115, 97, 37, 115, 104, 56, 110, 113, 109, + 119, 116, 124, 116, 124, 126, 113, 100, 71, 97, + 24, 10, 28, 12, 9, 22, 93, 67, 82, 34, + 14, 65, 3, 31, 7, 0, 10, 15, 17, 22, + 16, 95, 20, 28, 1, 83, 31, 18, 21, 2, + 6, 7, 47, 47, 104, 62, 38, 38, 32, 40, + 98, 48, 52, 51, 39, 51, 33, 34, 35, 123, + 59, 43, 59, 62, 40, 52, 60, 52, 126, 113, + 19, 47, 55, 48, 218, 223, 193, 198, 192, 149, + 140, 151, 130, 236, 206, 232, 200, 206, 208, 204, + 219, 215, 209, 195, 219, 242, 217, 201, 192, 218, + 211, 194, 229, 195, 198, 212, 254, 238, 239, 240, + 174, 248, 237, 254, 162, 224, 242, 228, 231, 243, + 225, 225, 180, 181, 182, 163, 190, 208, 242, 222, + 224, 246, 241, 229, 243, 243, 199, 225, 152, 138, + 156, 140, 137, 150, 204, 158, 150, 130, 146, 149, + 131, 131, 202, 203, 212, 186, 150, 217, 155, 135, + 159, 152, 130, 135, 153, 158, 152, 215, 156, 148, + 185, 235, 167, 170, 173, 186, 190, 191, 167, 167, + 224, 182, 174, 174, 168, 160, 250, 168, 172, 171, + 191, 171, 185, 186, 171, 243, 162, 164, 184, 185, + 189, 187, 77, 5, 8, 108, 86, 76, 73, 93, + 86, 74, 79, 79, 28, 7, 30, 5, 104, 78, + 86, 106, 74, 77, 93, 73, 87, 84, 73, 17, + 65, 86, 71, 21, 121, 127, 103, 121, 126, 106, + 104, 35, 44, 45, 65, 111, 38, 98, 124, 102, + 127, 107, 108, 112, 113, 113, 60, 117, 115, 96, + 48, 126, 117, 116, 97, 103, 24, 14, 12, 73, + 25, 7, 5, 1, 7, 67, 19, 21, 20, 6, + 16, 0, 29, 2, 88, 10, 10, 16, 12, 13, + 27, 29, 23, 95, 86, 50, 12, 22, 47, 59, + 60, 32, 33, 33, 118, 109, 120, 99, 19, 53, + 41, 55, 5, 43, 122, 62, 32, 58, 59, 47, + 40, 52, 61, 61, 112, 57, 55, 36, 116, 58, + 201, 200, 221, 219, 220, 202, 200, 141, 213, 203, + 201, 205, 195, 135, 215, 209, 200, 218, 204, 220, + 217, 198, 156, 217, 211, 199, 209, 145, 210, 210, + 216, 208, 254, 226, 230, 238, 160, 175, 201, 245, + 225, 230, 240, 245, 239, 232, 234, 191, 186, 161, + 184, 203, 251, 242, 243, 235, 247, 192, 228, 227, + 247, 227, 241, 242, 147, 203, 159, 136, 157, 207, + 158, 136, 143, 140, 150, 132, 130, 201, 202, 203, + 187, 149, 216, 156, 134, 156, 153, 141, 134, 154, + 159, 159, 214, 159, 149, 134, 234, 164, 171, 170, + 187, 189, 190, 168, 166, 227, 183, 169, 175, 171, + 161, 229, 169, 175, 170, 184, 170, 186, 187, 164, + 242, 161, 181, 188, 185, 161, 189, 187, 77, 5, + 8, 108, 86, 76, 73, 93, 86, 74, 79, 79, + 28, 7, 30, 5, 125, 94, 76, 116, 91, 75, + 78, 84, 81, 64, 98, 68, 88, 23, 112, 84, + 126, 110, 39, 93, 103, 98, 105, 90, 109, 113, + 107, 104, 104, 96, 36, 113, 115, 118, 125, 74, + 106, 126, 104, 120, 50, 92, 98, 117, 115, 101, + 46, 53, 74, 4, 26, 13, 11, 29, 76, 14, + 3, 13, 3, 4, 10, 71, 22, 0, 11, 14, + 29, 10, 10, 60, 29, 19, 17, 22, 28, 81, + 25, 5, 16, 16, 56, 107, 11, 38, 32, 33, + 41, 46, 54, 42, 47, 47, 124, 103, 5, 38, + 57, 52, 45, 55, 42, 101, 124, 12, 39, 50, + 62, 37, 63, 35, 45, 111, 138, 228, 218, 205, + 203, 221, 140, 228, 230, 153, 128, 242, 207, 195, + 193, 159, 154, 244, 202, 221, 219, 205, 156, 201, + 203, 195, 213, 139, 150, 227, 198, 220, 237, 236, + 237, 251, 174, 255, 254, 228, 225, 230, 186, 161, + 210, 245, 229, 236, 246, 242, 246, 254, 190, 240, + 250, 251, 225, 246, 228, 171, 182, 196, 224, 250, + 154, 203, 132, 134, 157, 156, 214, 205, 182, 130, + 139, 132, 198, 151, 150, 138, 156, 146, 140, 195, + 222, 187, 157, 137, 151, 220, 164, 152, 155, 146, + 206, 213, 153, 164, 189, 187, 173, 170, 246, 237, + 144, 166, 177, 180, 163, 180, 176, 140, 190, 225, + 248, 249, 157, 179, 179, 174, 183, 243, 161, 165, + 175, 237, 244, 133, 69, 88, 65, 93, 71, 64, + 66, 13, 65, 79, 79, 82, 67, 7, 86, 64, + 75, 78, 93, 74, 74, 111, 83, 78, 91, 71, + 89, 94, 88, 23, 125, 113, 48, 43, 68, 96, + 96, 100, 44, 66, 65, 76, 32, 115, 99, 118, + 113, 96, 105, 111, 84, 112, 112, 116, 60, 82, + 81, 92, 62, 49, 68, 114, 101, 96, 15, 24, + 28, 32, 10, 85, 76, 34, 16, 7, 5, 19, + 52, 2, 21, 16, 31, 8, 12, 41, 31, 13, + 29, 16, 23, 7, 21, 3, 5, 38, 1, 20, + 36, 63, 33, 61, 55, 11, 41, 43, 43, 45, + 41, 53, 47, 40, 42, 22, 63, 47, 44, 48, + 48, 56, 18, 60, 63, 54, 3, 61, 63, 39, + 36, 52, 205, 206, 251, 221, 193, 223, 224, 194, + 209, 208, 233, 213, 195, 202, 215, 241, 219, 208, + 221, 233, 204, 208, 218, 212, 198, 250, 196, 212, + 219, 196, 245, 209, 238, 226, 252, 224, 225, 225, + 237, 225, 210, 226, 242, 224, 235, 226, 240, 224, + 232, 232, 215, 235, 250, 250, 238, 238, 178, 244, + 226, 254, 227, 231, 180, 229, 134, 138, 139, 128, + 128, 136, 204, 159, 135, 146, 149, 132, 149, 147, + 171, 151, 158, 158, 138, 138, 222, 152, 142, 146, + 135, 131, 222, 209, 164, 146, 133, 128, 175, 184, + 188, 128, 170, 245, 236, 153, 167, 187, 180, 146, + 163, 179, 176, 172, 180, 188, 145, 173, 187, 178, + 157, 190, 177, 188, 165, 191, 162, 132, 177, 161, + 94, 66, 70, 78, 103, 91, 73, 64, 96, 76, + 79, 77, 67, 70, 74, 118, 95, 79, 76, 80, + 80, 88, 117, 73, 87, 94, 121, 95, 66, 82, + 83, 80, 120, 88, 109, 125, 122, 102, 98, 106, + 75, 119, 101, 108, 68, 104, 107, 105, 127, 122, + 118, 74, 105, 118, 104, 126, 122, 118, 98, 66, + 115, 99, 96, 124, 4, 12, 33, 29, 11, 2, + 56, 4, 15, 6, 58, 14, 8, 2, 41, 4, + 20, 26, 31, 28, 12, 44, 25, 9, 6, 26, + 30, 22, 63, 3, 17, 24, 30, 34, 37, 44, + 8, 61, 45, 32, 39, 0, 47, 47, 32, 46, + 35, 22, 63, 47, 44, 48, 48, 56, 21, 41, + 55, 62, 20, 48, 34, 50, 0, 60, 199, 206, + 251, 204, 218, 219, 197, 195, 197, 234, 212, 196, + 203, 247, 197, 214, 201, 204, 215, 203, 218, 236, + 217, 201, 198, 218, 222, 214, 255, 195, 209, 216, + 217, 238, 228, 236, 237, 251, 227, 255, 209, 230, + 244, 245, 239, 233, 227, 204, 238, 254, 245, 205, + 247, 242, 249, 199, 253, 253, 245, 194, 243, 227, + 224, 252, 132, 140, 161, 157, 139, 130, 184, 136, + 154, 151, 161, 147, 131, 134, 183, 128, 142, 143, + 145, 151, 153, 182, 136, 152, 159, 160, 137, 156, + 148, 152, 152, 166, 175, 191, 188, 160, 160, 168, + 133, 185, 167, 174, 144, 164, 180, 174, 171, 161, + 137, 190, 172, 173, 183, 177, 187, 148, 166, 182, + 189, 130, 162, 165, 189, 187, 77, 120, 77, 93, + 90, 70, 66, 74, 107, 87, 69, 76, 103, 68, + 80, 76, 85, 85, 107, 92, 74, 75, 85, 83, + 85, 90, 68, 84, 91, 103, 91, 92, 100, 127, + 123, 90, 107, 123, 120, 100, 108, 100, 73, 117, + 99, 106, 64, 106, 111, 121, 116, 124, 77, 122, + 104, 105, 123, 125, 119, 88, 98, 114, 121, 70, + 6, 2, 12, 12, 28, 60, 9, 25, 22, 10, + 14, 6, 47, 19, 1, 8, 41, 30, 20, 28, + 29, 11, 19, 15, 62, 28, 19, 16, 26, 30, + 14, 16, 46, 24, 45, 61, 58, 38, 34, 42, + 11, 55, 37, 44, 0, 46, 40, 32, 9, 62, + 44, 45, 55, 49, 59, 20, 38, 54, 61, 23, + 57, 57, 32, 6, 207, 223, 220, 192, 192, 200, + 229, 217, 199, 206, 236, 206, 200, 192, 247, 192, + 206, 207, 209, 215, 217, 246, 200, 216, 223, 244, + 194, 222, 195, 199, 231, 208, 254, 255, 225, 231, + 233, 198, 248, 232, 239, 192, 239, 237, 233, 245, + 215, 224, 238, 239, 241, 247, 249, 214, 232, 248, + 255, 192, 255, 228, 248, 243, 199, 240, 158, 159, + 129, 135, 137, 166, 152, 136, 143, 162, 140, 132, + 148, 147, 183, 128, 142, 143, 145, 151, 153, 182, + 136, 152, 159, 188, 177, 132, 130, 159, 167, 144, + 190, 191, 161, 167, 169, 134, 184, 168, 175, 145, + 161, 165, 175, 168, 136, 170, 185, 186, 180, 176, + 164, 186, 184, 142, 183, 167, 164, 184, 184, 176, + 157, 161, 79, 70, 108, 70, 91, 77, 64, 72, + 117, 74, 84, 73, 106, 78, 74, 78, 105, 94, + 76, 77, 87, 81, 91, 116, 70, 86, 93, 99, + 69, 68, 103, 80, 126, 127, 97, 103, 105, 70, + 120, 104, 111, 66, 108, 104, 97, 105, 105, 96, + 116, 111, 75, 124, 106, 107, 117, 115, 117, 90, + 100, 116, 123, 71, 117, 124, 24, 40, 7, 5, + 1, 29, 63, 8, 22, 23, 9, 15, 1, 46, + 16, 0, 23, 56, 23, 23, 26, 22, 8, 20, + 29, 29, 35, 20, 2, 3, 29, 27, 45, 2, + 60, 44, 35, 3, 37, 35, 39, 12, 48, 53, + 47, 40, 42, 54, 9, 62, 44, 45, 55, 49, + 59, 20, 38, 54, 61, 19, 63, 48, 0, 48, + 210, 223, 233, 219, 203, 206, 255, 200, 214, 215, + 201, 207, 193, 238, 208, 192, 215, 253, 209, 219, + 209, 209, 221, 222, 209, 218, 252, 212, 192, 210, + 216, 250, 250, 255, 225, 230, 224, 252, 223, 232, + 246, 247, 233, 239, 225, 206, 240, 224, 247, 214, + 241, 247, 241, 235, 253, 232, 224, 252, 214, 248, + 244, 248, 250, 244, 137, 136, 129, 165, 139, 153, + 137, 129, 173, 147, 148, 136, 137, 137, 151, 182, + 159, 143, 140, 144, 144, 152, 181, 137, 151, 158, + 162, 144, 152, 144, 145, 166, 175, 167, 173, 170, + 186, 160, 190, 158, 167, 183, 180, 168, 168, 160, + 141, 177, 191, 182, 154, 182, 177, 179, 185, 188, + 188, 159, 191, 178, 183, 187, 189, 175, 79, 79, + 123, 76, 90, 91, 69, 67, 69, 106, 84, 68, + 75, 100, 72, 80, 73, 79, 93, 75, 125, 80, + 80, 82, 64, 90, 94, 86, 122, 82, 66, 80, + 102, 88, 109, 125, 122, 102, 98, 106, 75, 119, + 101, 108, 73, 117, 96, 96, 104, 73, 125, 104, + 107, 122, 111, 105, 66, 114, 98, 112, 123, 114, + 96, 112, 24, 24, 59, 12, 26, 27, 5, 3, + 5, 42, 20, 4, 11, 46, 7, 10, 20, 30, + 28, 56, 29, 11, 21, 18, 28, 83, 38, 16, + 26, 2, 17, 79, 106, 34, 59, 29, 43, 34, + 60, 34, 48, 34, 50, 56, 4, 38, 54, 22, + 50, 52, 47, 28, 38, 43, 57, 51, 33, 58, + 63, 63, 5, 63, 59, 34, 239, 211, 220, 204, + 192, 220, 197, 194, 204, 239, 201, 207, 195, 244, + 204, 202, 205, 249, 217, 202, 219, 243, 217, 203, + 215, 223, 245, 201, 194, 210, 218, 198, 227, 228, + 230, 197, 235, 249, 233, 225, 199, 251, 244, 228, + 232, 244, 237, 234, 244, 217, 249, 250, 245, 220, + 243, 241, 253, 225, 213, 233, 226, 242, 250, 230, + 131, 132, 134, 171, 129, 157, 136, 136, 144, 160, + 143, 141, 137, 149, 161, 157, 142, 158, 150, 138, + 151, 144, 146, 177, 147, 145, 149, 157, 180, 150, + 135, 144, 134, 174, 190, 172, 162, 155, 169, 181, + 182, 143, 175, 162, 167, 171, 151, 177, 181, 169, + 185, 190, 187, 172, 137, 174, 183, 161, 132, 163, + 183, 179, 177, 166, 105, 74, 70, 14, 90, 15, + 74, 68, 76, 71, 0, 64, 72, 94, 4, 86, + 78, 84, 74, 88, 89, 90, 127, 92, 92, 20, + 68, 17, 85, 69, 81, 84, 126, 110, 40, 122, + 122, 96, 126, 108, 101, 102, 32, 110, 96, 39, + 112, 124, 106, 126, 34, 57, 81, 109, 120, 120, + 96, 96, 88, 120, 101, 99, 123, 103, 19, 40, + 29, 26, 26, 0, 1, 77, 17, 23, 18, 8, + 8, 0, 39, 10, 20, 31, 17, 13, 23, 16, + 18, 50, 2, 22, 2, 16, 24, 19, 55, 0, + 57, 63, 39, 36, 110, 43, 45, 57, 39, 21, + 33, 45, 51, 34, 16, 60, 42, 62, 27, 44, + 45, 43, 51, 48, 114, 32, 41, 60, 52, 56, + 56, 22, 223, 216, 220, 198, 195, 143, 205, 206, + 193, 204, 213, 207, 210, 228, 209, 214, 206, 212, + 213, 153, 205, 218, 208, 216, 209, 199, 223, 195, + 229, 210, 216, 208, 233, 255, 237, 237, 199, 251, + 233, 224, 205, 241, 228, 228, 244, 167, 244, 233, + 251, 248, 241, 247, 249, 191, 239, 233, 224, 242, + 228, 244, 241, 238, 180, 226, 152, 132, 134, 142, + 206, 140, 153, 159, 144, 134, 142, 149, 198, 148, + 144, 132, 142, 158, 171, 141, 140, 158, 136, 152, + 149, 138, 208, 151, 159, 153, 157, 134, 162, 174, + 172, 242, 231, 239, 236, 172, 182, 227, 166, 174, + 180, 231, 141, 139, 137, 143, 138, 140, 147, 154, + 146, 137, 129, 140, 131, 148, 154, 146, 151, 129, + 99, 100, 102, 118, 103, 107, 120, 68, 79, 70, + 79, 84, 82, 7, 75, 67, 26, 76, 89, 80, + 74, 86, 82, 90, 18, 82, 83, 82, 83, 68, + 71, 21, 126, 100, 99, 108, 96, 67, 99, 110, + 99, 111, 83, 117, 105, 117, 101, 98, 127, 104, + 68, 79, 113, 115, 105, 112, 119, 82, 126, 112, + 122, 110, 103, 124, 25, 59, 26, 6, 10, 26, + 15, 25, 43, 39, 49, 20, 9, 19, 13, 11, + 29, 56, 13, 11, 12, 26, 18, 30, 11, 58, + 52, 32, 3, 24, 0, 16, 14, 46, 36, 40, + 55, 30, 57, 34, 54, 42, 46, 38, 18, 62, + 52, 32, 22, 52, 44, 10, 55, 37, 57, 19, + 61, 39, 57, 62, 56, 54, 56, 3, 203, 199, + 221, 204, 253, 219, 201, 221, 234, 202, 211, 213, + 201, 213, 221, 241, 195, 203, 221, 239, 209, 211, + 201, 208, 215, 231, 201, 193, 211, 243, 209, 217, + 254, 234, 203, 232, 226, 236, 249, 225, 227, 247, + 233, 238, 232, 211, 253, 245, 255, 214, 241, 247, + 200, 240, 240, 232, 255, 246, 209, 255, 247, 251, + 237, 230, 131, 152, 188, 128, 141, 132, 191, 132, + 152, 134, 161, 141, 138, 136, 147, 166, 155, 151, + 155, 140, 146, 158, 136, 152, 160, 150, 145, 157, + 130, 158, 153, 144, 158, 162, 171, 162, 189, 142, + 160, 161, 173, 180, 131, 160, 170, 164, 177, 169, + 187, 175, 189, 139, 187, 190, 176, 169, 187, 190, + 181, 133, 164, 182, 176, 176, 89, 106, 68, 69, + 65, 88, 111, 76, 78, 64, 85, 77, 71, 83, + 65, 119, 95, 90, 84, 77, 87, 82, 89, 107, + 93, 95, 69, 92, 83, 118, 88, 89, 101, 124, + 75, 104, 98, 108, 121, 97, 99, 119, 101, 83, + 99, 102, 104, 113, 115, 118, 125, 90, 118, 126, + 114, 122, 119, 82, 124, 125, 121, 96, 85, 119, + 8, 25, 13, 31, 7, 14, 24, 8, 50, 17, + 9, 2, 3, 37, 29, 49, 19, 24, 19, 42, + 23, 5, 25, 48, 19, 7, 5, 3, 31, 3, + 13, 49, 43, 63, 45, 15, 59, 59, 57, 63, + 39, 0, 47, 47, 50, 53, 37, 38, 46, 15, + 33, 41, 59, 22, 50, 46, 38, 33, 37, 60, + 51, 57, 32, 20, 206, 207, 193, 221, 199, 192, + 194, 204, 206, 234, 206, 199, 201, 232, 194, 195, + 151, 254, 192, 218, 214, 222, 210, 218, 215, 229, + 213, 223, 210, 216, 198, 149, 226, 234, 251, 169, + 224, 224, 248, 173, 241, 246, 240, 241, 233, 245, + 240, 220, 245, 238, 234, 185, 242, 246, 255, 248, + 252, 224, 245, 177, 242, 248, 241, 230, 202, 133, + 135, 157, 206, 142, 128, 129, 141, 148, 192, 149, + 142, 142, 151, 197, 153, 148, 150, 151, 155, 156, + 136, 148, 157, 157, 165, 130, 147, 133, 176, 144, + 167, 164, 154, 172, 175, 163, 128, 162, 161, 162, + 172, 146, 178, 168, 182, 164, 189, 190, 171, 133, + 150, 182, 175, 169, 189, 161, 169, 129, 185, 164, + 157, 177, 16, 11, 4, 9, 105, 93, 67, 88, + 82, 106, 68, 27, 6, 11, 4, 102, 85, 86, + 85, 92, 80, 75, 6, 29, 98, 65, 16, 12, + 22, 99, 70, 27, 122, 121, 40, 52, 46, 91, + 126, 35, 109, 101, 102, 114, 99, 115, 36, 56, + 58, 88, 109, 106, 106, 112, 113, 94, 65, 71, + 92, 92, 66, 84, 46, 73, 45, 2, 28, 5, + 15, 13, 65, 63, 23, 13, 14, 4, 20, 59, + 6, 16, 19, 23, 28, 10, 34, 77, 31, 37, + 71, 49, 62, 61, 38, 43, 68, 41, 41, 39, + 33, 44, 32, 59, 16, 57, 39, 49, 45, 40, + 40, 38, 40, 25, 62, 62, 46, 60, 50, 48, + 44, 48, 55, 61, 36, 13, 20, 34, 39, 60, + 196, 206, 219, 218, 226, 206, 213, 200, 208, 255, + 244, 211, 199, 195, 205, 203, 221, 235, 212, 216, + 202, 217, 211, 207, 223, 157, 242, 196, 197, 222, + 218, 208, 249, 248, 196, 232, 247, 234, 254, 209, + 192, 246, 243, 232, 232, 226, 247, 246, 213, 249, + 242, 252, 253, 235, 239, 193, 221, 225, 244, 244, + 228, 195, 237, 229, 143, 152, 180, 165, 135, 130, + 133, 153, 173, 145, 132, 132, 148, 179, 157, 149, + 159, 213, 155, 138, 222, 223, 177, 146, 150, 154, + 150, 136, 214, 152, 134, 145, 175, 185, 232, 234, + 157, 187, 163, 189, 226, 175, 175, 178, 181, 231, + 180, 183, 179, 184, 189, 249, 173, 183, 179, 168, + 190, 183, 240, 179, 179, 247, 184, 176, 89, 88, + 8, 93, 70, 78, 66, 13, 78, 74, 77, 72, + 82, 7, 84, 87, 83, 88, 93, 109, 95, 84, + 89, 29, 66, 65, 95, 87, 95, 67, 20, 69, + 120, 98, 107, 108, 46, 124, 100, 98, 119, 111, + 100, 33, 100, 98, 36, 104, 117, 105, 125, 57, + 106, 119, 125, 115, 50, 127, 121, 124, 127, 99, + 52, 101, 24, 2, 11, 12, 61, 27, 3, 29, + 66, 15, 15, 18, 21, 71, 20, 23, 19, 24, + 29, 89, 13, 23, 19, 8, 30, 23, 80, 19, + 19, 87, 25, 26, 56, 46, 104, 61, 38, 46, + 34, 109, 46, 42, 45, 40, 50, 103, 52, 55, + 51, 56, 61, 13, 63, 52, 57, 125, 34, 33, + 63, 55, 63, 35, 116, 37, 216, 194, 203, 204, + 142, 220, 196, 194, 215, 207, 196, 129, 196, 194, + 132, 201, 223, 200, 203, 153, 202, 215, 221, 211, + 146, 223, 217, 220, 223, 195, 148, 197, 248, 226, + 235, 236, 195, 196, 216, 222, 246, 236, 240, 161, + 234, 232, 247, 246, 186, 235, 234, 240, 253, 250, + 188, 238, 250, 252, 229, 253, 242, 183, 246, 240, + 202, 135, 141, 154, 157, 207, 152, 133, 131, 141, + 192, 140, 135, 149, 143, 128, 142, 219, 153, 138, + 149, 223, 140, 143, 155, 144, 149, 178, 204, 171, + 179, 156, 190, 167, 169, 171, 227, 157, 185, 163, + 172, 166, 178, 157, 164, 178, 173, 169, 190, 168, + 132, 235, 189, 135, 233, 159, 156, 159, 128, 141, + 230, 139, 183, 185, 67, 78, 70, 93, 114, 91, + 73, 95, 79, 74, 78, 64, 74, 123, 64, 64, + 76, 94, 84, 86, 78, 82, 89, 83, 70, 111, + 114, 68, 69, 94, 90, 80, 121, 120, 68, 104, + 119, 106, 126, 81, 86, 113, 97, 101, 111, 105, + 99, 85, 118, 122, 108, 127, 113, 109, 113, 51, + 80, 102, 99, 120, 120, 114, 103, 102, 38, 10, + 17, 12, 28, 51, 46, 24, 17, 10, 14, 4, + 21, 20, 43, 7, 16, 30, 27, 13, 13, 35, + 51, 15, 22, 22, 2, 37, 15, 7, 17, 6, + 22, 6, 41, 59, 37, 42, 56, 2, 48, 39, + 37, 51, 18, 62, 52, 32, 116, 56, 43, 13, + 63, 52, 57, 125, 34, 33, 63, 55, 63, 35, + 116, 37, 216, 194, 203, 204, 142, 220, 196, 194, + 215, 207, 196, 129, 196, 194, 132, 200, 213, 201, + 221, 153, 202, 215, 221, 211, 146, 222, 209, 195, + 221, 210, 192, 149, 235, 248, 227, 169, 254, 253, + 229, 238, 231, 208, 244, 238, 246, 167, 232, 234, + 233, 232, 184, 233, 236, 246, 255, 248, 178, 224, + 248, 254, 227, 251, 240, 181, 136, 142, 200, 132, + 129, 157, 137, 205, 150, 139, 129, 143, 198, 138, + 133, 151, 145, 158, 140, 217, 156, 150, 152, 221, + 130, 129, 153, 146, 147, 163, 149, 158, 175, 235, + 184, 187, 161, 169, 165, 185, 226, 179, 178, 168, + 165, 162, 228, 182, 178, 180, 173, 181, 186, 255, + 190, 184, 242, 191, 181, 162, 165, 247, 160, 189, + 75, 69, 8, 68, 79, 93, 71, 72, 86, 3, + 66, 72, 66, 7, 84, 87, 83, 88, 93, 106, + 106, 111, 104, 79, 91, 84, 87, 84, 68, 23, + 68, 71, 99, 104, 109, 74, 52, 83, 75, 100, + 118, 111, 97, 99, 43, 85, 113, 107, 116, 126, + 106, 69, 124, 106, 117, 113, 118, 96, 76, 35, + 117, 79, 33, 87, 36, 39, 56, 53, 94, 51, + 15, 1, 11, 6, 14, 21, 58, 19, 1, 23, + 23, 18, 22, 24, 18, 35, 24, 24, 4, 22, + 28, 30, 6, 26, 17, 27, 62, 23, 10, 60, + 61, 38, 34, 40, 49, 48, 12, 32, 63, 34, + 54, 25, 14, 41, 57, 61, 55, 49, 59, 13, + 62, 50, 36, 55, 57, 37, 57, 123, 232, 222, + 219, 192, 192, 202, 223, 222, 238, 194, 217, 196, + 212, 251, 230, 208, 201, 210, 214, 220, 205, 204, + 243, 223, 216, 214, 211, 197, 197, 235, 251, 199, + 238, 238, 250, 221, 247, 255, 233, 254, 222, 208, + 244, 238, 246, 200, 246, 225, 255, 233, 204, 224, + 238, 250, 178, 254, 225, 192, 228, 254, 230, 183, + 248, 250, 153, 152, 200, 153, 156, 134, 143, 136, + 194, 144, 136, 142, 147, 139, 128, 197, 152, 158, + 216, 149, 155, 140, 143, 221, 134, 155, 145, 159, + 214, 131, 134, 156, 173, 172, 173, 187, 238, 191, + 190, 164, 161, 166, 148, 160, 173, 162, 228, 181, + 168, 180, 190, 176, 170, 255, 172, 175, 187, 176, + 181, 241, 165, 191, 187, 160, 70, 79, 8, 75, + 75, 15, 65, 66, 80, 70, 0, 85, 78, 70, + 74, 5, 78, 73, 81, 94, 89, 90, 78, 29, + 66, 65, 89, 82, 83, 100, 64, 90, 122, 43, + 100, 102, 125, 124, 44, 125, 112, 106, 99, 100, + 38, 116, 108, 106, 111, 119, 124, 57, 124, 122, + 60, 112, 125, 97, 117, 49, 98, 127, 117, 123, + 74, 31, 26, 0, 9, 8, 9, 31, 66, 19, + 18, 8, 5, 2, 48, 4, 17, 30, 88, 9, + 12, 16, 26, 20, 6, 83, 0, 3, 31, 20, + 17, 85, 57, 35, 39, 60, 34, 43, 108, 47, + 39, 99, 44, 36, 53, 52, 100, 49, 50, 58, + 54, 121, 42, 45, 53, 58, 53, 54, 34, 113, + 38, 37, 61, 54, 207, 255, 218, 200, 199, 195, + 197, 195, 197, 131, 243, 213, 201, 215, 240, 215, + 151, 232, 236, 203, 223, 214, 208, 212, 220, 212, + 144, 222, 208, 209, 199, 208, 254, 200, 178, 213, + 201, 230, 248, 225, 227, 225, 173, 211, 243, 233, + 234, 224, 232, 199, 250, 236, 247, 243, 248, 238, + 206, 161, 243, 201, 163, 213, 218, 217, 186, 183, + 216, 181, 141, 131, 133, 136, 140, 151, 188, 149, + 131, 149, 137, 140, 148, 154, 148, 165, 154, 154, + 138, 152, 158, 156, 128, 156, 147, 153, 128, 169, + 136, 190, 187, 160, 160, 170, 191, 190, 142, 162, + 185, 164, 180, 155, 144, 183, 187, 191, 177, 183, + 185, 143, 176, 188, 166, 181, 191, 163, 187, 249, + 150, 160, 89, 66, 70, 76, 93, 92, 96, 76, + 91, 70, 82, 125, 100, 82, 87, 76, 84, 94, + 75, 74, 113, 93, 86, 88, 81, 71, 67, 109, + 121, 69, 80, 80, 120, 95, 113, 121, 107, 124, + 80, 89, 112, 98, 105, 109, 111, 105, 99, 86, + 110, 116, 104, 86, 108, 123, 121, 111, 70, 106, + 96, 116, 56, 116, 103, 60, 67, 69, 72, 32, + 10, 79, 81, 77, 41, 2, 7, 8, 45, 0, + 72, 69, 54, 18, 22, 28, 94, 61, 14, 24, + 19, 24, 60, 24, 24, 18, 84, 23, 56, 46, + 41, 34, 110, 35, 37, 35, 39, 48, 108, 97, + 22, 40, 45, 43, 46, 40, 120, 127, 126, 25, + 53, 58, 39, 33, 53, 34, 21, 109, 8, 18, + 195, 223, 196, 200, 204, 130, 254, 216, 204, 205, + 197, 211, 250, 197, 209, 204, 214, 223, 203, 229, + 140, 220, 228, 136, 240, 253, 252, 225, 234, 135, + 232, 214, 230, 226, 237, 231, 250, 211, 248, 232, + 240, 238, 233, 239, 231, 235, 216, 225, 255, 237, + 253, 245, 241, 239, 241, 248, 252, 231, 204, 211, + 227, 228, 253, 251, 143, 152, 155, 165, 143, 150, + 137, 159, 190, 183, 146, 128, 130, 142, 138, 130, + 170, 151, 153, 141, 152, 144, 142, 144, 220, 177, + 133, 130, 159, 153, 145, 134, 185, 135, 169, 176, + 171, 189, 144, 133, 171, 176, 180, 174, 180, 190, + 152, 132, 189, 188, 170, 188, 185, 190, 168, 180, + 189, 189, 163, 141, 158, 190, 167, 161, 69, 89, + 81, 104, 73, 72, 94, 72, 69, 66, 84, 72, + 73, 73, 116, 74, 83, 85, 76, 74, 127, 81, + 88, 123, 91, 84, 69, 67, 83, 68, 26, 86, + 121, 73, 103, 113, 93, 102, 118, 104, 64, 108, + 120, 33, 117, 110, 126, 96, 74, 61, 94, 57, + 51, 63, 54, 85, 94, 80, 66, 116, 120, 124, + 123, 93, 3, 12, 0, 70, 34, 0, 27, 44, + 6, 21, 78, 65, 37, 11, 5, 22, 9, 18, + 27, 56, 26, 9, 82, 93, 58, 26, 23, 25, + 89, 59, 27, 2, 8, 57, 33, 42, 37, 111, + 63, 36, 56, 38, 1, 38, 33, 53, 33, 34, + 59, 47, 49, 54, 48, 127, 47, 41, 43, 63, + 53, 20, 46, 35, 49, 59, 217, 194, 199, 199, + 130, 143, 137, 228, 204, 213, 197, 211, 213, 206, + 203, 203, 150, 155, 157, 234, 214, 208, 203, 157, + 197, 218, 211, 218, 197, 245, 193, 220, 230, 239, + 168, 234, 251, 253, 254, 232, 236, 247, 160, 227, + 231, 245, 197, 198, 219, 211, 212, 191, 201, 221, + 249, 250, 251, 253, 170, 177, 182, 235, 180, 208, + 132, 143, 210, 201, 206, 128, 158, 137, 135, 145, + 192, 140, 137, 131, 141, 131, 131, 219, 138, 156, + 143, 138, 153, 142, 134, 211, 159, 131, 146, 146, + 134, 213, 186, 167, 169, 170, 167, 161, 171, 237, + 176, 166, 177, 180, 163, 180, 176, 135, 187, 168, + 189, 148, 191, 167, 136, 175, 179, 183, 185, 191, + 177, 134, 161, 180, 68, 95, 65, 93, 87, 126, + 89, 66, 86, 74, 78, 70, 107, 70, 92, 113, + 72, 90, 92, 80, 80, 88, 109, 72, 83, 93, + 68, 88, 66, 78, 117, 71, 104, 98, 124, 123, + 111, 104, 105, 94, 123, 110, 98, 110, 106, 116, + 71, 109, 127, 120, 115, 124, 122, 94, 112, 113, + 125, 100, 84, 120, 101, 118, 118, 121, 15, 40, + 7, 5, 1, 29, 42, 2, 16, 14, 1, 21, + 45, 14, 10, 1, 15, 15, 27, 63, 23, 29, + 19, 19, 19, 16, 19, 24, 58, 18, 2, 16, + 38, 56, 10, 40, 61, 42, 28, 40, 48, 42, + 47, 37, 102, 36, 43, 43, 46, 58, 49, 55, + 45, 127, 53, 51, 114, 22, 40, 50, 58, 34, + 48, 48, 206, 248, 220, 208, 194, 202, 223, 224, + 195, 219, 201, 204, 211, 202, 233, 204, 212, 210, + 213, 204, 211, 246, 210, 222, 192, 214, 221, 212, + 216, 195, 240, 220, 231, 238, 230, 250, 231, 224, + 226, 204, 238, 239, 239, 246, 194, 238, 247, 228, + 248, 247, 253, 218, 241, 243, 243, 239, 163, 210, + 252, 253, 249, 224, 208, 252, 153, 138, 138, 133, + 139, 172, 131, 129, 141, 145, 210, 177, 131, 149, + 141, 138, 158, 182, 141, 149, 138, 150, 140, 145, + 155, 150, 130, 209, 159, 132, 212, 153, 175, 184, + 187, 233, 186, 167, 173, 163, 226, 142, 181, 173, + 178, 174, 180, 169, 179, 190, 170, 148, 183, 177, + 181, 176, 167, 190, 240, 184, 165, 247, 185, 186, + 88, 78, 8, 93, 70, 78, 66, 13, 111, 86, + 76, 85, 79, 87, 72, 76, 95, 73, 117, 88, + 70, 86, 81, 72, 95, 113, 81, 66, 83, 103, + 81, 71, 99, 100, 108, 41, 109, 96, 98, 121, + 99, 106, 110, 114, 38, 110, 106, 37, 95, 99, + 123, 117, 107, 123, 121, 121, 66, 118, 98, 120, + 121, 115, 103, 69, 4, 7, 41, 5, 11, 29, + 24, 30, 33, 12, 14, 21, 7, 14, 10, 0, + 8, 43, 22, 21, 63, 19, 25, 15, 6, 39, + 17, 3, 17, 18, 0, 35, 43, 39, 61, 44, + 24, 46, 32, 56, 39, 48, 22, 32, 42, 50, + 33, 12, 46, 62, 53, 42, 8, 62, 48, 40, + 55, 26, 36, 52, 59, 30, 32, 48, 199, 216, + 251, 221, 203, 223, 223, 238, 205, 214, 206, 213, + 227, 201, 197, 199, 214, 222, 235, 214, 203, 209, + 216, 206, 230, 218, 221, 212, 255, 217, 224, 199, + 235, 239, 237, 202, 225, 225, 248, 236, 235, 237, + 229, 243, 210, 238, 233, 224, 211, 245, 204, 235, + 255, 251, 249, 201, 251, 254, 245, 216, 248, 196, + 241, 246, 133, 133, 140, 154, 190, 163, 168, 132, + 144, 134, 131, 149, 143, 136, 138, 177, 147, 150, + 157, 163, 145, 145, 153, 180, 156, 149, 159, 184, + 146, 181, 149, 134, 175, 158, 188, 170, 129, 169, + 170, 190, 167, 183, 132, 168, 181, 183, 168, 164, + 163, 149, 185, 180, 187, 140, 168, 188, 188, 183, + 177, 163, 178, 147, 189, 166, 90, 71, 73, 80, + 96, 78, 65, 72, 113, 66, 86, 68, 6, 85, + 65, 68, 86, 79, 81, 84, 91, 31, 72, 79, + 83, 87, 85, 17, 65, 94, 64, 93, 42, 120, + 124, 123, 111, 97, 107, 104, 34, 119, 105, 108, + 99, 61, 36, 81, 104, 122, 124, 124, 87, 123, + 60, 32, 50, 51, 68, 120, 123, 114, 52, 40, + 74, 18, 17, 16, 23, 66, 33, 32, 79, 7, + 4, 65, 46, 47, 94, 8, 23, 65, 11, 10, + 80, 25, 26, 27, 82, 31, 17, 2, 2, 35, + 6, 20, 46, 46, 12, 40, 58, 42, 108, 112, + 98, 16, 33, 55, 35, 103, 54, 32, 59, 55, + 44, 48, 51, 58, 124, 41, 32, 50, 52, 52, + 118, 32, 61, 33, 194, 139, 219, 221, 220, 206, + 194, 202, 199, 131, 212, 200, 203, 194, 158, 133, + 223, 195, 209, 202, 202, 218, 216, 233, 192, 210, + 212, 212, 197, 244, 219, 192, 228, 255, 168, 169, + 250, 253, 237, 233, 231, 240, 212, 238, 213, 230, + 242, 224, 186, 207, 240, 252, 236, 250, 188, 244, + 225, 179, 254, 254, 182, 248, 250, 240, 202, 136, + 128, 128, 130, 139, 204, 155, 135, 141, 132, 142, + 148, 170, 145, 137, 142, 146, 216, 143, 155, 145, + 152, 146, 128, 221, 208, 178, 158, 158, 152, 145, + 234, 189, 173, 167, 170, 160, 190, 237, 181, 170, + 180, 169, 230, 172, 161, 188, 250, 230, 248, 249, + 172, 186, 168, 168, 160, 189, 240, 181, 191, 164, + 183, 186, 68, 69, 77, 74, 90, 74, 72, 13, + 82, 74, 78, 70, 6, 85, 65, 86, 79, 87, + 76, 109, 76, 94, 88, 84, 92, 84, 16, 71, + 83, 89, 80, 90, 120, 43, 105, 101, 124, 106, + 109, 105, 123, 35, 114, 100, 97, 110, 119, 113, + 127, 105, 125, 125, 48, 63, 83, 115, 126, 106, + 48, 126, 120, 114, 52, 97, 24, 10, 12, 0, + 0, 8, 76, 27, 7, 13, 4, 14, 20, 71, + 7, 4, 20, 91, 26, 28, 94, 13, 25, 26, + 27, 0, 4, 20, 4, 18, 16, 91, 62, 57, + 41, 45, 39, 33, 43, 27, 39, 45, 36, 46, + 52, 49, 33, 43, 62, 52, 42, 26, 50, 48, + 47, 56, 54, 115, 32, 62, 37, 62, 32, 60, + 197, 197, 136, 202, 207, 193, 139, 217, 130, 193, + 197, 129, 197, 203, 203, 214, 223, 223, 152, 216, + 217, 222, 213, 211, 253, 213, 214, 145, 155, 151, + 241, 205, 233, 227, 233, 231, 233, 234, 220, 236, + 246, 235, 212, 238, 194, 230, 240, 228, 216, 250, + 235, 252, 206, 237, 243, 249, 231, 240, 228, 208, + 229, 228, 241, 225, 187, 158, 135, 157, 135, 129, + 139, 172, 145, 144, 133, 149, 171, 130, 151, 150, + 155, 156, 157, 170, 135, 146, 158, 146, 158, 157, + 149, 134, 184, 150, 153, 144, 234, 162, 187, 233, + 160, 186, 160, 161, 226, 172, 178, 225, 163, 170, + 180, 177, 163, 181, 189, 174, 151, 171, 185, 176, + 161, 136, 240, 250, 246, 152, 186, 185, 83, 11, + 101, 72, 92, 68, 73, 89, 2, 76, 82, 69, + 67, 85, 4, 81, 67, 75, 93, 25, 87, 76, + 28, 92, 94, 95, 95, 70, 83, 83, 68, 71, + 99, 104, 109, 68, 97, 107, 101, 107, 107, 96, + 97, 117, 105, 117, 80, 124, 106, 126, 126, 118, + 108, 124, 121, 72, 97, 118, 68, 120, 117, 124, + 103, 83, 5, 25, 32, 0, 29, 27, 3, 31, + 27, 36, 18, 14, 19, 23, 55, 0, 14, 15, + 17, 23, 25, 12, 47, 4, 28, 7, 24, 20, + 2, 30, 23, 60, 62, 46, 37, 5, 39, 34, + 37, 57, 11, 37, 20, 46, 51, 36, 44, 32, + 62, 23, 49, 52, 55, 43, 124, 52, 52, 115, + 36, 62, 35, 52, 60, 48, 206, 231, 229, 253, + 250, 236, 150, 241, 229, 202, 212, 205, 199, 197, + 137, 247, 207, 213, 214, 220, 204, 227, 222, 200, + 219, 223, 212, 194, 234, 133, 215, 237, 191, 201, + 198, 197, 222, 211, 188, 209, 225, 239, 233, 228, + 232, 243, 216, 241, 255, 233, 245, 240, 240, 254, + 240, 193, 246, 246, 230, 244, 250, 248, 228, 248, + 143, 133, 156, 181, 172, 154, 159, 132, 140, 134, + 147, 146, 170, 134, 157, 128, 136, 167, 172, 139, + 159, 155, 149, 147, 149, 163, 156, 144, 130, 145, + 155, 135, 167, 229, 138, 188, 189, 166, 162, 168, + 177, 176, 140, 160, 191, 162, 182, 153, 152, 174, + 171, 176, 176, 186, 175, 174, 157, 177, 186, 180, + 181, 163, 167, 137, 101, 89, 76, 76, 92, 123, + 85, 93, 71, 80, 124, 109, 79, 74, 77, 81, + 115, 93, 108, 86, 75, 92, 84, 88, 86, 124, + 66, 85, 83, 69, 96, 76, 122, 110, 38, 106, + 125, 120, 101, 121, 106, 35, 116, 115, 111, 96, + 99, 96, 104, 59, 104, 107, 119, 124, 121, 61, + 115, 103, 48, 92, 119, 101, 127, 112, 30, 34, + 14, 61, 1, 26, 15, 5, 7, 7, 45, 0, + 20, 12, 1, 17, 90, 18, 30, 89, 10, 16, + 9, 30, 26, 22, 20, 60, 61, 35, 32, 38, + 62, 36, 56, 105, 34, 38, 33, 36, 54, 16, + 20, 13, 5, 125, 24, 2, 51, 47, 52, 56, + 60, 114, 14, 40, 60, 61, 53, 35, 10, 53, + 33, 60, 198, 207, 219, 245, 156, 204, 244, 152, + 224, 237, 236, 241, 250, 151, 248, 198, 214, 210, + 221, 215, 202, 227, 200, 216, 192, 222, 217, 223, + 215, 219, 232, 209, 239, 253, 237, 229, 225, 255, + 225, 232, 236, 247, 220, 195, 243, 244, 237, 235, + 255, 232, 235, 213, 255, 230, 249, 239, 206, 199, + 226, 240, 242, 254, 250, 242, 186, 135, 137, 157, + 136, 128, 158, 128, 204, 161, 149, 146, 143, 137, + 129, 150, 137, 183, 153, 128, 155, 141, 160, 191, + 135, 128, 153, 159, 147, 132, 135, 186, 168, 161, + 173, 170, 186, 188, 144, 130, 176, 167, 165, 179, + 146, 190, 180, 160, 169, 135, 139, 173, 177, 175, + 144, 180, 191, 186, 164, 158, 164, 179, 177, 167, + 126, 82, 88, 76, 0, 76, 95, 94, 82, 76, + 84, 114, 95, 74, 70, 74, 86, 114, 92 + }; + + internal static string[] 5 = new string[2068]; + + private static string 6(int P_0, int P_1, int P_2) + { + string text = Encoding.UTF8.GetString(4, P_1, P_2); + 5[P_0] = text; + return text; + } + + public static string ?() + { + return 5[0] ?? 6(0, 0, 11); + } + + public static string ?() + { + return 5[1] ?? 6(1, 11, 2); + } + + public static string ?() + { + return 5[2] ?? 6(2, 13, 3); + } + + public static string ?() + { + return 5[3] ?? 6(3, 16, 27); + } + + public static string ?() + { + return 5[4] ?? 6(4, 43, 13); + } + + public static string ?() + { + return 5[5] ?? 6(5, 56, 8); + } + + public static string ?() + { + return 5[6] ?? 6(6, 64, 8); + } + + public static string ?() + { + return 5[7] ?? 6(7, 72, 17); + } + + public static string ?() + { + return 5[8] ?? 6(8, 89, 18); + } + + public static string ?() + { + return 5[9] ?? 6(9, 107, 19); + } + + public static string ?() + { + return 5[10] ?? 6(10, 126, 18); + } + + public static string ?() + { + return 5[11] ?? 6(11, 144, 16); + } + + public static string ?() + { + return 5[12] ?? 6(12, 160, 20); + } + + public static string ?() + { + return 5[13] ?? 6(13, 180, 28); + } + + public static string ?() + { + return 5[14] ?? 6(14, 208, 12); + } + + public static string ?() + { + return 5[15] ?? 6(15, 220, 39); + } + + public static string ?() + { + return 5[16] ?? 6(16, 259, 16); + } + + public static string ?() + { + return 5[17] ?? 6(17, 275, 0); + } + + public static string ?() + { + return 5[18] ?? 6(18, 275, 3); + } + + public static string ?() + { + return 5[19] ?? 6(19, 278, 8); + } + + public static string ?() + { + return 5[20] ?? 6(20, 286, 7); + } + + public static string ?() + { + return 5[21] ?? 6(21, 293, 6); + } + + public static string ?() + { + return 5[22] ?? 6(22, 299, 47); + } + + public static string ?() + { + return 5[23] ?? 6(23, 346, 9); + } + + public static string ?() + { + return 5[24] ?? 6(24, 355, 51); + } + + public static string ?() + { + return 5[25] ?? 6(25, 406, 7); + } + + public static string ?() + { + return 5[26] ?? 6(26, 413, 7); + } + + public static string ?() + { + return 5[27] ?? 6(27, 420, 1); + } + + public static string ?() + { + return 5[28] ?? 6(28, 421, 2); + } + + public static string ?() + { + return 5[29] ?? 6(29, 423, 1); + } + + public static string ?() + { + return 5[30] ?? 6(30, 424, 4); + } + + public static string ?() + { + return 5[31] ?? 6(31, 428, 44); + } + + public static string ?() + { + return 5[32] ?? 6(32, 472, 17); + } + + public static string ?() + { + return 5[33] ?? 6(33, 489, 16); + } + + public static string ?() + { + return 5[34] ?? 6(34, 505, 7); + } + + public static string ?() + { + return 5[35] ?? 6(35, 512, 42); + } + + public static string ?() + { + return 5[36] ?? 6(36, 554, 36); + } + + public static string ?() + { + return 5[37] ?? 6(37, 590, 33); + } + + public static string ?() + { + return 5[38] ?? 6(38, 623, 51); + } + + public static string ?() + { + return 5[39] ?? 6(39, 674, 9); + } + + public static string ?() + { + return 5[40] ?? 6(40, 683, 11); + } + + public static string ?() + { + return 5[41] ?? 6(41, 694, 42); + } + + public static string ?() + { + return 5[42] ?? 6(42, 736, 2); + } + + public static string ?() + { + return 5[43] ?? 6(43, 738, 26); + } + + public static string ?() + { + return 5[44] ?? 6(44, 764, 15); + } + + public static string ?() + { + return 5[45] ?? 6(45, 779, 36); + } + + public static string ?() + { + return 5[46] ?? 6(46, 815, 21); + } + + public static string ?() + { + return 5[47] ?? 6(47, 836, 16); + } + + public static string ?() + { + return 5[48] ?? 6(48, 852, 32); + } + + public static string ?() + { + return 5[49] ?? 6(49, 884, 14); + } + + public static string ?() + { + return 5[50] ?? 6(50, 898, 23); + } + + public static string ?() + { + return 5[51] ?? 6(51, 921, 21); + } + + public static string ?() + { + return 5[52] ?? 6(52, 942, 31); + } + + public static string ?() + { + return 5[53] ?? 6(53, 973, 23); + } + + public static string ?() + { + return 5[54] ?? 6(54, 996, 33); + } + + public static string ?() + { + return 5[55] ?? 6(55, 1029, 26); + } + + public static string ?() + { + return 5[56] ?? 6(56, 1055, 14); + } + + public static string ?() + { + return 5[57] ?? 6(57, 1069, 9); + } + + public static string ?() + { + return 5[58] ?? 6(58, 1078, 27); + } + + public static string ?() + { + return 5[59] ?? 6(59, 1105, 28); + } + + public static string ?() + { + return 5[60] ?? 6(60, 1133, 26); + } + + public static string ?() + { + return 5[61] ?? 6(61, 1159, 45); + } + + public static string ?() + { + return 5[62] ?? 6(62, 1204, 15); + } + + public static string ?() + { + return 5[63] ?? 6(63, 1219, 8); + } + + public static string ?() + { + return 5[64] ?? 6(64, 1227, 26); + } + + public static string ?() + { + return 5[65] ?? 6(65, 1253, 28); + } + + public static string ?() + { + return 5[66] ?? 6(66, 1281, 22); + } + + public static string ?() + { + return 5[67] ?? 6(67, 1303, 23); + } + + public static string ?() + { + return 5[68] ?? 6(68, 1326, 11); + } + + public static string ?() + { + return 5[69] ?? 6(69, 1337, 6); + } + + public static string ?() + { + return 5[70] ?? 6(70, 1343, 22); + } + + public static string ?() + { + return 5[71] ?? 6(71, 1365, 23); + } + + public static string ?() + { + return 5[72] ?? 6(72, 1388, 33); + } + + public static string ?() + { + return 5[73] ?? 6(73, 1421, 15); + } + + public static string ?() + { + return 5[74] ?? 6(74, 1436, 27); + } + + public static string ?() + { + return 5[75] ?? 6(75, 1463, 38); + } + + public static string ?() + { + return 5[76] ?? 6(76, 1501, 13); + } + + public static string ?() + { + return 5[77] ?? 6(77, 1514, 23); + } + + public static string ?() + { + return 5[78] ?? 6(78, 1537, 53); + } + + public static string ?() + { + return 5[79] ?? 6(79, 1590, 6); + } + + public static string ?() + { + return 5[80] ?? 6(80, 1596, 13); + } + + public static string ?() + { + return 5[81] ?? 6(81, 1609, 34); + } + + public static string ?() + { + return 5[82] ?? 6(82, 1643, 18); + } + + public static string ?() + { + return 5[83] ?? 6(83, 1661, 20); + } + + public static string ?() + { + return 5[84] ?? 6(84, 1681, 23); + } + + public static string ?() + { + return 5[85] ?? 6(85, 1704, 10); + } + + public static string ?() + { + return 5[86] ?? 6(86, 1714, 31); + } + + public static string ?() + { + return 5[87] ?? 6(87, 1745, 21); + } + + public static string ?() + { + return 5[88] ?? 6(88, 1766, 16); + } + + public static string ?() + { + return 5[89] ?? 6(89, 1782, 16); + } + + public static string ?() + { + return 5[90] ?? 6(90, 1798, 23); + } + + public static string ?() + { + return 5[91] ?? 6(91, 1821, 12); + } + + public static string ?() + { + return 5[92] ?? 6(92, 1833, 23); + } + + public static string ?() + { + return 5[93] ?? 6(93, 1856, 21); + } + + public static string ?() + { + return 5[94] ?? 6(94, 1877, 23); + } + + public static string ?() + { + return 5[95] ?? 6(95, 1900, 13); + } + + public static string ?() + { + return 5[96] ?? 6(96, 1913, 5); + } + + public static string ?() + { + return 5[97] ?? 6(97, 1918, 28); + } + + public static string ?() + { + return 5[98] ?? 6(98, 1946, 41); + } + + public static string ?() + { + return 5[99] ?? 6(99, 1987, 18); + } + + public static string ?() + { + return 5[100] ?? 6(100, 2005, 26); + } + + public static string ?() + { + return 5[101] ?? 6(101, 2031, 10); + } + + public static string ?() + { + return 5[102] ?? 6(102, 2041, 6); + } + + public static string ?() + { + return 5[103] ?? 6(103, 2047, 17); + } + + public static string ?() + { + return 5[104] ?? 6(104, 2064, 5); + } + + public static string ?() + { + return 5[105] ?? 6(105, 2069, 12); + } + + public static string ?() + { + return 5[106] ?? 6(106, 2081, 18); + } + + public static string ?() + { + return 5[107] ?? 6(107, 2099, 37); + } + + public static string ?() + { + return 5[108] ?? 6(108, 2136, 18); + } + + public static string ?() + { + return 5[109] ?? 6(109, 2154, 18); + } + + public static string ?() + { + return 5[110] ?? 6(110, 2172, 20); + } + + public static string ?() + { + return 5[111] ?? 6(111, 2192, 20); + } + + public static string ?() + { + return 5[112] ?? 6(112, 2212, 20); + } + + public static string ?() + { + return 5[113] ?? 6(113, 2232, 9); + } + + public static string ?() + { + return 5[114] ?? 6(114, 2241, 14); + } + + public static string ?() + { + return 5[115] ?? 6(115, 2255, 18); + } + + public static string ?() + { + return 5[116] ?? 6(116, 2273, 8); + } + + public static string ?() + { + return 5[117] ?? 6(117, 2281, 19); + } + + public static string ?() + { + return 5[118] ?? 6(118, 2300, 27); + } + + public static string ?() + { + return 5[119] ?? 6(119, 2327, 17); + } + + public static string ?() + { + return 5[120] ?? 6(120, 2344, 16); + } + + public static string ?() + { + return 5[121] ?? 6(121, 2360, 13); + } + + public static string ?() + { + return 5[122] ?? 6(122, 2373, 13); + } + + public static string ?() + { + return 5[123] ?? 6(123, 2386, 28); + } + + public static string ?() + { + return 5[124] ?? 6(124, 2414, 17); + } + + public static string ?() + { + return 5[125] ?? 6(125, 2431, 6); + } + + public static string ?() + { + return 5[126] ?? 6(126, 2437, 21); + } + + public static string ?() + { + return 5[127] ?? 6(127, 2458, 16); + } + + public static string ??() + { + return 5[128] ?? 6(128, 2474, 10); + } + + public static string ??() + { + return 5[129] ?? 6(129, 2484, 23); + } + + public static string ??() + { + return 5[130] ?? 6(130, 2507, 18); + } + + public static string ??() + { + return 5[131] ?? 6(131, 2525, 24); + } + + public static string ??() + { + return 5[132] ?? 6(132, 2549, 31); + } + + public static string ??() + { + return 5[133] ?? 6(133, 2580, 5); + } + + public static string ??() + { + return 5[134] ?? 6(134, 2585, 5); + } + + public static string ??() + { + return 5[135] ?? 6(135, 2590, 6); + } + + public static string ??() + { + return 5[136] ?? 6(136, 2596, 11); + } + + public static string ??() + { + return 5[137] ?? 6(137, 2607, 7); + } + + public static string ??() + { + return 5[138] ?? 6(138, 2614, 19); + } + + public static string ??() + { + return 5[139] ?? 6(139, 2633, 15); + } + + public static string ??() + { + return 5[140] ?? 6(140, 2648, 16); + } + + public static string ??() + { + return 5[141] ?? 6(141, 2664, 25); + } + + public static string ??() + { + return 5[142] ?? 6(142, 2689, 15); + } + + public static string ??() + { + return 5[143] ?? 6(143, 2704, 34); + } + + public static string ??() + { + return 5[144] ?? 6(144, 2738, 30); + } + + public static string ??() + { + return 5[145] ?? 6(145, 2768, 27); + } + + public static string ??() + { + return 5[146] ?? 6(146, 2795, 15); + } + + public static string ??() + { + return 5[147] ?? 6(147, 2810, 15); + } + + public static string ??() + { + return 5[148] ?? 6(148, 2825, 17); + } + + public static string ??() + { + return 5[149] ?? 6(149, 2842, 15); + } + + public static string ??() + { + return 5[150] ?? 6(150, 2857, 9); + } + + public static string ??() + { + return 5[151] ?? 6(151, 2866, 16); + } + + public static string ??() + { + return 5[152] ?? 6(152, 2882, 28); + } + + public static string ??() + { + return 5[153] ?? 6(153, 2910, 36); + } + + public static string ??() + { + return 5[154] ?? 6(154, 2946, 10); + } + + public static string ??() + { + return 5[155] ?? 6(155, 2956, 9); + } + + public static string ??() + { + return 5[156] ?? 6(156, 2965, 9); + } + + public static string ??() + { + return 5[157] ?? 6(157, 2974, 8); + } + + public static string ??() + { + return 5[158] ?? 6(158, 2982, 10); + } + + public static string ??() + { + return 5[159] ?? 6(159, 2992, 9); + } + + public static string ??() + { + return 5[160] ?? 6(160, 3001, 13); + } + + public static string ??() + { + return 5[161] ?? 6(161, 3014, 26); + } + + public static string ??() + { + return 5[162] ?? 6(162, 3040, 9); + } + + public static string ??() + { + return 5[163] ?? 6(163, 3049, 26); + } + + public static string ??() + { + return 5[164] ?? 6(164, 3075, 35); + } + + public static string ??() + { + return 5[165] ?? 6(165, 3110, 28); + } + + public static string ??() + { + return 5[166] ?? 6(166, 3138, 27); + } + + public static string ??() + { + return 5[167] ?? 6(167, 3165, 28); + } + + public static string ??() + { + return 5[168] ?? 6(168, 3193, 37); + } + + public static string ??() + { + return 5[169] ?? 6(169, 3230, 30); + } + + public static string ??() + { + return 5[170] ?? 6(170, 3260, 29); + } + + public static string ??() + { + return 5[171] ?? 6(171, 3289, 27); + } + + public static string ??() + { + return 5[172] ?? 6(172, 3316, 36); + } + + public static string ??() + { + return 5[173] ?? 6(173, 3352, 29); + } + + public static string ??() + { + return 5[174] ?? 6(174, 3381, 28); + } + + public static string ??() + { + return 5[175] ?? 6(175, 3409, 21); + } + + public static string ??() + { + return 5[176] ?? 6(176, 3430, 9); + } + + public static string ??() + { + return 5[177] ?? 6(177, 3439, 16); + } + + public static string ??() + { + return 5[178] ?? 6(178, 3455, 21); + } + + public static string ??() + { + return 5[179] ?? 6(179, 3476, 11); + } + + public static string ??() + { + return 5[180] ?? 6(180, 3487, 14); + } + + public static string ??() + { + return 5[181] ?? 6(181, 3501, 12); + } + + public static string ??() + { + return 5[182] ?? 6(182, 3513, 3); + } + + public static string ??() + { + return 5[183] ?? 6(183, 3516, 11); + } + + public static string ??() + { + return 5[184] ?? 6(184, 3527, 35); + } + + public static string ??() + { + return 5[185] ?? 6(185, 3562, 42); + } + + public static string ??() + { + return 5[186] ?? 6(186, 3604, 13); + } + + public static string ??() + { + return 5[187] ?? 6(187, 3617, 44); + } + + public static string ??() + { + return 5[188] ?? 6(188, 3661, 51); + } + + public static string ??() + { + return 5[189] ?? 6(189, 3712, 29); + } + + public static string ??() + { + return 5[190] ?? 6(190, 3741, 1); + } + + public static string ??() + { + return 5[191] ?? 6(191, 3742, 1); + } + + public static string ??() + { + return 5[192] ?? 6(192, 3743, 1); + } + + public static string ??() + { + return 5[193] ?? 6(193, 3744, 4); + } + + public static string ??() + { + return 5[194] ?? 6(194, 3748, 8); + } + + public static string ??() + { + return 5[195] ?? 6(195, 3756, 6); + } + + public static string ??() + { + return 5[196] ?? 6(196, 3762, 4); + } + + public static string ??() + { + return 5[197] ?? 6(197, 3766, 34); + } + + public static string ??() + { + return 5[198] ?? 6(198, 3800, 41); + } + + public static string ??() + { + return 5[199] ?? 6(199, 3841, 12); + } + + public static string ??() + { + return 5[200] ?? 6(200, 3853, 8); + } + + public static string ??() + { + return 5[201] ?? 6(201, 3861, 8); + } + + public static string ??() + { + return 5[202] ?? 6(202, 3869, 3); + } + + public static string ??() + { + return 5[203] ?? 6(203, 3872, 22); + } + + public static string ??() + { + return 5[204] ?? 6(204, 3894, 19); + } + + public static string ??() + { + return 5[205] ?? 6(205, 3913, 23); + } + + public static string ??() + { + return 5[206] ?? 6(206, 3936, 13); + } + + public static string ??() + { + return 5[207] ?? 6(207, 3949, 55); + } + + public static string ??() + { + return 5[208] ?? 6(208, 4004, 13); + } + + public static string ??() + { + return 5[209] ?? 6(209, 4017, 5); + } + + public static string ??() + { + return 5[210] ?? 6(210, 4022, 51); + } + + public static string ??() + { + return 5[211] ?? 6(211, 4073, 49); + } + + public static string ??() + { + return 5[212] ?? 6(212, 4122, 18); + } + + public static string ??() + { + return 5[213] ?? 6(213, 4140, 43); + } + + public static string ??() + { + return 5[214] ?? 6(214, 4183, 44); + } + + public static string ??() + { + return 5[215] ?? 6(215, 4227, 12); + } + + public static string ??() + { + return 5[216] ?? 6(216, 4239, 9); + } + + public static string ??() + { + return 5[217] ?? 6(217, 4248, 41); + } + + public static string ??() + { + return 5[218] ?? 6(218, 4289, 18); + } + + public static string ??() + { + return 5[219] ?? 6(219, 4307, 50); + } + + public static string ??() + { + return 5[220] ?? 6(220, 4357, 15); + } + + public static string ??() + { + return 5[221] ?? 6(221, 4372, 24); + } + + public static string ??() + { + return 5[222] ?? 6(222, 4396, 56); + } + + public static string ??() + { + return 5[223] ?? 6(223, 4452, 33); + } + + public static string ??() + { + return 5[224] ?? 6(224, 4485, 34); + } + + public static string ??() + { + return 5[225] ?? 6(225, 4519, 43); + } + + public static string ??() + { + return 5[226] ?? 6(226, 4562, 53); + } + + public static string ??() + { + return 5[227] ?? 6(227, 4615, 45); + } + + public static string ??() + { + return 5[228] ?? 6(228, 4660, 46); + } + + public static string ??() + { + return 5[229] ?? 6(229, 4706, 43); + } + + public static string ??() + { + return 5[230] ?? 6(230, 4749, 62); + } + + public static string ??() + { + return 5[231] ?? 6(231, 4811, 54); + } + + public static string ??() + { + return 5[232] ?? 6(232, 4865, 62); + } + + public static string ??() + { + return 5[233] ?? 6(233, 4927, 54); + } + + public static string ??() + { + return 5[234] ?? 6(234, 4981, 55); + } + + public static string ??() + { + return 5[235] ?? 6(235, 5036, 47); + } + + public static string ??() + { + return 5[236] ?? 6(236, 5083, 48); + } + + public static string ??() + { + return 5[237] ?? 6(237, 5131, 45); + } + + public static string ??() + { + return 5[238] ?? 6(238, 5176, 37); + } + + public static string ??() + { + return 5[239] ?? 6(239, 5213, 75); + } + + public static string ??() + { + return 5[240] ?? 6(240, 5288, 41); + } + + public static string ??() + { + return 5[241] ?? 6(241, 5329, 11); + } + + public static string ??() + { + return 5[242] ?? 6(242, 5340, 32); + } + + public static string ??() + { + return 5[243] ?? 6(243, 5372, 8); + } + + public static string ??() + { + return 5[244] ?? 6(244, 5380, 19); + } + + public static string ??() + { + return 5[245] ?? 6(245, 5399, 34); + } + + public static string ??() + { + return 5[246] ?? 6(246, 5433, 24); + } + + public static string ??() + { + return 5[247] ?? 6(247, 5457, 24); + } + + public static string ??() + { + return 5[248] ?? 6(248, 5481, 7); + } + + public static string ??() + { + return 5[249] ?? 6(249, 5488, 6); + } + + public static string ??() + { + return 5[250] ?? 6(250, 5494, 41); + } + + public static string ??() + { + return 5[251] ?? 6(251, 5535, 44); + } + + public static string ??() + { + return 5[252] ?? 6(252, 5579, 35); + } + + public static string ??() + { + return 5[253] ?? 6(253, 5614, 37); + } + + public static string ??() + { + return 5[254] ?? 6(254, 5651, 14); + } + + public static string ??() + { + return 5[255] ?? 6(255, 5665, 48); + } + + public static string ??() + { + return 5[256] ?? 6(256, 5713, 9); + } + + public static string ??() + { + return 5[257] ?? 6(257, 5722, 21); + } + + public static string ??() + { + return 5[258] ?? 6(258, 5743, 50); + } + + public static string ??() + { + return 5[259] ?? 6(259, 5793, 9); + } + + public static string ??() + { + return 5[260] ?? 6(260, 5802, 23); + } + + public static string ??() + { + return 5[261] ?? 6(261, 5825, 27); + } + + public static string ??() + { + return 5[262] ?? 6(262, 5852, 21); + } + + public static string ??() + { + return 5[263] ?? 6(263, 5873, 3); + } + + public static string ??() + { + return 5[264] ?? 6(264, 5876, 7); + } + + public static string ??() + { + return 5[265] ?? 6(265, 5883, 12); + } + + public static string ??() + { + return 5[266] ?? 6(266, 5895, 10); + } + + public static string ??() + { + return 5[267] ?? 6(267, 5905, 28); + } + + public static string ??() + { + return 5[268] ?? 6(268, 5933, 40); + } + + public static string ??() + { + return 5[269] ?? 6(269, 5973, 25); + } + + public static string ??() + { + return 5[270] ?? 6(270, 5998, 14); + } + + public static string ??() + { + return 5[271] ?? 6(271, 6012, 32); + } + + public static string ??() + { + return 5[272] ?? 6(272, 6044, 33); + } + + public static string ??() + { + return 5[273] ?? 6(273, 6077, 27); + } + + public static string ??() + { + return 5[274] ?? 6(274, 6104, 19); + } + + public static string ??() + { + return 5[275] ?? 6(275, 6123, 22); + } + + public static string ??() + { + return 5[276] ?? 6(276, 6145, 8); + } + + public static string ??() + { + return 5[277] ?? 6(277, 6153, 29); + } + + public static string ??() + { + return 5[278] ?? 6(278, 6182, 19); + } + + public static string ??() + { + return 5[279] ?? 6(279, 6201, 4); + } + + public static string ??() + { + return 5[280] ?? 6(280, 6205, 12); + } + + public static string ??() + { + return 5[281] ?? 6(281, 6217, 40); + } + + public static string ??() + { + return 5[282] ?? 6(282, 6257, 5); + } + + public static string ??() + { + return 5[283] ?? 6(283, 6262, 6); + } + + public static string ??() + { + return 5[284] ?? 6(284, 6268, 10); + } + + public static string ??() + { + return 5[285] ?? 6(285, 6278, 6); + } + + public static string ??() + { + return 5[286] ?? 6(286, 6284, 1); + } + + public static string ??() + { + return 5[287] ?? 6(287, 6285, 1); + } + + public static string ??() + { + return 5[288] ?? 6(288, 6286, 1); + } + + public static string ??() + { + return 5[289] ?? 6(289, 6287, 1); + } + + public static string ??() + { + return 5[290] ?? 6(290, 6288, 1); + } + + public static string ??() + { + return 5[291] ?? 6(291, 6289, 1); + } + + public static string ??() + { + return 5[292] ?? 6(292, 6290, 14); + } + + public static string ??() + { + return 5[293] ?? 6(293, 6304, 4); + } + + public static string ??() + { + return 5[294] ?? 6(294, 6308, 1); + } + + public static string ??() + { + return 5[295] ?? 6(295, 6309, 1); + } + + public static string ??() + { + return 5[296] ?? 6(296, 6310, 18); + } + + public static string ??() + { + return 5[297] ?? 6(297, 6328, 5); + } + + public static string ??() + { + return 5[298] ?? 6(298, 6333, 58); + } + + public static string ??() + { + return 5[299] ?? 6(299, 6391, 33); + } + + public static string ??() + { + return 5[300] ?? 6(300, 6424, 2); + } + + public static string ??() + { + return 5[301] ?? 6(301, 6426, 61); + } + + public static string ??() + { + return 5[302] ?? 6(302, 6487, 10); + } + + public static string ??() + { + return 5[303] ?? 6(303, 6497, 32); + } + + public static string ??() + { + return 5[304] ?? 6(304, 6529, 13); + } + + public static string ??() + { + return 5[305] ?? 6(305, 6542, 1); + } + + public static string ??() + { + return 5[306] ?? 6(306, 6543, 1); + } + + public static string ??() + { + return 5[307] ?? 6(307, 6544, 12); + } + + public static string ??() + { + return 5[308] ?? 6(308, 6556, 13); + } + + public static string ??() + { + return 5[309] ?? 6(309, 6569, 21); + } + + public static string ??() + { + return 5[310] ?? 6(310, 6590, 10); + } + + public static string ??() + { + return 5[311] ?? 6(311, 6600, 7); + } + + public static string ??() + { + return 5[312] ?? 6(312, 6607, 6); + } + + public static string ??() + { + return 5[313] ?? 6(313, 6613, 11); + } + + public static string ??() + { + return 5[314] ?? 6(314, 6624, 6); + } + + public static string ??() + { + return 5[315] ?? 6(315, 6630, 4); + } + + public static string ??() + { + return 5[316] ?? 6(316, 6634, 7); + } + + public static string ??() + { + return 5[317] ?? 6(317, 6641, 8); + } + + public static string ??() + { + return 5[318] ?? 6(318, 6649, 31); + } + + public static string ??() + { + return 5[319] ?? 6(319, 6680, 18); + } + + public static string ??() + { + return 5[320] ?? 6(320, 6698, 25); + } + + public static string ??() + { + return 5[321] ?? 6(321, 6723, 1); + } + + public static string ??() + { + return 5[322] ?? 6(322, 6724, 9); + } + + public static string ??() + { + return 5[323] ?? 6(323, 6733, 11); + } + + public static string ??() + { + return 5[324] ?? 6(324, 6744, 8); + } + + public static string ??() + { + return 5[325] ?? 6(325, 6752, 13); + } + + public static string ??() + { + return 5[326] ?? 6(326, 6765, 6); + } + + public static string ??() + { + return 5[327] ?? 6(327, 6771, 3); + } + + public static string ??() + { + return 5[328] ?? 6(328, 6774, 5); + } + + public static string ??() + { + return 5[329] ?? 6(329, 6779, 23); + } + + public static string ??() + { + return 5[330] ?? 6(330, 6802, 1); + } + + public static string ??() + { + return 5[331] ?? 6(331, 6803, 1); + } + + public static string ??() + { + return 5[332] ?? 6(332, 6804, 2); + } + + public static string ??() + { + return 5[333] ?? 6(333, 6806, 5); + } + + public static string ??() + { + return 5[334] ?? 6(334, 6811, 8); + } + + public static string ??() + { + return 5[335] ?? 6(335, 6819, 8); + } + + public static string ??() + { + return 5[336] ?? 6(336, 6827, 11); + } + + public static string ??() + { + return 5[337] ?? 6(337, 6838, 28); + } + + public static string ??() + { + return 5[338] ?? 6(338, 6866, 35); + } + + public static string ??() + { + return 5[339] ?? 6(339, 6901, 1); + } + + public static string ??() + { + return 5[340] ?? 6(340, 6902, 1); + } + + public static string ??() + { + return 5[341] ?? 6(341, 6903, 2); + } + + public static string ??() + { + return 5[342] ?? 6(342, 6905, 6); + } + + public static string ??() + { + return 5[343] ?? 6(343, 6911, 1); + } + + public static string ??() + { + return 5[344] ?? 6(344, 6912, 6); + } + + public static string ??() + { + return 5[345] ?? 6(345, 6918, 8); + } + + public static string ??() + { + return 5[346] ?? 6(346, 6926, 10); + } + + public static string ??() + { + return 5[347] ?? 6(347, 6936, 10); + } + + public static string ??() + { + return 5[348] ?? 6(348, 6946, 12); + } + + public static string ??() + { + return 5[349] ?? 6(349, 6958, 14); + } + + public static string ??() + { + return 5[350] ?? 6(350, 6972, 6); + } + + public static string ??() + { + return 5[351] ?? 6(351, 6978, 8); + } + + public static string ??() + { + return 5[352] ?? 6(352, 6986, 10); + } + + public static string ??() + { + return 5[353] ?? 6(353, 6996, 10); + } + + public static string ??() + { + return 5[354] ?? 6(354, 7006, 12); + } + + public static string ??() + { + return 5[355] ?? 6(355, 7018, 14); + } + + public static string ??() + { + return 5[356] ?? 6(356, 7032, 57); + } + + public static string ??() + { + return 5[357] ?? 6(357, 7089, 24); + } + + public static string ??() + { + return 5[358] ?? 6(358, 7113, 5); + } + + public static string ??() + { + return 5[359] ?? 6(359, 7118, 3); + } + + public static string ??() + { + return 5[360] ?? 6(360, 7121, 6); + } + + public static string ??() + { + return 5[361] ?? 6(361, 7127, 2); + } + + public static string ??() + { + return 5[362] ?? 6(362, 7129, 13); + } + + public static string ??() + { + return 5[363] ?? 6(363, 7142, 22); + } + + public static string ??() + { + return 5[364] ?? 6(364, 7164, 19); + } + + public static string ??() + { + return 5[365] ?? 6(365, 7183, 14); + } + + public static string ??() + { + return 5[366] ?? 6(366, 7197, 42); + } + + public static string ??() + { + return 5[367] ?? 6(367, 7239, 50); + } + + public static string ??() + { + return 5[368] ?? 6(368, 7289, 22); + } + + public static string ??() + { + return 5[369] ?? 6(369, 7311, 6); + } + + public static string ??() + { + return 5[370] ?? 6(370, 7317, 7); + } + + public static string ??() + { + return 5[371] ?? 6(371, 7324, 16); + } + + public static string ??() + { + return 5[372] ?? 6(372, 7340, 16); + } + + public static string ??() + { + return 5[373] ?? 6(373, 7356, 6); + } + + public static string ??() + { + return 5[374] ?? 6(374, 7362, 6); + } + + public static string ??() + { + return 5[375] ?? 6(375, 7368, 9); + } + + public static string ??() + { + return 5[376] ?? 6(376, 7377, 14); + } + + public static string ??() + { + return 5[377] ?? 6(377, 7391, 22); + } + + public static string ??() + { + return 5[378] ?? 6(378, 7413, 3); + } + + public static string ??() + { + return 5[379] ?? 6(379, 7416, 2); + } + + public static string ??() + { + return 5[380] ?? 6(380, 7418, 12); + } + + public static string ??() + { + return 5[381] ?? 6(381, 7430, 16); + } + + public static string ??() + { + return 5[382] ?? 6(382, 7446, 15); + } + + public static string ??() + { + return 5[383] ?? 6(383, 7461, 13); + } + + public static string ??() + { + return 5[384] ?? 6(384, 7474, 44); + } + + public static string ??() + { + return 5[385] ?? 6(385, 7518, 40); + } + + public static string ??() + { + return 5[386] ?? 6(386, 7558, 35); + } + + public static string ??() + { + return 5[387] ?? 6(387, 7593, 39); + } + + public static string ??() + { + return 5[388] ?? 6(388, 7632, 15); + } + + public static string ??() + { + return 5[389] ?? 6(389, 7647, 8); + } + + public static string ??() + { + return 5[390] ?? 6(390, 7655, 4); + } + + public static string ??() + { + return 5[391] ?? 6(391, 7659, 5); + } + + public static string ??() + { + return 5[392] ?? 6(392, 7664, 6); + } + + public static string ??() + { + return 5[393] ?? 6(393, 7670, 19); + } + + public static string ??() + { + return 5[394] ?? 6(394, 7689, 4); + } + + public static string ??() + { + return 5[395] ?? 6(395, 7693, 14); + } + + public static string ??() + { + return 5[396] ?? 6(396, 7707, 66); + } + + public static string ??() + { + return 5[397] ?? 6(397, 7773, 54); + } + + public static string ??() + { + return 5[398] ?? 6(398, 7827, 16); + } + + public static string ??() + { + return 5[399] ?? 6(399, 7843, 8); + } + + public static string ??() + { + return 5[400] ?? 6(400, 7851, 9); + } + + public static string ??() + { + return 5[401] ?? 6(401, 7860, 7); + } + + public static string ??() + { + return 5[402] ?? 6(402, 7867, 14); + } + + public static string ??() + { + return 5[403] ?? 6(403, 7881, 15); + } + + public static string ??() + { + return 5[404] ?? 6(404, 7896, 8); + } + + public static string ??() + { + return 5[405] ?? 6(405, 7904, 7); + } + + public static string ??() + { + return 5[406] ?? 6(406, 7911, 11); + } + + public static string ??() + { + return 5[407] ?? 6(407, 7922, 10); + } + + public static string ??() + { + return 5[408] ?? 6(408, 7932, 10); + } + + public static string ??() + { + return 5[409] ?? 6(409, 7942, 20); + } + + public static string ??() + { + return 5[410] ?? 6(410, 7962, 7); + } + + public static string ??() + { + return 5[411] ?? 6(411, 7969, 3); + } + + public static string ??() + { + return 5[412] ?? 6(412, 7972, 4); + } + + public static string ??() + { + return 5[413] ?? 6(413, 7976, 5); + } + + public static string ??() + { + return 5[414] ?? 6(414, 7981, 10); + } + + public static string ??() + { + return 5[415] ?? 6(415, 7991, 10); + } + + public static string ??() + { + return 5[416] ?? 6(416, 8001, 22); + } + + public static string ??() + { + return 5[417] ?? 6(417, 8023, 19); + } + + public static string ??() + { + return 5[418] ?? 6(418, 8042, 15); + } + + public static string ??() + { + return 5[419] ?? 6(419, 8057, 31); + } + + public static string ??() + { + return 5[420] ?? 6(420, 8088, 12); + } + + public static string ??() + { + return 5[421] ?? 6(421, 8100, 14); + } + + public static string ??() + { + return 5[422] ?? 6(422, 8114, 15); + } + + public static string ??() + { + return 5[423] ?? 6(423, 8129, 13); + } + + public static string ??() + { + return 5[424] ?? 6(424, 8142, 16); + } + + public static string ??() + { + return 5[425] ?? 6(425, 8158, 22); + } + + public static string ??() + { + return 5[426] ?? 6(426, 8180, 18); + } + + public static string ??() + { + return 5[427] ?? 6(427, 8198, 16); + } + + public static string ??() + { + return 5[428] ?? 6(428, 8214, 15); + } + + public static string ??() + { + return 5[429] ?? 6(429, 8229, 17); + } + + public static string ??() + { + return 5[430] ?? 6(430, 8246, 18); + } + + public static string ??() + { + return 5[431] ?? 6(431, 8264, 16); + } + + public static string ??() + { + return 5[432] ?? 6(432, 8280, 10); + } + + public static string ??() + { + return 5[433] ?? 6(433, 8290, 5); + } + + public static string ??() + { + return 5[434] ?? 6(434, 8295, 2); + } + + public static string ??() + { + return 5[435] ?? 6(435, 8297, 8); + } + + public static string ??() + { + return 5[436] ?? 6(436, 8305, 8); + } + + public static string ??() + { + return 5[437] ?? 6(437, 8313, 6); + } + + public static string ??() + { + return 5[438] ?? 6(438, 8319, 3); + } + + public static string ??() + { + return 5[439] ?? 6(439, 8322, 2); + } + + public static string ??() + { + return 5[440] ?? 6(440, 8324, 2); + } + + public static string ??() + { + return 5[441] ?? 6(441, 8326, 2); + } + + public static string ??() + { + return 5[442] ?? 6(442, 8328, 1); + } + + public static string ??() + { + return 5[443] ?? 6(443, 8329, 10); + } + + public static string ??() + { + return 5[444] ?? 6(444, 8339, 14); + } + + public static string ??() + { + return 5[445] ?? 6(445, 8353, 12); + } + + public static string ??() + { + return 5[446] ?? 6(446, 8365, 20); + } + + public static string ??() + { + return 5[447] ?? 6(447, 8385, 13); + } + + public static string ??() + { + return 5[448] ?? 6(448, 8398, 14); + } + + public static string ??() + { + return 5[449] ?? 6(449, 8412, 14); + } + + public static string ??() + { + return 5[450] ?? 6(450, 8426, 20); + } + + public static string ??() + { + return 5[451] ?? 6(451, 8446, 20); + } + + public static string ??() + { + return 5[452] ?? 6(452, 8466, 19); + } + + public static string ??() + { + return 5[453] ?? 6(453, 8485, 15); + } + + public static string ??() + { + return 5[454] ?? 6(454, 8500, 15); + } + + public static string ??() + { + return 5[455] ?? 6(455, 8515, 16); + } + + public static string ??() + { + return 5[456] ?? 6(456, 8531, 22); + } + + public static string ??() + { + return 5[457] ?? 6(457, 8553, 18); + } + + public static string ??() + { + return 5[458] ?? 6(458, 8571, 17); + } + + public static string ??() + { + return 5[459] ?? 6(459, 8588, 17); + } + + public static string ??() + { + return 5[460] ?? 6(460, 8605, 8); + } + + public static string ??() + { + return 5[461] ?? 6(461, 8613, 12); + } + + public static string ??() + { + return 5[462] ?? 6(462, 8625, 25); + } + + public static string ??() + { + return 5[463] ?? 6(463, 8650, 26); + } + + public static string ??() + { + return 5[464] ?? 6(464, 8676, 28); + } + + public static string ??() + { + return 5[465] ?? 6(465, 8704, 37); + } + + public static string ??() + { + return 5[466] ?? 6(466, 8741, 23); + } + + public static string ??() + { + return 5[467] ?? 6(467, 8764, 5); + } + + public static string ??() + { + return 5[468] ?? 6(468, 8769, 14); + } + + public static string ??() + { + return 5[469] ?? 6(469, 8783, 19); + } + + public static string ??() + { + return 5[470] ?? 6(470, 8802, 17); + } + + public static string ??() + { + return 5[471] ?? 6(471, 8819, 12); + } + + public static string ??() + { + return 5[472] ?? 6(472, 8831, 10); + } + + public static string ??() + { + return 5[473] ?? 6(473, 8841, 15); + } + + public static string ??() + { + return 5[474] ?? 6(474, 8856, 12); + } + + public static string ??() + { + return 5[475] ?? 6(475, 8868, 11); + } + + public static string ??() + { + return 5[476] ?? 6(476, 8879, 10); + } + + public static string ??() + { + return 5[477] ?? 6(477, 8889, 9); + } + + public static string ??() + { + return 5[478] ?? 6(478, 8898, 14); + } + + public static string ??() + { + return 5[479] ?? 6(479, 8912, 8); + } + + public static string ??() + { + return 5[480] ?? 6(480, 8920, 4); + } + + public static string ??() + { + return 5[481] ?? 6(481, 8924, 14); + } + + public static string ??() + { + return 5[482] ?? 6(482, 8938, 15); + } + + public static string ??() + { + return 5[483] ?? 6(483, 8953, 14); + } + + public static string ??() + { + return 5[484] ?? 6(484, 8967, 27); + } + + public static string ??() + { + return 5[485] ?? 6(485, 8994, 18); + } + + public static string ??() + { + return 5[486] ?? 6(486, 9012, 40); + } + + public static string ??() + { + return 5[487] ?? 6(487, 9052, 30); + } + + public static string ??() + { + return 5[488] ?? 6(488, 9082, 39); + } + + public static string ??() + { + return 5[489] ?? 6(489, 9121, 17); + } + + public static string ??() + { + return 5[490] ?? 6(490, 9138, 24); + } + + public static string ??() + { + return 5[491] ?? 6(491, 9162, 10); + } + + public static string ??() + { + return 5[492] ?? 6(492, 9172, 1); + } + + public static string ??() + { + return 5[493] ?? 6(493, 9173, 2); + } + + public static string ??() + { + return 5[494] ?? 6(494, 9175, 3); + } + + public static string ??() + { + return 5[495] ?? 6(495, 9178, 9); + } + + public static string ??() + { + return 5[496] ?? 6(496, 9187, 8); + } + + public static string ??() + { + return 5[497] ?? 6(497, 9195, 4); + } + + public static string ??() + { + return 5[498] ?? 6(498, 9199, 32); + } + + public static string ??() + { + return 5[499] ?? 6(499, 9231, 3); + } + + public static string ??() + { + return 5[500] ?? 6(500, 9234, 5); + } + + public static string ??() + { + return 5[501] ?? 6(501, 9239, 7); + } + + public static string ??() + { + return 5[502] ?? 6(502, 9246, 7); + } + + public static string ??() + { + return 5[503] ?? 6(503, 9253, 15); + } + + public static string ??() + { + return 5[504] ?? 6(504, 9268, 12); + } + + public static string ??() + { + return 5[505] ?? 6(505, 9280, 5); + } + + public static string ??() + { + return 5[506] ?? 6(506, 9285, 1); + } + + public static string ??() + { + return 5[507] ?? 6(507, 9286, 7); + } + + public static string ??() + { + return 5[508] ?? 6(508, 9293, 12); + } + + public static string ??() + { + return 5[509] ?? 6(509, 9305, 10); + } + + public static string ??() + { + return 5[510] ?? 6(510, 9315, 15); + } + + public static string ??() + { + return 5[511] ?? 6(511, 9330, 15); + } + + public static string ??() + { + return 5[512] ?? 6(512, 9345, 22); + } + + public static string ??() + { + return 5[513] ?? 6(513, 9367, 2); + } + + public static string ??() + { + return 5[514] ?? 6(514, 9369, 6); + } + + public static string ??() + { + return 5[515] ?? 6(515, 9375, 3); + } + + public static string ??() + { + return 5[516] ?? 6(516, 9378, 11); + } + + public static string ??() + { + return 5[517] ?? 6(517, 9389, 18); + } + + public static string ??() + { + return 5[518] ?? 6(518, 9407, 7); + } + + public static string ??() + { + return 5[519] ?? 6(519, 9414, 33); + } + + public static string ??() + { + return 5[520] ?? 6(520, 9447, 8); + } + + public static string ??() + { + return 5[521] ?? 6(521, 9455, 5); + } + + public static string ??() + { + return 5[522] ?? 6(522, 9460, 7); + } + + public static string ??() + { + return 5[523] ?? 6(523, 9467, 7); + } + + public static string ??() + { + return 5[524] ?? 6(524, 9474, 7); + } + + public static string ??() + { + return 5[525] ?? 6(525, 9481, 17); + } + + public static string ??() + { + return 5[526] ?? 6(526, 9498, 7); + } + + public static string ??() + { + return 5[527] ?? 6(527, 9505, 7); + } + + public static string ??() + { + return 5[528] ?? 6(528, 9512, 7); + } + + public static string ??() + { + return 5[529] ?? 6(529, 9519, 7); + } + + public static string ??() + { + return 5[530] ?? 6(530, 9526, 17); + } + + public static string ??() + { + return 5[531] ?? 6(531, 9543, 7); + } + + public static string ??() + { + return 5[532] ?? 6(532, 9550, 7); + } + + public static string ??() + { + return 5[533] ?? 6(533, 9557, 7); + } + + public static string ??() + { + return 5[534] ?? 6(534, 9564, 7); + } + + public static string ??() + { + return 5[535] ?? 6(535, 9571, 7); + } + + public static string ??() + { + return 5[536] ?? 6(536, 9578, 7); + } + + public static string ??() + { + return 5[537] ?? 6(537, 9585, 7); + } + + public static string ??() + { + return 5[538] ?? 6(538, 9592, 7); + } + + public static string ??() + { + return 5[539] ?? 6(539, 9599, 7); + } + + public static string ??() + { + return 5[540] ?? 6(540, 9606, 7); + } + + public static string ??() + { + return 5[541] ?? 6(541, 9613, 7); + } + + public static string ??() + { + return 5[542] ?? 6(542, 9620, 7); + } + + public static string ??() + { + return 5[543] ?? 6(543, 9627, 7); + } + + public static string ??() + { + return 5[544] ?? 6(544, 9634, 7); + } + + public static string ??() + { + return 5[545] ?? 6(545, 9641, 7); + } + + public static string ??() + { + return 5[546] ?? 6(546, 9648, 7); + } + + public static string ??() + { + return 5[547] ?? 6(547, 9655, 7); + } + + public static string ??() + { + return 5[548] ?? 6(548, 9662, 7); + } + + public static string ??() + { + return 5[549] ?? 6(549, 9669, 7); + } + + public static string ??() + { + return 5[550] ?? 6(550, 9676, 7); + } + + public static string ??() + { + return 5[551] ?? 6(551, 9683, 7); + } + + public static string ??() + { + return 5[552] ?? 6(552, 9690, 7); + } + + public static string ??() + { + return 5[553] ?? 6(553, 9697, 7); + } + + public static string ??() + { + return 5[554] ?? 6(554, 9704, 7); + } + + public static string ??() + { + return 5[555] ?? 6(555, 9711, 7); + } + + public static string ??() + { + return 5[556] ?? 6(556, 9718, 7); + } + + public static string ??() + { + return 5[557] ?? 6(557, 9725, 17); + } + + public static string ??() + { + return 5[558] ?? 6(558, 9742, 7); + } + + public static string ??() + { + return 5[559] ?? 6(559, 9749, 7); + } + + public static string ??() + { + return 5[560] ?? 6(560, 9756, 7); + } + + public static string ??() + { + return 5[561] ?? 6(561, 9763, 7); + } + + public static string ??() + { + return 5[562] ?? 6(562, 9770, 7); + } + + public static string ??() + { + return 5[563] ?? 6(563, 9777, 7); + } + + public static string ??() + { + return 5[564] ?? 6(564, 9784, 7); + } + + public static string ??() + { + return 5[565] ?? 6(565, 9791, 7); + } + + public static string ??() + { + return 5[566] ?? 6(566, 9798, 7); + } + + public static string ??() + { + return 5[567] ?? 6(567, 9805, 7); + } + + public static string ??() + { + return 5[568] ?? 6(568, 9812, 7); + } + + public static string ??() + { + return 5[569] ?? 6(569, 9819, 7); + } + + public static string ??() + { + return 5[570] ?? 6(570, 9826, 7); + } + + public static string ??() + { + return 5[571] ?? 6(571, 9833, 7); + } + + public static string ??() + { + return 5[572] ?? 6(572, 9840, 7); + } + + public static string ??() + { + return 5[573] ?? 6(573, 9847, 7); + } + + public static string ??() + { + return 5[574] ?? 6(574, 9854, 7); + } + + public static string ??() + { + return 5[575] ?? 6(575, 9861, 17); + } + + public static string ??() + { + return 5[576] ?? 6(576, 9878, 7); + } + + public static string ??() + { + return 5[577] ?? 6(577, 9885, 7); + } + + public static string ??() + { + return 5[578] ?? 6(578, 9892, 7); + } + + public static string ??() + { + return 5[579] ?? 6(579, 9899, 7); + } + + public static string ??() + { + return 5[580] ?? 6(580, 9906, 7); + } + + public static string ??() + { + return 5[581] ?? 6(581, 9913, 7); + } + + public static string ??() + { + return 5[582] ?? 6(582, 9920, 7); + } + + public static string ??() + { + return 5[583] ?? 6(583, 9927, 7); + } + + public static string ??() + { + return 5[584] ?? 6(584, 9934, 7); + } + + public static string ??() + { + return 5[585] ?? 6(585, 9941, 7); + } + + public static string ??() + { + return 5[586] ?? 6(586, 9948, 7); + } + + public static string ??() + { + return 5[587] ?? 6(587, 9955, 7); + } + + public static string ??() + { + return 5[588] ?? 6(588, 9962, 7); + } + + public static string ??() + { + return 5[589] ?? 6(589, 9969, 7); + } + + public static string ??() + { + return 5[590] ?? 6(590, 9976, 7); + } + + public static string ??() + { + return 5[591] ?? 6(591, 9983, 17); + } + + public static string ??() + { + return 5[592] ?? 6(592, 10000, 7); + } + + public static string ??() + { + return 5[593] ?? 6(593, 10007, 7); + } + + public static string ??() + { + return 5[594] ?? 6(594, 10014, 7); + } + + public static string ??() + { + return 5[595] ?? 6(595, 10021, 7); + } + + public static string ??() + { + return 5[596] ?? 6(596, 10028, 7); + } + + public static string ??() + { + return 5[597] ?? 6(597, 10035, 7); + } + + public static string ??() + { + return 5[598] ?? 6(598, 10042, 7); + } + + public static string ??() + { + return 5[599] ?? 6(599, 10049, 7); + } + + public static string ??() + { + return 5[600] ?? 6(600, 10056, 17); + } + + public static string ??() + { + return 5[601] ?? 6(601, 10073, 7); + } + + public static string ??() + { + return 5[602] ?? 6(602, 10080, 7); + } + + public static string ??() + { + return 5[603] ?? 6(603, 10087, 7); + } + + public static string ??() + { + return 5[604] ?? 6(604, 10094, 7); + } + + public static string ??() + { + return 5[605] ?? 6(605, 10101, 7); + } + + public static string ??() + { + return 5[606] ?? 6(606, 10108, 7); + } + + public static string ??() + { + return 5[607] ?? 6(607, 10115, 7); + } + + public static string ??() + { + return 5[608] ?? 6(608, 10122, 7); + } + + public static string ??() + { + return 5[609] ?? 6(609, 10129, 7); + } + + public static string ??() + { + return 5[610] ?? 6(610, 10136, 7); + } + + public static string ??() + { + return 5[611] ?? 6(611, 10143, 7); + } + + public static string ??() + { + return 5[612] ?? 6(612, 10150, 7); + } + + public static string ??() + { + return 5[613] ?? 6(613, 10157, 7); + } + + public static string ??() + { + return 5[614] ?? 6(614, 10164, 7); + } + + public static string ??() + { + return 5[615] ?? 6(615, 10171, 8); + } + + public static string ??() + { + return 5[616] ?? 6(616, 10179, 8); + } + + public static string ??() + { + return 5[617] ?? 6(617, 10187, 8); + } + + public static string ??() + { + return 5[618] ?? 6(618, 10195, 8); + } + + public static string ??() + { + return 5[619] ?? 6(619, 10203, 8); + } + + public static string ??() + { + return 5[620] ?? 6(620, 10211, 8); + } + + public static string ??() + { + return 5[621] ?? 6(621, 10219, 8); + } + + public static string ??() + { + return 5[622] ?? 6(622, 10227, 8); + } + + public static string ??() + { + return 5[623] ?? 6(623, 10235, 8); + } + + public static string ??() + { + return 5[624] ?? 6(624, 10243, 11); + } + + public static string ??() + { + return 5[625] ?? 6(625, 10254, 10); + } + + public static string ??() + { + return 5[626] ?? 6(626, 10264, 10); + } + + public static string ??() + { + return 5[627] ?? 6(627, 10274, 10); + } + + public static string ??() + { + return 5[628] ?? 6(628, 10284, 10); + } + + public static string ??() + { + return 5[629] ?? 6(629, 10294, 10); + } + + public static string ??() + { + return 5[630] ?? 6(630, 10304, 10); + } + + public static string ??() + { + return 5[631] ?? 6(631, 10314, 10); + } + + public static string ??() + { + return 5[632] ?? 6(632, 10324, 10); + } + + public static string ??() + { + return 5[633] ?? 6(633, 10334, 10); + } + + public static string ??() + { + return 5[634] ?? 6(634, 10344, 7); + } + + public static string ??() + { + return 5[635] ?? 6(635, 10351, 7); + } + + public static string ??() + { + return 5[636] ?? 6(636, 10358, 7); + } + + public static string ??() + { + return 5[637] ?? 6(637, 10365, 7); + } + + public static string ??() + { + return 5[638] ?? 6(638, 10372, 7); + } + + public static string ??() + { + return 5[639] ?? 6(639, 10379, 7); + } + + public static string ??() + { + return 5[640] ?? 6(640, 10386, 7); + } + + public static string ??() + { + return 5[641] ?? 6(641, 10393, 6); + } + + public static string ??() + { + return 5[642] ?? 6(642, 10399, 13); + } + + public static string ??() + { + return 5[643] ?? 6(643, 10412, 9); + } + + public static string ??() + { + return 5[644] ?? 6(644, 10421, 6); + } + + public static string ??() + { + return 5[645] ?? 6(645, 10427, 5); + } + + public static string ??() + { + return 5[646] ?? 6(646, 10432, 9); + } + + public static string ??() + { + return 5[647] ?? 6(647, 10441, 7); + } + + public static string ??() + { + return 5[648] ?? 6(648, 10448, 5); + } + + public static string ??() + { + return 5[649] ?? 6(649, 10453, 9); + } + + public static string ??() + { + return 5[650] ?? 6(650, 10462, 5); + } + + public static string ??() + { + return 5[651] ?? 6(651, 10467, 10); + } + + public static string ??() + { + return 5[652] ?? 6(652, 10477, 17); + } + + public static string ??() + { + return 5[653] ?? 6(653, 10494, 20); + } + + public static string ??() + { + return 5[654] ?? 6(654, 10514, 5); + } + + public static string ??() + { + return 5[655] ?? 6(655, 10519, 12); + } + + public static string ??() + { + return 5[656] ?? 6(656, 10531, 12); + } + + public static string ??() + { + return 5[657] ?? 6(657, 10543, 8); + } + + public static string ??() + { + return 5[658] ?? 6(658, 10551, 5); + } + + public static string ??() + { + return 5[659] ?? 6(659, 10556, 6); + } + + public static string ??() + { + return 5[660] ?? 6(660, 10562, 9); + } + + public static string ??() + { + return 5[661] ?? 6(661, 10571, 19); + } + + public static string ??() + { + return 5[662] ?? 6(662, 10590, 6); + } + + public static string ??() + { + return 5[663] ?? 6(663, 10596, 5); + } + + public static string ??() + { + return 5[664] ?? 6(664, 10601, 14); + } + + public static string ??() + { + return 5[665] ?? 6(665, 10615, 12); + } + + public static string ??() + { + return 5[666] ?? 6(666, 10627, 8); + } + + public static string ??() + { + return 5[667] ?? 6(667, 10635, 6); + } + + public static string ??() + { + return 5[668] ?? 6(668, 10641, 5); + } + + public static string ??() + { + return 5[669] ?? 6(669, 10646, 5); + } + + public static string ??() + { + return 5[670] ?? 6(670, 10651, 8); + } + + public static string ??() + { + return 5[671] ?? 6(671, 10659, 12); + } + + public static string ??() + { + return 5[672] ?? 6(672, 10671, 5); + } + + public static string ??() + { + return 5[673] ?? 6(673, 10676, 6); + } + + public static string ??() + { + return 5[674] ?? 6(674, 10682, 11); + } + + public static string ??() + { + return 5[675] ?? 6(675, 10693, 4); + } + + public static string ??() + { + return 5[676] ?? 6(676, 10697, 10); + } + + public static string ??() + { + return 5[677] ?? 6(677, 10707, 12); + } + + public static string ??() + { + return 5[678] ?? 6(678, 10719, 10); + } + + public static string ??() + { + return 5[679] ?? 6(679, 10729, 17); + } + + public static string ??() + { + return 5[680] ?? 6(680, 10746, 11); + } + + public static string ??() + { + return 5[681] ?? 6(681, 10757, 18); + } + + public static string ??() + { + return 5[682] ?? 6(682, 10775, 13); + } + + public static string ??() + { + return 5[683] ?? 6(683, 10788, 14); + } + + public static string ??() + { + return 5[684] ?? 6(684, 10802, 21); + } + + public static string ??() + { + return 5[685] ?? 6(685, 10823, 4); + } + + public static string ??() + { + return 5[686] ?? 6(686, 10827, 15); + } + + public static string ??() + { + return 5[687] ?? 6(687, 10842, 4); + } + + public static string ??() + { + return 5[688] ?? 6(688, 10846, 4); + } + + public static string ??() + { + return 5[689] ?? 6(689, 10850, 11); + } + + public static string ??() + { + return 5[690] ?? 6(690, 10861, 16); + } + + public static string ??() + { + return 5[691] ?? 6(691, 10877, 21); + } + + public static string ??() + { + return 5[692] ?? 6(692, 10898, 6); + } + + public static string ??() + { + return 5[693] ?? 6(693, 10904, 13); + } + + public static string ??() + { + return 5[694] ?? 6(694, 10917, 18); + } + + public static string ??() + { + return 5[695] ?? 6(695, 10935, 4); + } + + public static string ??() + { + return 5[696] ?? 6(696, 10939, 11); + } + + public static string ??() + { + return 5[697] ?? 6(697, 10950, 9); + } + + public static string ??() + { + return 5[698] ?? 6(698, 10959, 8); + } + + public static string ??() + { + return 5[699] ?? 6(699, 10967, 8); + } + + public static string ??() + { + return 5[700] ?? 6(700, 10975, 5); + } + + public static string ??() + { + return 5[701] ?? 6(701, 10980, 15); + } + + public static string ??() + { + return 5[702] ?? 6(702, 10995, 15); + } + + public static string ??() + { + return 5[703] ?? 6(703, 11010, 25); + } + + public static string ??() + { + return 5[704] ?? 6(704, 11035, 21); + } + + public static string ??() + { + return 5[705] ?? 6(705, 11056, 5); + } + + public static string ??() + { + return 5[706] ?? 6(706, 11061, 5); + } + + public static string ??() + { + return 5[707] ?? 6(707, 11066, 14); + } + + public static string ??() + { + return 5[708] ?? 6(708, 11080, 5); + } + + public static string ??() + { + return 5[709] ?? 6(709, 11085, 5); + } + + public static string ??() + { + return 5[710] ?? 6(710, 11090, 8); + } + + public static string ??() + { + return 5[711] ?? 6(711, 11098, 7); + } + + public static string ??() + { + return 5[712] ?? 6(712, 11105, 4); + } + + public static string ??() + { + return 5[713] ?? 6(713, 11109, 5); + } + + public static string ??() + { + return 5[714] ?? 6(714, 11114, 7); + } + + public static string ??() + { + return 5[715] ?? 6(715, 11121, 6); + } + + public static string ??() + { + return 5[716] ?? 6(716, 11127, 13); + } + + public static string ??() + { + return 5[717] ?? 6(717, 11140, 12); + } + + public static string ??() + { + return 5[718] ?? 6(718, 11152, 12); + } + + public static string ??() + { + return 5[719] ?? 6(719, 11164, 9); + } + + public static string ??() + { + return 5[720] ?? 6(720, 11173, 8); + } + + public static string ??() + { + return 5[721] ?? 6(721, 11181, 7); + } + + public static string ??() + { + return 5[722] ?? 6(722, 11188, 7); + } + + public static string ??() + { + return 5[723] ?? 6(723, 11195, 7); + } + + public static string ??() + { + return 5[724] ?? 6(724, 11202, 7); + } + + public static string ??() + { + return 5[725] ?? 6(725, 11209, 7); + } + + public static string ??() + { + return 5[726] ?? 6(726, 11216, 37); + } + + public static string ??() + { + return 5[727] ?? 6(727, 11253, 33); + } + + public static string ??() + { + return 5[728] ?? 6(728, 11286, 34); + } + + public static string ??() + { + return 5[729] ?? 6(729, 11320, 44); + } + + public static string ??() + { + return 5[730] ?? 6(730, 11364, 38); + } + + public static string ??() + { + return 5[731] ?? 6(731, 11402, 40); + } + + public static string ??() + { + return 5[732] ?? 6(732, 11442, 38); + } + + public static string ??() + { + return 5[733] ?? 6(733, 11480, 31); + } + + public static string ??() + { + return 5[734] ?? 6(734, 11511, 41); + } + + public static string ??() + { + return 5[735] ?? 6(735, 11552, 31); + } + + public static string ??() + { + return 5[736] ?? 6(736, 11583, 36); + } + + public static string ??() + { + return 5[737] ?? 6(737, 11619, 32); + } + + public static string ??() + { + return 5[738] ?? 6(738, 11651, 36); + } + + public static string ??() + { + return 5[739] ?? 6(739, 11687, 32); + } + + public static string ??() + { + return 5[740] ?? 6(740, 11719, 28); + } + + public static string ??() + { + return 5[741] ?? 6(741, 11747, 34); + } + + public static string ??() + { + return 5[742] ?? 6(742, 11781, 26); + } + + public static string ??() + { + return 5[743] ?? 6(743, 11807, 24); + } + + public static string ??() + { + return 5[744] ?? 6(744, 11831, 20); + } + + public static string ??() + { + return 5[745] ?? 6(745, 11851, 21); + } + + public static string ??() + { + return 5[746] ?? 6(746, 11872, 21); + } + + public static string ??() + { + return 5[747] ?? 6(747, 11893, 22); + } + + public static string ??() + { + return 5[748] ?? 6(748, 11915, 25); + } + + public static string ??() + { + return 5[749] ?? 6(749, 11940, 25); + } + + public static string ??() + { + return 5[750] ?? 6(750, 11965, 21); + } + + public static string ??() + { + return 5[751] ?? 6(751, 11986, 21); + } + + public static string ??() + { + return 5[752] ?? 6(752, 12007, 24); + } + + public static string ??() + { + return 5[753] ?? 6(753, 12031, 27); + } + + public static string ??() + { + return 5[754] ?? 6(754, 12058, 21); + } + + public static string ??() + { + return 5[755] ?? 6(755, 12079, 21); + } + + public static string ??() + { + return 5[756] ?? 6(756, 12100, 22); + } + + public static string ??() + { + return 5[757] ?? 6(757, 12122, 22); + } + + public static string ??() + { + return 5[758] ?? 6(758, 12144, 25); + } + + public static string ??() + { + return 5[759] ?? 6(759, 12169, 21); + } + + public static string ??() + { + return 5[760] ?? 6(760, 12190, 18); + } + + public static string ??() + { + return 5[761] ?? 6(761, 12208, 28); + } + + public static string ??() + { + return 5[762] ?? 6(762, 12236, 27); + } + + public static string ??() + { + return 5[763] ?? 6(763, 12263, 35); + } + + public static string ??() + { + return 5[764] ?? 6(764, 12298, 33); + } + + public static string ??() + { + return 5[765] ?? 6(765, 12331, 29); + } + + public static string ??() + { + return 5[766] ?? 6(766, 12360, 30); + } + + public static string ??() + { + return 5[767] ?? 6(767, 12390, 30); + } + + public static string ??() + { + return 5[768] ?? 6(768, 12420, 34); + } + + public static string ??() + { + return 5[769] ?? 6(769, 12454, 34); + } + + public static string ??() + { + return 5[770] ?? 6(770, 12488, 30); + } + + public static string ??() + { + return 5[771] ?? 6(771, 12518, 30); + } + + public static string ??() + { + return 5[772] ?? 6(772, 12548, 33); + } + + public static string ??() + { + return 5[773] ?? 6(773, 12581, 36); + } + + public static string ??() + { + return 5[774] ?? 6(774, 12617, 30); + } + + public static string ??() + { + return 5[775] ?? 6(775, 12647, 31); + } + + public static string ??() + { + return 5[776] ?? 6(776, 12678, 34); + } + + public static string ??() + { + return 5[777] ?? 6(777, 12712, 30); + } + + public static string ??() + { + return 5[778] ?? 6(778, 12742, 27); + } + + public static string ??() + { + return 5[779] ?? 6(779, 12769, 37); + } + + public static string ??() + { + return 5[780] ?? 6(780, 12806, 36); + } + + public static string ??() + { + return 5[781] ?? 6(781, 12842, 33); + } + + public static string ??() + { + return 5[782] ?? 6(782, 12875, 33); + } + + public static string ??() + { + return 5[783] ?? 6(783, 12908, 38); + } + + public static string ??() + { + return 5[784] ?? 6(784, 12946, 34); + } + + public static string ??() + { + return 5[785] ?? 6(785, 12980, 39); + } + + public static string ??() + { + return 5[786] ?? 6(786, 13019, 35); + } + + public static string ??() + { + return 5[787] ?? 6(787, 13054, 39); + } + + public static string ??() + { + return 5[788] ?? 6(788, 13093, 32); + } + + public static string ??() + { + return 5[789] ?? 6(789, 13125, 32); + } + + public static string ??() + { + return 5[790] ?? 6(790, 13157, 37); + } + + public static string ??() + { + return 5[791] ?? 6(791, 13194, 33); + } + + public static string ??() + { + return 5[792] ?? 6(792, 13227, 29); + } + + public static string ??() + { + return 5[793] ?? 6(793, 13256, 29); + } + + public static string ??() + { + return 5[794] ?? 6(794, 13285, 25); + } + + public static string ??() + { + return 5[795] ?? 6(795, 13310, 35); + } + + public static string ??() + { + return 5[796] ?? 6(796, 13345, 26); + } + + public static string ??() + { + return 5[797] ?? 6(797, 13371, 26); + } + + public static string ??() + { + return 5[798] ?? 6(798, 13397, 26); + } + + public static string ??() + { + return 5[799] ?? 6(799, 13423, 30); + } + + public static string ??() + { + return 5[800] ?? 6(800, 13453, 26); + } + + public static string ??() + { + return 5[801] ?? 6(801, 13479, 30); + } + + public static string ??() + { + return 5[802] ?? 6(802, 13509, 32); + } + + public static string ??() + { + return 5[803] ?? 6(803, 13541, 26); + } + + public static string ??() + { + return 5[804] ?? 6(804, 13567, 36); + } + + public static string ??() + { + return 5[805] ?? 6(805, 13603, 26); + } + + public static string ??() + { + return 5[806] ?? 6(806, 13629, 29); + } + + public static string ??() + { + return 5[807] ?? 6(807, 13658, 26); + } + + public static string ??() + { + return 5[808] ?? 6(808, 13684, 26); + } + + public static string ??() + { + return 5[809] ?? 6(809, 13710, 27); + } + + public static string ??() + { + return 5[810] ?? 6(810, 13737, 33); + } + + public static string ??() + { + return 5[811] ?? 6(811, 13770, 27); + } + + public static string ??() + { + return 5[812] ?? 6(812, 13797, 30); + } + + public static string ??() + { + return 5[813] ?? 6(813, 13827, 23); + } + + public static string ??() + { + return 5[814] ?? 6(814, 13850, 26); + } + + public static string ??() + { + return 5[815] ?? 6(815, 13876, 32); + } + + public static string ??() + { + return 5[816] ?? 6(816, 13908, 35); + } + + public static string ??() + { + return 5[817] ?? 6(817, 13943, 21); + } + + public static string ??() + { + return 5[818] ?? 6(818, 13964, 23); + } + + public static string ??() + { + return 5[819] ?? 6(819, 13987, 26); + } + + public static string ??() + { + return 5[820] ?? 6(820, 14013, 24); + } + + public static string ??() + { + return 5[821] ?? 6(821, 14037, 20); + } + + public static string ??() + { + return 5[822] ?? 6(822, 14057, 13); + } + + public static string ??() + { + return 5[823] ?? 6(823, 14070, 22); + } + + public static string ??() + { + return 5[824] ?? 6(824, 14092, 25); + } + + public static string ??() + { + return 5[825] ?? 6(825, 14117, 21); + } + + public static string ??() + { + return 5[826] ?? 6(826, 14138, 27); + } + + public static string ??() + { + return 5[827] ?? 6(827, 14165, 25); + } + + public static string ??() + { + return 5[828] ?? 6(828, 14190, 15); + } + + public static string ??() + { + return 5[829] ?? 6(829, 14205, 28); + } + + public static string ??() + { + return 5[830] ?? 6(830, 14233, 26); + } + + public static string ??() + { + return 5[831] ?? 6(831, 14259, 16); + } + + public static string ??() + { + return 5[832] ?? 6(832, 14275, 15); + } + + public static string ??() + { + return 5[833] ?? 6(833, 14290, 16); + } + + public static string ??() + { + return 5[834] ?? 6(834, 14306, 27); + } + + public static string ??() + { + return 5[835] ?? 6(835, 14333, 23); + } + + public static string ??() + { + return 5[836] ?? 6(836, 14356, 29); + } + + public static string ??() + { + return 5[837] ?? 6(837, 14385, 27); + } + + public static string ??() + { + return 5[838] ?? 6(838, 14412, 11); + } + + public static string ??() + { + return 5[839] ?? 6(839, 14423, 9); + } + + public static string ??() + { + return 5[840] ?? 6(840, 14432, 14); + } + + public static string ??() + { + return 5[841] ?? 6(841, 14446, 13); + } + + public static string ??() + { + return 5[842] ?? 6(842, 14459, 41); + } + + public static string ??() + { + return 5[843] ?? 6(843, 14500, 37); + } + + public static string ??() + { + return 5[844] ?? 6(844, 14537, 40); + } + + public static string ??() + { + return 5[845] ?? 6(845, 14577, 12); + } + + public static string ??() + { + return 5[846] ?? 6(846, 14589, 38); + } + + public static string ??() + { + return 5[847] ?? 6(847, 14627, 34); + } + + public static string ??() + { + return 5[848] ?? 6(848, 14661, 45); + } + + public static string ??() + { + return 5[849] ?? 6(849, 14706, 36); + } + + public static string ??() + { + return 5[850] ?? 6(850, 14742, 32); + } + + public static string ??() + { + return 5[851] ?? 6(851, 14774, 33); + } + + public static string ??() + { + return 5[852] ?? 6(852, 14807, 32); + } + + public static string ??() + { + return 5[853] ?? 6(853, 14839, 37); + } + + public static string ??() + { + return 5[854] ?? 6(854, 14876, 42); + } + + public static string ??() + { + return 5[855] ?? 6(855, 14918, 42); + } + + public static string ??() + { + return 5[856] ?? 6(856, 14960, 46); + } + + public static string ??() + { + return 5[857] ?? 6(857, 15006, 35); + } + + public static string ??() + { + return 5[858] ?? 6(858, 15041, 38); + } + + public static string ??() + { + return 5[859] ?? 6(859, 15079, 39); + } + + public static string ??() + { + return 5[860] ?? 6(860, 15118, 42); + } + + public static string ??() + { + return 5[861] ?? 6(861, 15160, 36); + } + + public static string ??() + { + return 5[862] ?? 6(862, 15196, 46); + } + + public static string ??() + { + return 5[863] ?? 6(863, 15242, 34); + } + + public static string ??() + { + return 5[864] ?? 6(864, 15276, 23); + } + + public static string ??() + { + return 5[865] ?? 6(865, 15299, 40); + } + + public static string ??() + { + return 5[866] ?? 6(866, 15339, 27); + } + + public static string ??() + { + return 5[867] ?? 6(867, 15366, 33); + } + + public static string ??() + { + return 5[868] ?? 6(868, 15399, 33); + } + + public static string ??() + { + return 5[869] ?? 6(869, 15432, 41); + } + + public static string ??() + { + return 5[870] ?? 6(870, 15473, 22); + } + + public static string ??() + { + return 5[871] ?? 6(871, 15495, 15); + } + + public static string ??() + { + return 5[872] ?? 6(872, 15510, 39); + } + + public static string ??() + { + return 5[873] ?? 6(873, 15549, 34); + } + + public static string ??() + { + return 5[874] ?? 6(874, 15583, 34); + } + + public static string ??() + { + return 5[875] ?? 6(875, 15617, 21); + } + + public static string ??() + { + return 5[876] ?? 6(876, 15638, 37); + } + + public static string ??() + { + return 5[877] ?? 6(877, 15675, 40); + } + + public static string ??() + { + return 5[878] ?? 6(878, 15715, 35); + } + + public static string ??() + { + return 5[879] ?? 6(879, 15750, 33); + } + + public static string ??() + { + return 5[880] ?? 6(880, 15783, 38); + } + + public static string ??() + { + return 5[881] ?? 6(881, 15821, 36); + } + + public static string ??() + { + return 5[882] ?? 6(882, 15857, 41); + } + + public static string ??() + { + return 5[883] ?? 6(883, 15898, 42); + } + + public static string ??() + { + return 5[884] ?? 6(884, 15940, 38); + } + + public static string ??() + { + return 5[885] ?? 6(885, 15978, 43); + } + + public static string ??() + { + return 5[886] ?? 6(886, 16021, 7); + } + + public static string ??() + { + return 5[887] ?? 6(887, 16028, 17); + } + + public static string ??() + { + return 5[888] ?? 6(888, 16045, 16); + } + + public static string ??() + { + return 5[889] ?? 6(889, 16061, 9); + } + + public static string ??() + { + return 5[890] ?? 6(890, 16070, 21); + } + + public static string ??() + { + return 5[891] ?? 6(891, 16091, 26); + } + + public static string ??() + { + return 5[892] ?? 6(892, 16117, 31); + } + + public static string ??() + { + return 5[893] ?? 6(893, 16148, 11); + } + + public static string ??() + { + return 5[894] ?? 6(894, 16159, 23); + } + + public static string ??() + { + return 5[895] ?? 6(895, 16182, 28); + } + + public static string ??() + { + return 5[896] ?? 6(896, 16210, 16); + } + + public static string ??() + { + return 5[897] ?? 6(897, 16226, 23); + } + + public static string ??() + { + return 5[898] ?? 6(898, 16249, 23); + } + + public static string ??() + { + return 5[899] ?? 6(899, 16272, 22); + } + + public static string ??() + { + return 5[900] ?? 6(900, 16294, 20); + } + + public static string ??() + { + return 5[901] ?? 6(901, 16314, 17); + } + + public static string ??() + { + return 5[902] ?? 6(902, 16331, 25); + } + + public static string ??() + { + return 5[903] ?? 6(903, 16356, 25); + } + + public static string ??() + { + return 5[904] ?? 6(904, 16381, 35); + } + + public static string ??() + { + return 5[905] ?? 6(905, 16416, 31); + } + + public static string ??() + { + return 5[906] ?? 6(906, 16447, 17); + } + + public static string ??() + { + return 5[907] ?? 6(907, 16464, 17); + } + + public static string ??() + { + return 5[908] ?? 6(908, 16481, 15); + } + + public static string ??() + { + return 5[909] ?? 6(909, 16496, 17); + } + + public static string ??() + { + return 5[910] ?? 6(910, 16513, 15); + } + + public static string ??() + { + return 5[911] ?? 6(911, 16528, 25); + } + + public static string ??() + { + return 5[912] ?? 6(912, 16553, 24); + } + + public static string ??() + { + return 5[913] ?? 6(913, 16577, 9); + } + + public static string ??() + { + return 5[914] ?? 6(914, 16586, 26); + } + + public static string ??() + { + return 5[915] ?? 6(915, 16612, 19); + } + + public static string ??() + { + return 5[916] ?? 6(916, 16631, 16); + } + + public static string ??() + { + return 5[917] ?? 6(917, 16647, 31); + } + + public static string ??() + { + return 5[918] ?? 6(918, 16678, 31); + } + + public static string ??() + { + return 5[919] ?? 6(919, 16709, 32); + } + + public static string ??() + { + return 5[920] ?? 6(920, 16741, 22); + } + + public static string ??() + { + return 5[921] ?? 6(921, 16763, 15); + } + + public static string ??() + { + return 5[922] ?? 6(922, 16778, 20); + } + + public static string ??() + { + return 5[923] ?? 6(923, 16798, 21); + } + + public static string ??() + { + return 5[924] ?? 6(924, 16819, 20); + } + + public static string ??() + { + return 5[925] ?? 6(925, 16839, 19); + } + + public static string ??() + { + return 5[926] ?? 6(926, 16858, 20); + } + + public static string ??() + { + return 5[927] ?? 6(927, 16878, 28); + } + + public static string ??() + { + return 5[928] ?? 6(928, 16906, 32); + } + + public static string ??() + { + return 5[929] ?? 6(929, 16938, 6); + } + + public static string ??() + { + return 5[930] ?? 6(930, 16944, 64); + } + + public static string ??() + { + return 5[931] ?? 6(931, 17008, 15); + } + + public static string ??() + { + return 5[932] ?? 6(932, 17023, 23); + } + + public static string ??() + { + return 5[933] ?? 6(933, 17046, 17); + } + + public static string ??() + { + return 5[934] ?? 6(934, 17063, 54); + } + + public static string ??() + { + return 5[935] ?? 6(935, 17117, 56); + } + + public static string ??() + { + return 5[936] ?? 6(936, 17173, 36); + } + + public static string ??() + { + return 5[937] ?? 6(937, 17209, 37); + } + + public static string ??() + { + return 5[938] ?? 6(938, 17246, 39); + } + + public static string ??() + { + return 5[939] ?? 6(939, 17285, 5); + } + + public static string ??() + { + return 5[940] ?? 6(940, 17290, 9); + } + + public static string ??() + { + return 5[941] ?? 6(941, 17299, 10); + } + + public static string ??() + { + return 5[942] ?? 6(942, 17309, 13); + } + + public static string ??() + { + return 5[943] ?? 6(943, 17322, 17); + } + + public static string ??() + { + return 5[944] ?? 6(944, 17339, 20); + } + + public static string ??() + { + return 5[945] ?? 6(945, 17359, 32); + } + + public static string ??() + { + return 5[946] ?? 6(946, 17391, 3); + } + + public static string ??() + { + return 5[947] ?? 6(947, 17394, 51); + } + + public static string ??() + { + return 5[948] ?? 6(948, 17445, 1); + } + + public static string ??() + { + return 5[949] ?? 6(949, 17446, 30); + } + + public static string ??() + { + return 5[950] ?? 6(950, 17476, 52); + } + + public static string ??() + { + return 5[951] ?? 6(951, 17528, 25); + } + + public static string ??() + { + return 5[952] ?? 6(952, 17553, 26); + } + + public static string ??() + { + return 5[953] ?? 6(953, 17579, 40); + } + + public static string ??() + { + return 5[954] ?? 6(954, 17619, 40); + } + + public static string ??() + { + return 5[955] ?? 6(955, 17659, 4); + } + + public static string ??() + { + return 5[956] ?? 6(956, 17663, 24); + } + + public static string ??() + { + return 5[957] ?? 6(957, 17687, 12); + } + + public static string ??() + { + return 5[958] ?? 6(958, 17699, 2); + } + + public static string ??() + { + return 5[959] ?? 6(959, 17701, 9); + } + + public static string ??() + { + return 5[960] ?? 6(960, 17710, 9); + } + + public static string ??() + { + return 5[961] ?? 6(961, 17719, 7); + } + + public static string ??() + { + return 5[962] ?? 6(962, 17726, 10); + } + + public static string ??() + { + return 5[963] ?? 6(963, 17736, 8); + } + + public static string ??() + { + return 5[964] ?? 6(964, 17744, 13); + } + + public static string ??() + { + return 5[965] ?? 6(965, 17757, 13); + } + + public static string ??() + { + return 5[966] ?? 6(966, 17770, 7); + } + + public static string ??() + { + return 5[967] ?? 6(967, 17777, 6); + } + + public static string ??() + { + return 5[968] ?? 6(968, 17783, 5); + } + + public static string ??() + { + return 5[969] ?? 6(969, 17788, 10); + } + + public static string ??() + { + return 5[970] ?? 6(970, 17798, 12); + } + + public static string ??() + { + return 5[971] ?? 6(971, 17810, 11); + } + + public static string ??() + { + return 5[972] ?? 6(972, 17821, 22); + } + + public static string ??() + { + return 5[973] ?? 6(973, 17843, 24); + } + + public static string ??() + { + return 5[974] ?? 6(974, 17867, 6); + } + + public static string ??() + { + return 5[975] ?? 6(975, 17873, 7); + } + + public static string ??() + { + return 5[976] ?? 6(976, 17880, 1); + } + + public static string ??() + { + return 5[977] ?? 6(977, 17881, 6); + } + + public static string ??() + { + return 5[978] ?? 6(978, 17887, 11); + } + + public static string ??() + { + return 5[979] ?? 6(979, 17898, 10); + } + + public static string ??() + { + return 5[980] ?? 6(980, 17908, 8); + } + + public static string ??() + { + return 5[981] ?? 6(981, 17916, 4); + } + + public static string ??() + { + return 5[982] ?? 6(982, 17920, 12); + } + + public static string ??() + { + return 5[983] ?? 6(983, 17932, 44); + } + + public static string ??() + { + return 5[984] ?? 6(984, 17976, 6); + } + + public static string ??() + { + return 5[985] ?? 6(985, 17982, 11); + } + + public static string ??() + { + return 5[986] ?? 6(986, 17993, 4); + } + + public static string ??() + { + return 5[987] ?? 6(987, 17997, 7); + } + + public static string ??() + { + return 5[988] ?? 6(988, 18004, 8); + } + + public static string ??() + { + return 5[989] ?? 6(989, 18012, 4); + } + + public static string ??() + { + return 5[990] ?? 6(990, 18016, 9); + } + + public static string ??() + { + return 5[991] ?? 6(991, 18025, 9); + } + + public static string ??() + { + return 5[992] ?? 6(992, 18034, 8); + } + + public static string ??() + { + return 5[993] ?? 6(993, 18042, 4); + } + + public static string ??() + { + return 5[994] ?? 6(994, 18046, 9); + } + + public static string ??() + { + return 5[995] ?? 6(995, 18055, 12); + } + + public static string ??() + { + return 5[996] ?? 6(996, 18067, 18); + } + + public static string ??() + { + return 5[997] ?? 6(997, 18085, 7); + } + + public static string ??() + { + return 5[998] ?? 6(998, 18092, 18); + } + + public static string ??() + { + return 5[999] ?? 6(999, 18110, 13); + } + + public static string ??() + { + return 5[1000] ?? 6(1000, 18123, 2); + } + + public static string ??() + { + return 5[1001] ?? 6(1001, 18125, 38); + } + + public static string ??() + { + return 5[1002] ?? 6(1002, 18163, 16); + } + + public static string ??() + { + return 5[1003] ?? 6(1003, 18179, 14); + } + + public static string ??() + { + return 5[1004] ?? 6(1004, 18193, 20); + } + + public static string ??() + { + return 5[1005] ?? 6(1005, 18213, 4); + } + + public static string ??() + { + return 5[1006] ?? 6(1006, 18217, 13); + } + + public static string ??() + { + return 5[1007] ?? 6(1007, 18230, 4); + } + + public static string ??() + { + return 5[1008] ?? 6(1008, 18234, 2); + } + + public static string ??() + { + return 5[1009] ?? 6(1009, 18236, 2); + } + + public static string ??() + { + return 5[1010] ?? 6(1010, 18238, 5); + } + + public static string ??() + { + return 5[1011] ?? 6(1011, 18243, 8); + } + + public static string ??() + { + return 5[1012] ?? 6(1012, 18251, 16); + } + + public static string ??() + { + return 5[1013] ?? 6(1013, 18267, 8); + } + + public static string ??() + { + return 5[1014] ?? 6(1014, 18275, 6); + } + + public static string ??() + { + return 5[1015] ?? 6(1015, 18281, 10); + } + + public static string ??() + { + return 5[1016] ?? 6(1016, 18291, 18); + } + + public static string ??() + { + return 5[1017] ?? 6(1017, 18309, 5); + } + + public static string ??() + { + return 5[1018] ?? 6(1018, 18314, 16); + } + + public static string ??() + { + return 5[1019] ?? 6(1019, 18330, 10); + } + + public static string ??() + { + return 5[1020] ?? 6(1020, 18340, 18); + } + + public static string ??() + { + return 5[1021] ?? 6(1021, 18358, 2); + } + + public static string ??() + { + return 5[1022] ?? 6(1022, 18360, 3); + } + + public static string ??() + { + return 5[1023] ?? 6(1023, 18363, 12); + } + + public static string ??() + { + return 5[1024] ?? 6(1024, 18375, 10); + } + + public static string ??() + { + return 5[1025] ?? 6(1025, 18385, 11); + } + + public static string ??() + { + return 5[1026] ?? 6(1026, 18396, 17); + } + + public static string ??() + { + return 5[1027] ?? 6(1027, 18413, 8); + } + + public static string ??() + { + return 5[1028] ?? 6(1028, 18421, 8); + } + + public static string ??() + { + return 5[1029] ?? 6(1029, 18429, 9); + } + + public static string ??() + { + return 5[1030] ?? 6(1030, 18438, 22); + } + + public static string ??() + { + return 5[1031] ?? 6(1031, 18460, 17); + } + + public static string ??() + { + return 5[1032] ?? 6(1032, 18477, 14); + } + + public static string ??() + { + return 5[1033] ?? 6(1033, 18491, 28); + } + + public static string ??() + { + return 5[1034] ?? 6(1034, 18519, 19); + } + + public static string ??() + { + return 5[1035] ?? 6(1035, 18538, 132); + } + + public static string ??() + { + return 5[1036] ?? 6(1036, 18670, 20); + } + + public static string ??() + { + return 5[1037] ?? 6(1037, 18690, 24); + } + + public static string ??() + { + return 5[1038] ?? 6(1038, 18714, 22); + } + + public static string ??() + { + return 5[1039] ?? 6(1039, 18736, 17); + } + + public static string ??() + { + return 5[1040] ?? 6(1040, 18753, 19); + } + + public static string ??() + { + return 5[1041] ?? 6(1041, 18772, 24); + } + + public static string ??() + { + return 5[1042] ?? 6(1042, 18796, 18); + } + + public static string ??() + { + return 5[1043] ?? 6(1043, 18814, 16); + } + + public static string ??() + { + return 5[1044] ?? 6(1044, 18830, 20); + } + + public static string ??() + { + return 5[1045] ?? 6(1045, 18850, 27); + } + + public static string ??() + { + return 5[1046] ?? 6(1046, 18877, 18); + } + + public static string ??() + { + return 5[1047] ?? 6(1047, 18895, 17); + } + + public static string ??() + { + return 5[1048] ?? 6(1048, 18912, 29); + } + + public static string ??() + { + return 5[1049] ?? 6(1049, 18941, 26); + } + + public static string ??() + { + return 5[1050] ?? 6(1050, 18967, 22); + } + + public static string ??() + { + return 5[1051] ?? 6(1051, 18989, 10); + } + + public static string ??() + { + return 5[1052] ?? 6(1052, 18999, 18); + } + + public static string ??() + { + return 5[1053] ?? 6(1053, 19017, 14); + } + + public static string ??() + { + return 5[1054] ?? 6(1054, 19031, 23); + } + + public static string ??() + { + return 5[1055] ?? 6(1055, 19054, 23); + } + + public static string ??() + { + return 5[1056] ?? 6(1056, 19077, 9); + } + + public static string ??() + { + return 5[1057] ?? 6(1057, 19086, 54); + } + + public static string ??() + { + return 5[1058] ?? 6(1058, 19140, 36); + } + + public static string ??() + { + return 5[1059] ?? 6(1059, 19176, 58); + } + + public static string ??() + { + return 5[1060] ?? 6(1060, 19234, 15); + } + + public static string ??() + { + return 5[1061] ?? 6(1061, 19249, 25); + } + + public static string ??() + { + return 5[1062] ?? 6(1062, 19274, 28); + } + + public static string ??() + { + return 5[1063] ?? 6(1063, 19302, 17); + } + + public static string ??() + { + return 5[1064] ?? 6(1064, 19319, 7); + } + + public static string ??() + { + return 5[1065] ?? 6(1065, 19326, 9); + } + + public static string ??() + { + return 5[1066] ?? 6(1066, 19335, 13); + } + + public static string ??() + { + return 5[1067] ?? 6(1067, 19348, 13); + } + + public static string ??() + { + return 5[1068] ?? 6(1068, 19361, 10); + } + + public static string ??() + { + return 5[1069] ?? 6(1069, 19371, 11); + } + + public static string ??() + { + return 5[1070] ?? 6(1070, 19382, 12); + } + + public static string ??() + { + return 5[1071] ?? 6(1071, 19394, 9); + } + + public static string ??() + { + return 5[1072] ?? 6(1072, 19403, 45); + } + + public static string ??() + { + return 5[1073] ?? 6(1073, 19448, 4); + } + + public static string ??() + { + return 5[1074] ?? 6(1074, 19452, 19); + } + + public static string ??() + { + return 5[1075] ?? 6(1075, 19471, 12); + } + + public static string ??() + { + return 5[1076] ?? 6(1076, 19483, 18); + } + + public static string ??() + { + return 5[1077] ?? 6(1077, 19501, 13); + } + + public static string ??() + { + return 5[1078] ?? 6(1078, 19514, 17); + } + + public static string ??() + { + return 5[1079] ?? 6(1079, 19531, 13); + } + + public static string ??() + { + return 5[1080] ?? 6(1080, 19544, 17); + } + + public static string ??() + { + return 5[1081] ?? 6(1081, 19561, 29); + } + + public static string ??() + { + return 5[1082] ?? 6(1082, 19590, 27); + } + + public static string ??() + { + return 5[1083] ?? 6(1083, 19617, 14); + } + + public static string ??() + { + return 5[1084] ?? 6(1084, 19631, 18); + } + + public static string ??() + { + return 5[1085] ?? 6(1085, 19649, 25); + } + + public static string ??() + { + return 5[1086] ?? 6(1086, 19674, 34); + } + + public static string ??() + { + return 5[1087] ?? 6(1087, 19708, 13); + } + + public static string ??() + { + return 5[1088] ?? 6(1088, 19721, 21); + } + + public static string ??() + { + return 5[1089] ?? 6(1089, 19742, 47); + } + + public static string ??() + { + return 5[1090] ?? 6(1090, 19789, 8); + } + + public static string ??() + { + return 5[1091] ?? 6(1091, 19797, 7); + } + + public static string ??() + { + return 5[1092] ?? 6(1092, 19804, 5); + } + + public static string ??() + { + return 5[1093] ?? 6(1093, 19809, 10); + } + + public static string ??() + { + return 5[1094] ?? 6(1094, 19819, 4); + } + + public static string ??() + { + return 5[1095] ?? 6(1095, 19823, 7); + } + + public static string ??() + { + return 5[1096] ?? 6(1096, 19830, 8); + } + + public static string ??() + { + return 5[1097] ?? 6(1097, 19838, 12); + } + + public static string ??() + { + return 5[1098] ?? 6(1098, 19850, 2); + } + + public static string ??() + { + return 5[1099] ?? 6(1099, 19852, 4); + } + + public static string ??() + { + return 5[1100] ?? 6(1100, 19856, 30); + } + + public static string ??() + { + return 5[1101] ?? 6(1101, 19886, 8); + } + + public static string ??() + { + return 5[1102] ?? 6(1102, 19894, 16); + } + + public static string ??() + { + return 5[1103] ?? 6(1103, 19910, 18); + } + + public static string ??() + { + return 5[1104] ?? 6(1104, 19928, 12); + } + + public static string ??() + { + return 5[1105] ?? 6(1105, 19940, 14); + } + + public static string ??() + { + return 5[1106] ?? 6(1106, 19954, 6); + } + + public static string ??() + { + return 5[1107] ?? 6(1107, 19960, 5); + } + + public static string ??() + { + return 5[1108] ?? 6(1108, 19965, 49); + } + + public static string ??() + { + return 5[1109] ?? 6(1109, 20014, 48); + } + + public static string ??() + { + return 5[1110] ?? 6(1110, 20062, 52); + } + + public static string ??() + { + return 5[1111] ?? 6(1111, 20114, 51); + } + + public static string ??() + { + return 5[1112] ?? 6(1112, 20165, 54); + } + + public static string ??() + { + return 5[1113] ?? 6(1113, 20219, 53); + } + + public static string ??() + { + return 5[1114] ?? 6(1114, 20272, 44); + } + + public static string ??() + { + return 5[1115] ?? 6(1115, 20316, 42); + } + + public static string ??() + { + return 5[1116] ?? 6(1116, 20358, 13); + } + + public static string ??() + { + return 5[1117] ?? 6(1117, 20371, 17); + } + + public static string ??() + { + return 5[1118] ?? 6(1118, 20388, 26); + } + + public static string ??() + { + return 5[1119] ?? 6(1119, 20414, 15); + } + + public static string ??() + { + return 5[1120] ?? 6(1120, 20429, 29); + } + + public static string ??() + { + return 5[1121] ?? 6(1121, 20458, 15); + } + + public static string ??() + { + return 5[1122] ?? 6(1122, 20473, 10); + } + + public static string ??() + { + return 5[1123] ?? 6(1123, 20483, 11); + } + + public static string ??() + { + return 5[1124] ?? 6(1124, 20494, 15); + } + + public static string ??() + { + return 5[1125] ?? 6(1125, 20509, 12); + } + + public static string ??() + { + return 5[1126] ?? 6(1126, 20521, 6); + } + + public static string ??() + { + return 5[1127] ?? 6(1127, 20527, 9); + } + + public static string ??() + { + return 5[1128] ?? 6(1128, 20536, 11); + } + + public static string ??() + { + return 5[1129] ?? 6(1129, 20547, 30); + } + + public static string ??() + { + return 5[1130] ?? 6(1130, 20577, 37); + } + + public static string ??() + { + return 5[1131] ?? 6(1131, 20614, 10); + } + + public static string ??() + { + return 5[1132] ?? 6(1132, 20624, 48); + } + + public static string ??() + { + return 5[1133] ?? 6(1133, 20672, 13); + } + + public static string ??() + { + return 5[1134] ?? 6(1134, 20685, 49); + } + + public static string ??() + { + return 5[1135] ?? 6(1135, 20734, 14); + } + + public static string ??() + { + return 5[1136] ?? 6(1136, 20748, 38); + } + + public static string ??() + { + return 5[1137] ?? 6(1137, 20786, 7); + } + + public static string ??() + { + return 5[1138] ?? 6(1138, 20793, 23); + } + + public static string ??() + { + return 5[1139] ?? 6(1139, 20816, 32); + } + + public static string ??() + { + return 5[1140] ?? 6(1140, 20848, 30); + } + + public static string ??() + { + return 5[1141] ?? 6(1141, 20878, 11); + } + + public static string ??() + { + return 5[1142] ?? 6(1142, 20889, 24); + } + + public static string ??() + { + return 5[1143] ?? 6(1143, 20913, 31); + } + + public static string ??() + { + return 5[1144] ?? 6(1144, 20944, 97); + } + + public static string ??() + { + return 5[1145] ?? 6(1145, 21041, 10); + } + + public static string ??() + { + return 5[1146] ?? 6(1146, 21051, 17); + } + + public static string ??() + { + return 5[1147] ?? 6(1147, 21068, 34); + } + + public static string ??() + { + return 5[1148] ?? 6(1148, 21102, 107); + } + + public static string ??() + { + return 5[1149] ?? 6(1149, 21209, 11); + } + + public static string ??() + { + return 5[1150] ?? 6(1150, 21220, 7); + } + + public static string ??() + { + return 5[1151] ?? 6(1151, 21227, 12); + } + + public static string ??() + { + return 5[1152] ?? 6(1152, 21239, 12); + } + + public static string ??() + { + return 5[1153] ?? 6(1153, 21251, 11); + } + + public static string ??() + { + return 5[1154] ?? 6(1154, 21262, 100); + } + + public static string ??() + { + return 5[1155] ?? 6(1155, 21362, 22); + } + + public static string ??() + { + return 5[1156] ?? 6(1156, 21384, 5); + } + + public static string ??() + { + return 5[1157] ?? 6(1157, 21389, 14); + } + + public static string ??() + { + return 5[1158] ?? 6(1158, 21403, 16); + } + + public static string ??() + { + return 5[1159] ?? 6(1159, 21419, 13); + } + + public static string ??() + { + return 5[1160] ?? 6(1160, 21432, 4); + } + + public static string ??() + { + return 5[1161] ?? 6(1161, 21436, 9); + } + + public static string ??() + { + return 5[1162] ?? 6(1162, 21445, 7); + } + + public static string ??() + { + return 5[1163] ?? 6(1163, 21452, 6); + } + + public static string ??() + { + return 5[1164] ?? 6(1164, 21458, 7); + } + + public static string ??() + { + return 5[1165] ?? 6(1165, 21465, 8); + } + + public static string ??() + { + return 5[1166] ?? 6(1166, 21473, 18); + } + + public static string ??() + { + return 5[1167] ?? 6(1167, 21491, 5); + } + + public static string ??() + { + return 5[1168] ?? 6(1168, 21496, 15); + } + + public static string ??() + { + return 5[1169] ?? 6(1169, 21511, 7); + } + + public static string ??() + { + return 5[1170] ?? 6(1170, 21518, 18); + } + + public static string ??() + { + return 5[1171] ?? 6(1171, 21536, 8); + } + + public static string ??() + { + return 5[1172] ?? 6(1172, 21544, 8); + } + + public static string ??() + { + return 5[1173] ?? 6(1173, 21552, 13); + } + + public static string ??() + { + return 5[1174] ?? 6(1174, 21565, 17); + } + + public static string ??() + { + return 5[1175] ?? 6(1175, 21582, 111); + } + + public static string ??() + { + return 5[1176] ?? 6(1176, 21693, 114); + } + + public static string ??() + { + return 5[1177] ?? 6(1177, 21807, 165); + } + + public static string ??() + { + return 5[1178] ?? 6(1178, 21972, 8); + } + + public static string ??() + { + return 5[1179] ?? 6(1179, 21980, 4); + } + + public static string ??() + { + return 5[1180] ?? 6(1180, 21984, 10); + } + + public static string ??() + { + return 5[1181] ?? 6(1181, 21994, 11); + } + + public static string ??() + { + return 5[1182] ?? 6(1182, 22005, 4); + } + + public static string ??() + { + return 5[1183] ?? 6(1183, 22009, 8); + } + + public static string ??() + { + return 5[1184] ?? 6(1184, 22017, 9); + } + + public static string ??() + { + return 5[1185] ?? 6(1185, 22026, 2); + } + + public static string ??() + { + return 5[1186] ?? 6(1186, 22028, 12); + } + + public static string ??() + { + return 5[1187] ?? 6(1187, 22040, 10); + } + + public static string ??() + { + return 5[1188] ?? 6(1188, 22050, 8); + } + + public static string ??() + { + return 5[1189] ?? 6(1189, 22058, 11); + } + + public static string ??() + { + return 5[1190] ?? 6(1190, 22069, 8); + } + + public static string ??() + { + return 5[1191] ?? 6(1191, 22077, 12); + } + + public static string ??() + { + return 5[1192] ?? 6(1192, 22089, 8); + } + + public static string ??() + { + return 5[1193] ?? 6(1193, 22097, 8); + } + + public static string ??() + { + return 5[1194] ?? 6(1194, 22105, 17); + } + + public static string ??() + { + return 5[1195] ?? 6(1195, 22122, 11); + } + + public static string ??() + { + return 5[1196] ?? 6(1196, 22133, 43); + } + + public static string ??() + { + return 5[1197] ?? 6(1197, 22176, 21); + } + + public static string ??() + { + return 5[1198] ?? 6(1198, 22197, 5); + } + + public static string ??() + { + return 5[1199] ?? 6(1199, 22202, 5); + } + + public static string ??() + { + return 5[1200] ?? 6(1200, 22207, 8); + } + + public static string ??() + { + return 5[1201] ?? 6(1201, 22215, 46); + } + + public static string ??() + { + return 5[1202] ?? 6(1202, 22261, 46); + } + + public static string ??() + { + return 5[1203] ?? 6(1203, 22307, 11); + } + + public static string ??() + { + return 5[1204] ?? 6(1204, 22318, 4); + } + + public static string ??() + { + return 5[1205] ?? 6(1205, 22322, 45); + } + + public static string ??() + { + return 5[1206] ?? 6(1206, 22367, 4); + } + + public static string ??() + { + return 5[1207] ?? 6(1207, 22371, 23); + } + + public static string ??() + { + return 5[1208] ?? 6(1208, 22394, 27); + } + + public static string ??() + { + return 5[1209] ?? 6(1209, 22421, 36); + } + + public static string ??() + { + return 5[1210] ?? 6(1210, 22457, 45); + } + + public static string ??() + { + return 5[1211] ?? 6(1211, 22502, 3); + } + + public static string ??() + { + return 5[1212] ?? 6(1212, 22505, 28); + } + + public static string ??() + { + return 5[1213] ?? 6(1213, 22533, 16); + } + + public static string ??() + { + return 5[1214] ?? 6(1214, 22549, 19); + } + + public static string ??() + { + return 5[1215] ?? 6(1215, 22568, 124); + } + + public static string ??() + { + return 5[1216] ?? 6(1216, 22692, 1); + } + + public static string ??() + { + return 5[1217] ?? 6(1217, 22693, 1); + } + + public static string ??() + { + return 5[1218] ?? 6(1218, 22694, 1); + } + + public static string ??() + { + return 5[1219] ?? 6(1219, 22695, 1); + } + + public static string ??() + { + return 5[1220] ?? 6(1220, 22696, 1); + } + + public static string ??() + { + return 5[1221] ?? 6(1221, 22697, 10); + } + + public static string ??() + { + return 5[1222] ?? 6(1222, 22707, 16); + } + + public static string ??() + { + return 5[1223] ?? 6(1223, 22723, 16); + } + + public static string ??() + { + return 5[1224] ?? 6(1224, 22739, 133); + } + + public static string ??() + { + return 5[1225] ?? 6(1225, 22872, 15); + } + + public static string ??() + { + return 5[1226] ?? 6(1226, 22887, 14); + } + + public static string ??() + { + return 5[1227] ?? 6(1227, 22901, 16); + } + + public static string ??() + { + return 5[1228] ?? 6(1228, 22917, 9); + } + + public static string ??() + { + return 5[1229] ?? 6(1229, 22926, 65); + } + + public static string ??() + { + return 5[1230] ?? 6(1230, 22991, 31); + } + + public static string ??() + { + return 5[1231] ?? 6(1231, 23022, 48); + } + + public static string ??() + { + return 5[1232] ?? 6(1232, 23070, 8); + } + + public static string ??() + { + return 5[1233] ?? 6(1233, 23078, 70); + } + + public static string ??() + { + return 5[1234] ?? 6(1234, 23148, 36); + } + + public static string ??() + { + return 5[1235] ?? 6(1235, 23184, 9); + } + + public static string ??() + { + return 5[1236] ?? 6(1236, 23193, 26); + } + + public static string ??() + { + return 5[1237] ?? 6(1237, 23219, 4); + } + + public static string ??() + { + return 5[1238] ?? 6(1238, 23223, 14); + } + + public static string ??() + { + return 5[1239] ?? 6(1239, 23237, 30); + } + + public static string ??() + { + return 5[1240] ?? 6(1240, 23267, 4); + } + + public static string ??() + { + return 5[1241] ?? 6(1241, 23271, 2); + } + + public static string ??() + { + return 5[1242] ?? 6(1242, 23273, 30); + } + + public static string ??() + { + return 5[1243] ?? 6(1243, 23303, 11); + } + + public static string ??() + { + return 5[1244] ?? 6(1244, 23314, 11); + } + + public static string ??() + { + return 5[1245] ?? 6(1245, 23325, 21); + } + + public static string ??() + { + return 5[1246] ?? 6(1246, 23346, 14); + } + + public static string ??() + { + return 5[1247] ?? 6(1247, 23360, 8); + } + + public static string ??() + { + return 5[1248] ?? 6(1248, 23368, 14); + } + + public static string ??() + { + return 5[1249] ?? 6(1249, 23382, 8); + } + + public static string ??() + { + return 5[1250] ?? 6(1250, 23390, 12); + } + + public static string ??() + { + return 5[1251] ?? 6(1251, 23402, 14); + } + + public static string ??() + { + return 5[1252] ?? 6(1252, 23416, 12); + } + + public static string ??() + { + return 5[1253] ?? 6(1253, 23428, 17); + } + + public static string ??() + { + return 5[1254] ?? 6(1254, 23445, 19); + } + + public static string ??() + { + return 5[1255] ?? 6(1255, 23464, 16); + } + + public static string ??() + { + return 5[1256] ?? 6(1256, 23480, 20); + } + + public static string ??() + { + return 5[1257] ?? 6(1257, 23500, 9); + } + + public static string ??() + { + return 5[1258] ?? 6(1258, 23509, 11); + } + + public static string ??() + { + return 5[1259] ?? 6(1259, 23520, 14); + } + + public static string ??() + { + return 5[1260] ?? 6(1260, 23534, 15); + } + + public static string ??() + { + return 5[1261] ?? 6(1261, 23549, 15); + } + + public static string ??() + { + return 5[1262] ?? 6(1262, 23564, 71); + } + + public static string ??() + { + return 5[1263] ?? 6(1263, 23635, 78); + } + + public static string ??() + { + return 5[1264] ?? 6(1264, 23713, 80); + } + + public static string ??() + { + return 5[1265] ?? 6(1265, 23793, 77); + } + + public static string ??() + { + return 5[1266] ?? 6(1266, 23870, 80); + } + + public static string ??() + { + return 5[1267] ?? 6(1267, 23950, 4); + } + + public static string ??() + { + return 5[1268] ?? 6(1268, 23954, 93); + } + + public static string ??() + { + return 5[1269] ?? 6(1269, 24047, 17); + } + + public static string ??() + { + return 5[1270] ?? 6(1270, 24064, 9); + } + + public static string ??() + { + return 5[1271] ?? 6(1271, 24073, 12); + } + + public static string ??() + { + return 5[1272] ?? 6(1272, 24085, 9); + } + + public static string ??() + { + return 5[1273] ?? 6(1273, 24094, 43); + } + + public static string ??() + { + return 5[1274] ?? 6(1274, 24137, 29); + } + + public static string ??() + { + return 5[1275] ?? 6(1275, 24166, 38); + } + + public static string ??() + { + return 5[1276] ?? 6(1276, 24204, 22); + } + + public static string ??() + { + return 5[1277] ?? 6(1277, 24226, 127); + } + + public static string ??() + { + return 5[1278] ?? 6(1278, 24353, 39); + } + + public static string ??() + { + return 5[1279] ?? 6(1279, 24392, 29); + } + + public static string ??() + { + return 5[1280] ?? 6(1280, 24421, 30); + } + + public static string ??() + { + return 5[1281] ?? 6(1281, 24451, 153); + } + + public static string ??() + { + return 5[1282] ?? 6(1282, 24604, 53); + } + + public static string ??() + { + return 5[1283] ?? 6(1283, 24657, 21); + } + + public static string ??() + { + return 5[1284] ?? 6(1284, 24678, 38); + } + + public static string ??() + { + return 5[1285] ?? 6(1285, 24716, 15); + } + + public static string ??() + { + return 5[1286] ?? 6(1286, 24731, 21); + } + + public static string ??() + { + return 5[1287] ?? 6(1287, 24752, 38); + } + + public static string ??() + { + return 5[1288] ?? 6(1288, 24790, 2); + } + + public static string ??() + { + return 5[1289] ?? 6(1289, 24792, 21); + } + + public static string ??() + { + return 5[1290] ?? 6(1290, 24813, 32); + } + + public static string ??() + { + return 5[1291] ?? 6(1291, 24845, 10); + } + + public static string ??() + { + return 5[1292] ?? 6(1292, 24855, 4); + } + + public static string ??() + { + return 5[1293] ?? 6(1293, 24859, 1); + } + + public static string ??() + { + return 5[1294] ?? 6(1294, 24860, 20); + } + + public static string ??() + { + return 5[1295] ?? 6(1295, 24880, 24); + } + + public static string ??() + { + return 5[1296] ?? 6(1296, 24904, 5); + } + + public static string ??() + { + return 5[1297] ?? 6(1297, 24909, 9); + } + + public static string ??() + { + return 5[1298] ?? 6(1298, 24918, 11); + } + + public static string ??() + { + return 5[1299] ?? 6(1299, 24929, 47); + } + + public static string ??() + { + return 5[1300] ?? 6(1300, 24976, 18); + } + + public static string ??() + { + return 5[1301] ?? 6(1301, 24994, 36); + } + + public static string ??() + { + return 5[1302] ?? 6(1302, 25030, 20); + } + + public static string ??() + { + return 5[1303] ?? 6(1303, 25050, 39); + } + + public static string ??() + { + return 5[1304] ?? 6(1304, 25089, 23); + } + + public static string ??() + { + return 5[1305] ?? 6(1305, 25112, 48); + } + + public static string ??() + { + return 5[1306] ?? 6(1306, 25160, 23); + } + + public static string ??() + { + return 5[1307] ?? 6(1307, 25183, 41); + } + + public static string ??() + { + return 5[1308] ?? 6(1308, 25224, 11); + } + + public static string ??() + { + return 5[1309] ?? 6(1309, 25235, 39); + } + + public static string ??() + { + return 5[1310] ?? 6(1310, 25274, 9); + } + + public static string ??() + { + return 5[1311] ?? 6(1311, 25283, 9); + } + + public static string ??() + { + return 5[1312] ?? 6(1312, 25292, 6); + } + + public static string ??() + { + return 5[1313] ?? 6(1313, 25298, 6); + } + + public static string ??() + { + return 5[1314] ?? 6(1314, 25304, 34); + } + + public static string ??() + { + return 5[1315] ?? 6(1315, 25338, 36); + } + + public static string ??() + { + return 5[1316] ?? 6(1316, 25374, 2); + } + + public static string ??() + { + return 5[1317] ?? 6(1317, 25376, 10); + } + + public static string ??() + { + return 5[1318] ?? 6(1318, 25386, 12); + } + + public static string ??() + { + return 5[1319] ?? 6(1319, 25398, 24); + } + + public static string ??() + { + return 5[1320] ?? 6(1320, 25422, 1); + } + + public static string ??() + { + return 5[1321] ?? 6(1321, 25423, 66); + } + + public static string ??() + { + return 5[1322] ?? 6(1322, 25489, 8); + } + + public static string ??() + { + return 5[1323] ?? 6(1323, 25497, 11); + } + + public static string ??() + { + return 5[1324] ?? 6(1324, 25508, 6); + } + + public static string ??() + { + return 5[1325] ?? 6(1325, 25514, 9); + } + + public static string ??() + { + return 5[1326] ?? 6(1326, 25523, 4); + } + + public static string ??() + { + return 5[1327] ?? 6(1327, 25527, 6); + } + + public static string ??() + { + return 5[1328] ?? 6(1328, 25533, 25); + } + + public static string ??() + { + return 5[1329] ?? 6(1329, 25558, 5); + } + + public static string ??() + { + return 5[1330] ?? 6(1330, 25563, 7); + } + + public static string ??() + { + return 5[1331] ?? 6(1331, 25570, 15); + } + + public static string ??() + { + return 5[1332] ?? 6(1332, 25585, 11); + } + + public static string ??() + { + return 5[1333] ?? 6(1333, 25596, 18); + } + + public static string ??() + { + return 5[1334] ?? 6(1334, 25614, 6); + } + + public static string ??() + { + return 5[1335] ?? 6(1335, 25620, 10); + } + + public static string ??() + { + return 5[1336] ?? 6(1336, 25630, 24); + } + + public static string ??() + { + return 5[1337] ?? 6(1337, 25654, 18); + } + + public static string ??() + { + return 5[1338] ?? 6(1338, 25672, 14); + } + + public static string ??() + { + return 5[1339] ?? 6(1339, 25686, 19); + } + + public static string ??() + { + return 5[1340] ?? 6(1340, 25705, 11); + } + + public static string ??() + { + return 5[1341] ?? 6(1341, 25716, 2); + } + + public static string ??() + { + return 5[1342] ?? 6(1342, 25718, 15); + } + + public static string ??() + { + return 5[1343] ?? 6(1343, 25733, 7); + } + + public static string ??() + { + return 5[1344] ?? 6(1344, 25740, 10); + } + + public static string ??() + { + return 5[1345] ?? 6(1345, 25750, 9); + } + + public static string ??() + { + return 5[1346] ?? 6(1346, 25759, 25); + } + + public static string ??() + { + return 5[1347] ?? 6(1347, 25784, 26); + } + + public static string ??() + { + return 5[1348] ?? 6(1348, 25810, 10); + } + + public static string ??() + { + return 5[1349] ?? 6(1349, 25820, 10); + } + + public static string ??() + { + return 5[1350] ?? 6(1350, 25830, 15); + } + + public static string ??() + { + return 5[1351] ?? 6(1351, 25845, 15); + } + + public static string ??() + { + return 5[1352] ?? 6(1352, 25860, 4); + } + + public static string ??() + { + return 5[1353] ?? 6(1353, 25864, 7); + } + + public static string ??() + { + return 5[1354] ?? 6(1354, 25871, 13); + } + + public static string ??() + { + return 5[1355] ?? 6(1355, 25884, 9); + } + + public static string ??() + { + return 5[1356] ?? 6(1356, 25893, 23); + } + + public static string ??() + { + return 5[1357] ?? 6(1357, 25916, 9); + } + + public static string ??() + { + return 5[1358] ?? 6(1358, 25925, 9); + } + + public static string ??() + { + return 5[1359] ?? 6(1359, 25934, 15); + } + + public static string ??() + { + return 5[1360] ?? 6(1360, 25949, 14); + } + + public static string ??() + { + return 5[1361] ?? 6(1361, 25963, 5); + } + + public static string ??() + { + return 5[1362] ?? 6(1362, 25968, 5); + } + + public static string ??() + { + return 5[1363] ?? 6(1363, 25973, 5); + } + + public static string ??() + { + return 5[1364] ?? 6(1364, 25978, 6); + } + + public static string ??() + { + return 5[1365] ?? 6(1365, 25984, 13); + } + + public static string ??() + { + return 5[1366] ?? 6(1366, 25997, 13); + } + + public static string ??() + { + return 5[1367] ?? 6(1367, 26010, 14); + } + + public static string ??() + { + return 5[1368] ?? 6(1368, 26024, 13); + } + + public static string ??() + { + return 5[1369] ?? 6(1369, 26037, 13); + } + + public static string ??() + { + return 5[1370] ?? 6(1370, 26050, 7); + } + + public static string ??() + { + return 5[1371] ?? 6(1371, 26057, 13); + } + + public static string ??() + { + return 5[1372] ?? 6(1372, 26070, 9); + } + + public static string ??() + { + return 5[1373] ?? 6(1373, 26079, 9); + } + + public static string ??() + { + return 5[1374] ?? 6(1374, 26088, 4); + } + + public static string ??() + { + return 5[1375] ?? 6(1375, 26092, 2); + } + + public static string ??() + { + return 5[1376] ?? 6(1376, 26094, 14); + } + + public static string ??() + { + return 5[1377] ?? 6(1377, 26108, 5); + } + + public static string ??() + { + return 5[1378] ?? 6(1378, 26113, 9); + } + + public static string ??() + { + return 5[1379] ?? 6(1379, 26122, 9); + } + + public static string ??() + { + return 5[1380] ?? 6(1380, 26131, 16); + } + + public static string ??() + { + return 5[1381] ?? 6(1381, 26147, 21); + } + + public static string ??() + { + return 5[1382] ?? 6(1382, 26168, 15); + } + + public static string ??() + { + return 5[1383] ?? 6(1383, 26183, 5); + } + + public static string ??() + { + return 5[1384] ?? 6(1384, 26188, 11); + } + + public static string ??() + { + return 5[1385] ?? 6(1385, 26199, 12); + } + + public static string ??() + { + return 5[1386] ?? 6(1386, 26211, 11); + } + + public static string ??() + { + return 5[1387] ?? 6(1387, 26222, 9); + } + + public static string ??() + { + return 5[1388] ?? 6(1388, 26231, 4); + } + + public static string ??() + { + return 5[1389] ?? 6(1389, 26235, 12); + } + + public static string ??() + { + return 5[1390] ?? 6(1390, 26247, 9); + } + + public static string ??() + { + return 5[1391] ?? 6(1391, 26256, 8); + } + + public static string ??() + { + return 5[1392] ?? 6(1392, 26264, 11); + } + + public static string ??() + { + return 5[1393] ?? 6(1393, 26275, 21); + } + + public static string ??() + { + return 5[1394] ?? 6(1394, 26296, 45); + } + + public static string ??() + { + return 5[1395] ?? 6(1395, 26341, 6); + } + + public static string ??() + { + return 5[1396] ?? 6(1396, 26347, 58); + } + + public static string ??() + { + return 5[1397] ?? 6(1397, 26405, 11); + } + + public static string ??() + { + return 5[1398] ?? 6(1398, 26416, 53); + } + + public static string ??() + { + return 5[1399] ?? 6(1399, 26469, 7); + } + + public static string ??() + { + return 5[1400] ?? 6(1400, 26476, 8); + } + + public static string ??() + { + return 5[1401] ?? 6(1401, 26484, 3); + } + + public static string ??() + { + return 5[1402] ?? 6(1402, 26487, 7); + } + + public static string ??() + { + return 5[1403] ?? 6(1403, 26494, 150); + } + + public static string ??() + { + return 5[1404] ?? 6(1404, 26644, 6); + } + + public static string ??() + { + return 5[1405] ?? 6(1405, 26650, 5); + } + + public static string ??() + { + return 5[1406] ?? 6(1406, 26655, 12); + } + + public static string ??() + { + return 5[1407] ?? 6(1407, 26667, 57); + } + + public static string ??() + { + return 5[1408] ?? 6(1408, 26724, 56); + } + + public static string ??() + { + return 5[1409] ?? 6(1409, 26780, 11); + } + + public static string ??() + { + return 5[1410] ?? 6(1410, 26791, 9); + } + + public static string ??() + { + return 5[1411] ?? 6(1411, 26800, 7); + } + + public static string ??() + { + return 5[1412] ?? 6(1412, 26807, 23); + } + + public static string ??() + { + return 5[1413] ?? 6(1413, 26830, 9); + } + + public static string ??() + { + return 5[1414] ?? 6(1414, 26839, 8); + } + + public static string ??() + { + return 5[1415] ?? 6(1415, 26847, 13); + } + + public static string ??() + { + return 5[1416] ?? 6(1416, 26860, 8); + } + + public static string ??() + { + return 5[1417] ?? 6(1417, 26868, 8); + } + + public static string ??() + { + return 5[1418] ?? 6(1418, 26876, 14); + } + + public static string ??() + { + return 5[1419] ?? 6(1419, 26890, 19); + } + + public static string ??() + { + return 5[1420] ?? 6(1420, 26909, 19); + } + + public static string ??() + { + return 5[1421] ?? 6(1421, 26928, 17); + } + + public static string ??() + { + return 5[1422] ?? 6(1422, 26945, 20); + } + + public static string ??() + { + return 5[1423] ?? 6(1423, 26965, 21); + } + + public static string ??() + { + return 5[1424] ?? 6(1424, 26986, 21); + } + + public static string ??() + { + return 5[1425] ?? 6(1425, 27007, 29); + } + + public static string ??() + { + return 5[1426] ?? 6(1426, 27036, 27); + } + + public static string ??() + { + return 5[1427] ?? 6(1427, 27063, 58); + } + + public static string ??() + { + return 5[1428] ?? 6(1428, 27121, 35); + } + + public static string ??() + { + return 5[1429] ?? 6(1429, 27156, 25); + } + + public static string ??() + { + return 5[1430] ?? 6(1430, 27181, 27); + } + + public static string ??() + { + return 5[1431] ?? 6(1431, 27208, 27); + } + + public static string ??() + { + return 5[1432] ?? 6(1432, 27235, 24); + } + + public static string ??() + { + return 5[1433] ?? 6(1433, 27259, 33); + } + + public static string ??() + { + return 5[1434] ?? 6(1434, 27292, 19); + } + + public static string ??() + { + return 5[1435] ?? 6(1435, 27311, 47); + } + + public static string ??() + { + return 5[1436] ?? 6(1436, 27358, 47); + } + + public static string ??() + { + return 5[1437] ?? 6(1437, 27405, 40); + } + + public static string ??() + { + return 5[1438] ?? 6(1438, 27445, 42); + } + + public static string ??() + { + return 5[1439] ?? 6(1439, 27487, 34); + } + + public static string ??() + { + return 5[1440] ?? 6(1440, 27521, 27); + } + + public static string ??() + { + return 5[1441] ?? 6(1441, 27548, 39); + } + + public static string ??() + { + return 5[1442] ?? 6(1442, 27587, 32); + } + + public static string ??() + { + return 5[1443] ?? 6(1443, 27619, 43); + } + + public static string ??() + { + return 5[1444] ?? 6(1444, 27662, 28); + } + + public static string ??() + { + return 5[1445] ?? 6(1445, 27690, 35); + } + + public static string ??() + { + return 5[1446] ?? 6(1446, 27725, 7); + } + + public static string ??() + { + return 5[1447] ?? 6(1447, 27732, 12); + } + + public static string ??() + { + return 5[1448] ?? 6(1448, 27744, 34); + } + + public static string ??() + { + return 5[1449] ?? 6(1449, 27778, 6); + } + + public static string ??() + { + return 5[1450] ?? 6(1450, 27784, 17); + } + + public static string ??() + { + return 5[1451] ?? 6(1451, 27801, 39); + } + + public static string ??() + { + return 5[1452] ?? 6(1452, 27840, 33); + } + + public static string ??() + { + return 5[1453] ?? 6(1453, 27873, 31); + } + + public static string ??() + { + return 5[1454] ?? 6(1454, 27904, 6); + } + + public static string ??() + { + return 5[1455] ?? 6(1455, 27910, 7); + } + + public static string ??() + { + return 5[1456] ?? 6(1456, 27917, 14); + } + + public static string ??() + { + return 5[1457] ?? 6(1457, 27931, 14); + } + + public static string ??() + { + return 5[1458] ?? 6(1458, 27945, 17); + } + + public static string ??() + { + return 5[1459] ?? 6(1459, 27962, 36); + } + + public static string ??() + { + return 5[1460] ?? 6(1460, 27998, 53); + } + + public static string ??() + { + return 5[1461] ?? 6(1461, 28051, 23); + } + + public static string ??() + { + return 5[1462] ?? 6(1462, 28074, 47); + } + + public static string ??() + { + return 5[1463] ?? 6(1463, 28121, 3); + } + + public static string ??() + { + return 5[1464] ?? 6(1464, 28124, 7); + } + + public static string ??() + { + return 5[1465] ?? 6(1465, 28131, 4); + } + + public static string ??() + { + return 5[1466] ?? 6(1466, 28135, 33); + } + + public static string ??() + { + return 5[1467] ?? 6(1467, 28168, 9); + } + + public static string ??() + { + return 5[1468] ?? 6(1468, 28177, 17); + } + + public static string ??() + { + return 5[1469] ?? 6(1469, 28194, 15); + } + + public static string ??() + { + return 5[1470] ?? 6(1470, 28209, 11); + } + + public static string ??() + { + return 5[1471] ?? 6(1471, 28220, 8); + } + + public static string ??() + { + return 5[1472] ?? 6(1472, 28228, 9); + } + + public static string ??() + { + return 5[1473] ?? 6(1473, 28237, 165); + } + + public static string ??() + { + return 5[1474] ?? 6(1474, 28402, 15); + } + + public static string ??() + { + return 5[1475] ?? 6(1475, 28417, 8); + } + + public static string ??() + { + return 5[1476] ?? 6(1476, 28425, 5); + } + + public static string ??() + { + return 5[1477] ?? 6(1477, 28430, 36); + } + + public static string ??() + { + return 5[1478] ?? 6(1478, 28466, 9); + } + + public static string ??() + { + return 5[1479] ?? 6(1479, 28475, 34); + } + + public static string ??() + { + return 5[1480] ?? 6(1480, 28509, 20); + } + + public static string ??() + { + return 5[1481] ?? 6(1481, 28529, 16); + } + + public static string ??() + { + return 5[1482] ?? 6(1482, 28545, 17); + } + + public static string ??() + { + return 5[1483] ?? 6(1483, 28562, 2); + } + + public static string ??() + { + return 5[1484] ?? 6(1484, 28564, 24); + } + + public static string ??() + { + return 5[1485] ?? 6(1485, 28588, 43); + } + + public static string ??() + { + return 5[1486] ?? 6(1486, 28631, 6); + } + + public static string ??() + { + return 5[1487] ?? 6(1487, 28637, 9); + } + + public static string ??() + { + return 5[1488] ?? 6(1488, 28646, 8); + } + + public static string ??() + { + return 5[1489] ?? 6(1489, 28654, 7); + } + + public static string ??() + { + return 5[1490] ?? 6(1490, 28661, 12); + } + + public static string ??() + { + return 5[1491] ?? 6(1491, 28673, 7); + } + + public static string ??() + { + return 5[1492] ?? 6(1492, 28680, 14); + } + + public static string ??() + { + return 5[1493] ?? 6(1493, 28694, 13); + } + + public static string ??() + { + return 5[1494] ?? 6(1494, 28707, 18); + } + + public static string ??() + { + return 5[1495] ?? 6(1495, 28725, 16); + } + + public static string ??() + { + return 5[1496] ?? 6(1496, 28741, 26); + } + + public static string ??() + { + return 5[1497] ?? 6(1497, 28767, 18); + } + + public static string ??() + { + return 5[1498] ?? 6(1498, 28785, 12); + } + + public static string ??() + { + return 5[1499] ?? 6(1499, 28797, 6); + } + + public static string ??() + { + return 5[1500] ?? 6(1500, 28803, 8); + } + + public static string ??() + { + return 5[1501] ?? 6(1501, 28811, 11); + } + + public static string ??() + { + return 5[1502] ?? 6(1502, 28822, 14); + } + + public static string ??() + { + return 5[1503] ?? 6(1503, 28836, 7); + } + + public static string ??() + { + return 5[1504] ?? 6(1504, 28843, 7); + } + + public static string ??() + { + return 5[1505] ?? 6(1505, 28850, 11); + } + + public static string ??() + { + return 5[1506] ?? 6(1506, 28861, 21); + } + + public static string ??() + { + return 5[1507] ?? 6(1507, 28882, 11); + } + + public static string ??() + { + return 5[1508] ?? 6(1508, 28893, 13); + } + + public static string ??() + { + return 5[1509] ?? 6(1509, 28906, 3); + } + + public static string ??() + { + return 5[1510] ?? 6(1510, 28909, 9); + } + + public static string ??() + { + return 5[1511] ?? 6(1511, 28918, 12); + } + + public static string ??() + { + return 5[1512] ?? 6(1512, 28930, 16); + } + + public static string ??() + { + return 5[1513] ?? 6(1513, 28946, 15); + } + + public static string ??() + { + return 5[1514] ?? 6(1514, 28961, 10); + } + + public static string ??() + { + return 5[1515] ?? 6(1515, 28971, 10); + } + + public static string ??() + { + return 5[1516] ?? 6(1516, 28981, 4); + } + + public static string ??() + { + return 5[1517] ?? 6(1517, 28985, 6); + } + + public static string ??() + { + return 5[1518] ?? 6(1518, 28991, 11); + } + + public static string ??() + { + return 5[1519] ?? 6(1519, 29002, 7); + } + + public static string ??() + { + return 5[1520] ?? 6(1520, 29009, 15); + } + + public static string ??() + { + return 5[1521] ?? 6(1521, 29024, 10); + } + + public static string ??() + { + return 5[1522] ?? 6(1522, 29034, 12); + } + + public static string ??() + { + return 5[1523] ?? 6(1523, 29046, 19); + } + + public static string ??() + { + return 5[1524] ?? 6(1524, 29065, 25); + } + + public static string ??() + { + return 5[1525] ?? 6(1525, 29090, 8); + } + + public static string ??() + { + return 5[1526] ?? 6(1526, 29098, 6); + } + + public static string ??() + { + return 5[1527] ?? 6(1527, 29104, 12); + } + + public static string ??() + { + return 5[1528] ?? 6(1528, 29116, 10); + } + + public static string ??() + { + return 5[1529] ?? 6(1529, 29126, 9); + } + + public static string ??() + { + return 5[1530] ?? 6(1530, 29135, 8); + } + + public static string ??() + { + return 5[1531] ?? 6(1531, 29143, 8); + } + + public static string ??() + { + return 5[1532] ?? 6(1532, 29151, 16); + } + + public static string ??() + { + return 5[1533] ?? 6(1533, 29167, 7); + } + + public static string ??() + { + return 5[1534] ?? 6(1534, 29174, 7); + } + + public static string ??() + { + return 5[1535] ?? 6(1535, 29181, 10); + } + + public static string ??() + { + return 5[1536] ?? 6(1536, 29191, 13); + } + + public static string ??() + { + return 5[1537] ?? 6(1537, 29204, 14); + } + + public static string ??() + { + return 5[1538] ?? 6(1538, 29218, 4); + } + + public static string ??() + { + return 5[1539] ?? 6(1539, 29222, 7); + } + + public static string ??() + { + return 5[1540] ?? 6(1540, 29229, 14); + } + + public static string ??() + { + return 5[1541] ?? 6(1541, 29243, 11); + } + + public static string ??() + { + return 5[1542] ?? 6(1542, 29254, 11); + } + + public static string ??() + { + return 5[1543] ?? 6(1543, 29265, 14); + } + + public static string ??() + { + return 5[1544] ?? 6(1544, 29279, 12); + } + + public static string ??() + { + return 5[1545] ?? 6(1545, 29291, 11); + } + + public static string ??() + { + return 5[1546] ?? 6(1546, 29302, 14); + } + + public static string ??() + { + return 5[1547] ?? 6(1547, 29316, 19); + } + + public static string ??() + { + return 5[1548] ?? 6(1548, 29335, 14); + } + + public static string ??() + { + return 5[1549] ?? 6(1549, 29349, 19); + } + + public static string ??() + { + return 5[1550] ?? 6(1550, 29368, 9); + } + + public static string ??() + { + return 5[1551] ?? 6(1551, 29377, 11); + } + + public static string ??() + { + return 5[1552] ?? 6(1552, 29388, 16); + } + + public static string ??() + { + return 5[1553] ?? 6(1553, 29404, 8); + } + + public static string ??() + { + return 5[1554] ?? 6(1554, 29412, 10); + } + + public static string ??() + { + return 5[1555] ?? 6(1555, 29422, 7); + } + + public static string ??() + { + return 5[1556] ?? 6(1556, 29429, 18); + } + + public static string ??() + { + return 5[1557] ?? 6(1557, 29447, 14); + } + + public static string ??() + { + return 5[1558] ?? 6(1558, 29461, 9); + } + + public static string ??() + { + return 5[1559] ?? 6(1559, 29470, 9); + } + + public static string ??() + { + return 5[1560] ?? 6(1560, 29479, 8); + } + + public static string ??() + { + return 5[1561] ?? 6(1561, 29487, 12); + } + + public static string ??() + { + return 5[1562] ?? 6(1562, 29499, 24); + } + + public static string ??() + { + return 5[1563] ?? 6(1563, 29523, 7); + } + + public static string ??() + { + return 5[1564] ?? 6(1564, 29530, 6); + } + + public static string ??() + { + return 5[1565] ?? 6(1565, 29536, 6); + } + + public static string ??() + { + return 5[1566] ?? 6(1566, 29542, 13); + } + + public static string ??() + { + return 5[1567] ?? 6(1567, 29555, 16); + } + + public static string ??() + { + return 5[1568] ?? 6(1568, 29571, 16); + } + + public static string ??() + { + return 5[1569] ?? 6(1569, 29587, 13); + } + + public static string ??() + { + return 5[1570] ?? 6(1570, 29600, 10); + } + + public static string ??() + { + return 5[1571] ?? 6(1571, 29610, 11); + } + + public static string ??() + { + return 5[1572] ?? 6(1572, 29621, 15); + } + + public static string ??() + { + return 5[1573] ?? 6(1573, 29636, 16); + } + + public static string ??() + { + return 5[1574] ?? 6(1574, 29652, 7); + } + + public static string ??() + { + return 5[1575] ?? 6(1575, 29659, 7); + } + + public static string ??() + { + return 5[1576] ?? 6(1576, 29666, 12); + } + + public static string ??() + { + return 5[1577] ?? 6(1577, 29678, 8); + } + + public static string ??() + { + return 5[1578] ?? 6(1578, 29686, 14); + } + + public static string ??() + { + return 5[1579] ?? 6(1579, 29700, 16); + } + + public static string ??() + { + return 5[1580] ?? 6(1580, 29716, 170); + } + + public static string ??() + { + return 5[1581] ?? 6(1581, 29886, 14); + } + + public static string ??() + { + return 5[1582] ?? 6(1582, 29900, 16); + } + + public static string ??() + { + return 5[1583] ?? 6(1583, 29916, 11); + } + + public static string ??() + { + return 5[1584] ?? 6(1584, 29927, 12); + } + + public static string ??() + { + return 5[1585] ?? 6(1585, 29939, 12); + } + + public static string ??() + { + return 5[1586] ?? 6(1586, 29951, 18); + } + + public static string ??() + { + return 5[1587] ?? 6(1587, 29969, 19); + } + + public static string ??() + { + return 5[1588] ?? 6(1588, 29988, 26); + } + + public static string ??() + { + return 5[1589] ?? 6(1589, 30014, 11); + } + + public static string ??() + { + return 5[1590] ?? 6(1590, 30025, 18); + } + + public static string ??() + { + return 5[1591] ?? 6(1591, 30043, 16); + } + + public static string ??() + { + return 5[1592] ?? 6(1592, 30059, 24); + } + + public static string ??() + { + return 5[1593] ?? 6(1593, 30083, 13); + } + + public static string ??() + { + return 5[1594] ?? 6(1594, 30096, 22); + } + + public static string ??() + { + return 5[1595] ?? 6(1595, 30118, 13); + } + + public static string ??() + { + return 5[1596] ?? 6(1596, 30131, 22); + } + + public static string ??() + { + return 5[1597] ?? 6(1597, 30153, 14); + } + + public static string ??() + { + return 5[1598] ?? 6(1598, 30167, 16); + } + + public static string ??() + { + return 5[1599] ?? 6(1599, 30183, 12); + } + + public static string ??() + { + return 5[1600] ?? 6(1600, 30195, 18); + } + + public static string ??() + { + return 5[1601] ?? 6(1601, 30213, 18); + } + + public static string ??() + { + return 5[1602] ?? 6(1602, 30231, 5); + } + + public static string ??() + { + return 5[1603] ?? 6(1603, 30236, 15); + } + + public static string ??() + { + return 5[1604] ?? 6(1604, 30251, 1); + } + + public static string ??() + { + return 5[1605] ?? 6(1605, 30252, 2); + } + + public static string ??() + { + return 5[1606] ?? 6(1606, 30254, 39); + } + + public static string ??() + { + return 5[1607] ?? 6(1607, 30293, 11); + } + + public static string ??() + { + return 5[1608] ?? 6(1608, 30304, 36); + } + + public static string ??() + { + return 5[1609] ?? 6(1609, 30340, 23); + } + + public static string ??() + { + return 5[1610] ?? 6(1610, 30363, 5); + } + + public static string ??() + { + return 5[1611] ?? 6(1611, 30368, 56); + } + + public static string ??() + { + return 5[1612] ?? 6(1612, 30424, 10); + } + + public static string ??() + { + return 5[1613] ?? 6(1613, 30434, 8); + } + + public static string ??() + { + return 5[1614] ?? 6(1614, 30442, 10); + } + + public static string ??() + { + return 5[1615] ?? 6(1615, 30452, 3); + } + + public static string ??() + { + return 5[1616] ?? 6(1616, 30455, 11); + } + + public static string ??() + { + return 5[1617] ?? 6(1617, 30466, 15); + } + + public static string ??() + { + return 5[1618] ?? 6(1618, 30481, 9); + } + + public static string ??() + { + return 5[1619] ?? 6(1619, 30490, 13); + } + + public static string ??() + { + return 5[1620] ?? 6(1620, 30503, 13); + } + + public static string ??() + { + return 5[1621] ?? 6(1621, 30516, 11); + } + + public static string ??() + { + return 5[1622] ?? 6(1622, 30527, 9); + } + + public static string ??() + { + return 5[1623] ?? 6(1623, 30536, 6); + } + + public static string ??() + { + return 5[1624] ?? 6(1624, 30542, 13); + } + + public static string ??() + { + return 5[1625] ?? 6(1625, 30555, 146); + } + + public static string ??() + { + return 5[1626] ?? 6(1626, 30701, 10); + } + + public static string ??() + { + return 5[1627] ?? 6(1627, 30711, 3); + } + + public static string ??() + { + return 5[1628] ?? 6(1628, 30714, 4); + } + + public static string ??() + { + return 5[1629] ?? 6(1629, 30718, 4); + } + + public static string ??() + { + return 5[1630] ?? 6(1630, 30722, 7); + } + + public static string ??() + { + return 5[1631] ?? 6(1631, 30729, 7); + } + + public static string ??() + { + return 5[1632] ?? 6(1632, 30736, 1); + } + + public static string ??() + { + return 5[1633] ?? 6(1633, 30737, 6); + } + + public static string ??() + { + return 5[1634] ?? 6(1634, 30743, 10); + } + + public static string ??() + { + return 5[1635] ?? 6(1635, 30753, 3); + } + + public static string ??() + { + return 5[1636] ?? 6(1636, 30756, 10); + } + + public static string ??() + { + return 5[1637] ?? 6(1637, 30766, 9); + } + + public static string ??() + { + return 5[1638] ?? 6(1638, 30775, 9); + } + + public static string ??() + { + return 5[1639] ?? 6(1639, 30784, 3); + } + + public static string ??() + { + return 5[1640] ?? 6(1640, 30787, 8); + } + + public static string ??() + { + return 5[1641] ?? 6(1641, 30795, 1); + } + + public static string ??() + { + return 5[1642] ?? 6(1642, 30796, 5); + } + + public static string ??() + { + return 5[1643] ?? 6(1643, 30801, 6); + } + + public static string ??() + { + return 5[1644] ?? 6(1644, 30807, 8); + } + + public static string ??() + { + return 5[1645] ?? 6(1645, 30815, 24); + } + + public static string ??() + { + return 5[1646] ?? 6(1646, 30839, 2); + } + + public static string ??() + { + return 5[1647] ?? 6(1647, 30841, 2); + } + + public static string ??() + { + return 5[1648] ?? 6(1648, 30843, 3); + } + + public static string ??() + { + return 5[1649] ?? 6(1649, 30846, 2); + } + + public static string ??() + { + return 5[1650] ?? 6(1650, 30848, 1); + } + + public static string ??() + { + return 5[1651] ?? 6(1651, 30849, 4); + } + + public static string ??() + { + return 5[1652] ?? 6(1652, 30853, 6); + } + + public static string ??() + { + return 5[1653] ?? 6(1653, 30859, 8); + } + + public static string ??() + { + return 5[1654] ?? 6(1654, 30867, 4); + } + + public static string ??() + { + return 5[1655] ?? 6(1655, 30871, 10); + } + + public static string ??() + { + return 5[1656] ?? 6(1656, 30881, 19); + } + + public static string ??() + { + return 5[1657] ?? 6(1657, 30900, 4); + } + + public static string ??() + { + return 5[1658] ?? 6(1658, 30904, 36); + } + + public static string ??() + { + return 5[1659] ?? 6(1659, 30940, 13); + } + + public static string ??() + { + return 5[1660] ?? 6(1660, 30953, 10); + } + + public static string ??() + { + return 5[1661] ?? 6(1661, 30963, 7); + } + + public static string ??() + { + return 5[1662] ?? 6(1662, 30970, 7); + } + + public static string ??() + { + return 5[1663] ?? 6(1663, 30977, 16); + } + + public static string ??() + { + return 5[1664] ?? 6(1664, 30993, 10); + } + + public static string ??() + { + return 5[1665] ?? 6(1665, 31003, 11); + } + + public static string ??() + { + return 5[1666] ?? 6(1666, 31014, 5); + } + + public static string ??() + { + return 5[1667] ?? 6(1667, 31019, 14); + } + + public static string ??() + { + return 5[1668] ?? 6(1668, 31033, 17); + } + + public static string ??() + { + return 5[1669] ?? 6(1669, 31050, 18); + } + + public static string ??() + { + return 5[1670] ?? 6(1670, 31068, 13); + } + + public static string ??() + { + return 5[1671] ?? 6(1671, 31081, 7); + } + + public static string ??() + { + return 5[1672] ?? 6(1672, 31088, 11); + } + + public static string ??() + { + return 5[1673] ?? 6(1673, 31099, 18); + } + + public static string ??() + { + return 5[1674] ?? 6(1674, 31117, 11); + } + + public static string ??() + { + return 5[1675] ?? 6(1675, 31128, 11); + } + + public static string ??() + { + return 5[1676] ?? 6(1676, 31139, 4); + } + + public static string ??() + { + return 5[1677] ?? 6(1677, 31143, 4); + } + + public static string ??() + { + return 5[1678] ?? 6(1678, 31147, 3); + } + + public static string ??() + { + return 5[1679] ?? 6(1679, 31150, 3); + } + + public static string ??() + { + return 5[1680] ?? 6(1680, 31153, 8); + } + + public static string ??() + { + return 5[1681] ?? 6(1681, 31161, 159); + } + + public static string ??() + { + return 5[1682] ?? 6(1682, 31320, 6); + } + + public static string ??() + { + return 5[1683] ?? 6(1683, 31326, 10); + } + + public static string ??() + { + return 5[1684] ?? 6(1684, 31336, 12); + } + + public static string ??() + { + return 5[1685] ?? 6(1685, 31348, 6); + } + + public static string ??() + { + return 5[1686] ?? 6(1686, 31354, 24); + } + + public static string ??() + { + return 5[1687] ?? 6(1687, 31378, 10); + } + + public static string ??() + { + return 5[1688] ?? 6(1688, 31388, 5); + } + + public static string ??() + { + return 5[1689] ?? 6(1689, 31393, 8); + } + + public static string ??() + { + return 5[1690] ?? 6(1690, 31401, 6); + } + + public static string ??() + { + return 5[1691] ?? 6(1691, 31407, 15); + } + + public static string ??() + { + return 5[1692] ?? 6(1692, 31422, 16); + } + + public static string ??() + { + return 5[1693] ?? 6(1693, 31438, 157); + } + + public static string ??() + { + return 5[1694] ?? 6(1694, 31595, 7); + } + + public static string ??() + { + return 5[1695] ?? 6(1695, 31602, 6); + } + + public static string ??() + { + return 5[1696] ?? 6(1696, 31608, 23); + } + + public static string ??() + { + return 5[1697] ?? 6(1697, 31631, 9); + } + + public static string ??() + { + return 5[1698] ?? 6(1698, 31640, 8); + } + + public static string ??() + { + return 5[1699] ?? 6(1699, 31648, 167); + } + + public static string ??() + { + return 5[1700] ?? 6(1700, 31815, 4); + } + + public static string ??() + { + return 5[1701] ?? 6(1701, 31819, 15); + } + + public static string ??() + { + return 5[1702] ?? 6(1702, 31834, 14); + } + + public static string ??() + { + return 5[1703] ?? 6(1703, 31848, 12); + } + + public static string ??() + { + return 5[1704] ?? 6(1704, 31860, 4); + } + + public static string ??() + { + return 5[1705] ?? 6(1705, 31864, 8); + } + + public static string ??() + { + return 5[1706] ?? 6(1706, 31872, 5); + } + + public static string ??() + { + return 5[1707] ?? 6(1707, 31877, 20); + } + + public static string ??() + { + return 5[1708] ?? 6(1708, 31897, 27); + } + + public static string ??() + { + return 5[1709] ?? 6(1709, 31924, 61); + } + + public static string ??() + { + return 5[1710] ?? 6(1710, 31985, 5); + } + + public static string ??() + { + return 5[1711] ?? 6(1711, 31990, 8); + } + + public static string ??() + { + return 5[1712] ?? 6(1712, 31998, 24); + } + + public static string ??() + { + return 5[1713] ?? 6(1713, 32022, 31); + } + + public static string ??() + { + return 5[1714] ?? 6(1714, 32053, 16); + } + + public static string ??() + { + return 5[1715] ?? 6(1715, 32069, 9); + } + + public static string ??() + { + return 5[1716] ?? 6(1716, 32078, 2); + } + + public static string ??() + { + return 5[1717] ?? 6(1717, 32080, 6); + } + + public static string ??() + { + return 5[1718] ?? 6(1718, 32086, 5); + } + + public static string ??() + { + return 5[1719] ?? 6(1719, 32091, 5); + } + + public static string ??() + { + return 5[1720] ?? 6(1720, 32096, 5); + } + + public static string ??() + { + return 5[1721] ?? 6(1721, 32101, 4); + } + + public static string ??() + { + return 5[1722] ?? 6(1722, 32105, 2); + } + + public static string ??() + { + return 5[1723] ?? 6(1723, 32107, 10); + } + + public static string ??() + { + return 5[1724] ?? 6(1724, 32117, 12); + } + + public static string ??() + { + return 5[1725] ?? 6(1725, 32129, 6); + } + + public static string ??() + { + return 5[1726] ?? 6(1726, 32135, 7); + } + + public static string ??() + { + return 5[1727] ?? 6(1727, 32142, 7); + } + + public static string ??() + { + return 5[1728] ?? 6(1728, 32149, 8); + } + + public static string ??() + { + return 5[1729] ?? 6(1729, 32157, 4); + } + + public static string ??() + { + return 5[1730] ?? 6(1730, 32161, 4); + } + + public static string ??() + { + return 5[1731] ?? 6(1731, 32165, 3); + } + + public static string ??() + { + return 5[1732] ?? 6(1732, 32168, 13); + } + + public static string ??() + { + return 5[1733] ?? 6(1733, 32181, 6); + } + + public static string ??() + { + return 5[1734] ?? 6(1734, 32187, 16); + } + + public static string ??() + { + return 5[1735] ?? 6(1735, 32203, 4); + } + + public static string ??() + { + return 5[1736] ?? 6(1736, 32207, 4); + } + + public static string ??() + { + return 5[1737] ?? 6(1737, 32211, 8); + } + + public static string ??() + { + return 5[1738] ?? 6(1738, 32219, 6); + } + + public static string ??() + { + return 5[1739] ?? 6(1739, 32225, 10); + } + + public static string ??() + { + return 5[1740] ?? 6(1740, 32235, 7); + } + + public static string ??() + { + return 5[1741] ?? 6(1741, 32242, 7); + } + + public static string ??() + { + return 5[1742] ?? 6(1742, 32249, 11); + } + + public static string ??() + { + return 5[1743] ?? 6(1743, 32260, 11); + } + + public static string ??() + { + return 5[1744] ?? 6(1744, 32271, 16); + } + + public static string ??() + { + return 5[1745] ?? 6(1745, 32287, 138); + } + + public static string ??() + { + return 5[1746] ?? 6(1746, 32425, 5); + } + + public static string ??() + { + return 5[1747] ?? 6(1747, 32430, 17); + } + + public static string ??() + { + return 5[1748] ?? 6(1748, 32447, 11); + } + + public static string ??() + { + return 5[1749] ?? 6(1749, 32458, 22); + } + + public static string ??() + { + return 5[1750] ?? 6(1750, 32480, 6); + } + + public static string ??() + { + return 5[1751] ?? 6(1751, 32486, 7); + } + + public static string ??() + { + return 5[1752] ?? 6(1752, 32493, 12); + } + + public static string ??() + { + return 5[1753] ?? 6(1753, 32505, 10); + } + + public static string ??() + { + return 5[1754] ?? 6(1754, 32515, 10); + } + + public static string ??() + { + return 5[1755] ?? 6(1755, 32525, 9); + } + + public static string ??() + { + return 5[1756] ?? 6(1756, 32534, 23); + } + + public static string ??() + { + return 5[1757] ?? 6(1757, 32557, 9); + } + + public static string ??() + { + return 5[1758] ?? 6(1758, 32566, 14); + } + + public static string ??() + { + return 5[1759] ?? 6(1759, 32580, 8); + } + + public static string ??() + { + return 5[1760] ?? 6(1760, 32588, 10); + } + + public static string ??() + { + return 5[1761] ?? 6(1761, 32598, 9); + } + + public static string ??() + { + return 5[1762] ?? 6(1762, 32607, 16); + } + + public static string ??() + { + return 5[1763] ?? 6(1763, 32623, 20); + } + + public static string ??() + { + return 5[1764] ?? 6(1764, 32643, 36); + } + + public static string ??() + { + return 5[1765] ?? 6(1765, 32679, 10); + } + + public static string ??() + { + return 5[1766] ?? 6(1766, 32689, 16); + } + + public static string ??() + { + return 5[1767] ?? 6(1767, 32705, 12); + } + + public static string ??() + { + return 5[1768] ?? 6(1768, 32717, 6); + } + + public static string ??() + { + return 5[1769] ?? 6(1769, 32723, 12); + } + + public static string ??() + { + return 5[1770] ?? 6(1770, 32735, 13); + } + + public static string ??() + { + return 5[1771] ?? 6(1771, 32748, 137); + } + + public static string ??() + { + return 5[1772] ?? 6(1772, 32885, 7); + } + + public static string ??() + { + return 5[1773] ?? 6(1773, 32892, 62); + } + + public static string ??() + { + return 5[1774] ?? 6(1774, 32954, 4); + } + + public static string ??() + { + return 5[1775] ?? 6(1775, 32958, 8); + } + + public static string ??() + { + return 5[1776] ?? 6(1776, 32966, 3); + } + + public static string ??() + { + return 5[1777] ?? 6(1777, 32969, 62); + } + + public static string ??() + { + return 5[1778] ?? 6(1778, 33031, 21); + } + + public static string ??() + { + return 5[1779] ?? 6(1779, 33052, 23); + } + + public static string ??() + { + return 5[1780] ?? 6(1780, 33075, 11); + } + + public static string ??() + { + return 5[1781] ?? 6(1781, 33086, 19); + } + + public static string ??() + { + return 5[1782] ?? 6(1782, 33105, 61); + } + + public static string ??() + { + return 5[1783] ?? 6(1783, 33166, 5); + } + + public static string ??() + { + return 5[1784] ?? 6(1784, 33171, 23); + } + + public static string ??() + { + return 5[1785] ?? 6(1785, 33194, 62); + } + + public static string ??() + { + return 5[1786] ?? 6(1786, 33256, 6); + } + + public static string ??() + { + return 5[1787] ?? 6(1787, 33262, 67); + } + + public static string ??() + { + return 5[1788] ?? 6(1788, 33329, 8); + } + + public static string ??() + { + return 5[1789] ?? 6(1789, 33337, 23); + } + + public static string ??() + { + return 5[1790] ?? 6(1790, 33360, 62); + } + + public static string ??() + { + return 5[1791] ?? 6(1791, 33422, 12); + } + + public static string ??() + { + return 5[1792] ?? 6(1792, 33434, 13); + } + + public static string ??() + { + return 5[1793] ?? 6(1793, 33447, 12); + } + + public static string ??() + { + return 5[1794] ?? 6(1794, 33459, 5); + } + + public static string ??() + { + return 5[1795] ?? 6(1795, 33464, 8); + } + + public static string ??() + { + return 5[1796] ?? 6(1796, 33472, 21); + } + + public static string ??() + { + return 5[1797] ?? 6(1797, 33493, 13); + } + + public static string ??() + { + return 5[1798] ?? 6(1798, 33506, 12); + } + + public static string ??() + { + return 5[1799] ?? 6(1799, 33518, 9); + } + + public static string ??() + { + return 5[1800] ?? 6(1800, 33527, 10); + } + + public static string ??() + { + return 5[1801] ?? 6(1801, 33537, 10); + } + + public static string ??() + { + return 5[1802] ?? 6(1802, 33547, 6); + } + + public static string ??() + { + return 5[1803] ?? 6(1803, 33553, 12); + } + + public static string ??() + { + return 5[1804] ?? 6(1804, 33565, 15); + } + + public static string ??() + { + return 5[1805] ?? 6(1805, 33580, 17); + } + + public static string ??() + { + return 5[1806] ?? 6(1806, 33597, 11); + } + + public static string ??() + { + return 5[1807] ?? 6(1807, 33608, 13); + } + + public static string ??() + { + return 5[1808] ?? 6(1808, 33621, 11); + } + + public static string ??() + { + return 5[1809] ?? 6(1809, 33632, 8); + } + + public static string ??() + { + return 5[1810] ?? 6(1810, 33640, 11); + } + + public static string ??() + { + return 5[1811] ?? 6(1811, 33651, 12); + } + + public static string ??() + { + return 5[1812] ?? 6(1812, 33663, 22); + } + + public static string ??() + { + return 5[1813] ?? 6(1813, 33685, 13); + } + + public static string ??() + { + return 5[1814] ?? 6(1814, 33698, 16); + } + + public static string ??() + { + return 5[1815] ?? 6(1815, 33714, 21); + } + + public static string ??() + { + return 5[1816] ?? 6(1816, 33735, 22); + } + + public static string ??() + { + return 5[1817] ?? 6(1817, 33757, 29); + } + + public static string ??() + { + return 5[1818] ?? 6(1818, 33786, 8); + } + + public static string ??() + { + return 5[1819] ?? 6(1819, 33794, 13); + } + + public static string ??() + { + return 5[1820] ?? 6(1820, 33807, 15); + } + + public static string ??() + { + return 5[1821] ?? 6(1821, 33822, 20); + } + + public static string ??() + { + return 5[1822] ?? 6(1822, 33842, 28); + } + + public static string ??() + { + return 5[1823] ?? 6(1823, 33870, 25); + } + + public static string ??() + { + return 5[1824] ?? 6(1824, 33895, 4); + } + + public static string ??() + { + return 5[1825] ?? 6(1825, 33899, 18); + } + + public static string ??() + { + return 5[1826] ?? 6(1826, 33917, 18); + } + + public static string ??() + { + return 5[1827] ?? 6(1827, 33935, 18); + } + + public static string ??() + { + return 5[1828] ?? 6(1828, 33953, 26); + } + + public static string ??() + { + return 5[1829] ?? 6(1829, 33979, 26); + } + + public static string ??() + { + return 5[1830] ?? 6(1830, 34005, 26); + } + + public static string ??() + { + return 5[1831] ?? 6(1831, 34031, 19); + } + + public static string ??() + { + return 5[1832] ?? 6(1832, 34050, 19); + } + + public static string ??() + { + return 5[1833] ?? 6(1833, 34069, 19); + } + + public static string ??() + { + return 5[1834] ?? 6(1834, 34088, 19); + } + + public static string ??() + { + return 5[1835] ?? 6(1835, 34107, 19); + } + + public static string ??() + { + return 5[1836] ?? 6(1836, 34126, 17); + } + + public static string ??() + { + return 5[1837] ?? 6(1837, 34143, 17); + } + + public static string ??() + { + return 5[1838] ?? 6(1838, 34160, 17); + } + + public static string ??() + { + return 5[1839] ?? 6(1839, 34177, 17); + } + + public static string ??() + { + return 5[1840] ?? 6(1840, 34194, 17); + } + + public static string ??() + { + return 5[1841] ?? 6(1841, 34211, 17); + } + + public static string ??() + { + return 5[1842] ?? 6(1842, 34228, 17); + } + + public static string ??() + { + return 5[1843] ?? 6(1843, 34245, 28); + } + + public static string ??() + { + return 5[1844] ?? 6(1844, 34273, 15); + } + + public static string ??() + { + return 5[1845] ?? 6(1845, 34288, 15); + } + + public static string ??() + { + return 5[1846] ?? 6(1846, 34303, 15); + } + + public static string ??() + { + return 5[1847] ?? 6(1847, 34318, 16); + } + + public static string ??() + { + return 5[1848] ?? 6(1848, 34334, 16); + } + + public static string ??() + { + return 5[1849] ?? 6(1849, 34350, 16); + } + + public static string ??() + { + return 5[1850] ?? 6(1850, 34366, 16); + } + + public static string ??() + { + return 5[1851] ?? 6(1851, 34382, 16); + } + + public static string ??() + { + return 5[1852] ?? 6(1852, 34398, 25); + } + + public static string ??() + { + return 5[1853] ?? 6(1853, 34423, 25); + } + + public static string ??() + { + return 5[1854] ?? 6(1854, 34448, 14); + } + + public static string ??() + { + return 5[1855] ?? 6(1855, 34462, 20); + } + + public static string ??() + { + return 5[1856] ?? 6(1856, 34482, 20); + } + + public static string ??() + { + return 5[1857] ?? 6(1857, 34502, 20); + } + + public static string ??() + { + return 5[1858] ?? 6(1858, 34522, 22); + } + + public static string ??() + { + return 5[1859] ?? 6(1859, 34544, 22); + } + + public static string ??() + { + return 5[1860] ?? 6(1860, 34566, 32); + } + + public static string ??() + { + return 5[1861] ?? 6(1861, 34598, 41); + } + + public static string ??() + { + return 5[1862] ?? 6(1862, 34639, 24); + } + + public static string ??() + { + return 5[1863] ?? 6(1863, 34663, 27); + } + + public static string ??() + { + return 5[1864] ?? 6(1864, 34690, 31); + } + + public static string ??() + { + return 5[1865] ?? 6(1865, 34721, 33); + } + + public static string ??() + { + return 5[1866] ?? 6(1866, 34754, 23); + } + + public static string ??() + { + return 5[1867] ?? 6(1867, 34777, 8); + } + + public static string ??() + { + return 5[1868] ?? 6(1868, 34785, 14); + } + + public static string ??() + { + return 5[1869] ?? 6(1869, 34799, 13); + } + + public static string ??() + { + return 5[1870] ?? 6(1870, 34812, 17); + } + + public static string ??() + { + return 5[1871] ?? 6(1871, 34829, 13); + } + + public static string ??() + { + return 5[1872] ?? 6(1872, 34842, 14); + } + + public static string ??() + { + return 5[1873] ?? 6(1873, 34856, 18); + } + + public static string ??() + { + return 5[1874] ?? 6(1874, 34874, 20); + } + + public static string ??() + { + return 5[1875] ?? 6(1875, 34894, 14); + } + + public static string ??() + { + return 5[1876] ?? 6(1876, 34908, 13); + } + + public static string ??() + { + return 5[1877] ?? 6(1877, 34921, 13); + } + + public static string ??() + { + return 5[1878] ?? 6(1878, 34934, 10); + } + + public static string ??() + { + return 5[1879] ?? 6(1879, 34944, 22); + } + + public static string ??() + { + return 5[1880] ?? 6(1880, 34966, 30); + } + + public static string ??() + { + return 5[1881] ?? 6(1881, 34996, 13); + } + + public static string ??() + { + return 5[1882] ?? 6(1882, 35009, 13); + } + + public static string ??() + { + return 5[1883] ?? 6(1883, 35022, 16); + } + + public static string ??() + { + return 5[1884] ?? 6(1884, 35038, 11); + } + + public static string ??() + { + return 5[1885] ?? 6(1885, 35049, 9); + } + + public static string ??() + { + return 5[1886] ?? 6(1886, 35058, 13); + } + + public static string ??() + { + return 5[1887] ?? 6(1887, 35071, 14); + } + + public static string ??() + { + return 5[1888] ?? 6(1888, 35085, 15); + } + + public static string ??() + { + return 5[1889] ?? 6(1889, 35100, 12); + } + + public static string ??() + { + return 5[1890] ?? 6(1890, 35112, 42); + } + + public static string ??() + { + return 5[1891] ?? 6(1891, 35154, 17); + } + + public static string ??() + { + return 5[1892] ?? 6(1892, 35171, 1); + } + + public static string ??() + { + return 5[1893] ?? 6(1893, 35172, 2); + } + + public static string ??() + { + return 5[1894] ?? 6(1894, 35174, 4); + } + + public static string ??() + { + return 5[1895] ?? 6(1895, 35178, 4); + } + + public static string ??() + { + return 5[1896] ?? 6(1896, 35182, 24); + } + + public static string ??() + { + return 5[1897] ?? 6(1897, 35206, 31); + } + + public static string ??() + { + return 5[1898] ?? 6(1898, 35237, 28); + } + + public static string ??() + { + return 5[1899] ?? 6(1899, 35265, 9); + } + + public static string ??() + { + return 5[1900] ?? 6(1900, 35274, 17); + } + + public static string ??() + { + return 5[1901] ?? 6(1901, 35291, 10); + } + + public static string ??() + { + return 5[1902] ?? 6(1902, 35301, 11); + } + + public static string ??() + { + return 5[1903] ?? 6(1903, 35312, 7); + } + + public static string ??() + { + return 5[1904] ?? 6(1904, 35319, 17); + } + + public static string ??() + { + return 5[1905] ?? 6(1905, 35336, 11); + } + + public static string ??() + { + return 5[1906] ?? 6(1906, 35347, 10); + } + + public static string ??() + { + return 5[1907] ?? 6(1907, 35357, 20); + } + + public static string ??() + { + return 5[1908] ?? 6(1908, 35377, 25); + } + + public static string ??() + { + return 5[1909] ?? 6(1909, 35402, 27); + } + + public static string ??() + { + return 5[1910] ?? 6(1910, 35429, 28); + } + + public static string ??() + { + return 5[1911] ?? 6(1911, 35457, 28); + } + + public static string ??() + { + return 5[1912] ?? 6(1912, 35485, 28); + } + + public static string ??() + { + return 5[1913] ?? 6(1913, 35513, 30); + } + + public static string ??() + { + return 5[1914] ?? 6(1914, 35543, 12); + } + + public static string ??() + { + return 5[1915] ?? 6(1915, 35555, 18); + } + + public static string ??() + { + return 5[1916] ?? 6(1916, 35573, 24); + } + + public static string ??() + { + return 5[1917] ?? 6(1917, 35597, 12); + } + + public static string ??() + { + return 5[1918] ?? 6(1918, 35609, 22); + } + + public static string ??() + { + return 5[1919] ?? 6(1919, 35631, 43); + } + + public static string ??() + { + return 5[1920] ?? 6(1920, 35674, 4); + } + + public static string ??() + { + return 5[1921] ?? 6(1921, 35678, 4); + } + + public static string ??() + { + return 5[1922] ?? 6(1922, 35682, 4); + } + + public static string ??() + { + return 5[1923] ?? 6(1923, 35686, 21); + } + + public static string ??() + { + return 5[1924] ?? 6(1924, 35707, 7); + } + + public static string ??() + { + return 5[1925] ?? 6(1925, 35714, 11); + } + + public static string ??() + { + return 5[1926] ?? 6(1926, 35725, 11); + } + + public static string ??() + { + return 5[1927] ?? 6(1927, 35736, 5); + } + + public static string ??() + { + return 5[1928] ?? 6(1928, 35741, 8); + } + + public static string ??() + { + return 5[1929] ?? 6(1929, 35749, 12); + } + + public static string ??() + { + return 5[1930] ?? 6(1930, 35761, 6); + } + + public static string ??() + { + return 5[1931] ?? 6(1931, 35767, 3); + } + + public static string ??() + { + return 5[1932] ?? 6(1932, 35770, 3); + } + + public static string ??() + { + return 5[1933] ?? 6(1933, 35773, 151); + } + + public static string ??() + { + return 5[1934] ?? 6(1934, 35924, 2); + } + + public static string ??() + { + return 5[1935] ?? 6(1935, 35926, 14); + } + + public static string ??() + { + return 5[1936] ?? 6(1936, 35940, 47); + } + + public static string ??() + { + return 5[1937] ?? 6(1937, 35987, 49); + } + + public static string ??() + { + return 5[1938] ?? 6(1938, 36036, 47); + } + + public static string ??() + { + return 5[1939] ?? 6(1939, 36083, 49); + } + + public static string ??() + { + return 5[1940] ?? 6(1940, 36132, 3); + } + + public static string ??() + { + return 5[1941] ?? 6(1941, 36135, 52); + } + + public static string ??() + { + return 5[1942] ?? 6(1942, 36187, 152); + } + + public static string ??() + { + return 5[1943] ?? 6(1943, 36339, 54); + } + + public static string ??() + { + return 5[1944] ?? 6(1944, 36393, 52); + } + + public static string ??() + { + return 5[1945] ?? 6(1945, 36445, 54); + } + + public static string ??() + { + return 5[1946] ?? 6(1946, 36499, 3); + } + + public static string ??() + { + return 5[1947] ?? 6(1947, 36502, 13); + } + + public static string ??() + { + return 5[1948] ?? 6(1948, 36515, 150); + } + + public static string ??() + { + return 5[1949] ?? 6(1949, 36665, 49); + } + + public static string ??() + { + return 5[1950] ?? 6(1950, 36714, 51); + } + + public static string ??() + { + return 5[1951] ?? 6(1951, 36765, 49); + } + + public static string ??() + { + return 5[1952] ?? 6(1952, 36814, 51); + } + + public static string ??() + { + return 5[1953] ?? 6(1953, 36865, 13); + } + + public static string ??() + { + return 5[1954] ?? 6(1954, 36878, 4); + } + + public static string ??() + { + return 5[1955] ?? 6(1955, 36882, 15); + } + + public static string ??() + { + return 5[1956] ?? 6(1956, 36897, 158); + } + + public static string ??() + { + return 5[1957] ?? 6(1957, 37055, 2); + } + + public static string ??() + { + return 5[1958] ?? 6(1958, 37057, 7); + } + + public static string ??() + { + return 5[1959] ?? 6(1959, 37064, 4); + } + + public static string ??() + { + return 5[1960] ?? 6(1960, 37068, 4); + } + + public static string ??() + { + return 5[1961] ?? 6(1961, 37072, 10); + } + + public static string ??() + { + return 5[1962] ?? 6(1962, 37082, 10); + } + + public static string ??() + { + return 5[1963] ?? 6(1963, 37092, 8); + } + + public static string ??() + { + return 5[1964] ?? 6(1964, 37100, 16); + } + + public static string ??() + { + return 5[1965] ?? 6(1965, 37116, 165); + } + + public static string ??() + { + return 5[1966] ?? 6(1966, 37281, 7); + } + + public static string ??() + { + return 5[1967] ?? 6(1967, 37288, 8); + } + + public static string ??() + { + return 5[1968] ?? 6(1968, 37296, 6); + } + + public static string ??() + { + return 5[1969] ?? 6(1969, 37302, 1); + } + + public static string ??() + { + return 5[1970] ?? 6(1970, 37303, 2); + } + + public static string ??() + { + return 5[1971] ?? 6(1971, 37305, 1); + } + + public static string ??() + { + return 5[1972] ?? 6(1972, 37306, 5); + } + + public static string ??() + { + return 5[1973] ?? 6(1973, 37311, 8); + } + + public static string ??() + { + return 5[1974] ?? 6(1974, 37319, 12); + } + + public static string ??() + { + return 5[1975] ?? 6(1975, 37331, 13); + } + + public static string ??() + { + return 5[1976] ?? 6(1976, 37344, 10); + } + + public static string ??() + { + return 5[1977] ?? 6(1977, 37354, 17); + } + + public static string ??() + { + return 5[1978] ?? 6(1978, 37371, 12); + } + + public static string ??() + { + return 5[1979] ?? 6(1979, 37383, 12); + } + + public static string ??() + { + return 5[1980] ?? 6(1980, 37395, 10); + } + + public static string ??() + { + return 5[1981] ?? 6(1981, 37405, 17); + } + + public static string ??() + { + return 5[1982] ?? 6(1982, 37422, 2); + } + + public static string ??() + { + return 5[1983] ?? 6(1983, 37424, 3); + } + + public static string ??() + { + return 5[1984] ?? 6(1984, 37427, 2); + } + + public static string ??() + { + return 5[1985] ?? 6(1985, 37429, 7); + } + + public static string ??() + { + return 5[1986] ?? 6(1986, 37436, 8); + } + + public static string ??() + { + return 5[1987] ?? 6(1987, 37444, 21); + } + + public static string ??() + { + return 5[1988] ?? 6(1988, 37465, 22); + } + + public static string ??() + { + return 5[1989] ?? 6(1989, 37487, 22); + } + + public static string ??() + { + return 5[1990] ?? 6(1990, 37509, 25); + } + + public static string ??() + { + return 5[1991] ?? 6(1991, 37534, 16); + } + + public static string ??() + { + return 5[1992] ?? 6(1992, 37550, 7); + } + + public static string ??() + { + return 5[1993] ?? 6(1993, 37557, 17); + } + + public static string ??() + { + return 5[1994] ?? 6(1994, 37574, 6); + } + + public static string ??() + { + return 5[1995] ?? 6(1995, 37580, 4); + } + + public static string ??() + { + return 5[1996] ?? 6(1996, 37584, 3); + } + + public static string ??() + { + return 5[1997] ?? 6(1997, 37587, 15); + } + + public static string ??() + { + return 5[1998] ?? 6(1998, 37602, 37); + } + + public static string ??() + { + return 5[1999] ?? 6(1999, 37639, 7); + } + + public static string ??() + { + return 5[2000] ?? 6(2000, 37646, 7); + } + + public static string ??() + { + return 5[2001] ?? 6(2001, 37653, 9); + } + + public static string ??() + { + return 5[2002] ?? 6(2002, 37662, 9); + } + + public static string ??() + { + return 5[2003] ?? 6(2003, 37671, 18); + } + + public static string ??() + { + return 5[2004] ?? 6(2004, 37689, 18); + } + + public static string ??() + { + return 5[2005] ?? 6(2005, 37707, 16); + } + + public static string ??() + { + return 5[2006] ?? 6(2006, 37723, 14); + } + + public static string ??() + { + return 5[2007] ?? 6(2007, 37737, 17); + } + + public static string ??() + { + return 5[2008] ?? 6(2008, 37754, 14); + } + + public static string ??() + { + return 5[2009] ?? 6(2009, 37768, 17); + } + + public static string ??() + { + return 5[2010] ?? 6(2010, 37785, 38); + } + + public static string ??() + { + return 5[2011] ?? 6(2011, 37823, 18); + } + + public static string ??() + { + return 5[2012] ?? 6(2012, 37841, 8); + } + + public static string ??() + { + return 5[2013] ?? 6(2013, 37849, 11); + } + + public static string ??() + { + return 5[2014] ?? 6(2014, 37860, 6); + } + + public static string ??() + { + return 5[2015] ?? 6(2015, 37866, 10); + } + + public static string ??() + { + return 5[2016] ?? 6(2016, 37876, 9); + } + + public static string ??() + { + return 5[2017] ?? 6(2017, 37885, 5); + } + + public static string ??() + { + return 5[2018] ?? 6(2018, 37890, 10); + } + + public static string ??() + { + return 5[2019] ?? 6(2019, 37900, 12); + } + + public static string ??() + { + return 5[2020] ?? 6(2020, 37912, 20); + } + + public static string ??() + { + return 5[2021] ?? 6(2021, 37932, 11); + } + + public static string ??() + { + return 5[2022] ?? 6(2022, 37943, 13); + } + + public static string ??() + { + return 5[2023] ?? 6(2023, 37956, 11); + } + + public static string ??() + { + return 5[2024] ?? 6(2024, 37967, 8); + } + + public static string ??() + { + return 5[2025] ?? 6(2025, 37975, 6); + } + + public static string ??() + { + return 5[2026] ?? 6(2026, 37981, 13); + } + + public static string ??() + { + return 5[2027] ?? 6(2027, 37994, 11); + } + + public static string ??() + { + return 5[2028] ?? 6(2028, 38005, 19); + } + + public static string ??() + { + return 5[2029] ?? 6(2029, 38024, 49); + } + + public static string ??() + { + return 5[2030] ?? 6(2030, 38073, 8); + } + + public static string ??() + { + return 5[2031] ?? 6(2031, 38081, 23); + } + + public static string ??() + { + return 5[2032] ?? 6(2032, 38104, 17); + } + + public static string ??() + { + return 5[2033] ?? 6(2033, 38121, 58); + } + + public static string ??() + { + return 5[2034] ?? 6(2034, 38179, 14); + } + + public static string ??() + { + return 5[2035] ?? 6(2035, 38193, 28); + } + + public static string ??() + { + return 5[2036] ?? 6(2036, 38221, 38); + } + + public static string ??() + { + return 5[2037] ?? 6(2037, 38259, 32); + } + + public static string ??() + { + return 5[2038] ?? 6(2038, 38291, 77); + } + + public static string ??() + { + return 5[2039] ?? 6(2039, 38368, 13); + } + + public static string ??() + { + return 5[2040] ?? 6(2040, 38381, 6); + } + + public static string ??() + { + return 5[2041] ?? 6(2041, 38387, 37); + } + + public static string ??() + { + return 5[2042] ?? 6(2042, 38424, 14); + } + + public static string ??() + { + return 5[2043] ?? 6(2043, 38438, 14); + } + + public static string ??() + { + return 5[2044] ?? 6(2044, 38452, 12); + } + + public static string ??() + { + return 5[2045] ?? 6(2045, 38464, 12); + } + + public static string ??() + { + return 5[2046] ?? 6(2046, 38476, 13); + } + + public static string ??() + { + return 5[2047] ?? 6(2047, 38489, 24); + } + + public static string ??() + { + return 5[2048] ?? 6(2048, 38513, 8); + } + + public static string ??() + { + return 5[2049] ?? 6(2049, 38521, 1); + } + + public static string ??() + { + return 5[2050] ?? 6(2050, 38522, 3); + } + + public static string ??() + { + return 5[2051] ?? 6(2051, 38525, 33); + } + + public static string ??() + { + return 5[2052] ?? 6(2052, 38558, 20); + } + + public static string ??() + { + return 5[2053] ?? 6(2053, 38578, 23); + } + + public static string ??() + { + return 5[2054] ?? 6(2054, 38601, 13); + } + + public static string ??() + { + return 5[2055] ?? 6(2055, 38614, 13); + } + + public static string ??() + { + return 5[2056] ?? 6(2056, 38627, 14); + } + + public static string ??() + { + return 5[2057] ?? 6(2057, 38641, 16); + } + + public static string ??() + { + return 5[2058] ?? 6(2058, 38657, 4); + } + + public static string ??() + { + return 5[2059] ?? 6(2059, 38661, 160); + } + + public static string ??() + { + return 5[2060] ?? 6(2060, 38821, 22); + } + + public static string ??() + { + return 5[2061] ?? 6(2061, 38843, 15); + } + + public static string ??() + { + return 5[2062] ?? 6(2062, 38858, 17); + } + + public static string ??() + { + return 5[2063] ?? 6(2063, 38875, 4); + } + + public static string ??() + { + return 5[2064] ?? 6(2064, 38879, 10); + } + + public static string ??() + { + return 5[2065] ?? 6(2065, 38889, 3); + } + + public static string ??() + { + return 5[2066] ?? 6(2066, 38892, 155); + } + + public static string ??() + { + return 5[2067] ?? 6(2067, 39047, 12); + } + + static 3E560F35-EA4B-4F47-8302-BE30F80C1E18() + { + for (int i = 0; i < 4.Length; i++) + { + 4[i] = (byte)(4[i] ^ i ^ 0xAA); + } + } + } +} diff --git a/lib/._QuanTAlib.Tests.csproj b/lib/._QuanTAlib.Tests.csproj new file mode 100644 index 0000000000000000000000000000000000000000..62309917fc092b44ce531bf39b41b79bdc6fa1b5 GIT binary patch literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vf+zv$ zV3+~K+-O=D5#plB`MG+D1qC^&dId%KWvO|IdC92^j7$t)7L;F~E-P${rgfA%8Umvs zFd71*Aut*OqaiRF0;3@?8UmvsFd71*Aut*O*h2u+*#u!QkPFGkELJE=EzU13N={Ws y%P-1S$jmEA%`3^w&r8h7sZ_{GO)F7I%1O-22KI%ax`s4`>VLRbWEkZB{|5lH?I - - - - true - - - - obj\tests\ - bin\tests\ - bin\tests\$(Configuration)\ - - + + + + + true + + + + obj\tests\ + bin\tests\ + bin\tests\$(Configuration)\ + + diff --git a/lib/QuanTAlib.Tests.csproj b/lib/QuanTAlib.Tests.csproj index 0959c97e..b4cc5f7b 100644 --- a/lib/QuanTAlib.Tests.csproj +++ b/lib/QuanTAlib.Tests.csproj @@ -1,46 +1,42 @@ - - - - net10.0 - - enable - enable - false - true - false - false - $(NoWarn);CS8892 - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - daily_IBM.csv - - - - + + + + net10.0 + enable + enable + false + true + $(NoWarn);CS8892 + false + + + + + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + daily_IBM.csv + + + + diff --git a/lib/averages/ema/Ema.Quantower.cs b/lib/averages/ema/Ema.Quantower.cs index 5e93fc0a..cb415efb 100644 --- a/lib/averages/ema/Ema.Quantower.cs +++ b/lib/averages/ema/Ema.Quantower.cs @@ -1,58 +1,58 @@ -using System.Drawing; -using TradingPlatform.BusinessLayer; - -namespace QuanTAlib; - -public class EmaIndicator : Indicator, IWatchlistIndicator -{ - [InputParameter("Period", sortIndex: 1, 1, 1000, 1, 0)] - public int Period { get; set; } = 10; - - [IndicatorExtensions.DataSourceInput] - public SourceType Source { get; set; } = SourceType.Close; - - [InputParameter("Show cold values", sortIndex: 21)] - public bool ShowColdValues { get; set; } = true; - - private Ema? ma; - protected LineSeries? Series; - protected string? SourceName; - - public int MinHistoryDepths => Period; - int IWatchlistIndicator.MinHistoryDepths => MinHistoryDepths; - - public override string ShortName => $"EMA {Period}:{SourceName}"; - - public EmaIndicator() - { - OnBackGround = true; - SeparateWindow = false; - SourceName = Source.ToString(); - Name = "EMA - Exponential Moving Average"; - Description = "Exponential Moving Average"; - Series = new(name: $"EMA {Period}", color: IndicatorExtensions.Averages, width: 2, style: LineStyle.Solid); - AddLineSeries(Series); - } - - protected override void OnInit() - { - ma = new Ema(Period); - SourceName = Source.ToString(); - base.OnInit(); - } - - protected override void OnUpdate(UpdateArgs args) - { - TValue input = this.GetInputValue(args, Source); - bool isNew = args.Reason == UpdateReason.NewBar || args.Reason == UpdateReason.HistoricalBar; - TValue result = ma!.Update(input, isNew); - Series!.SetValue(result.Value); - Series!.SetMarker(0, Color.Transparent); //OnPaintChart draws the line, hidden here - } - - public override void OnPaintChart(PaintChartEventArgs args) - { - base.OnPaintChart(args); - this.PaintSmoothCurve(args, Series!, 0, showColdValues: ShowColdValues, tension: 0.2); - } -} +using System.Drawing; +using TradingPlatform.BusinessLayer; + +namespace QuanTAlib; + +public class EmaIndicator : Indicator, IWatchlistIndicator +{ + [InputParameter("Period", sortIndex: 1, 1, 1000, 1, 0)] + public int Period { get; set; } = 10; + + [IndicatorExtensions.DataSourceInput] + public SourceType Source { get; set; } = SourceType.Close; + + [InputParameter("Show cold values", sortIndex: 21)] + public bool ShowColdValues { get; set; } = true; + + private Ema? ma; + protected LineSeries? Series; + protected string? SourceName; + + public int MinHistoryDepths => Period; + int IWatchlistIndicator.MinHistoryDepths => MinHistoryDepths; + + public override string ShortName => $"EMA {Period}:{SourceName}"; + + public EmaIndicator() + { + OnBackGround = true; + SeparateWindow = false; + SourceName = Source.ToString(); + Name = "EMA - Exponential Moving Average"; + Description = "Exponential Moving Average"; + Series = new(name: $"EMA {Period}", color: IndicatorExtensions.Averages, width: 2, style: LineStyle.Solid); + AddLineSeries(Series); + } + + protected override void OnInit() + { + ma = new Ema(Period); + SourceName = Source.ToString(); + base.OnInit(); + } + + protected override void OnUpdate(UpdateArgs args) + { + TValue input = this.GetInputValue(args, Source); + bool isNew = args.Reason == UpdateReason.NewBar || args.Reason == UpdateReason.HistoricalBar; + TValue result = ma!.Update(input, isNew); + Series!.SetValue(result.Value); + Series!.SetMarker(0, Color.Transparent); //OnPaintChart draws the line, hidden here + } + + public override void OnPaintChart(PaintChartEventArgs args) + { + base.OnPaintChart(args); + this.PaintSmoothCurve(args, Series!, 0, showColdValues: ShowColdValues, tension: 0.2); + } +} diff --git a/lib/averages/ema/Ema.Tests.cs b/lib/averages/ema/Ema.Tests.cs index 2cb381cd..d5dce2fd 100644 --- a/lib/averages/ema/Ema.Tests.cs +++ b/lib/averages/ema/Ema.Tests.cs @@ -1,228 +1,228 @@ -using System; -using Xunit; -using QuanTAlib; - -namespace QuanTAlib.Tests; - -public class EmaTests -{ - [Fact] - public void Ema_Constructor_Period_ValidatesInput() - { - Assert.Throws(() => new Ema(0)); - Assert.Throws(() => new Ema(-1)); - - var ema = new Ema(10); - Assert.NotNull(ema); - } - - [Fact] - public void Ema_Constructor_Alpha_ValidatesInput() - { - Assert.Throws(() => new Ema(0.0)); - Assert.Throws(() => new Ema(-0.1)); - Assert.Throws(() => new Ema(1.1)); - - var ema = new Ema(0.5); - Assert.NotNull(ema); - } - - [Fact] - public void Ema_Calc_ReturnsValue() - { - var ema = new Ema(10); - - Assert.Equal(0, ema.Value.Value); - - TValue result = ema.Update(new TValue(DateTime.Now, 100)); - - Assert.True(result.Value > 0); - Assert.Equal(result.Value, ema.Value.Value); - } - - [Fact] - public void Ema_Calc_IsNew_AcceptsParameter() - { - var ema = new Ema(10); - - ema.Update(new TValue(DateTime.Now, 100), isNew: true); - double value1 = ema.Value; - - ema.Update(new TValue(DateTime.Now, 105), isNew: true); - double value2 = ema.Value; - - // Values should change with new bars - Assert.NotEqual(value1, value2); - } - - [Fact] - public void Ema_Calc_IsNew_False_UpdatesValue() - { - var ema = new Ema(10); - - ema.Update(new TValue(DateTime.Now, 100)); - ema.Update(new TValue(DateTime.Now, 110), isNew: true); - double beforeUpdate = ema.Value; - - ema.Update(new TValue(DateTime.Now, 120), isNew: false); - double afterUpdate = ema.Value; - - // Update should change the value - Assert.NotEqual(beforeUpdate, afterUpdate); - } - - [Fact] - public void Ema_Reset_ClearsState() - { - var ema = new Ema(10); - - ema.Update(new TValue(DateTime.Now, 100)); - ema.Update(new TValue(DateTime.Now, 105)); - double valueBefore = ema.Value; - - ema.Reset(); - - Assert.Equal(0, ema.Value.Value); - - // After reset, should accept new values - ema.Update(new TValue(DateTime.Now, 50)); - Assert.NotEqual(0, ema.Value.Value); - Assert.NotEqual(valueBefore, ema.Value.Value); - } - - [Fact] - public void Ema_Properties_Accessible() - { - var ema = new Ema(10); - - Assert.Equal(0, ema.Value.Value); - Assert.False(ema.IsHot); - - ema.Update(new TValue(DateTime.Now, 100)); - - Assert.NotEqual(0, ema.Value.Value); - } - - [Fact] - public void Ema_IsHot_BecomesTrueAfterWarmup() - { - var ema = new Ema(10); - - // Initially IsHot should be false - Assert.False(ema.IsHot); - - // Feed values until it warms up - // Warmup condition is state.E <= 1e-10 - // state.E starts at 1.0 and decays by (1 - alpha) each step - // alpha = 2 / (10 + 1) = 2/11 ~= 0.1818 - // (1 - alpha) ~= 0.8181 - // 1.0 * (0.8181)^n <= 1e-10 - // n * log(0.8181) <= log(1e-10) - // n * -0.200 <= -23.02 - // n >= 115 steps roughly - - int steps = 0; - while (!ema.IsHot && steps < 1000) - { - ema.Update(new TValue(DateTime.Now, 100)); - steps++; - } - - Assert.True(ema.IsHot); - Assert.True(steps > 0); // Should take some steps - } - - [Fact] - public void Ema_PeriodEquivalence_BothConstructorsWork() - { - int period = 20; - double alpha = 2.0 / (period + 1); - - var emaPeriod = new Ema(period); - var emaAlpha = new Ema(alpha); - - // Both should accept Calc calls and produce same result - TValue result1 = emaPeriod.Update(new TValue(DateTime.Now, 100)); - TValue result2 = emaAlpha.Update(new TValue(DateTime.Now, 100)); - - Assert.Equal(result1.Value, result2.Value, 1e-10); - } - - [Fact] - public void Ema_IterativeCorrections_RestoreToOriginalState() - { - var ema = new Ema(10); - var gbm = new GBM(startPrice: 100.0, mu: 0.02, sigma: 0.1); - - // Feed 10 new values - TValue tenthInput = default; - for (int i = 0; i < 10; i++) - { - var bar = gbm.Next(isNew: true); - tenthInput = new TValue(bar.Time, bar.Close); - ema.Update(tenthInput, isNew: true); - } - - // Remember EMA state after 10 values - double emaAfterTen = ema.Value; - - // Generate 9 corrections with isNew=false (different values) - for (int i = 0; i < 9; i++) - { - var bar = gbm.Next(isNew: false); - ema.Update(new TValue(bar.Time, bar.Close), isNew: false); - } - - // Feed the remembered 10th input again with isNew=false - TValue finalEma = ema.Update(tenthInput, isNew: false); - - // EMA should match the original state after 10 values - Assert.Equal(emaAfterTen, finalEma.Value, 1e-10); - } - - [Fact] - public void Ema_BatchCalc_MatchesIterativeCalc() - { - var emaIterative = new Ema(10); - var emaBatch = new Ema(10); - var gbm = new GBM(startPrice: 100.0, mu: 0.02, sigma: 0.1); - - // Generate data - var series = new TSeries(); - for (int i = 0; i < 100; i++) - { - var bar = gbm.Next(isNew: true); - series.Add(bar.Time, bar.Close); - } - - // Calculate iteratively - var iterativeResults = new TSeries(); - foreach (var item in series) - { - iterativeResults.Add(emaIterative.Update(item)); - } - - // Calculate batch - var batchResults = emaBatch.Update(series); - - // Compare - Assert.Equal(iterativeResults.Count, batchResults.Count); - for (int i = 0; i < iterativeResults.Count; i++) - { - Assert.Equal(iterativeResults[i].Value, batchResults[i].Value, 1e-10); - Assert.Equal(iterativeResults[i].Time, batchResults[i].Time); - } - } - - [Fact] - public void Ema_Result_ImplicitConversionToDouble() - { - var ema = new Ema(10); - ema.Update(new TValue(DateTime.Now, 100)); - - // This should compile and work because TValue has implicit conversion to double - double result = ema.Value; - - Assert.Equal(100.0, result, 1e-10); - } -} +using System; +using Xunit; +using QuanTAlib; + +namespace QuanTAlib.Tests; + +public class EmaTests +{ + [Fact] + public void Ema_Constructor_Period_ValidatesInput() + { + Assert.Throws(() => new Ema(0)); + Assert.Throws(() => new Ema(-1)); + + var ema = new Ema(10); + Assert.NotNull(ema); + } + + [Fact] + public void Ema_Constructor_Alpha_ValidatesInput() + { + Assert.Throws(() => new Ema(0.0)); + Assert.Throws(() => new Ema(-0.1)); + Assert.Throws(() => new Ema(1.1)); + + var ema = new Ema(0.5); + Assert.NotNull(ema); + } + + [Fact] + public void Ema_Calc_ReturnsValue() + { + var ema = new Ema(10); + + Assert.Equal(0, ema.Value.Value); + + TValue result = ema.Update(new TValue(DateTime.Now, 100)); + + Assert.True(result.Value > 0); + Assert.Equal(result.Value, ema.Value.Value); + } + + [Fact] + public void Ema_Calc_IsNew_AcceptsParameter() + { + var ema = new Ema(10); + + ema.Update(new TValue(DateTime.Now, 100), isNew: true); + double value1 = ema.Value; + + ema.Update(new TValue(DateTime.Now, 105), isNew: true); + double value2 = ema.Value; + + // Values should change with new bars + Assert.NotEqual(value1, value2); + } + + [Fact] + public void Ema_Calc_IsNew_False_UpdatesValue() + { + var ema = new Ema(10); + + ema.Update(new TValue(DateTime.Now, 100)); + ema.Update(new TValue(DateTime.Now, 110), isNew: true); + double beforeUpdate = ema.Value; + + ema.Update(new TValue(DateTime.Now, 120), isNew: false); + double afterUpdate = ema.Value; + + // Update should change the value + Assert.NotEqual(beforeUpdate, afterUpdate); + } + + [Fact] + public void Ema_Reset_ClearsState() + { + var ema = new Ema(10); + + ema.Update(new TValue(DateTime.Now, 100)); + ema.Update(new TValue(DateTime.Now, 105)); + double valueBefore = ema.Value; + + ema.Reset(); + + Assert.Equal(0, ema.Value.Value); + + // After reset, should accept new values + ema.Update(new TValue(DateTime.Now, 50)); + Assert.NotEqual(0, ema.Value.Value); + Assert.NotEqual(valueBefore, ema.Value.Value); + } + + [Fact] + public void Ema_Properties_Accessible() + { + var ema = new Ema(10); + + Assert.Equal(0, ema.Value.Value); + Assert.False(ema.IsHot); + + ema.Update(new TValue(DateTime.Now, 100)); + + Assert.NotEqual(0, ema.Value.Value); + } + + [Fact] + public void Ema_IsHot_BecomesTrueAfterWarmup() + { + var ema = new Ema(10); + + // Initially IsHot should be false + Assert.False(ema.IsHot); + + // Feed values until it warms up + // Warmup condition is state.E <= 1e-10 + // state.E starts at 1.0 and decays by (1 - alpha) each step + // alpha = 2 / (10 + 1) = 2/11 ~= 0.1818 + // (1 - alpha) ~= 0.8181 + // 1.0 * (0.8181)^n <= 1e-10 + // n * log(0.8181) <= log(1e-10) + // n * -0.200 <= -23.02 + // n >= 115 steps roughly + + int steps = 0; + while (!ema.IsHot && steps < 1000) + { + ema.Update(new TValue(DateTime.Now, 100)); + steps++; + } + + Assert.True(ema.IsHot); + Assert.True(steps > 0); // Should take some steps + } + + [Fact] + public void Ema_PeriodEquivalence_BothConstructorsWork() + { + int period = 20; + double alpha = 2.0 / (period + 1); + + var emaPeriod = new Ema(period); + var emaAlpha = new Ema(alpha); + + // Both should accept Calc calls and produce same result + TValue result1 = emaPeriod.Update(new TValue(DateTime.Now, 100)); + TValue result2 = emaAlpha.Update(new TValue(DateTime.Now, 100)); + + Assert.Equal(result1.Value, result2.Value, 1e-10); + } + + [Fact] + public void Ema_IterativeCorrections_RestoreToOriginalState() + { + var ema = new Ema(10); + var gbm = new GBM(startPrice: 100.0, mu: 0.02, sigma: 0.1); + + // Feed 10 new values + TValue tenthInput = default; + for (int i = 0; i < 10; i++) + { + var bar = gbm.Next(isNew: true); + tenthInput = new TValue(bar.Time, bar.Close); + ema.Update(tenthInput, isNew: true); + } + + // Remember EMA state after 10 values + double emaAfterTen = ema.Value; + + // Generate 9 corrections with isNew=false (different values) + for (int i = 0; i < 9; i++) + { + var bar = gbm.Next(isNew: false); + ema.Update(new TValue(bar.Time, bar.Close), isNew: false); + } + + // Feed the remembered 10th input again with isNew=false + TValue finalEma = ema.Update(tenthInput, isNew: false); + + // EMA should match the original state after 10 values + Assert.Equal(emaAfterTen, finalEma.Value, 1e-10); + } + + [Fact] + public void Ema_BatchCalc_MatchesIterativeCalc() + { + var emaIterative = new Ema(10); + var emaBatch = new Ema(10); + var gbm = new GBM(startPrice: 100.0, mu: 0.02, sigma: 0.1); + + // Generate data + var series = new TSeries(); + for (int i = 0; i < 100; i++) + { + var bar = gbm.Next(isNew: true); + series.Add(bar.Time, bar.Close); + } + + // Calculate iteratively + var iterativeResults = new TSeries(); + foreach (var item in series) + { + iterativeResults.Add(emaIterative.Update(item)); + } + + // Calculate batch + var batchResults = emaBatch.Update(series); + + // Compare + Assert.Equal(iterativeResults.Count, batchResults.Count); + for (int i = 0; i < iterativeResults.Count; i++) + { + Assert.Equal(iterativeResults[i].Value, batchResults[i].Value, 1e-10); + Assert.Equal(iterativeResults[i].Time, batchResults[i].Time); + } + } + + [Fact] + public void Ema_Result_ImplicitConversionToDouble() + { + var ema = new Ema(10); + ema.Update(new TValue(DateTime.Now, 100)); + + // This should compile and work because TValue has implicit conversion to double + double result = ema.Value; + + Assert.Equal(100.0, result, 1e-10); + } +} diff --git a/lib/averages/ema/Ema.Validation.Tests.cs b/lib/averages/ema/Ema.Validation.Tests.cs index 49b68ef8..57efd191 100644 --- a/lib/averages/ema/Ema.Validation.Tests.cs +++ b/lib/averages/ema/Ema.Validation.Tests.cs @@ -1,198 +1,198 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Skender.Stock.Indicators; -using TALib; -using Tulip; -using Xunit; -using Xunit.Abstractions; -using QuanTAlib; - -namespace QuanTAlib.Tests; - -public class EmaValidationTests : IDisposable -{ - private readonly TBarSeries _bars; - private readonly TSeries _data; - private readonly List _skenderQuotes; - private readonly Random _rnd = new(42); - private readonly ITestOutputHelper _output; - - public EmaValidationTests(ITestOutputHelper output) - { - _output = output; - - // 1. Generate 1000 records using GBM feed - var gbm = new GBM(startPrice: 100.0, mu: 0.05, sigma: 0.2); - _bars = gbm.Fetch(1000, DateTime.UtcNow.Ticks, TimeSpan.FromMinutes(1)); - - // 2. Extract Close TSeries - _data = _bars.Close; - - // 3. Prepare data for Skender (List) - _skenderQuotes = new List(); - for (int i = 0; i < _bars.Count; i++) - { - _skenderQuotes.Add(new Quote - { - Date = new DateTime(_bars.Open.Times[i]), - Open = (decimal)_bars.Open[i].Value, - High = (decimal)_bars.High[i].Value, - Low = (decimal)_bars.Low[i].Value, - Close = (decimal)_bars.Close[i].Value, - Volume = (decimal)_bars.Volume[i].Value - }); - } - } - - public void Dispose() - { - // Cleanup if needed - } - - [Fact] - public void Validate_Skender() - { - int[] periods = { 5, 10, 20, 50, 100 }; - - foreach (var period in periods) - { - // Calculate QuanTAlib EMA - var ema = new global::QuanTAlib.Ema(period); - var qResult = ema.Update(_data); - - // Calculate Skender EMA - var sResult = _skenderQuotes.GetEma(period).ToList(); - - // Compare last 100 records - VerifyData(qResult, sResult, period); - } - _output.WriteLine("EMA validated successfully against Skender"); - } - - [Fact] - public void Validate_Talib() - { - int[] periods = { 5, 10, 20, 50, 100 }; - - // Prepare data for TA-Lib (double[]) - double[] tData = _data.Select(x => x.Value).ToArray(); - double[] output = new double[tData.Length]; - - foreach (var period in periods) - { - // Calculate QuanTAlib EMA - var ema = new global::QuanTAlib.Ema(period); - var qResult = ema.Update(_data); - - // Calculate TA-Lib EMA - var retCode = TALib.Functions.Ema(tData, 0..^0, output, out var outRange, period); - - // Check success - Assert.Equal(Core.RetCode.Success, retCode); - - // TA-Lib skips the lookback period, so output[0] corresponds to input[lookback] - int lookback = TALib.Functions.EmaLookback(period); - - // Compare last 100 records - VerifyData_Talib(qResult, output, outRange, lookback, period); - } - _output.WriteLine("EMA validated successfully against TA-Lib"); - } - - [Fact] - public void Validate_Tulip() - { - int[] periods = { 5, 10, 20, 50, 100 }; - - // Prepare data for Tulip (double[]) - double[] tData = _data.Select(x => x.Value).ToArray(); - - foreach (var period in periods) - { - // Calculate QuanTAlib EMA - var ema = new global::QuanTAlib.Ema(period); - var qResult = ema.Update(_data); - - // Calculate Tulip EMA - var emaIndicator = Tulip.Indicators.ema; - double[][] inputs = { tData }; - double[] options = { (double)period }; - double[][] outputs = { new double[tData.Length] }; - - emaIndicator.Run(inputs, options, outputs); - var tResult = outputs[0]; - - // Compare last 100 records - VerifyData(qResult, tResult.ToList(), period); - } - _output.WriteLine("EMA validated successfully against Tulip"); - } - - private void VerifyData(TSeries qSeries, List tSeries, int period) - { - // Ensure we have enough data - Assert.Equal(qSeries.Count, tSeries.Count); - - int count = qSeries.Count; - int skip = count - 100; // Last 100 records - - for (int i = skip; i < count; i++) - { - double qValue = qSeries[i].Value; - double tValue = tSeries[i]; - if (tValue == 0) continue; - - Assert.Equal(tValue, qValue, 1e-6); - } - } - - private void VerifyData(TSeries qSeries, List sSeries, int period) - { - // Ensure we have enough data - Assert.Equal(qSeries.Count, sSeries.Count); - - int count = qSeries.Count; - int skip = count - 100; // Last 100 records - - for (int i = skip; i < count; i++) - { - double qValue = qSeries[i].Value; - double? sValue = sSeries[i].Ema; - - // Skip if Skender returns null (warmup period) - if (!sValue.HasValue) continue; - - // Assert equality with tolerance - Assert.Equal(sValue.Value, qValue, 1e-6); - } - } - - private void VerifyData_Talib(TSeries qSeries, double[] tOutput, Range outRange, int lookback, int period) - { - int count = qSeries.Count; - int skip = count - 100; // Last 100 records - - // outRange.End.Value is the number of elements written to tOutput - int validCount = outRange.End.Value - outRange.Start.Value; - - for (int i = skip; i < count; i++) - { - double qValue = qSeries[i].Value; - - // Calculate index in tOutput - // If i < lookback, we don't have a value from TA-Lib - if (i < lookback) continue; - - int tIndex = i - lookback; - - // Check if tIndex is within valid range - if (tIndex >= validCount) continue; - - double tValue = tOutput[tIndex]; - - // Assert equality with tolerance - Assert.Equal(tValue, qValue, 1e-6); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using Skender.Stock.Indicators; +using TALib; +using Tulip; +using Xunit; +using Xunit.Abstractions; +using QuanTAlib; + +namespace QuanTAlib.Tests; + +public class EmaValidationTests : IDisposable +{ + private readonly TBarSeries _bars; + private readonly TSeries _data; + private readonly List _skenderQuotes; + private readonly Random _rnd = new(42); + private readonly ITestOutputHelper _output; + + public EmaValidationTests(ITestOutputHelper output) + { + _output = output; + + // 1. Generate 1000 records using GBM feed + var gbm = new GBM(startPrice: 100.0, mu: 0.05, sigma: 0.2); + _bars = gbm.Fetch(1000, DateTime.UtcNow.Ticks, TimeSpan.FromMinutes(1)); + + // 2. Extract Close TSeries + _data = _bars.Close; + + // 3. Prepare data for Skender (List) + _skenderQuotes = new List(); + for (int i = 0; i < _bars.Count; i++) + { + _skenderQuotes.Add(new Quote + { + Date = new DateTime(_bars.Open.Times[i]), + Open = (decimal)_bars.Open[i].Value, + High = (decimal)_bars.High[i].Value, + Low = (decimal)_bars.Low[i].Value, + Close = (decimal)_bars.Close[i].Value, + Volume = (decimal)_bars.Volume[i].Value + }); + } + } + + public void Dispose() + { + // Cleanup if needed + } + + [Fact] + public void Validate_Skender() + { + int[] periods = { 5, 10, 20, 50, 100 }; + + foreach (var period in periods) + { + // Calculate QuanTAlib EMA + var ema = new global::QuanTAlib.Ema(period); + var qResult = ema.Update(_data); + + // Calculate Skender EMA + var sResult = _skenderQuotes.GetEma(period).ToList(); + + // Compare last 100 records + VerifyData(qResult, sResult, period); + } + _output.WriteLine("EMA validated successfully against Skender"); + } + + [Fact] + public void Validate_Talib() + { + int[] periods = { 5, 10, 20, 50, 100 }; + + // Prepare data for TA-Lib (double[]) + double[] tData = _data.Select(x => x.Value).ToArray(); + double[] output = new double[tData.Length]; + + foreach (var period in periods) + { + // Calculate QuanTAlib EMA + var ema = new global::QuanTAlib.Ema(period); + var qResult = ema.Update(_data); + + // Calculate TA-Lib EMA + var retCode = TALib.Functions.Ema(tData, 0..^0, output, out var outRange, period); + + // Check success + Assert.Equal(Core.RetCode.Success, retCode); + + // TA-Lib skips the lookback period, so output[0] corresponds to input[lookback] + int lookback = TALib.Functions.EmaLookback(period); + + // Compare last 100 records + VerifyData_Talib(qResult, output, outRange, lookback, period); + } + _output.WriteLine("EMA validated successfully against TA-Lib"); + } + + [Fact] + public void Validate_Tulip() + { + int[] periods = { 5, 10, 20, 50, 100 }; + + // Prepare data for Tulip (double[]) + double[] tData = _data.Select(x => x.Value).ToArray(); + + foreach (var period in periods) + { + // Calculate QuanTAlib EMA + var ema = new global::QuanTAlib.Ema(period); + var qResult = ema.Update(_data); + + // Calculate Tulip EMA + var emaIndicator = Tulip.Indicators.ema; + double[][] inputs = { tData }; + double[] options = { (double)period }; + double[][] outputs = { new double[tData.Length] }; + + emaIndicator.Run(inputs, options, outputs); + var tResult = outputs[0]; + + // Compare last 100 records + VerifyData(qResult, tResult.ToList(), period); + } + _output.WriteLine("EMA validated successfully against Tulip"); + } + + private void VerifyData(TSeries qSeries, List tSeries, int period) + { + // Ensure we have enough data + Assert.Equal(qSeries.Count, tSeries.Count); + + int count = qSeries.Count; + int skip = count - 100; // Last 100 records + + for (int i = skip; i < count; i++) + { + double qValue = qSeries[i].Value; + double tValue = tSeries[i]; + if (tValue == 0) continue; + + Assert.Equal(tValue, qValue, 1e-6); + } + } + + private void VerifyData(TSeries qSeries, List sSeries, int period) + { + // Ensure we have enough data + Assert.Equal(qSeries.Count, sSeries.Count); + + int count = qSeries.Count; + int skip = count - 100; // Last 100 records + + for (int i = skip; i < count; i++) + { + double qValue = qSeries[i].Value; + double? sValue = sSeries[i].Ema; + + // Skip if Skender returns null (warmup period) + if (!sValue.HasValue) continue; + + // Assert equality with tolerance + Assert.Equal(sValue.Value, qValue, 1e-6); + } + } + + private void VerifyData_Talib(TSeries qSeries, double[] tOutput, Range outRange, int lookback, int period) + { + int count = qSeries.Count; + int skip = count - 100; // Last 100 records + + // outRange.End.Value is the number of elements written to tOutput + int validCount = outRange.End.Value - outRange.Start.Value; + + for (int i = skip; i < count; i++) + { + double qValue = qSeries[i].Value; + + // Calculate index in tOutput + // If i < lookback, we don't have a value from TA-Lib + if (i < lookback) continue; + + int tIndex = i - lookback; + + // Check if tIndex is within valid range + if (tIndex >= validCount) continue; + + double tValue = tOutput[tIndex]; + + // Assert equality with tolerance + Assert.Equal(tValue, qValue, 1e-6); + } + } +} diff --git a/lib/averages/ema/Ema.cs b/lib/averages/ema/Ema.cs index d9241af7..b6858f49 100644 --- a/lib/averages/ema/Ema.cs +++ b/lib/averages/ema/Ema.cs @@ -1,163 +1,163 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuanTAlib; - -public struct EmaState -{ - public double Ema; - public double E; - public bool IsHot; - - public static EmaState New() => new() { Ema = 0, E = 1.0, IsHot = false }; -} - -/// -/// Exponential Moving Average (EMA) - IIR filter with exponential warmup compensator. -/// Provides valid output from first bar with O(1) complexity. -/// -/// -/// Algorithm uses exponential smoothing with compensator for immediate valid results. -/// Reference: https://github.com/mihakralj/pinescript/blob/main/indicators/trends_IIR/ema.md -/// -public class Ema -{ - private readonly double _alpha; - private EmaState _state = EmaState.New(); - private EmaState _p_state = EmaState.New(); - - /// - /// Creates EMA with specified period. - /// Alpha = 2 / (period + 1) - /// - /// Period for EMA calculation (must be > 0) - public Ema(int period) - { - if (period <= 0) - throw new ArgumentException("Period must be greater than 0", nameof(period)); - - _alpha = 2.0 / (period + 1); - } - - /// - /// Creates EMA with specified alpha smoothing factor. - /// - /// Smoothing factor (0 < alpha <= 1) - public Ema(double alpha) - { - if (alpha <= 0 || alpha > 1) - throw new ArgumentException("Alpha must be between 0 and 1", nameof(alpha)); - - _alpha = alpha; - } - - /// - /// Current EMA value. - /// - public TValue Value { get; private set; } - - /// - /// True if the EMA has warmed up and is providing valid results. - /// - public bool IsHot => _state.IsHot; - - /// - /// Core EMA calculation kernel. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static double Compute(double input, double alpha, ref EmaState state) - { - state.Ema += alpha * (input - state.Ema); - - if (!state.IsHot) - { - state.E *= (1.0 - alpha); - state.IsHot = state.E <= 1e-10; - return state.Ema / (1.0 - state.E); - } - - return state.Ema; - } - - /// - /// Updates EMA with the given value. - /// - /// Input value - /// True for new bar, false for update to current bar (default: true) - /// Compensated EMA value - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public TValue Update(TValue input, bool isNew = true) - { - if (isNew) - { - _p_state = _state; - } - else - { - _state = _p_state; - } - - double val = Compute(input.Value, _alpha, ref _state); - Value = new TValue(input.Time, val); - return Value; - } - - /// - /// Updates EMA with the entire series. - /// - /// Input series - /// EMA series - public TSeries Update(TSeries source) - { - int len = source.Count; - var t = new List(len); - var v = new List(len); - CollectionsMarshal.SetCount(t, len); - CollectionsMarshal.SetCount(v, len); - - var tSpan = CollectionsMarshal.AsSpan(t); - var vSpan = CollectionsMarshal.AsSpan(v); - var sourceValues = source.Values; - var sourceTimes = source.Times; - - // Local state for batch processing - EmaState state = _state; - - for (int i = 0; i < len; i++) - { - double val = Compute(sourceValues[i], _alpha, ref state); - tSpan[i] = sourceTimes[i]; - vSpan[i] = val; - } - - // Update instance state to the final state - _state = state; - _p_state = state; // Assume last point is committed - - Value = new TValue(tSpan[len - 1], vSpan[len - 1]); - return new TSeries(t, v); - } - - /// - /// Calculates EMA for the entire series using a new instance. - /// - /// Input series - /// EMA period - /// EMA series - public static TSeries Calculate(TSeries source, int period) - { - var ema = new Ema(period); - return ema.Update(source); - } - - /// - /// Resets the EMA state. - /// - public void Reset() - { - _state = EmaState.New(); - _p_state = _state; - Value = default; - } -} +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuanTAlib; + +public struct EmaState +{ + public double Ema; + public double E; + public bool IsHot; + + public static EmaState New() => new() { Ema = 0, E = 1.0, IsHot = false }; +} + +/// +/// Exponential Moving Average (EMA) - IIR filter with exponential warmup compensator. +/// Provides valid output from first bar with O(1) complexity. +/// +/// +/// Algorithm uses exponential smoothing with compensator for immediate valid results. +/// Reference: https://github.com/mihakralj/pinescript/blob/main/indicators/trends_IIR/ema.md +/// +public class Ema +{ + private readonly double _alpha; + private EmaState _state = EmaState.New(); + private EmaState _p_state = EmaState.New(); + + /// + /// Creates EMA with specified period. + /// Alpha = 2 / (period + 1) + /// + /// Period for EMA calculation (must be > 0) + public Ema(int period) + { + if (period <= 0) + throw new ArgumentException("Period must be greater than 0", nameof(period)); + + _alpha = 2.0 / (period + 1); + } + + /// + /// Creates EMA with specified alpha smoothing factor. + /// + /// Smoothing factor (0 < alpha <= 1) + public Ema(double alpha) + { + if (alpha <= 0 || alpha > 1) + throw new ArgumentException("Alpha must be between 0 and 1", nameof(alpha)); + + _alpha = alpha; + } + + /// + /// Current EMA value. + /// + public TValue Value { get; private set; } + + /// + /// True if the EMA has warmed up and is providing valid results. + /// + public bool IsHot => _state.IsHot; + + /// + /// Core EMA calculation kernel. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double Compute(double input, double alpha, ref EmaState state) + { + state.Ema += alpha * (input - state.Ema); + + if (!state.IsHot) + { + state.E *= (1.0 - alpha); + state.IsHot = state.E <= 1e-10; + return state.Ema / (1.0 - state.E); + } + + return state.Ema; + } + + /// + /// Updates EMA with the given value. + /// + /// Input value + /// True for new bar, false for update to current bar (default: true) + /// Compensated EMA value + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public TValue Update(TValue input, bool isNew = true) + { + if (isNew) + { + _p_state = _state; + } + else + { + _state = _p_state; + } + + double val = Compute(input.Value, _alpha, ref _state); + Value = new TValue(input.Time, val); + return Value; + } + + /// + /// Updates EMA with the entire series. + /// + /// Input series + /// EMA series + public TSeries Update(TSeries source) + { + int len = source.Count; + var t = new List(len); + var v = new List(len); + CollectionsMarshal.SetCount(t, len); + CollectionsMarshal.SetCount(v, len); + + var tSpan = CollectionsMarshal.AsSpan(t); + var vSpan = CollectionsMarshal.AsSpan(v); + var sourceValues = source.Values; + var sourceTimes = source.Times; + + // Local state for batch processing + EmaState state = _state; + + for (int i = 0; i < len; i++) + { + double val = Compute(sourceValues[i], _alpha, ref state); + tSpan[i] = sourceTimes[i]; + vSpan[i] = val; + } + + // Update instance state to the final state + _state = state; + _p_state = state; // Assume last point is committed + + Value = new TValue(tSpan[len - 1], vSpan[len - 1]); + return new TSeries(t, v); + } + + /// + /// Calculates EMA for the entire series using a new instance. + /// + /// Input series + /// EMA period + /// EMA series + public static TSeries Calculate(TSeries source, int period) + { + var ema = new Ema(period); + return ema.Update(source); + } + + /// + /// Resets the EMA state. + /// + public void Reset() + { + _state = EmaState.New(); + _p_state = _state; + Value = default; + } +} diff --git a/lib/averages/ema/Ema.md b/lib/averages/ema/Ema.md index 200faba8..7b914b05 100644 --- a/lib/averages/ema/Ema.md +++ b/lib/averages/ema/Ema.md @@ -1,136 +1,136 @@ -# EMA: Exponential Moving Average - -[Pine Script Implementation of EMA](https://github.com/mihakralj/pinescript/blob/main/indicators/trends_IIR/ema.pine) - -## Overview and Purpose - -The Exponential Moving Average (EMA) is a fundamental technical indicator that calculates the average price over a specific period while giving more weight to recent price data. Introduced in the 1950s, EMA has become one of the most widely used technical indicators in financial markets due to its balance of responsiveness and stability. - -Unlike the Simple Moving Average (SMA) which assigns equal weight to all data points, the EMA emphasizes recent price action, allowing traders to identify trend changes earlier while still filtering out short-term market noise. Its mathematical elegance has made it a standard tool in signal processing beyond finance, including communications, control systems, and data analysis. - -## Core Concepts - -* **Weighted price action:** EMA gives greater importance to recent prices through exponential weighting, providing a more timely response to current market conditions -* **Smoothing mechanism:** Acts as a noise filter by reducing the impact of random price fluctuations while preserving meaningful trends -* **Universal application:** Functions effectively across all timeframes from intraday to monthly charts, with parameter adjustments -* **Foundation indicator:** Serves as the mathematical basis for numerous other technical indicators (MACD, PPO, etc.) - -EMA achieves its enhanced responsiveness by applying a smoothing factor (α) that determines how quickly older data points lose influence. This approach creates a moving average that reacts faster to price changes than an SMA of the same length while maintaining enough stability to identify the underlying trend. - -## Common Settings and Parameters - -| Parameter | Default | Function | When to Adjust | -|-----------|---------|----------|---------------| -| Length | 20 | Controls responsiveness/smoothness | Shorter for faster signals in active markets, longer for stable trends in ranging markets | -| Source | Close | Data point used for calculation | Change to HL2 or HLC3 for more balanced price representation | -| Alpha | 2/(length+1) | Determines weighting decay | Direct alpha manipulation allows for precise tuning beyond standard length settings | - -**Pro Tip:** Many professional traders use multiple EMAs simultaneously (e.g., 8, 21, 50) to identify potential support/resistance levels and trend strength based on their relative positioning. - -## Calculation and Mathematical Foundation - -**Simplified explanation:** -EMA works by calculating a weighted average where recent prices have more influence. The implementation uses an optimized form of the EMA calculation that is both computationally efficient and numerically stable. - -**Technical formula:** -The optimized EMA formula used in the implementation is: -$$EMA_t = \alpha \cdot P_t + (1 - \alpha) \cdot EMA_{t-1}$$ - -Where: - -* $\alpha = \frac{2}{N + 1}$ is the smoothing factor ($N$ is the period) -* $P_t$ is the current price value -* $EMA_{t-1}$ is the previous period's EMA value - -This form is algebraically equivalent to the traditional EMA formula but offers better computational efficiency and numerical stability. - -> 🔍 **Technical Note:** The implementation uses a sophisticated warm-up compensation method that provides accurate EMA values from the first bar. The compensation works by tracking an error term that decays exponentially: -> $$e_t = e_{t-1} \cdot (1 - \alpha)$$ -> $$Compensation = \frac{1}{1 - e_t}$$ -> $$EMA_{corrected} = Compensation \cdot EMA_{raw}$$ -> This compensation automatically adjusts during the warm-up phase and becomes negligible ($e \le 1e^{-10}$) once sufficient data has been processed, ensuring mathematically correct values throughout the entire data series without requiring a traditional warm-up period. - -## C# Implementation - -The library provides two implementations: a standard scalar version and a SIMD-optimized vector version for high-performance scenarios. - -### Single EMA (`Ema`) - -The `Ema` class calculates a single exponential moving average. - -```csharp -using QuanTAlib; - -// Initialize with period 10 -var ema = new Ema(10); - -// Or initialize with specific alpha -var emaAlpha = new Ema(0.5); - -// Streaming update -TValue result = ema.Update(new TValue(time, price)); -Console.WriteLine($"Current EMA: {result.Value}"); - -// Access current value property -Console.WriteLine($"Current Value: {ema.Value.Value}"); - -// Batch calculation -TSeries source = ...; -TSeries results = Ema.Calculate(source, 10); -``` - -### Multi-Alpha EMA (`EmaVector`) - -The `EmaVector` class is a SIMD-optimized implementation for calculating multiple EMAs with different periods on the same input series simultaneously. It leverages hardware intrinsics (AVX/SSE) for high performance. - -```csharp -using QuanTAlib; - -// Initialize with multiple periods -int[] periods = { 9, 12, 26 }; -var emaVector = new EmaVector(periods); - -// Streaming update -TValue[] results = emaVector.Update(new TValue(time, price)); - -// Access values -Console.WriteLine($"EMA(9): {results[0].Value}"); -Console.WriteLine($"EMA(12): {results[1].Value}"); -Console.WriteLine($"EMA(26): {results[2].Value}"); - -// Batch calculation -TSeries source = ...; -TSeries[] seriesResults = emaVector.Calculate(source); -``` - -### Performance Characteristics - -* **O(1) Complexity:** The calculation time is constant regardless of the period length. -* **SIMD Optimization:** `EmaVector` processes multiple periods in parallel using vector instructions, significantly reducing CPU cycles for multi-timeframe analysis. -* **Zero Allocation:** The streaming `Update` method is designed to be allocation-free (excluding the return struct). - -## Interpretation Details - -The EMA's primary value comes from its ability to identify trend direction and potential reversal points: - -* When price is above EMA, the short-term trend is generally bullish -* When price is below EMA, the short-term trend is generally bearish -* When a shorter-period EMA crosses above a longer-period EMA, it often signals the beginning of an uptrend -* When a shorter-period EMA crosses below a longer-period EMA, it often signals the beginning of a downtrend -* The slope of the EMA indicates trend strength and momentum - -EMAs work particularly well in trending markets but may generate false signals during sideways or choppy conditions. For optimal results, traders typically use EMA crossovers or EMA-price crossovers as part of a broader system that includes volume and momentum confirmation. - -## Limitations and Considerations - -* **Market conditions:** Less effective in choppy, sideways markets where price constantly crosses the average -* **Lag factor:** While less significant than SMA, EMA still exhibits some lag, especially with longer lookback periods -* **False signals:** Can produce whipsaws during consolidation phases or range-bound conditions -* **Parameter sensitivity:** Small changes in length or alpha can significantly alter behavior -* **Complementary tools:** Should be used with momentum indicators (RSI, MACD) or volume indicators for confirmation - -## References - -1. Murphy, J.J. (1999). *Technical Analysis of the Financial Markets*. New York Institute of Finance. -2. Kaufman, P. (2013). *Trading Systems and Methods*, 5th Edition. Wiley Trading. -3. Ehlers, J. (2001). *Rocket Science for Traders*. John Wiley & Sons. +# EMA: Exponential Moving Average + +[Pine Script Implementation of EMA](https://github.com/mihakralj/pinescript/blob/main/indicators/trends_IIR/ema.pine) + +## Overview and Purpose + +The Exponential Moving Average (EMA) is a fundamental technical indicator that calculates the average price over a specific period while giving more weight to recent price data. Introduced in the 1950s, EMA has become one of the most widely used technical indicators in financial markets due to its balance of responsiveness and stability. + +Unlike the Simple Moving Average (SMA) which assigns equal weight to all data points, the EMA emphasizes recent price action, allowing traders to identify trend changes earlier while still filtering out short-term market noise. Its mathematical elegance has made it a standard tool in signal processing beyond finance, including communications, control systems, and data analysis. + +## Core Concepts + +* **Weighted price action:** EMA gives greater importance to recent prices through exponential weighting, providing a more timely response to current market conditions +* **Smoothing mechanism:** Acts as a noise filter by reducing the impact of random price fluctuations while preserving meaningful trends +* **Universal application:** Functions effectively across all timeframes from intraday to monthly charts, with parameter adjustments +* **Foundation indicator:** Serves as the mathematical basis for numerous other technical indicators (MACD, PPO, etc.) + +EMA achieves its enhanced responsiveness by applying a smoothing factor (α) that determines how quickly older data points lose influence. This approach creates a moving average that reacts faster to price changes than an SMA of the same length while maintaining enough stability to identify the underlying trend. + +## Common Settings and Parameters + +| Parameter | Default | Function | When to Adjust | +|-----------|---------|----------|---------------| +| Length | 20 | Controls responsiveness/smoothness | Shorter for faster signals in active markets, longer for stable trends in ranging markets | +| Source | Close | Data point used for calculation | Change to HL2 or HLC3 for more balanced price representation | +| Alpha | 2/(length+1) | Determines weighting decay | Direct alpha manipulation allows for precise tuning beyond standard length settings | + +**Pro Tip:** Many professional traders use multiple EMAs simultaneously (e.g., 8, 21, 50) to identify potential support/resistance levels and trend strength based on their relative positioning. + +## Calculation and Mathematical Foundation + +**Simplified explanation:** +EMA works by calculating a weighted average where recent prices have more influence. The implementation uses an optimized form of the EMA calculation that is both computationally efficient and numerically stable. + +**Technical formula:** +The optimized EMA formula used in the implementation is: +$$EMA_t = \alpha \cdot P_t + (1 - \alpha) \cdot EMA_{t-1}$$ + +Where: + +* $\alpha = \frac{2}{N + 1}$ is the smoothing factor ($N$ is the period) +* $P_t$ is the current price value +* $EMA_{t-1}$ is the previous period's EMA value + +This form is algebraically equivalent to the traditional EMA formula but offers better computational efficiency and numerical stability. + +> 🔍 **Technical Note:** The implementation uses a sophisticated warm-up compensation method that provides accurate EMA values from the first bar. The compensation works by tracking an error term that decays exponentially: +> $$e_t = e_{t-1} \cdot (1 - \alpha)$$ +> $$Compensation = \frac{1}{1 - e_t}$$ +> $$EMA_{corrected} = Compensation \cdot EMA_{raw}$$ +> This compensation automatically adjusts during the warm-up phase and becomes negligible ($e \le 1e^{-10}$) once sufficient data has been processed, ensuring mathematically correct values throughout the entire data series without requiring a traditional warm-up period. + +## C# Implementation + +The library provides two implementations: a standard scalar version and a SIMD-optimized vector version for high-performance scenarios. + +### Single EMA (`Ema`) + +The `Ema` class calculates a single exponential moving average. + +```csharp +using QuanTAlib; + +// Initialize with period 10 +var ema = new Ema(10); + +// Or initialize with specific alpha +var emaAlpha = new Ema(0.5); + +// Streaming update +TValue result = ema.Update(new TValue(time, price)); +Console.WriteLine($"Current EMA: {result.Value}"); + +// Access current value property +Console.WriteLine($"Current Value: {ema.Value.Value}"); + +// Batch calculation +TSeries source = ...; +TSeries results = Ema.Calculate(source, 10); +``` + +### Multi-Alpha EMA (`EmaVector`) + +The `EmaVector` class is a SIMD-optimized implementation for calculating multiple EMAs with different periods on the same input series simultaneously. It leverages hardware intrinsics (AVX/SSE) for high performance. + +```csharp +using QuanTAlib; + +// Initialize with multiple periods +int[] periods = { 9, 12, 26 }; +var emaVector = new EmaVector(periods); + +// Streaming update +TValue[] results = emaVector.Update(new TValue(time, price)); + +// Access values +Console.WriteLine($"EMA(9): {results[0].Value}"); +Console.WriteLine($"EMA(12): {results[1].Value}"); +Console.WriteLine($"EMA(26): {results[2].Value}"); + +// Batch calculation +TSeries source = ...; +TSeries[] seriesResults = emaVector.Calculate(source); +``` + +### Performance Characteristics + +* **O(1) Complexity:** The calculation time is constant regardless of the period length. +* **SIMD Optimization:** `EmaVector` processes multiple periods in parallel using vector instructions, significantly reducing CPU cycles for multi-timeframe analysis. +* **Zero Allocation:** The streaming `Update` method is designed to be allocation-free (excluding the return struct). + +## Interpretation Details + +The EMA's primary value comes from its ability to identify trend direction and potential reversal points: + +* When price is above EMA, the short-term trend is generally bullish +* When price is below EMA, the short-term trend is generally bearish +* When a shorter-period EMA crosses above a longer-period EMA, it often signals the beginning of an uptrend +* When a shorter-period EMA crosses below a longer-period EMA, it often signals the beginning of a downtrend +* The slope of the EMA indicates trend strength and momentum + +EMAs work particularly well in trending markets but may generate false signals during sideways or choppy conditions. For optimal results, traders typically use EMA crossovers or EMA-price crossovers as part of a broader system that includes volume and momentum confirmation. + +## Limitations and Considerations + +* **Market conditions:** Less effective in choppy, sideways markets where price constantly crosses the average +* **Lag factor:** While less significant than SMA, EMA still exhibits some lag, especially with longer lookback periods +* **False signals:** Can produce whipsaws during consolidation phases or range-bound conditions +* **Parameter sensitivity:** Small changes in length or alpha can significantly alter behavior +* **Complementary tools:** Should be used with momentum indicators (RSI, MACD) or volume indicators for confirmation + +## References + +1. Murphy, J.J. (1999). *Technical Analysis of the Financial Markets*. New York Institute of Finance. +2. Kaufman, P. (2013). *Trading Systems and Methods*, 5th Edition. Wiley Trading. +3. Ehlers, J. (2001). *Rocket Science for Traders*. John Wiley & Sons. diff --git a/lib/averages/ema/EmaVector.Tests.cs b/lib/averages/ema/EmaVector.Tests.cs index 9e532544..5bb2b024 100644 --- a/lib/averages/ema/EmaVector.Tests.cs +++ b/lib/averages/ema/EmaVector.Tests.cs @@ -1,138 +1,138 @@ -using System; -using System.Linq; -using Xunit; -using QuanTAlib; - -namespace QuanTAlib.Tests; - -public class EmaVectorTests -{ - [Fact] - public void Initialization_WithPeriods_SetsCorrectAlphas() - { - int[] periods = { 10, 20 }; - var emaVector = new EmaVector(periods); - - // We can't check private fields directly, but we can check results after 1 step - // Alpha = 2 / (P + 1) - // P=10 -> A=2/11 - // P=20 -> A=2/21 - - var res = emaVector.Update(new TValue(DateTime.Now, 100.0)); - - // First value should be 100.0 due to compensation - Assert.Equal(100.0, res[0].Value, 1e-9); - Assert.Equal(100.0, res[1].Value, 1e-9); - } - - [Fact] - public void Calc_Streaming_MatchesSingleEma() - { - int[] periods = { 5, 10, 20 }; - var emaVector = new EmaVector(periods); - var emaSingles = periods.Select(p => new Ema(p)).ToArray(); - - var values = new double[] { 10, 20, 30, 40, 50, 40, 30, 20, 10 }; - var time = DateTime.Now; - - foreach (var val in values) - { - var tVal = new TValue(time, val); - var multiRes = emaVector.Update(tVal); - - for (int i = 0; i < periods.Length; i++) - { - var singleRes = emaSingles[i].Update(tVal); - Assert.Equal(singleRes.Value, multiRes[i].Value, 1e-9); - Assert.Equal(singleRes.Time, multiRes[i].Time); - } - - time = time.AddMinutes(1); - } - } - - [Fact] - public void Calc_Series_MatchesSingleEma() - { - int[] periods = { 5, 10, 20 }; - var emaVector = new EmaVector(periods); - var emaSingles = periods.Select(p => new Ema(p)).ToArray(); - - int len = 100; - var t = new System.Collections.Generic.List(len); - var v = new System.Collections.Generic.List(len); - var now = DateTime.Now; - - for (int i = 0; i < len; i++) - { - t.Add(now.AddMinutes(i).Ticks); - v.Add(Math.Sin(i * 0.1) * 100); - } - - var series = new TSeries(t, v); - - var multiRes = emaVector.Calculate(series); - - for (int i = 0; i < periods.Length; i++) - { - var singleRes = emaSingles[i].Update(series); - - Assert.Equal(singleRes.Count, multiRes[i].Count); - for (int j = 0; j < len; j++) - { - Assert.Equal(singleRes.Values[j], multiRes[i].Values[j], 1e-8); - } - } - } - - [Fact] - public void Calc_Series_MatchesStreaming() - { - int[] periods = { 5, 10, 20 }; - var emaVectorBatch = new EmaVector(periods); - var emaVectorStream = new EmaVector(periods); - - int len = 100; - var t = new System.Collections.Generic.List(len); - var v = new System.Collections.Generic.List(len); - var now = DateTime.Now; - - for (int i = 0; i < len; i++) - { - t.Add(now.AddMinutes(i).Ticks); - v.Add(Math.Sin(i * 0.1) * 100); - } - - var series = new TSeries(t, v); - - // Batch calculation - var batchRes = emaVectorBatch.Calculate(series); - - // Streaming calculation - for (int i = 0; i < len; i++) - { - var tVal = new TValue(new DateTime(t[i]), v[i]); - var streamRes = emaVectorStream.Update(tVal); - - for (int j = 0; j < periods.Length; j++) - { - Assert.Equal(batchRes[j].Values[i], streamRes[j].Value, 1e-9); - } - } - } - - [Fact] - public void Reset_ClearsState() - { - int[] periods = { 10 }; - var emaVector = new EmaVector(periods); - - emaVector.Update(new TValue(DateTime.Now, 100.0)); - emaVector.Reset(); - - // After reset, next calculation should treat it as first value (warmup) - var res = emaVector.Update(new TValue(DateTime.Now, 200.0)); - - Assert.Equal(200.0, res[0].Value, 1e-9); - } -} +using System; +using System.Linq; +using Xunit; +using QuanTAlib; + +namespace QuanTAlib.Tests; + +public class EmaVectorTests +{ + [Fact] + public void Initialization_WithPeriods_SetsCorrectAlphas() + { + int[] periods = { 10, 20 }; + var emaVector = new EmaVector(periods); + + // We can't check private fields directly, but we can check results after 1 step + // Alpha = 2 / (P + 1) + // P=10 -> A=2/11 + // P=20 -> A=2/21 + + var res = emaVector.Update(new TValue(DateTime.Now, 100.0)); + + // First value should be 100.0 due to compensation + Assert.Equal(100.0, res[0].Value, 1e-9); + Assert.Equal(100.0, res[1].Value, 1e-9); + } + + [Fact] + public void Calc_Streaming_MatchesSingleEma() + { + int[] periods = { 5, 10, 20 }; + var emaVector = new EmaVector(periods); + var emaSingles = periods.Select(p => new Ema(p)).ToArray(); + + var values = new double[] { 10, 20, 30, 40, 50, 40, 30, 20, 10 }; + var time = DateTime.Now; + + foreach (var val in values) + { + var tVal = new TValue(time, val); + var multiRes = emaVector.Update(tVal); + + for (int i = 0; i < periods.Length; i++) + { + var singleRes = emaSingles[i].Update(tVal); + Assert.Equal(singleRes.Value, multiRes[i].Value, 1e-9); + Assert.Equal(singleRes.Time, multiRes[i].Time); + } + + time = time.AddMinutes(1); + } + } + + [Fact] + public void Calc_Series_MatchesSingleEma() + { + int[] periods = { 5, 10, 20 }; + var emaVector = new EmaVector(periods); + var emaSingles = periods.Select(p => new Ema(p)).ToArray(); + + int len = 100; + var t = new System.Collections.Generic.List(len); + var v = new System.Collections.Generic.List(len); + var now = DateTime.Now; + + for (int i = 0; i < len; i++) + { + t.Add(now.AddMinutes(i).Ticks); + v.Add(Math.Sin(i * 0.1) * 100); + } + + var series = new TSeries(t, v); + + var multiRes = emaVector.Calculate(series); + + for (int i = 0; i < periods.Length; i++) + { + var singleRes = emaSingles[i].Update(series); + + Assert.Equal(singleRes.Count, multiRes[i].Count); + for (int j = 0; j < len; j++) + { + Assert.Equal(singleRes.Values[j], multiRes[i].Values[j], 1e-8); + } + } + } + + [Fact] + public void Calc_Series_MatchesStreaming() + { + int[] periods = { 5, 10, 20 }; + var emaVectorBatch = new EmaVector(periods); + var emaVectorStream = new EmaVector(periods); + + int len = 100; + var t = new System.Collections.Generic.List(len); + var v = new System.Collections.Generic.List(len); + var now = DateTime.Now; + + for (int i = 0; i < len; i++) + { + t.Add(now.AddMinutes(i).Ticks); + v.Add(Math.Sin(i * 0.1) * 100); + } + + var series = new TSeries(t, v); + + // Batch calculation + var batchRes = emaVectorBatch.Calculate(series); + + // Streaming calculation + for (int i = 0; i < len; i++) + { + var tVal = new TValue(new DateTime(t[i]), v[i]); + var streamRes = emaVectorStream.Update(tVal); + + for (int j = 0; j < periods.Length; j++) + { + Assert.Equal(batchRes[j].Values[i], streamRes[j].Value, 1e-9); + } + } + } + + [Fact] + public void Reset_ClearsState() + { + int[] periods = { 10 }; + var emaVector = new EmaVector(periods); + + emaVector.Update(new TValue(DateTime.Now, 100.0)); + emaVector.Reset(); + + // After reset, next calculation should treat it as first value (warmup) + var res = emaVector.Update(new TValue(DateTime.Now, 200.0)); + + Assert.Equal(200.0, res[0].Value, 1e-9); + } +} diff --git a/lib/averages/ema/EmaVector.cs b/lib/averages/ema/EmaVector.cs index 359057d6..54ac784e 100644 --- a/lib/averages/ema/EmaVector.cs +++ b/lib/averages/ema/EmaVector.cs @@ -1,271 +1,283 @@ -using System; -using System.Collections.Generic; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuanTAlib; - -/// -/// Multi-Alpha Exponential Moving Average (EMA) - SIMD optimized. -/// Calculates multiple EMAs with different periods/alphas for the same input series in parallel. -/// -public class EmaVector -{ - private readonly double[] _alphas; - private readonly double[] _emas; - private readonly double[] _Es; - private readonly int _count; - - /// - /// Current EMA values for all periods. - /// - public TValue[] Values { get; private set; } - - /// - /// Initializes EmaVector with specified periods. - /// - /// Array of periods - public EmaVector(int[] periods) - { - _count = periods.Length; - _alphas = new double[_count]; - _emas = new double[_count]; - _Es = new double[_count]; - Values = new TValue[_count]; - - for (int i = 0; i < _count; i++) - { - if (periods[i] <= 0) throw new ArgumentException("Period must be greater than 0", nameof(periods)); - _alphas[i] = 2.0 / (periods[i] + 1); - ResetAt(i); - } - } - - /// - /// Initializes EmaVector with specified alphas. - /// - /// Array of alphas - public EmaVector(double[] alphas) - { - _count = alphas.Length; - _alphas = new double[_count]; - _emas = new double[_count]; - _Es = new double[_count]; - Values = new TValue[_count]; - - for (int i = 0; i < _count; i++) - { - if (alphas[i] <= 0 || alphas[i] > 1) throw new ArgumentException("Alpha must be between 0 and 1", nameof(alphas)); - _alphas[i] = alphas[i]; - ResetAt(i); - } - } - - private void ResetAt(int index) - { - _emas[index] = 0.0; - _Es[index] = 1.0; - } - - /// - /// Resets all EMA states. - /// - public void Reset() - { - for (int i = 0; i < _count; i++) - { - ResetAt(i); - } - Array.Clear(Values); - } - - /// - /// Updates EMAs with the given value. - /// - /// Input value - /// Array of compensated EMA values - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public TValue[] Update(TValue input) - { - double val = input.Value; - - // SIMD Loop - int vecCount = Vector.Count; - int i = 0; - - if (Vector.IsHardwareAccelerated && _count >= vecCount) - { - var vecInput = new Vector(val); - var vecOne = Vector.One; - var vecEpsilon = new Vector(1e-10); - - for (; i <= _count - vecCount; i += vecCount) - { - // Load state - var vecAlpha = new Vector(_alphas, i); - var vecEma = new Vector(_emas, i); - var vecE = new Vector(_Es, i); - - // Update EMA - // ema += alpha * (input - ema) - vecEma += vecAlpha * (vecInput - vecEma); - - // Update E (warmup factor) - // E *= (1 - alpha) - vecE *= (vecOne - vecAlpha); - - // Calculate compensated result - // res = ema / (1 - E) - var vecCompensated = vecEma / (vecOne - vecE); - - // Check warmup condition: E > 1e-10 - var warmupMask = Vector.GreaterThan(vecE, vecEpsilon); - - // Select result - // Vector.ConditionalSelect requires Vector mask. - // Vector.GreaterThan returns Vector for double. - // We cast Vector to Vector to use as mask. - var vecResult = Vector.ConditionalSelect(Vector.AsVectorDouble(warmupMask), vecCompensated, vecEma); - - // Store state - vecEma.CopyTo(_emas, i); - vecE.CopyTo(_Es, i); - - // Store result - for (int j = 0; j < vecCount; j++) - { - Values[i + j] = new TValue(input.Time, vecResult[j]); - } - } - } - - // Scalar fallback for remaining items - for (; i < _count; i++) - { - double alpha = _alphas[i]; - _emas[i] += alpha * (val - _emas[i]); - - double result = _emas[i]; - if (_Es[i] > 1e-10) - { - _Es[i] *= (1.0 - alpha); - if (_Es[i] > 1e-10) - { - result = _emas[i] / (1.0 - _Es[i]); - } - } - - Values[i] = new TValue(input.Time, result); - } - - return Values; - } - - /// - /// Calculates EMAs for the entire series. - /// - /// Input series - /// Array of EMA series - public TSeries[] Calculate(TSeries source) - { - int len = source.Count; - var resultSeries = new TSeries[_count]; - - // Pre-allocate lists - var tLists = new List[_count]; - var vLists = new List[_count]; - - for (int i = 0; i < _count; i++) - { - tLists[i] = new List(len); - vLists[i] = new List(len); - CollectionsMarshal.SetCount(tLists[i], len); - CollectionsMarshal.SetCount(vLists[i], len); - } - - var sourceValues = source.Values; - var sourceTimes = source.Times; - - int vecCount = Vector.Count; - var vecOne = Vector.One; - var vecEpsilon = new Vector(1e-10); - - for (int t = 0; t < len; t++) - { - double val = sourceValues[t]; - long time = sourceTimes[t]; - var vecInput = new Vector(val); - - int i = 0; - if (Vector.IsHardwareAccelerated && _count >= vecCount) - { - for (; i <= _count - vecCount; i += vecCount) - { - var vecAlpha = new Vector(_alphas, i); - var vecEma = new Vector(_emas, i); - var vecE = new Vector(_Es, i); - - vecEma += vecAlpha * (vecInput - vecEma); - vecE *= (vecOne - vecAlpha); - - var vecCompensated = vecEma / (vecOne - vecE); - var warmupMask = Vector.GreaterThan(vecE, vecEpsilon); - var vecResult = Vector.ConditionalSelect(Vector.AsVectorDouble(warmupMask), vecCompensated, vecEma); - - vecEma.CopyTo(_emas, i); - vecE.CopyTo(_Es, i); - - // Scatter results to lists - for (int j = 0; j < vecCount; j++) - { - CollectionsMarshal.AsSpan(tLists[i + j])[t] = time; - CollectionsMarshal.AsSpan(vLists[i + j])[t] = vecResult[j]; - } - } - } - - for (; i < _count; i++) - { - double alpha = _alphas[i]; - _emas[i] += alpha * (val - _emas[i]); - - double result = _emas[i]; - if (_Es[i] > 1e-10) - { - _Es[i] *= (1.0 - alpha); - if (_Es[i] > 1e-10) - { - result = _emas[i] / (1.0 - _Es[i]); - } - } - - CollectionsMarshal.AsSpan(tLists[i])[t] = time; - CollectionsMarshal.AsSpan(vLists[i])[t] = result; - } - } - - // Create TSeries and update Values - for (int i = 0; i < _count; i++) - { - resultSeries[i] = new TSeries(tLists[i], vLists[i]); - var lastT = CollectionsMarshal.AsSpan(tLists[i])[len - 1]; - var lastV = CollectionsMarshal.AsSpan(vLists[i])[len - 1]; - Values[i] = new TValue(lastT, lastV); - } - - return resultSeries; - } - - /// - /// Calculates EMAs for the entire series using specified periods. - /// - /// Input series - /// Array of periods - /// Array of EMA series - public static TSeries[] Calculate(TSeries source, int[] periods) - { - var emaVector = new EmaVector(periods); - return emaVector.Calculate(source); - } -} +using System; +using System.Collections.Generic; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuanTAlib; + +/// +/// Multi-Alpha Exponential Moving Average (EMA) - SIMD optimized. +/// Calculates multiple EMAs with different periods/alphas for the same input series in parallel. +/// +public class EmaVector +{ + private readonly double[] _alphas; + private readonly double[] _emas; + private readonly double[] _Es; + private readonly int _count; + + /// + /// Current EMA values for all periods. + /// + public TValue[] Values { get; private set; } + + /// + /// Initializes EmaVector with specified periods. + /// + /// Array of periods + public EmaVector(int[] periods) + { + _count = periods.Length; + _alphas = new double[_count]; + _emas = new double[_count]; + _Es = new double[_count]; + Values = new TValue[_count]; + + for (int i = 0; i < _count; i++) + { + if (periods[i] <= 0) throw new ArgumentException("Period must be greater than 0", nameof(periods)); + _alphas[i] = 2.0 / (periods[i] + 1); + ResetAt(i); + } + } + + /// + /// Initializes EmaVector with specified alphas. + /// + /// Array of alphas + public EmaVector(double[] alphas) + { + _count = alphas.Length; + _alphas = new double[_count]; + _emas = new double[_count]; + _Es = new double[_count]; + Values = new TValue[_count]; + + for (int i = 0; i < _count; i++) + { + if (alphas[i] <= 0 || alphas[i] > 1) throw new ArgumentException("Alpha must be between 0 and 1", nameof(alphas)); + _alphas[i] = alphas[i]; + ResetAt(i); + } + } + + private void ResetAt(int index) + { + _emas[index] = 0.0; + _Es[index] = 1.0; + } + + /// + /// Resets all EMA states. + /// + public void Reset() + { + for (int i = 0; i < _count; i++) + { + ResetAt(i); + } + Array.Clear(Values); + } + + /// + /// Updates EMAs with the given value. + /// + /// Input value + /// Array of compensated EMA values + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public TValue[] Update(TValue input) + { + double val = input.Value; + + // SIMD Loop + int vecCount = Vector.Count; + int i = 0; + + if (Vector.IsHardwareAccelerated && _count >= vecCount) + { + var vecInput = new Vector(val); + var vecOne = Vector.One; + var vecEpsilon = new Vector(1e-10); + + for (; i <= _count - vecCount; i += vecCount) + { + // Load state + var vecAlpha = new Vector(_alphas, i); + var vecEma = new Vector(_emas, i); + var vecE = new Vector(_Es, i); + + // Update EMA + // ema += alpha * (input - ema) + vecEma += vecAlpha * (vecInput - vecEma); + + // Update E (warmup factor) + // E *= (1 - alpha) + vecE *= (vecOne - vecAlpha); + + // Calculate compensated result + // res = ema / (1 - E) + var vecCompensated = vecEma / (vecOne - vecE); + + // Check warmup condition: E <= 1e-10 means "hot" (use raw EMA) + // Vector.LessThanOrEqual returns Vector with all-1s for true, all-0s for false + // We reinterpret as Vector for use with ConditionalSelect + var isHotMask = Vector.LessThanOrEqual(vecE, vecEpsilon); + + // Select result: if hot (E <= epsilon), use raw EMA; otherwise use compensated + // ConditionalSelect: mask=true -> first arg, mask=false -> second arg + var vecResult = Vector.ConditionalSelect( + Vector.AsVectorDouble(isHotMask), + vecEma, // Hot: use raw EMA + vecCompensated // Cold: use compensated + ); + + // Store state + vecEma.CopyTo(_emas, i); + vecE.CopyTo(_Es, i); + + // Store result + for (int j = 0; j < vecCount; j++) + { + Values[i + j] = new TValue(input.Time, vecResult[j]); + } + } + } + + // Scalar fallback for remaining items + for (; i < _count; i++) + { + double alpha = _alphas[i]; + _emas[i] += alpha * (val - _emas[i]); + + double result = _emas[i]; + if (_Es[i] > 1e-10) + { + _Es[i] *= (1.0 - alpha); + if (_Es[i] > 1e-10) + { + result = _emas[i] / (1.0 - _Es[i]); + } + } + + Values[i] = new TValue(input.Time, result); + } + + return Values; + } + + /// + /// Calculates EMAs for the entire series. + /// + /// Input series + /// Array of EMA series + public TSeries[] Calculate(TSeries source) + { + int len = source.Count; + var resultSeries = new TSeries[_count]; + + // Pre-allocate lists + var tLists = new List[_count]; + var vLists = new List[_count]; + + for (int i = 0; i < _count; i++) + { + tLists[i] = new List(len); + vLists[i] = new List(len); + CollectionsMarshal.SetCount(tLists[i], len); + CollectionsMarshal.SetCount(vLists[i], len); + } + + var sourceValues = source.Values; + var sourceTimes = source.Times; + + int vecCount = Vector.Count; + var vecOne = Vector.One; + var vecEpsilon = new Vector(1e-10); + + for (int t = 0; t < len; t++) + { + double val = sourceValues[t]; + long time = sourceTimes[t]; + var vecInput = new Vector(val); + + int i = 0; + if (Vector.IsHardwareAccelerated && _count >= vecCount) + { + for (; i <= _count - vecCount; i += vecCount) + { + var vecAlpha = new Vector(_alphas, i); + var vecEma = new Vector(_emas, i); + var vecE = new Vector(_Es, i); + + vecEma += vecAlpha * (vecInput - vecEma); + vecE *= (vecOne - vecAlpha); + + var vecCompensated = vecEma / (vecOne - vecE); + + // Check warmup condition: E <= 1e-10 means "hot" (use raw EMA) + var isHotMask = Vector.LessThanOrEqual(vecE, vecEpsilon); + + // Select result: if hot, use raw EMA; otherwise use compensated + var vecResult = Vector.ConditionalSelect( + Vector.AsVectorDouble(isHotMask), + vecEma, // Hot: use raw EMA + vecCompensated // Cold: use compensated + ); + + vecEma.CopyTo(_emas, i); + vecE.CopyTo(_Es, i); + + // Scatter results to lists + for (int j = 0; j < vecCount; j++) + { + CollectionsMarshal.AsSpan(tLists[i + j])[t] = time; + CollectionsMarshal.AsSpan(vLists[i + j])[t] = vecResult[j]; + } + } + } + + for (; i < _count; i++) + { + double alpha = _alphas[i]; + _emas[i] += alpha * (val - _emas[i]); + + double result = _emas[i]; + if (_Es[i] > 1e-10) + { + _Es[i] *= (1.0 - alpha); + if (_Es[i] > 1e-10) + { + result = _emas[i] / (1.0 - _Es[i]); + } + } + + CollectionsMarshal.AsSpan(tLists[i])[t] = time; + CollectionsMarshal.AsSpan(vLists[i])[t] = result; + } + } + + // Create TSeries and update Values + for (int i = 0; i < _count; i++) + { + resultSeries[i] = new TSeries(tLists[i], vLists[i]); + var lastT = CollectionsMarshal.AsSpan(tLists[i])[len - 1]; + var lastV = CollectionsMarshal.AsSpan(vLists[i])[len - 1]; + Values[i] = new TValue(lastT, lastV); + } + + return resultSeries; + } + + /// + /// Calculates EMAs for the entire series using specified periods. + /// + /// Input series + /// Array of periods + /// Array of EMA series + public static TSeries[] Calculate(TSeries source, int[] periods) + { + var emaVector = new EmaVector(periods); + return emaVector.Calculate(source); + } +} diff --git a/lib/core/simd/SimdExtensions.Tests.cs b/lib/core/simd/SimdExtensions.Tests.cs index 3818db8e..999d4f24 100644 --- a/lib/core/simd/SimdExtensions.Tests.cs +++ b/lib/core/simd/SimdExtensions.Tests.cs @@ -1,249 +1,249 @@ -using System; -using Xunit; -using QuanTAlib; - -namespace QuanTAlib.Tests; - -public class SimdExtensionsTests -{ - [Fact] - public void SumSIMD_EmptySpan_ReturnsZero() - { - var span = ReadOnlySpan.Empty; - Assert.Equal(0.0, span.SumSIMD()); - } - - [Fact] - public void SumSIMD_SingleElement_ReturnsElement() - { - double[] data = [42.5]; - var span = new ReadOnlySpan(data); - Assert.Equal(42.5, span.SumSIMD()); - } - - [Fact] - public void SumSIMD_MultipleElements_ReturnsCorrectSum() - { - double[] data = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]; - var span = new ReadOnlySpan(data); - Assert.Equal(55.0, span.SumSIMD(), precision: 10); - } - - [Fact] - public void SumSIMD_LargeArray_ReturnsCorrectSum() - { - double[] data = new double[1000]; - for (int i = 0; i < data.Length; i++) - data[i] = i + 1.0; - - var span = new ReadOnlySpan(data); - double expected = 1000.0 * 1001.0 / 2.0; // Sum of 1..1000 - Assert.Equal(expected, span.SumSIMD(), precision: 8); - } - - [Fact] - public void MinSIMD_EmptySpan_ReturnsNaN() - { - var span = ReadOnlySpan.Empty; - Assert.True(double.IsNaN(span.MinSIMD())); - } - - [Fact] - public void MinSIMD_SingleElement_ReturnsElement() - { - double[] data = [42.5]; - var span = new ReadOnlySpan(data); - Assert.Equal(42.5, span.MinSIMD()); - } - - [Fact] - public void MinSIMD_MultipleElements_ReturnsMinimum() - { - double[] data = [5.0, 2.0, 8.0, 1.0, 9.0, 3.0, 7.0, 4.0]; - var span = new ReadOnlySpan(data); - Assert.Equal(1.0, span.MinSIMD()); - } - - [Fact] - public void MaxSIMD_EmptySpan_ReturnsNaN() - { - var span = ReadOnlySpan.Empty; - Assert.True(double.IsNaN(span.MaxSIMD())); - } - - [Fact] - public void MaxSIMD_SingleElement_ReturnsElement() - { - double[] data = [42.5]; - var span = new ReadOnlySpan(data); - Assert.Equal(42.5, span.MaxSIMD()); - } - - [Fact] - public void MaxSIMD_MultipleElements_ReturnsMaximum() - { - double[] data = [5.0, 2.0, 8.0, 1.0, 9.0, 3.0, 7.0, 4.0]; - var span = new ReadOnlySpan(data); - Assert.Equal(9.0, span.MaxSIMD()); - } - - [Fact] - public void AverageSIMD_EmptySpan_ReturnsNaN() - { - var span = ReadOnlySpan.Empty; - Assert.True(double.IsNaN(span.AverageSIMD())); - } - - [Fact] - public void AverageSIMD_MultipleElements_ReturnsCorrectAverage() - { - double[] data = [1.0, 2.0, 3.0, 4.0, 5.0]; - var span = new ReadOnlySpan(data); - Assert.Equal(3.0, span.AverageSIMD(), precision: 10); - } - - [Fact] - public void VarianceSIMD_LessThanTwoElements_ReturnsNaN() - { - double[] data = [42.5]; - var span = new ReadOnlySpan(data); - Assert.True(double.IsNaN(span.VarianceSIMD())); - } - - [Fact] - public void VarianceSIMD_MultipleElements_ReturnsCorrectVariance() - { - double[] data = [2.0, 4.0, 4.0, 4.0, 5.0, 5.0, 7.0, 9.0]; - var span = new ReadOnlySpan(data); - - // Expected variance: 4.571428... (sample variance) - double variance = span.VarianceSIMD(); - Assert.True(Math.Abs(variance - 4.571428) < 0.0001); - } - - [Fact] - public void StdDevSIMD_MultipleElements_ReturnsCorrectStdDev() - { - double[] data = [2.0, 4.0, 4.0, 4.0, 5.0, 5.0, 7.0, 9.0]; - var span = new ReadOnlySpan(data); - - // Expected std dev: sqrt(4.571428) ≈ 2.138 - double stdDev = span.StdDevSIMD(); - Assert.True(Math.Abs(stdDev - 2.138) < 0.01); - } - - [Fact] - public void MinMaxSIMD_EmptySpan_ReturnsBothNaN() - { - var span = ReadOnlySpan.Empty; - var (min, max) = span.MinMaxSIMD(); - Assert.True(double.IsNaN(min)); - Assert.True(double.IsNaN(max)); - } - - [Fact] - public void MinMaxSIMD_SingleElement_ReturnsSameValue() - { - double[] data = [42.5]; - var span = new ReadOnlySpan(data); - var (min, max) = span.MinMaxSIMD(); - Assert.Equal(42.5, min); - Assert.Equal(42.5, max); - } - - [Fact] - public void MinMaxSIMD_MultipleElements_ReturnsCorrectMinMax() - { - double[] data = [5.0, 2.0, 8.0, 1.0, 9.0, 3.0, 7.0, 4.0]; - var span = new ReadOnlySpan(data); - var (min, max) = span.MinMaxSIMD(); - Assert.Equal(1.0, min); - Assert.Equal(9.0, max); - } - - [Fact] - public void SIMD_WorksWithTSeriesValues() - { - var series = new TSeries(100); - - for (int i = 0; i < 100; i++) - { - series.Add(DateTime.UtcNow.Ticks + i, i + 1.0); - } - - var values = series.Values; - - double sum = values.SumSIMD(); - double avg = values.AverageSIMD(); - double min = values.MinSIMD(); - double max = values.MaxSIMD(); - var (minAlt, maxAlt) = values.MinMaxSIMD(); - - Assert.Equal(5050.0, sum, precision: 8); // Sum of 1..100 - Assert.Equal(50.5, avg, precision: 8); - Assert.Equal(1.0, min); - Assert.Equal(100.0, max); - Assert.Equal(min, minAlt); - Assert.Equal(max, maxAlt); - } - - [Fact] - public void SIMD_WorksWithTBarSeriesClose() - { - var gbm = new GBM(startPrice: 100.0); - long startTime = DateTime.UtcNow.Ticks; - var interval = TimeSpan.FromMinutes(1); - var bars = gbm.Fetch(1000, startTime, interval); - - var closeValues = bars.Close.Values; - - double sum = closeValues.SumSIMD(); - double avg = closeValues.AverageSIMD(); - double min = closeValues.MinSIMD(); - double max = closeValues.MaxSIMD(); - - Assert.True(sum > 0); - Assert.True(avg > 0); - Assert.True(min > 0); - Assert.True(max > min); - } - - [Fact] - public void SIMD_PerformanceTest_LargeDataset() - { - // Generate large dataset - var gbm = new GBM(startPrice: 100.0); - long startTime = DateTime.UtcNow.Ticks; - var interval = TimeSpan.FromMinutes(1); - var bars = gbm.Fetch(10000, startTime, interval); - var closeValues = bars.Close.Values; - - // Warm up - _ = closeValues.SumSIMD(); - - // Test SIMD operations - var sw = System.Diagnostics.Stopwatch.StartNew(); - - double sum = closeValues.SumSIMD(); - double avg = closeValues.AverageSIMD(); - double min = closeValues.MinSIMD(); - double max = closeValues.MaxSIMD(); - var (minAlt, maxAlt) = closeValues.MinMaxSIMD(); - double variance = closeValues.VarianceSIMD(); - double stdDev = closeValues.StdDevSIMD(); - - sw.Stop(); - - // Verify results are valid - Assert.True(sum > 0); - Assert.True(avg > 0); - Assert.True(min > 0); - Assert.True(max > min); - Assert.True(variance > 0); - Assert.True(stdDev > 0); - - // Performance should be sub-millisecond for 10k elements - Assert.True(sw.ElapsedMilliseconds < 10, - $"SIMD operations took {sw.ElapsedMilliseconds}ms, expected < 10ms"); - } -} +using System; +using Xunit; +using QuanTAlib; + +namespace QuanTAlib.Tests; + +public class SimdExtensionsTests +{ + [Fact] + public void SumSIMD_EmptySpan_ReturnsZero() + { + var span = ReadOnlySpan.Empty; + Assert.Equal(0.0, span.SumSIMD()); + } + + [Fact] + public void SumSIMD_SingleElement_ReturnsElement() + { + double[] data = [42.5]; + var span = new ReadOnlySpan(data); + Assert.Equal(42.5, span.SumSIMD()); + } + + [Fact] + public void SumSIMD_MultipleElements_ReturnsCorrectSum() + { + double[] data = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]; + var span = new ReadOnlySpan(data); + Assert.Equal(55.0, span.SumSIMD(), precision: 10); + } + + [Fact] + public void SumSIMD_LargeArray_ReturnsCorrectSum() + { + double[] data = new double[1000]; + for (int i = 0; i < data.Length; i++) + data[i] = i + 1.0; + + var span = new ReadOnlySpan(data); + double expected = 1000.0 * 1001.0 / 2.0; // Sum of 1..1000 + Assert.Equal(expected, span.SumSIMD(), precision: 8); + } + + [Fact] + public void MinSIMD_EmptySpan_ReturnsNaN() + { + var span = ReadOnlySpan.Empty; + Assert.True(double.IsNaN(span.MinSIMD())); + } + + [Fact] + public void MinSIMD_SingleElement_ReturnsElement() + { + double[] data = [42.5]; + var span = new ReadOnlySpan(data); + Assert.Equal(42.5, span.MinSIMD()); + } + + [Fact] + public void MinSIMD_MultipleElements_ReturnsMinimum() + { + double[] data = [5.0, 2.0, 8.0, 1.0, 9.0, 3.0, 7.0, 4.0]; + var span = new ReadOnlySpan(data); + Assert.Equal(1.0, span.MinSIMD()); + } + + [Fact] + public void MaxSIMD_EmptySpan_ReturnsNaN() + { + var span = ReadOnlySpan.Empty; + Assert.True(double.IsNaN(span.MaxSIMD())); + } + + [Fact] + public void MaxSIMD_SingleElement_ReturnsElement() + { + double[] data = [42.5]; + var span = new ReadOnlySpan(data); + Assert.Equal(42.5, span.MaxSIMD()); + } + + [Fact] + public void MaxSIMD_MultipleElements_ReturnsMaximum() + { + double[] data = [5.0, 2.0, 8.0, 1.0, 9.0, 3.0, 7.0, 4.0]; + var span = new ReadOnlySpan(data); + Assert.Equal(9.0, span.MaxSIMD()); + } + + [Fact] + public void AverageSIMD_EmptySpan_ReturnsNaN() + { + var span = ReadOnlySpan.Empty; + Assert.True(double.IsNaN(span.AverageSIMD())); + } + + [Fact] + public void AverageSIMD_MultipleElements_ReturnsCorrectAverage() + { + double[] data = [1.0, 2.0, 3.0, 4.0, 5.0]; + var span = new ReadOnlySpan(data); + Assert.Equal(3.0, span.AverageSIMD(), precision: 10); + } + + [Fact] + public void VarianceSIMD_LessThanTwoElements_ReturnsNaN() + { + double[] data = [42.5]; + var span = new ReadOnlySpan(data); + Assert.True(double.IsNaN(span.VarianceSIMD())); + } + + [Fact] + public void VarianceSIMD_MultipleElements_ReturnsCorrectVariance() + { + double[] data = [2.0, 4.0, 4.0, 4.0, 5.0, 5.0, 7.0, 9.0]; + var span = new ReadOnlySpan(data); + + // Expected variance: 4.571428... (sample variance) + double variance = span.VarianceSIMD(); + Assert.True(Math.Abs(variance - 4.571428) < 0.0001); + } + + [Fact] + public void StdDevSIMD_MultipleElements_ReturnsCorrectStdDev() + { + double[] data = [2.0, 4.0, 4.0, 4.0, 5.0, 5.0, 7.0, 9.0]; + var span = new ReadOnlySpan(data); + + // Expected std dev: sqrt(4.571428) ≈ 2.138 + double stdDev = span.StdDevSIMD(); + Assert.True(Math.Abs(stdDev - 2.138) < 0.01); + } + + [Fact] + public void MinMaxSIMD_EmptySpan_ReturnsBothNaN() + { + var span = ReadOnlySpan.Empty; + var (min, max) = span.MinMaxSIMD(); + Assert.True(double.IsNaN(min)); + Assert.True(double.IsNaN(max)); + } + + [Fact] + public void MinMaxSIMD_SingleElement_ReturnsSameValue() + { + double[] data = [42.5]; + var span = new ReadOnlySpan(data); + var (min, max) = span.MinMaxSIMD(); + Assert.Equal(42.5, min); + Assert.Equal(42.5, max); + } + + [Fact] + public void MinMaxSIMD_MultipleElements_ReturnsCorrectMinMax() + { + double[] data = [5.0, 2.0, 8.0, 1.0, 9.0, 3.0, 7.0, 4.0]; + var span = new ReadOnlySpan(data); + var (min, max) = span.MinMaxSIMD(); + Assert.Equal(1.0, min); + Assert.Equal(9.0, max); + } + + [Fact] + public void SIMD_WorksWithTSeriesValues() + { + var series = new TSeries(100); + + for (int i = 0; i < 100; i++) + { + series.Add(DateTime.UtcNow.Ticks + i, i + 1.0); + } + + var values = series.Values; + + double sum = values.SumSIMD(); + double avg = values.AverageSIMD(); + double min = values.MinSIMD(); + double max = values.MaxSIMD(); + var (minAlt, maxAlt) = values.MinMaxSIMD(); + + Assert.Equal(5050.0, sum, precision: 8); // Sum of 1..100 + Assert.Equal(50.5, avg, precision: 8); + Assert.Equal(1.0, min); + Assert.Equal(100.0, max); + Assert.Equal(min, minAlt); + Assert.Equal(max, maxAlt); + } + + [Fact] + public void SIMD_WorksWithTBarSeriesClose() + { + var gbm = new GBM(startPrice: 100.0); + long startTime = DateTime.UtcNow.Ticks; + var interval = TimeSpan.FromMinutes(1); + var bars = gbm.Fetch(1000, startTime, interval); + + var closeValues = bars.Close.Values; + + double sum = closeValues.SumSIMD(); + double avg = closeValues.AverageSIMD(); + double min = closeValues.MinSIMD(); + double max = closeValues.MaxSIMD(); + + Assert.True(sum > 0); + Assert.True(avg > 0); + Assert.True(min > 0); + Assert.True(max > min); + } + + [Fact] + public void SIMD_PerformanceTest_LargeDataset() + { + // Generate large dataset + var gbm = new GBM(startPrice: 100.0); + long startTime = DateTime.UtcNow.Ticks; + var interval = TimeSpan.FromMinutes(1); + var bars = gbm.Fetch(10000, startTime, interval); + var closeValues = bars.Close.Values; + + // Warm up + _ = closeValues.SumSIMD(); + + // Test SIMD operations + var sw = System.Diagnostics.Stopwatch.StartNew(); + + double sum = closeValues.SumSIMD(); + double avg = closeValues.AverageSIMD(); + double min = closeValues.MinSIMD(); + double max = closeValues.MaxSIMD(); + var (minAlt, maxAlt) = closeValues.MinMaxSIMD(); + double variance = closeValues.VarianceSIMD(); + double stdDev = closeValues.StdDevSIMD(); + + sw.Stop(); + + // Verify results are valid + Assert.True(sum > 0); + Assert.True(avg > 0); + Assert.True(min > 0); + Assert.True(max > min); + Assert.True(variance > 0); + Assert.True(stdDev > 0); + + // Performance should be sub-millisecond for 10k elements + Assert.True(sw.ElapsedMilliseconds < 10, + $"SIMD operations took {sw.ElapsedMilliseconds}ms, expected < 10ms"); + } +} diff --git a/lib/core/simd/SimdExtensions.cs b/lib/core/simd/SimdExtensions.cs index 1113f135..c294a1e9 100644 --- a/lib/core/simd/SimdExtensions.cs +++ b/lib/core/simd/SimdExtensions.cs @@ -1,280 +1,280 @@ -using System.Numerics; -using System.Runtime.CompilerServices; - -namespace QuanTAlib; - -/// -/// SIMD-accelerated extension methods for high-performance array operations. -/// Uses Vector for 4-8x speedup on supported hardware with automatic scalar fallback. -/// -public static class SimdExtensions -{ - /// - /// Calculates sum using SIMD vectorization when available. - /// 4-8x faster than scalar loop on AVX2/AVX-512 hardware. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static double SumSIMD(this ReadOnlySpan span) - { - if (span.IsEmpty) return 0.0; - - if (Vector.IsHardwareAccelerated && span.Length >= Vector.Count) - { - Vector sum = Vector.Zero; - int vectorSize = Vector.Count; - int i = 0; - - // Process in vector chunks - for (; i <= span.Length - vectorSize; i += vectorSize) - { - var vector = new Vector(span.Slice(i, vectorSize)); - sum += vector; - } - - // Horizontal sum of vector - double result = 0.0; - for (int j = 0; j < vectorSize; j++) - result += sum[j]; - - // Process remaining elements - for (; i < span.Length; i++) - result += span[i]; - - return result; - } - - // Scalar fallback - double scalar = 0.0; - for (int i = 0; i < span.Length; i++) - scalar += span[i]; - return scalar; - } - - /// - /// Calculates minimum value using SIMD vectorization when available. - /// 4-6x faster than scalar loop on AVX2/AVX-512 hardware. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static double MinSIMD(this ReadOnlySpan span) - { - if (span.IsEmpty) return double.NaN; - if (span.Length == 1) return span[0]; - - if (Vector.IsHardwareAccelerated && span.Length >= Vector.Count) - { - int vectorSize = Vector.Count; - var minVec = new Vector(span.Slice(0, vectorSize)); - int i = vectorSize; - - // Process in vector chunks - for (; i <= span.Length - vectorSize; i += vectorSize) - { - var vector = new Vector(span.Slice(i, vectorSize)); - minVec = Vector.Min(minVec, vector); - } - - // Find minimum within vector - double result = minVec[0]; - for (int j = 1; j < vectorSize; j++) - { - if (minVec[j] < result) - result = minVec[j]; - } - - // Process remaining elements - for (; i < span.Length; i++) - { - if (span[i] < result) - result = span[i]; - } - - return result; - } - - // Scalar fallback - double min = span[0]; - for (int i = 1; i < span.Length; i++) - { - if (span[i] < min) - min = span[i]; - } - return min; - } - - /// - /// Calculates maximum value using SIMD vectorization when available. - /// 4-6x faster than scalar loop on AVX2/AVX-512 hardware. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static double MaxSIMD(this ReadOnlySpan span) - { - if (span.IsEmpty) return double.NaN; - if (span.Length == 1) return span[0]; - - if (Vector.IsHardwareAccelerated && span.Length >= Vector.Count) - { - int vectorSize = Vector.Count; - var maxVec = new Vector(span.Slice(0, vectorSize)); - int i = vectorSize; - - // Process in vector chunks - for (; i <= span.Length - vectorSize; i += vectorSize) - { - var vector = new Vector(span.Slice(i, vectorSize)); - maxVec = Vector.Max(maxVec, vector); - } - - // Find maximum within vector - double result = maxVec[0]; - for (int j = 1; j < vectorSize; j++) - { - if (maxVec[j] > result) - result = maxVec[j]; - } - - // Process remaining elements - for (; i < span.Length; i++) - { - if (span[i] > result) - result = span[i]; - } - - return result; - } - - // Scalar fallback - double max = span[0]; - for (int i = 1; i < span.Length; i++) - { - if (span[i] > max) - max = span[i]; - } - return max; - } - - /// - /// Calculates average using SIMD vectorization when available. - /// 4-8x faster than scalar loop on AVX2/AVX-512 hardware. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static double AverageSIMD(this ReadOnlySpan span) - { - if (span.IsEmpty) return double.NaN; - return span.SumSIMD() / span.Length; - } - - /// - /// Calculates variance using SIMD vectorization (Welford's online algorithm adapted). - /// More numerically stable than naive two-pass algorithm. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static double VarianceSIMD(this ReadOnlySpan span, double? mean = null) - { - if (span.Length < 2) return double.NaN; - - double m = mean ?? span.AverageSIMD(); - - if (Vector.IsHardwareAccelerated && span.Length >= Vector.Count) - { - var meanVec = new Vector(m); - Vector sumSq = Vector.Zero; - int vectorSize = Vector.Count; - int i = 0; - - // Process in vector chunks - for (; i <= span.Length - vectorSize; i += vectorSize) - { - var vector = new Vector(span.Slice(i, vectorSize)); - var diff = vector - meanVec; - sumSq += diff * diff; - } - - // Horizontal sum of vector - double result = 0.0; - for (int j = 0; j < vectorSize; j++) - result += sumSq[j]; - - // Process remaining elements - for (; i < span.Length; i++) - { - double diff = span[i] - m; - result += diff * diff; - } - - return result / (span.Length - 1); - } - - // Scalar fallback - double sumSquares = 0.0; - for (int i = 0; i < span.Length; i++) - { - double diff = span[i] - m; - sumSquares += diff * diff; - } - return sumSquares / (span.Length - 1); - } - - /// - /// Calculates standard deviation using SIMD vectorization. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static double StdDevSIMD(this ReadOnlySpan span, double? mean = null) - { - return Math.Sqrt(span.VarianceSIMD(mean)); - } - - /// - /// Finds both min and max in a single pass using SIMD vectorization. - /// More efficient than calling MinSIMD and MaxSIMD separately. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static (double Min, double Max) MinMaxSIMD(this ReadOnlySpan span) - { - if (span.IsEmpty) return (double.NaN, double.NaN); - if (span.Length == 1) return (span[0], span[0]); - - if (Vector.IsHardwareAccelerated && span.Length >= Vector.Count) - { - int vectorSize = Vector.Count; - var minVec = new Vector(span.Slice(0, vectorSize)); - var maxVec = minVec; - int i = vectorSize; - - // Process in vector chunks - for (; i <= span.Length - vectorSize; i += vectorSize) - { - var vector = new Vector(span.Slice(i, vectorSize)); - minVec = Vector.Min(minVec, vector); - maxVec = Vector.Max(maxVec, vector); - } - - // Find min/max within vectors - double min = minVec[0]; - double max = maxVec[0]; - for (int j = 1; j < vectorSize; j++) - { - if (minVec[j] < min) min = minVec[j]; - if (maxVec[j] > max) max = maxVec[j]; - } - - // Process remaining elements - for (; i < span.Length; i++) - { - if (span[i] < min) min = span[i]; - if (span[i] > max) max = span[i]; - } - - return (min, max); - } - - // Scalar fallback - double scalarMin = span[0]; - double scalarMax = span[0]; - for (int i = 1; i < span.Length; i++) - { - if (span[i] < scalarMin) scalarMin = span[i]; - if (span[i] > scalarMax) scalarMax = span[i]; - } - return (scalarMin, scalarMax); - } -} +using System.Numerics; +using System.Runtime.CompilerServices; + +namespace QuanTAlib; + +/// +/// SIMD-accelerated extension methods for high-performance array operations. +/// Uses Vector for 4-8x speedup on supported hardware with automatic scalar fallback. +/// +public static class SimdExtensions +{ + /// + /// Calculates sum using SIMD vectorization when available. + /// 4-8x faster than scalar loop on AVX2/AVX-512 hardware. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double SumSIMD(this ReadOnlySpan span) + { + if (span.IsEmpty) return 0.0; + + if (Vector.IsHardwareAccelerated && span.Length >= Vector.Count) + { + Vector sum = Vector.Zero; + int vectorSize = Vector.Count; + int i = 0; + + // Process in vector chunks + for (; i <= span.Length - vectorSize; i += vectorSize) + { + var vector = new Vector(span.Slice(i, vectorSize)); + sum += vector; + } + + // Horizontal sum of vector + double result = 0.0; + for (int j = 0; j < vectorSize; j++) + result += sum[j]; + + // Process remaining elements + for (; i < span.Length; i++) + result += span[i]; + + return result; + } + + // Scalar fallback + double scalar = 0.0; + for (int i = 0; i < span.Length; i++) + scalar += span[i]; + return scalar; + } + + /// + /// Calculates minimum value using SIMD vectorization when available. + /// 4-6x faster than scalar loop on AVX2/AVX-512 hardware. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double MinSIMD(this ReadOnlySpan span) + { + if (span.IsEmpty) return double.NaN; + if (span.Length == 1) return span[0]; + + if (Vector.IsHardwareAccelerated && span.Length >= Vector.Count) + { + int vectorSize = Vector.Count; + var minVec = new Vector(span.Slice(0, vectorSize)); + int i = vectorSize; + + // Process in vector chunks + for (; i <= span.Length - vectorSize; i += vectorSize) + { + var vector = new Vector(span.Slice(i, vectorSize)); + minVec = Vector.Min(minVec, vector); + } + + // Find minimum within vector + double result = minVec[0]; + for (int j = 1; j < vectorSize; j++) + { + if (minVec[j] < result) + result = minVec[j]; + } + + // Process remaining elements + for (; i < span.Length; i++) + { + if (span[i] < result) + result = span[i]; + } + + return result; + } + + // Scalar fallback + double min = span[0]; + for (int i = 1; i < span.Length; i++) + { + if (span[i] < min) + min = span[i]; + } + return min; + } + + /// + /// Calculates maximum value using SIMD vectorization when available. + /// 4-6x faster than scalar loop on AVX2/AVX-512 hardware. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double MaxSIMD(this ReadOnlySpan span) + { + if (span.IsEmpty) return double.NaN; + if (span.Length == 1) return span[0]; + + if (Vector.IsHardwareAccelerated && span.Length >= Vector.Count) + { + int vectorSize = Vector.Count; + var maxVec = new Vector(span.Slice(0, vectorSize)); + int i = vectorSize; + + // Process in vector chunks + for (; i <= span.Length - vectorSize; i += vectorSize) + { + var vector = new Vector(span.Slice(i, vectorSize)); + maxVec = Vector.Max(maxVec, vector); + } + + // Find maximum within vector + double result = maxVec[0]; + for (int j = 1; j < vectorSize; j++) + { + if (maxVec[j] > result) + result = maxVec[j]; + } + + // Process remaining elements + for (; i < span.Length; i++) + { + if (span[i] > result) + result = span[i]; + } + + return result; + } + + // Scalar fallback + double max = span[0]; + for (int i = 1; i < span.Length; i++) + { + if (span[i] > max) + max = span[i]; + } + return max; + } + + /// + /// Calculates average using SIMD vectorization when available. + /// 4-8x faster than scalar loop on AVX2/AVX-512 hardware. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double AverageSIMD(this ReadOnlySpan span) + { + if (span.IsEmpty) return double.NaN; + return span.SumSIMD() / span.Length; + } + + /// + /// Calculates variance using SIMD vectorization (Welford's online algorithm adapted). + /// More numerically stable than naive two-pass algorithm. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double VarianceSIMD(this ReadOnlySpan span, double? mean = null) + { + if (span.Length < 2) return double.NaN; + + double m = mean ?? span.AverageSIMD(); + + if (Vector.IsHardwareAccelerated && span.Length >= Vector.Count) + { + var meanVec = new Vector(m); + Vector sumSq = Vector.Zero; + int vectorSize = Vector.Count; + int i = 0; + + // Process in vector chunks + for (; i <= span.Length - vectorSize; i += vectorSize) + { + var vector = new Vector(span.Slice(i, vectorSize)); + var diff = vector - meanVec; + sumSq += diff * diff; + } + + // Horizontal sum of vector + double result = 0.0; + for (int j = 0; j < vectorSize; j++) + result += sumSq[j]; + + // Process remaining elements + for (; i < span.Length; i++) + { + double diff = span[i] - m; + result += diff * diff; + } + + return result / (span.Length - 1); + } + + // Scalar fallback + double sumSquares = 0.0; + for (int i = 0; i < span.Length; i++) + { + double diff = span[i] - m; + sumSquares += diff * diff; + } + return sumSquares / (span.Length - 1); + } + + /// + /// Calculates standard deviation using SIMD vectorization. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double StdDevSIMD(this ReadOnlySpan span, double? mean = null) + { + return Math.Sqrt(span.VarianceSIMD(mean)); + } + + /// + /// Finds both min and max in a single pass using SIMD vectorization. + /// More efficient than calling MinSIMD and MaxSIMD separately. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static (double Min, double Max) MinMaxSIMD(this ReadOnlySpan span) + { + if (span.IsEmpty) return (double.NaN, double.NaN); + if (span.Length == 1) return (span[0], span[0]); + + if (Vector.IsHardwareAccelerated && span.Length >= Vector.Count) + { + int vectorSize = Vector.Count; + var minVec = new Vector(span.Slice(0, vectorSize)); + var maxVec = minVec; + int i = vectorSize; + + // Process in vector chunks + for (; i <= span.Length - vectorSize; i += vectorSize) + { + var vector = new Vector(span.Slice(i, vectorSize)); + minVec = Vector.Min(minVec, vector); + maxVec = Vector.Max(maxVec, vector); + } + + // Find min/max within vectors + double min = minVec[0]; + double max = maxVec[0]; + for (int j = 1; j < vectorSize; j++) + { + if (minVec[j] < min) min = minVec[j]; + if (maxVec[j] > max) max = maxVec[j]; + } + + // Process remaining elements + for (; i < span.Length; i++) + { + if (span[i] < min) min = span[i]; + if (span[i] > max) max = span[i]; + } + + return (min, max); + } + + // Scalar fallback + double scalarMin = span[0]; + double scalarMax = span[0]; + for (int i = 1; i < span.Length; i++) + { + if (span[i] < scalarMin) scalarMin = span[i]; + if (span[i] > scalarMax) scalarMax = span[i]; + } + return (scalarMin, scalarMax); + } +} diff --git a/lib/core/simd/SimdExtensions.md b/lib/core/simd/SimdExtensions.md index 5b22c8b7..ad6e5e33 100644 --- a/lib/core/simd/SimdExtensions.md +++ b/lib/core/simd/SimdExtensions.md @@ -1,43 +1,43 @@ -# SimdExtensions Class - -`SimdExtensions` provides high-performance, SIMD-accelerated extension methods for `ReadOnlySpan`. It leverages .NET's `Vector` to achieve 4-8x speedups on supported hardware (AVX2, AVX-512) while automatically falling back to scalar implementations on older hardware. - -## Key Features - -- **Hardware Acceleration**: Uses CPU vector registers to process multiple elements in parallel. -- **Automatic Fallback**: Gracefully handles non-SIMD hardware or small arrays. -- **Zero-Allocation**: Operates directly on spans without creating new arrays. -- **Aggressive Inlining**: Methods are marked for inlining to minimize call overhead. - -## Available Methods - -| Method | Description | -|--------|-------------| -| `SumSIMD()` | Calculates the sum of elements. | -| `MinSIMD()` | Finds the minimum value. | -| `MaxSIMD()` | Finds the maximum value. | -| `MinMaxSIMD()` | Finds both min and max in a single pass (more efficient than separate calls). | -| `AverageSIMD()` | Calculates the arithmetic mean. | -| `VarianceSIMD()` | Calculates the sample variance. | -| `StdDevSIMD()` | Calculates the sample standard deviation. | - -## Performance - -On modern CPUs (e.g., Intel Core i7/i9, AMD Ryzen), these methods typically outperform standard LINQ or scalar loops by a factor of 4 to 8 for large arrays. - -## Usage - -```csharp -using QuanTAlib; - -double[] data = { 1.0, 2.0, 3.0, 4.0, 5.0, ... }; -ReadOnlySpan span = data; - -// Calculate sum -double sum = span.SumSIMD(); - -// Calculate min and max in one pass -var (min, max) = span.MinMaxSIMD(); - -// Calculate standard deviation -double stdDev = span.StdDevSIMD(); +# SimdExtensions Class + +`SimdExtensions` provides high-performance, SIMD-accelerated extension methods for `ReadOnlySpan`. It leverages .NET's `Vector` to achieve 4-8x speedups on supported hardware (AVX2, AVX-512) while automatically falling back to scalar implementations on older hardware. + +## Key Features + +- **Hardware Acceleration**: Uses CPU vector registers to process multiple elements in parallel. +- **Automatic Fallback**: Gracefully handles non-SIMD hardware or small arrays. +- **Zero-Allocation**: Operates directly on spans without creating new arrays. +- **Aggressive Inlining**: Methods are marked for inlining to minimize call overhead. + +## Available Methods + +| Method | Description | +|--------|-------------| +| `SumSIMD()` | Calculates the sum of elements. | +| `MinSIMD()` | Finds the minimum value. | +| `MaxSIMD()` | Finds the maximum value. | +| `MinMaxSIMD()` | Finds both min and max in a single pass (more efficient than separate calls). | +| `AverageSIMD()` | Calculates the arithmetic mean. | +| `VarianceSIMD()` | Calculates the sample variance. | +| `StdDevSIMD()` | Calculates the sample standard deviation. | + +## Performance + +On modern CPUs (e.g., Intel Core i7/i9, AMD Ryzen), these methods typically outperform standard LINQ or scalar loops by a factor of 4 to 8 for large arrays. + +## Usage + +```csharp +using QuanTAlib; + +double[] data = { 1.0, 2.0, 3.0, 4.0, 5.0, ... }; +ReadOnlySpan span = data; + +// Calculate sum +double sum = span.SumSIMD(); + +// Calculate min and max in one pass +var (min, max) = span.MinMaxSIMD(); + +// Calculate standard deviation +double stdDev = span.StdDevSIMD(); diff --git a/lib/core/tbar/TBar.Notebook.dib b/lib/core/tbar/TBar.Notebook.dib index 7e00ac54..f0103508 100644 --- a/lib/core/tbar/TBar.Notebook.dib +++ b/lib/core/tbar/TBar.Notebook.dib @@ -1,74 +1,74 @@ -#!meta - -{"kernelInfo":{"defaultKernelName":"csharp","items":[{"aliases":[],"languageName":"csharp","name":"csharp"}]}} - -#!csharp - -// Reference the library -#r "..\..\bin\QuanTAlib.dll" - -using QuanTAlib; - -// 1. Creating a TBar -// TBar represents a single OHLCV bar (Open, High, Low, Close, Volume) -// It is an immutable struct optimized for memory and performance - -long now = DateTime.UtcNow.Ticks; -var bar = new TBar(now, 100.0, 105.0, 95.0, 102.0, 1000.0); - -Console.WriteLine($"Created TBar: {bar}"); -Console.WriteLine($"Time: {bar.AsDateTime}"); -Console.WriteLine($"Open: {bar.Open}"); -Console.WriteLine($"High: {bar.High}"); -Console.WriteLine($"Low: {bar.Low}"); -Console.WriteLine($"Close: {bar.Close}"); -Console.WriteLine($"Volume: {bar.Volume}"); - -#!csharp - -// 2. Computed Properties -// TBar provides on-demand calculation of common price averages -// These are calculated when accessed, saving storage space - -Console.WriteLine($"HL2 (High+Low)/2: {bar.HL2}"); -Console.WriteLine($"OC2 (Open+Close)/2: {bar.OC2}"); -Console.WriteLine($"OHL3 (Open+High+Low)/3: {bar.OHL3}"); -Console.WriteLine($"HLC3 (High+Low+Close)/3: {bar.HLC3}"); -Console.WriteLine($"OHLC4 (Open+High+Low+Close)/4: {bar.OHLC4}"); -Console.WriteLine($"HLCC4 (High+Low+Close+Close)/4: {bar.HLCC4}"); - -#!csharp - -// 3. TValue Accessors -// You can efficiently access individual components as TValue (Time-Value pair) -// This is useful when you need to treat a specific price component as a time series point - -Console.WriteLine($"Open TValue: {bar.O}"); -Console.WriteLine($"High TValue: {bar.H}"); -Console.WriteLine($"Low TValue: {bar.L}"); -Console.WriteLine($"Close TValue: {bar.C}"); -Console.WriteLine($"Volume TValue: {bar.V}"); - -#!csharp - -// 4. Implicit Conversions -// TBar supports implicit conversions to double (Close price), TValue (Close), and DateTime - -double closePrice = bar; -TValue value = bar; -DateTime dt = bar; - -Console.WriteLine($"Implicit double (Close): {closePrice}"); -Console.WriteLine($"Implicit TValue (Close): {value}"); -Console.WriteLine($"Implicit DateTime: {dt}"); - -#!csharp - -// 5. Equality and Immutability -// Being a struct, TBar has value semantics - -var bar2 = new TBar(now, 100.0, 105.0, 95.0, 102.0, 1000.0); -var bar3 = new TBar(now, 101.0, 106.0, 96.0, 103.0, 1100.0); - -Console.WriteLine($"bar equals bar2? {bar == bar2}"); // True, same values -Console.WriteLine($"bar equals bar3? {bar == bar3}"); // False, different values +#!meta + +{"kernelInfo":{"defaultKernelName":"csharp","items":[{"aliases":[],"languageName":"csharp","name":"csharp"}]}} + +#!csharp + +// Reference the library +#r "..\..\bin\QuanTAlib.dll" + +using QuanTAlib; + +// 1. Creating a TBar +// TBar represents a single OHLCV bar (Open, High, Low, Close, Volume) +// It is an immutable struct optimized for memory and performance + +long now = DateTime.UtcNow.Ticks; +var bar = new TBar(now, 100.0, 105.0, 95.0, 102.0, 1000.0); + +Console.WriteLine($"Created TBar: {bar}"); +Console.WriteLine($"Time: {bar.AsDateTime}"); +Console.WriteLine($"Open: {bar.Open}"); +Console.WriteLine($"High: {bar.High}"); +Console.WriteLine($"Low: {bar.Low}"); +Console.WriteLine($"Close: {bar.Close}"); +Console.WriteLine($"Volume: {bar.Volume}"); + +#!csharp + +// 2. Computed Properties +// TBar provides on-demand calculation of common price averages +// These are calculated when accessed, saving storage space + +Console.WriteLine($"HL2 (High+Low)/2: {bar.HL2}"); +Console.WriteLine($"OC2 (Open+Close)/2: {bar.OC2}"); +Console.WriteLine($"OHL3 (Open+High+Low)/3: {bar.OHL3}"); +Console.WriteLine($"HLC3 (High+Low+Close)/3: {bar.HLC3}"); +Console.WriteLine($"OHLC4 (Open+High+Low+Close)/4: {bar.OHLC4}"); +Console.WriteLine($"HLCC4 (High+Low+Close+Close)/4: {bar.HLCC4}"); + +#!csharp + +// 3. TValue Accessors +// You can efficiently access individual components as TValue (Time-Value pair) +// This is useful when you need to treat a specific price component as a time series point + +Console.WriteLine($"Open TValue: {bar.O}"); +Console.WriteLine($"High TValue: {bar.H}"); +Console.WriteLine($"Low TValue: {bar.L}"); +Console.WriteLine($"Close TValue: {bar.C}"); +Console.WriteLine($"Volume TValue: {bar.V}"); + +#!csharp + +// 4. Implicit Conversions +// TBar supports implicit conversions to double (Close price), TValue (Close), and DateTime + +double closePrice = bar; +TValue value = bar; +DateTime dt = bar; + +Console.WriteLine($"Implicit double (Close): {closePrice}"); +Console.WriteLine($"Implicit TValue (Close): {value}"); +Console.WriteLine($"Implicit DateTime: {dt}"); + +#!csharp + +// 5. Equality and Immutability +// Being a struct, TBar has value semantics + +var bar2 = new TBar(now, 100.0, 105.0, 95.0, 102.0, 1000.0); +var bar3 = new TBar(now, 101.0, 106.0, 96.0, 103.0, 1100.0); + +Console.WriteLine($"bar equals bar2? {bar == bar2}"); // True, same values +Console.WriteLine($"bar equals bar3? {bar == bar3}"); // False, different values diff --git a/lib/core/tbar/TBar.Tests.cs b/lib/core/tbar/TBar.Tests.cs index a1c75380..1d6a4f86 100644 --- a/lib/core/tbar/TBar.Tests.cs +++ b/lib/core/tbar/TBar.Tests.cs @@ -1,76 +1,76 @@ -using System; -using Xunit; -using QuanTAlib; - -namespace QuanTAlib.Tests -{ - public class TBarTests - { - [Fact] - public void Constructor_SetsPropertiesCorrectly() - { - long time = DateTime.UtcNow.Ticks; - double open = 100; - double high = 110; - double low = 90; - double close = 105; - double volume = 1000; - - var bar = new TBar(time, open, high, low, close, volume); - - Assert.Equal(time, bar.Time); - Assert.Equal(open, bar.Open); - Assert.Equal(high, bar.High); - Assert.Equal(low, bar.Low); - Assert.Equal(close, bar.Close); - Assert.Equal(volume, bar.Volume); - } - - [Fact] - public void HL2_CalculatesCorrectly() - { - var bar = new TBar(0, 100, 110, 90, 105, 1000); - Assert.Equal(100.0, bar.HL2); // (110 + 90) / 2 - } - - [Fact] - public void OHL3_CalculatesCorrectly() - { - var bar = new TBar(0, 100, 110, 90, 105, 1000); - Assert.Equal(100.0, bar.OHL3); // (100 + 110 + 90) / 3 - } - - [Fact] - public void HLC3_CalculatesCorrectly() - { - var bar = new TBar(0, 100, 110, 90, 100, 1000); - Assert.Equal(100.0, bar.HLC3); // (110 + 90 + 100) / 3 - } - - [Fact] - public void OHLC4_CalculatesCorrectly() - { - var bar = new TBar(0, 100, 110, 90, 100, 1000); - Assert.Equal(100.0, bar.OHLC4); // (100 + 110 + 90 + 100) / 4 - } - - [Fact] - public void HLCC4_CalculatesCorrectly() - { - var bar = new TBar(0, 100, 110, 90, 100, 1000); - Assert.Equal(100.0, bar.HLCC4); // (110 + 90 + 100 + 100) / 4 - } - - [Fact] - public void ImplicitConversion_ToTValue_ReturnsClosePriceWithTime() - { - long time = DateTime.UtcNow.Ticks; - var bar = new TBar(time, 100, 110, 90, 105, 1000); - - TValue tv = bar; - - Assert.Equal(time, tv.Time); - Assert.Equal(105.0, tv.Value); - } - } -} +using System; +using Xunit; +using QuanTAlib; + +namespace QuanTAlib.Tests +{ + public class TBarTests + { + [Fact] + public void Constructor_SetsPropertiesCorrectly() + { + long time = DateTime.UtcNow.Ticks; + double open = 100; + double high = 110; + double low = 90; + double close = 105; + double volume = 1000; + + var bar = new TBar(time, open, high, low, close, volume); + + Assert.Equal(time, bar.Time); + Assert.Equal(open, bar.Open); + Assert.Equal(high, bar.High); + Assert.Equal(low, bar.Low); + Assert.Equal(close, bar.Close); + Assert.Equal(volume, bar.Volume); + } + + [Fact] + public void HL2_CalculatesCorrectly() + { + var bar = new TBar(0, 100, 110, 90, 105, 1000); + Assert.Equal(100.0, bar.HL2); // (110 + 90) / 2 + } + + [Fact] + public void OHL3_CalculatesCorrectly() + { + var bar = new TBar(0, 100, 110, 90, 105, 1000); + Assert.Equal(100.0, bar.OHL3); // (100 + 110 + 90) / 3 + } + + [Fact] + public void HLC3_CalculatesCorrectly() + { + var bar = new TBar(0, 100, 110, 90, 100, 1000); + Assert.Equal(100.0, bar.HLC3); // (110 + 90 + 100) / 3 + } + + [Fact] + public void OHLC4_CalculatesCorrectly() + { + var bar = new TBar(0, 100, 110, 90, 100, 1000); + Assert.Equal(100.0, bar.OHLC4); // (100 + 110 + 90 + 100) / 4 + } + + [Fact] + public void HLCC4_CalculatesCorrectly() + { + var bar = new TBar(0, 100, 110, 90, 100, 1000); + Assert.Equal(100.0, bar.HLCC4); // (110 + 90 + 100 + 100) / 4 + } + + [Fact] + public void ImplicitConversion_ToTValue_ReturnsClosePriceWithTime() + { + long time = DateTime.UtcNow.Ticks; + var bar = new TBar(time, 100, 110, 90, 105, 1000); + + TValue tv = bar; + + Assert.Equal(time, tv.Time); + Assert.Equal(105.0, tv.Value); + } + } +} diff --git a/lib/core/tbar/TBar.md b/lib/core/tbar/TBar.md index 3fcde644..edd1ca64 100644 --- a/lib/core/tbar/TBar.md +++ b/lib/core/tbar/TBar.md @@ -1,68 +1,68 @@ -# TBar Struct - -`TBar` is a lightweight, immutable struct representing a single OHLCV (Open, High, Low, Close, Volume) bar. It is designed for high-performance financial data processing with minimal memory overhead. - -## Key Features - -- **Memory Efficient**: Pure data type occupying exactly 48 bytes (1 `long` + 5 `double`s). -- **Immutable**: Thread-safe by design. -- **Zero-Copy Conversions**: Efficiently converts to `TValue` for individual price components (Open, High, Low, Close, Volume). -- **Computed Properties**: Provides on-demand calculation of common price averages (HL2, HLC3, etc.) without storage overhead. -- **SIMD Compatible**: Layout is optimized for potential vectorization in collection types. - -## Structure Definition - -```csharp -public readonly struct TBar : IEquatable -{ - public readonly long Time; // Unix ticks - public readonly double Open; - public readonly double High; - public readonly double Low; - public readonly double Close; - public readonly double Volume; -} -``` - -## Properties - -| Property | Type | Description | -|----------|------|-------------| -| `Time` | `long` | Timestamp in ticks. | -| `Open` | `double` | Opening price. | -| `High` | `double` | Highest price. | -| `Low` | `double` | Lowest price. | -| `Close` | `double` | Closing price. | -| `Volume` | `double` | Traded volume. | -| `AsDateTime` | `DateTime` | `Time` converted to UTC DateTime. | - -### Computed Averages -These properties are calculated on the fly: -- `HL2`: (High + Low) / 2 -- `OC2`: (Open + Close) / 2 -- `OHL3`: (Open + High + Low) / 3 -- `HLC3`: (High + Low + Close) / 3 -- `OHLC4`: (Open + High + Low + Close) / 4 -- `HLCC4`: (High + Low + Close + Close) / 4 - -### TValue Accessors -Efficiently access components as `TValue` (Time-Value pair): -- `O`: (Time, Open) -- `H`: (Time, High) -- `L`: (Time, Low) -- `C`: (Time, Close) -- `V`: (Time, Volume) - -## Usage - -### Creating a TBar -```csharp -long now = DateTime.UtcNow.Ticks; -var bar = new TBar(now, 100.0, 105.0, 95.0, 102.0, 1000.0); -``` - -### Implicit Conversions -```csharp -double closePrice = bar; // Implicitly converts to Close price -TValue value = bar; // Implicitly converts to (Time, Close) -DateTime dt = bar; // Implicitly converts to DateTime +# TBar Struct + +`TBar` is a lightweight, immutable struct representing a single OHLCV (Open, High, Low, Close, Volume) bar. It is designed for high-performance financial data processing with minimal memory overhead. + +## Key Features + +- **Memory Efficient**: Pure data type occupying exactly 48 bytes (1 `long` + 5 `double`s). +- **Immutable**: Thread-safe by design. +- **Zero-Copy Conversions**: Efficiently converts to `TValue` for individual price components (Open, High, Low, Close, Volume). +- **Computed Properties**: Provides on-demand calculation of common price averages (HL2, HLC3, etc.) without storage overhead. +- **SIMD Compatible**: Layout is optimized for potential vectorization in collection types. + +## Structure Definition + +```csharp +public readonly struct TBar : IEquatable +{ + public readonly long Time; // Unix ticks + public readonly double Open; + public readonly double High; + public readonly double Low; + public readonly double Close; + public readonly double Volume; +} +``` + +## Properties + +| Property | Type | Description | +|----------|------|-------------| +| `Time` | `long` | Timestamp in ticks. | +| `Open` | `double` | Opening price. | +| `High` | `double` | Highest price. | +| `Low` | `double` | Lowest price. | +| `Close` | `double` | Closing price. | +| `Volume` | `double` | Traded volume. | +| `AsDateTime` | `DateTime` | `Time` converted to UTC DateTime. | + +### Computed Averages +These properties are calculated on the fly: +- `HL2`: (High + Low) / 2 +- `OC2`: (Open + Close) / 2 +- `OHL3`: (Open + High + Low) / 3 +- `HLC3`: (High + Low + Close) / 3 +- `OHLC4`: (Open + High + Low + Close) / 4 +- `HLCC4`: (High + Low + Close + Close) / 4 + +### TValue Accessors +Efficiently access components as `TValue` (Time-Value pair): +- `O`: (Time, Open) +- `H`: (Time, High) +- `L`: (Time, Low) +- `C`: (Time, Close) +- `V`: (Time, Volume) + +## Usage + +### Creating a TBar +```csharp +long now = DateTime.UtcNow.Ticks; +var bar = new TBar(now, 100.0, 105.0, 95.0, 102.0, 1000.0); +``` + +### Implicit Conversions +```csharp +double closePrice = bar; // Implicitly converts to Close price +TValue value = bar; // Implicitly converts to (Time, Close) +DateTime dt = bar; // Implicitly converts to DateTime diff --git a/lib/core/tbar/tbar.cs b/lib/core/tbar/tbar.cs index 29571c45..39d3a119 100644 --- a/lib/core/tbar/tbar.cs +++ b/lib/core/tbar/tbar.cs @@ -1,83 +1,83 @@ -using System.Runtime.CompilerServices; - -namespace QuanTAlib; - -/// -/// A lightweight struct representing an OHLCV bar. -/// Pure data type: 48 bytes (long + 5 doubles). -/// -[SkipLocalsInit] -public readonly struct TBar : IEquatable -{ - public readonly long Time; - public readonly double Open; - public readonly double High; - public readonly double Low; - public readonly double Close; - public readonly double Volume; - - public DateTime AsDateTime => new(Time, DateTimeKind.Utc); - - // TValue conversions (Zero-copy / lightweight creation) - public TValue O { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new(Time, Open); } - public TValue H { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new(Time, High); } - public TValue L { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new(Time, Low); } - public TValue C { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new(Time, Close); } - public TValue V { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new(Time, Volume); } - - // Computed properties (calculated on demand, no storage overhead) - public double HL2 { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => (High + Low) * 0.5; } - public double OC2 { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => (Open + Close) * 0.5; } - public double OHL3 { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => (Open + High + Low) / 3.0; } - public double HLC3 { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => (High + Low + Close) / 3.0; } - public double OHLC4 { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => (Open + High + Low + Close) * 0.25; } - public double HLCC4 { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => (High + Low + Close + Close) * 0.25; } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public TBar(long time, double open, double high, double low, double close, double volume) - { - Time = time; - Open = open; - High = high; - Low = low; - Close = close; - Volume = volume; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public TBar(DateTime time, double open, double high, double low, double close, double volume) - { - Time = time.Ticks; - Open = open; - High = high; - Low = low; - Close = close; - Volume = volume; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static implicit operator double(TBar bar) => bar.Close; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static implicit operator TValue(TBar bar) => new(bar.Time, bar.Close); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static implicit operator DateTime(TBar bar) => new(bar.Time, DateTimeKind.Utc); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override string ToString() => $"[{AsDateTime:yyyy-MM-dd HH:mm:ss}: O={Open:F2}, H={High:F2}, L={Low:F2}, C={Close:F2}, V={Volume:F2}]"; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool Equals(TBar other) => - Time == other.Time && - Open == other.Open && - High == other.High && - Low == other.Low && - Close == other.Close && - Volume == other.Volume; - - public override bool Equals(object? obj) => obj is TBar other && Equals(other); - public override int GetHashCode() => HashCode.Combine(Time, Open, High, Low, Close, Volume); - public static bool operator ==(TBar left, TBar right) => left.Equals(right); - public static bool operator !=(TBar left, TBar right) => !left.Equals(right); -} +using System.Runtime.CompilerServices; + +namespace QuanTAlib; + +/// +/// A lightweight struct representing an OHLCV bar. +/// Pure data type: 48 bytes (long + 5 doubles). +/// +[SkipLocalsInit] +public readonly struct TBar : IEquatable +{ + public readonly long Time; + public readonly double Open; + public readonly double High; + public readonly double Low; + public readonly double Close; + public readonly double Volume; + + public DateTime AsDateTime => new(Time, DateTimeKind.Utc); + + // TValue conversions (Zero-copy / lightweight creation) + public TValue O { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new(Time, Open); } + public TValue H { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new(Time, High); } + public TValue L { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new(Time, Low); } + public TValue C { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new(Time, Close); } + public TValue V { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new(Time, Volume); } + + // Computed properties (calculated on demand, no storage overhead) + public double HL2 { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => (High + Low) * 0.5; } + public double OC2 { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => (Open + Close) * 0.5; } + public double OHL3 { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => (Open + High + Low) / 3.0; } + public double HLC3 { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => (High + Low + Close) / 3.0; } + public double OHLC4 { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => (Open + High + Low + Close) * 0.25; } + public double HLCC4 { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => (High + Low + Close + Close) * 0.25; } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public TBar(long time, double open, double high, double low, double close, double volume) + { + Time = time; + Open = open; + High = high; + Low = low; + Close = close; + Volume = volume; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public TBar(DateTime time, double open, double high, double low, double close, double volume) + { + Time = time.Ticks; + Open = open; + High = high; + Low = low; + Close = close; + Volume = volume; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double(TBar bar) => bar.Close; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator TValue(TBar bar) => new(bar.Time, bar.Close); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator DateTime(TBar bar) => new(bar.Time, DateTimeKind.Utc); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() => $"[{AsDateTime:yyyy-MM-dd HH:mm:ss}: O={Open:F2}, H={High:F2}, L={Low:F2}, C={Close:F2}, V={Volume:F2}]"; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(TBar other) => + Time == other.Time && + Open == other.Open && + High == other.High && + Low == other.Low && + Close == other.Close && + Volume == other.Volume; + + public override bool Equals(object? obj) => obj is TBar other && Equals(other); + public override int GetHashCode() => HashCode.Combine(Time, Open, High, Low, Close, Volume); + public static bool operator ==(TBar left, TBar right) => left.Equals(right); + public static bool operator !=(TBar left, TBar right) => !left.Equals(right); +} diff --git a/lib/core/tbarseries/TBarSeries.Notebook.dib b/lib/core/tbarseries/TBarSeries.Notebook.dib index 81eb7899..9064c391 100644 --- a/lib/core/tbarseries/TBarSeries.Notebook.dib +++ b/lib/core/tbarseries/TBarSeries.Notebook.dib @@ -1,82 +1,82 @@ -#!meta - -{"kernelInfo":{"defaultKernelName":"csharp","items":[{"aliases":[],"languageName":"csharp","name":"csharp"}]}} - -#!csharp - -// Reference the library -#r "..\..\bin\QuanTAlib.dll" - -using QuanTAlib; - -// 1. Creating a TBarSeries -// TBarSeries is a collection of bars stored in Structure of Arrays (SoA) format -// This layout is optimized for performance and SIMD operations - -var bars = new TBarSeries(); -long now = DateTime.UtcNow.Ticks; - -// Add a new bar -var bar1 = new TBar(now, 100, 105, 95, 102, 1000); -bars.Add(bar1, isNew: true); - -Console.WriteLine($"Added Bar 1: Count={bars.Count}"); -Console.WriteLine($"Last Close: {bars.Last.Close}"); - -#!csharp - -// 2. Streaming Updates -// TBarSeries supports updating the last bar in place -// This is crucial for real-time feeds where the current bar changes until it closes - -// Update the bar (e.g. price changed within the same minute) -var bar1Update = new TBar(now, 100, 106, 95, 104, 1500); -bars.Add(bar1Update, isNew: false); - -Console.WriteLine($"Updated Bar 1: Count={bars.Count} (Count should not increase)"); -Console.WriteLine($"Last Close: {bars.Last.Close}"); -Console.WriteLine($"Last High: {bars.Last.High}"); - -#!csharp - -// 3. Zero-Copy Views -// You can access individual components (Open, High, Low, Close, Volume) as TSeries -// These views share the underlying memory, so no copying is involved - -Console.WriteLine($"Bars Count: {bars.Count}"); -Console.WriteLine($"Close Series Count: {bars.Close.Count}"); -Console.WriteLine($"Close Series Last: {bars.Close.Last.Value}"); - -// Verify view updates automatically -Console.WriteLine("\nAdding new bar..."); -bars.Add(now + TimeSpan.TicksPerMinute, 104, 108, 103, 107, 2000, isNew: true); - -Console.WriteLine($"Bars Count: {bars.Count}"); -Console.WriteLine($"Close Series Count: {bars.Close.Count} (Should match Bars Count)"); -Console.WriteLine($"Close Series Last: {bars.Close.Last.Value} (Should be 107)"); - -#!csharp - -// 4. Aliases and Direct Access -// TBarSeries provides short aliases (O, H, L, C, V) and direct access properties - -Console.WriteLine($"Alias Access (C.Last): {bars.C.Last.Value}"); -Console.WriteLine($"Direct Last Access (LastClose): {bars.LastClose}"); -Console.WriteLine($"Direct Last Time (LastTime): {new DateTime(bars.LastTime)}"); - -#!csharp - -// 5. Iteration -// You can iterate over the bars or individual series - -Console.WriteLine("\nIterating over bars:"); -foreach (var bar in bars) -{ - Console.WriteLine($" {bar}"); -} - -Console.WriteLine("\nIterating over Close prices:"); -for (int i = 0; i < bars.Count; i++) -{ - Console.WriteLine($" Bar {i}: Close={bars.Close[i].Value}"); -} +#!meta + +{"kernelInfo":{"defaultKernelName":"csharp","items":[{"aliases":[],"languageName":"csharp","name":"csharp"}]}} + +#!csharp + +// Reference the library +#r "..\..\bin\QuanTAlib.dll" + +using QuanTAlib; + +// 1. Creating a TBarSeries +// TBarSeries is a collection of bars stored in Structure of Arrays (SoA) format +// This layout is optimized for performance and SIMD operations + +var bars = new TBarSeries(); +long now = DateTime.UtcNow.Ticks; + +// Add a new bar +var bar1 = new TBar(now, 100, 105, 95, 102, 1000); +bars.Add(bar1, isNew: true); + +Console.WriteLine($"Added Bar 1: Count={bars.Count}"); +Console.WriteLine($"Last Close: {bars.Last.Close}"); + +#!csharp + +// 2. Streaming Updates +// TBarSeries supports updating the last bar in place +// This is crucial for real-time feeds where the current bar changes until it closes + +// Update the bar (e.g. price changed within the same minute) +var bar1Update = new TBar(now, 100, 106, 95, 104, 1500); +bars.Add(bar1Update, isNew: false); + +Console.WriteLine($"Updated Bar 1: Count={bars.Count} (Count should not increase)"); +Console.WriteLine($"Last Close: {bars.Last.Close}"); +Console.WriteLine($"Last High: {bars.Last.High}"); + +#!csharp + +// 3. Zero-Copy Views +// You can access individual components (Open, High, Low, Close, Volume) as TSeries +// These views share the underlying memory, so no copying is involved + +Console.WriteLine($"Bars Count: {bars.Count}"); +Console.WriteLine($"Close Series Count: {bars.Close.Count}"); +Console.WriteLine($"Close Series Last: {bars.Close.Last.Value}"); + +// Verify view updates automatically +Console.WriteLine("\nAdding new bar..."); +bars.Add(now + TimeSpan.TicksPerMinute, 104, 108, 103, 107, 2000, isNew: true); + +Console.WriteLine($"Bars Count: {bars.Count}"); +Console.WriteLine($"Close Series Count: {bars.Close.Count} (Should match Bars Count)"); +Console.WriteLine($"Close Series Last: {bars.Close.Last.Value} (Should be 107)"); + +#!csharp + +// 4. Aliases and Direct Access +// TBarSeries provides short aliases (O, H, L, C, V) and direct access properties + +Console.WriteLine($"Alias Access (C.Last): {bars.C.Last.Value}"); +Console.WriteLine($"Direct Last Access (LastClose): {bars.LastClose}"); +Console.WriteLine($"Direct Last Time (LastTime): {new DateTime(bars.LastTime)}"); + +#!csharp + +// 5. Iteration +// You can iterate over the bars or individual series + +Console.WriteLine("\nIterating over bars:"); +foreach (var bar in bars) +{ + Console.WriteLine($" {bar}"); +} + +Console.WriteLine("\nIterating over Close prices:"); +for (int i = 0; i < bars.Count; i++) +{ + Console.WriteLine($" Bar {i}: Close={bars.Close[i].Value}"); +} diff --git a/lib/core/tbarseries/TBarSeries.Tests.cs b/lib/core/tbarseries/TBarSeries.Tests.cs index 41640388..d538ac9c 100644 --- a/lib/core/tbarseries/TBarSeries.Tests.cs +++ b/lib/core/tbarseries/TBarSeries.Tests.cs @@ -1,58 +1,58 @@ -using System; -using Xunit; -using QuanTAlib; - -namespace QuanTAlib.Tests -{ - public class TBarSeriesTests - { - [Fact] - public void Add_NewBar_IncreasesCount() - { - var series = new TBarSeries(); - var bar = new TBar(DateTime.UtcNow.Ticks, 100, 110, 90, 105, 1000); - - series.Add(bar, isNew: true); - - Assert.Single(series); - Assert.Equal(105.0, series.Last.Close); - } - - [Fact] - public void Add_UpdateBar_DoesNotIncreaseCount() - { - var series = new TBarSeries(); - long time = DateTime.UtcNow.Ticks; - var bar1 = new TBar(time, 100, 110, 90, 105, 1000); - var bar2 = new TBar(time, 100, 112, 90, 108, 1200); - - series.Add(bar1, isNew: true); - series.Add(bar2, isNew: false); - - Assert.Single(series); - Assert.Equal(108.0, series.Last.Close); - Assert.Equal(112.0, series.Last.High); - } - - [Fact] - public void SubSeries_AreUpdated() - { - var series = new TBarSeries(); - var bar = new TBar(DateTime.UtcNow.Ticks, 100, 110, 90, 105, 1000); - - series.Add(bar, isNew: true); - - Assert.Single(series.Open); - Assert.Single(series.High); - Assert.Single(series.Low); - Assert.Single(series.Close); - Assert.Single(series.Volume); - - Assert.Equal(100.0, series.Open.Last.Value); - Assert.Equal(110.0, series.High.Last.Value); - Assert.Equal(90.0, series.Low.Last.Value); - Assert.Equal(105.0, series.Close.Last.Value); - Assert.Equal(1000.0, series.Volume.Last.Value); - } - } -} +using System; +using Xunit; +using QuanTAlib; + +namespace QuanTAlib.Tests +{ + public class TBarSeriesTests + { + [Fact] + public void Add_NewBar_IncreasesCount() + { + var series = new TBarSeries(); + var bar = new TBar(DateTime.UtcNow.Ticks, 100, 110, 90, 105, 1000); + + series.Add(bar, isNew: true); + + Assert.Single(series); + Assert.Equal(105.0, series.Last.Close); + } + + [Fact] + public void Add_UpdateBar_DoesNotIncreaseCount() + { + var series = new TBarSeries(); + long time = DateTime.UtcNow.Ticks; + var bar1 = new TBar(time, 100, 110, 90, 105, 1000); + var bar2 = new TBar(time, 100, 112, 90, 108, 1200); + + series.Add(bar1, isNew: true); + series.Add(bar2, isNew: false); + + Assert.Single(series); + Assert.Equal(108.0, series.Last.Close); + Assert.Equal(112.0, series.Last.High); + } + + [Fact] + public void SubSeries_AreUpdated() + { + var series = new TBarSeries(); + var bar = new TBar(DateTime.UtcNow.Ticks, 100, 110, 90, 105, 1000); + + series.Add(bar, isNew: true); + + Assert.Single(series.Open); + Assert.Single(series.High); + Assert.Single(series.Low); + Assert.Single(series.Close); + Assert.Single(series.Volume); + + Assert.Equal(100.0, series.Open.Last.Value); + Assert.Equal(110.0, series.High.Last.Value); + Assert.Equal(90.0, series.Low.Last.Value); + Assert.Equal(105.0, series.Close.Last.Value); + Assert.Equal(1000.0, series.Volume.Last.Value); + } + } +} diff --git a/lib/core/tbarseries/TBarSeries.md b/lib/core/tbarseries/TBarSeries.md index 9c873419..d1b0ca2b 100644 --- a/lib/core/tbarseries/TBarSeries.md +++ b/lib/core/tbarseries/TBarSeries.md @@ -1,70 +1,70 @@ -# TBarSeries Class - -`TBarSeries` is a high-performance collection of OHLCV bars implemented using a Structure of Arrays (SoA) layout. This design optimizes memory access patterns and enables efficient SIMD operations while providing convenient object-oriented views. - -## Key Features - -- **Structure of Arrays (SoA)**: Stores Time, Open, High, Low, Close, and Volume in separate contiguous arrays rather than an array of structs. This improves cache locality for operations that only need specific components (e.g., calculating SMA on Close prices). -- **Zero-Copy Views**: Exposes `TSeries` properties (`Open`, `High`, `Low`, `Close`, `Volume`) that view the underlying data without copying. -- **Streaming Support**: Efficiently handles real-time data updates with `Add(bar, isNew: false)`. -- **Memory Efficient**: Minimizes object overhead by using shared internal lists. - -## Class Definition - -```csharp -public class TBarSeries : IReadOnlyList -{ - // Views - public TSeries Open { get; } - public TSeries High { get; } - public TSeries Low { get; } - public TSeries Close { get; } - public TSeries Volume { get; } - - // Aliases - public TSeries O => Open; - public TSeries H => High; - public TSeries L => Low; - public TSeries C => Close; - public TSeries V => Volume; -} -``` - -## Core Methods - -| Method | Description | -|--------|-------------| -| `Add(TBar bar, bool isNew = true)` | Adds a new bar or updates the last one. | -| `Add(DateTime time, double o, double h, double l, double c, double v, bool isNew)` | Adds raw values directly. | -| `Count` | Returns the number of bars. | -| `Last` | Returns the most recent `TBar`. | - -## Usage - -### Creating and Populating -```csharp -var bars = new TBarSeries(); - -// Add a new bar -long now = DateTime.UtcNow.Ticks; -bars.Add(new TBar(now, 100, 105, 95, 102, 1000), isNew: true); - -// Update the last bar (e.g., real-time feed update) -bars.Add(new TBar(now, 100, 106, 95, 104, 1500), isNew: false); -``` - -### Accessing Data -```csharp -// Access entire bar -TBar lastBar = bars.Last; - -// Access specific component series (Zero-Copy) -TSeries closes = bars.Close; -double lastClose = closes.Last.Value; - -// Access via indexer -TBar firstBar = bars[0]; -``` - -### Performance Note -Because `TBarSeries` uses SoA layout, iterating over a single component (like `Close` prices) is extremely cache-efficient. The CPU prefetcher can load contiguous doubles without loading the interleaved Open, High, Low, or Volume data. +# TBarSeries Class + +`TBarSeries` is a high-performance collection of OHLCV bars implemented using a Structure of Arrays (SoA) layout. This design optimizes memory access patterns and enables efficient SIMD operations while providing convenient object-oriented views. + +## Key Features + +- **Structure of Arrays (SoA)**: Stores Time, Open, High, Low, Close, and Volume in separate contiguous arrays rather than an array of structs. This improves cache locality for operations that only need specific components (e.g., calculating SMA on Close prices). +- **Zero-Copy Views**: Exposes `TSeries` properties (`Open`, `High`, `Low`, `Close`, `Volume`) that view the underlying data without copying. +- **Streaming Support**: Efficiently handles real-time data updates with `Add(bar, isNew: false)`. +- **Memory Efficient**: Minimizes object overhead by using shared internal lists. + +## Class Definition + +```csharp +public class TBarSeries : IReadOnlyList +{ + // Views + public TSeries Open { get; } + public TSeries High { get; } + public TSeries Low { get; } + public TSeries Close { get; } + public TSeries Volume { get; } + + // Aliases + public TSeries O => Open; + public TSeries H => High; + public TSeries L => Low; + public TSeries C => Close; + public TSeries V => Volume; +} +``` + +## Core Methods + +| Method | Description | +|--------|-------------| +| `Add(TBar bar, bool isNew = true)` | Adds a new bar or updates the last one. | +| `Add(DateTime time, double o, double h, double l, double c, double v, bool isNew)` | Adds raw values directly. | +| `Count` | Returns the number of bars. | +| `Last` | Returns the most recent `TBar`. | + +## Usage + +### Creating and Populating +```csharp +var bars = new TBarSeries(); + +// Add a new bar +long now = DateTime.UtcNow.Ticks; +bars.Add(new TBar(now, 100, 105, 95, 102, 1000), isNew: true); + +// Update the last bar (e.g., real-time feed update) +bars.Add(new TBar(now, 100, 106, 95, 104, 1500), isNew: false); +``` + +### Accessing Data +```csharp +// Access entire bar +TBar lastBar = bars.Last; + +// Access specific component series (Zero-Copy) +TSeries closes = bars.Close; +double lastClose = closes.Last.Value; + +// Access via indexer +TBar firstBar = bars[0]; +``` + +### Performance Note +Because `TBarSeries` uses SoA layout, iterating over a single component (like `Close` prices) is extremely cache-efficient. The CPU prefetcher can load contiguous doubles without loading the interleaved Open, High, Low, or Volume data. diff --git a/lib/core/tbarseries/tbarseries.cs b/lib/core/tbarseries/tbarseries.cs index 3098c9b8..762295ce 100644 --- a/lib/core/tbarseries/tbarseries.cs +++ b/lib/core/tbarseries/tbarseries.cs @@ -1,147 +1,147 @@ -using System.Collections; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuanTAlib; - -/// -/// A high-performance OHLCV time series implementation using Structure of Arrays (SoA) layout. -/// Stores Time, Open, High, Low, Close, Volume in separate contiguous arrays for SIMD efficiency. -/// Exposes TSeries views for each component that share the underlying Time array. -/// -public class TBarSeries : IReadOnlyList -{ - // Internal storage: SoA layout - protected readonly List _t = new(); - protected readonly List _o = new(); - protected readonly List _h = new(); - protected readonly List _l = new(); - protected readonly List _c = new(); - protected readonly List _v = new(); - - public string Name { get; set; } = "Bar"; - public event Action? Pub; - - // Public properties are Views into the main data - public TSeries Open { get; } - public TSeries High { get; } - public TSeries Low { get; } - public TSeries Close { get; } - public TSeries Volume { get; } - - // Aliases for convenience - public TSeries O => Open; - public TSeries H => High; - public TSeries L => Low; - public TSeries C => Close; - public TSeries V => Volume; - - public TBarSeries() - { - // Initialize views sharing the same Time list but different Value lists - Open = new TSeries(_t, _o) { Name = "Open" }; - High = new TSeries(_t, _h) { Name = "High" }; - Low = new TSeries(_t, _l) { Name = "Low" }; - Close = new TSeries(_t, _c) { Name = "Close" }; - Volume = new TSeries(_t, _v) { Name = "Volume" }; - } - - /// - /// Constructor with capacity hint to avoid List growth overhead. - /// - public TBarSeries(int capacity) - { - _t = new List(capacity); - _o = new List(capacity); - _h = new List(capacity); - _l = new List(capacity); - _c = new List(capacity); - _v = new List(capacity); - - // Initialize views sharing the same Time list but different Value lists - Open = new TSeries(_t, _o) { Name = "Open" }; - High = new TSeries(_t, _h) { Name = "High" }; - Low = new TSeries(_t, _l) { Name = "Low" }; - Close = new TSeries(_t, _c) { Name = "Close" }; - Volume = new TSeries(_t, _v) { Name = "Volume" }; - } - - public int Count - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _c.Count; - } - - public TBar this[int index] - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => new(_t[index], _o[index], _h[index], _l[index], _c[index], _v[index]); - } - - public TBar Last - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _c.Count > 0 ? new(_t[^1], _o[^1], _h[^1], _l[^1], _c[^1], _v[^1]) : default; - } - - public long LastTime { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _t.Count > 0 ? _t[^1] : 0; } - public double LastOpen { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _o.Count > 0 ? _o[^1] : double.NaN; } - public double LastHigh { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _h.Count > 0 ? _h[^1] : double.NaN; } - public double LastLow { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _l.Count > 0 ? _l[^1] : double.NaN; } - public double LastClose { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _c.Count > 0 ? _c[^1] : double.NaN; } - public double LastVolume { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _v.Count > 0 ? _v[^1] : double.NaN; } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Add(TBar bar, bool isNew = true) - { - if (isNew || _c.Count == 0) - { - _t.Add(bar.Time); - _o.Add(bar.Open); - _h.Add(bar.High); - _l.Add(bar.Low); - _c.Add(bar.Close); - _v.Add(bar.Volume); - } - else - { - int lastIdx = _c.Count - 1; - _t[lastIdx] = bar.Time; - _o[lastIdx] = bar.Open; - _h[lastIdx] = bar.High; - _l[lastIdx] = bar.Low; - _c[lastIdx] = bar.Close; - _v[lastIdx] = bar.Volume; - } - - Pub?.Invoke(bar); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Add(long time, double open, double high, double low, double close, double volume, bool isNew = true) => - Add(new TBar(time, open, high, low, close, volume), isNew); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Add(DateTime time, double open, double high, double low, double close, double volume, bool isNew = true) => - Add(new TBar(time.Ticks, open, high, low, close, volume), isNew); - - public void Add(IEnumerable t, IEnumerable o, IEnumerable h, IEnumerable l, IEnumerable c, IEnumerable v) - { - _t.AddRange(t); - _o.AddRange(o); - _h.AddRange(h); - _l.AddRange(l); - _c.AddRange(c); - _v.AddRange(v); - } - - public IEnumerator GetEnumerator() - { - for (int i = 0; i < _c.Count; i++) - { - yield return new TBar(_t[i], _o[i], _h[i], _l[i], _c[i], _v[i]); - } - } - - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); -} +using System.Collections; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuanTAlib; + +/// +/// A high-performance OHLCV time series implementation using Structure of Arrays (SoA) layout. +/// Stores Time, Open, High, Low, Close, Volume in separate contiguous arrays for SIMD efficiency. +/// Exposes TSeries views for each component that share the underlying Time array. +/// +public class TBarSeries : IReadOnlyList +{ + // Internal storage: SoA layout + protected readonly List _t = new(); + protected readonly List _o = new(); + protected readonly List _h = new(); + protected readonly List _l = new(); + protected readonly List _c = new(); + protected readonly List _v = new(); + + public string Name { get; set; } = "Bar"; + public event Action? Pub; + + // Public properties are Views into the main data + public TSeries Open { get; } + public TSeries High { get; } + public TSeries Low { get; } + public TSeries Close { get; } + public TSeries Volume { get; } + + // Aliases for convenience + public TSeries O => Open; + public TSeries H => High; + public TSeries L => Low; + public TSeries C => Close; + public TSeries V => Volume; + + public TBarSeries() + { + // Initialize views sharing the same Time list but different Value lists + Open = new TSeries(_t, _o) { Name = "Open" }; + High = new TSeries(_t, _h) { Name = "High" }; + Low = new TSeries(_t, _l) { Name = "Low" }; + Close = new TSeries(_t, _c) { Name = "Close" }; + Volume = new TSeries(_t, _v) { Name = "Volume" }; + } + + /// + /// Constructor with capacity hint to avoid List growth overhead. + /// + public TBarSeries(int capacity) + { + _t = new List(capacity); + _o = new List(capacity); + _h = new List(capacity); + _l = new List(capacity); + _c = new List(capacity); + _v = new List(capacity); + + // Initialize views sharing the same Time list but different Value lists + Open = new TSeries(_t, _o) { Name = "Open" }; + High = new TSeries(_t, _h) { Name = "High" }; + Low = new TSeries(_t, _l) { Name = "Low" }; + Close = new TSeries(_t, _c) { Name = "Close" }; + Volume = new TSeries(_t, _v) { Name = "Volume" }; + } + + public int Count + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _c.Count; + } + + public TBar this[int index] + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new(_t[index], _o[index], _h[index], _l[index], _c[index], _v[index]); + } + + public TBar Last + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _c.Count > 0 ? new(_t[^1], _o[^1], _h[^1], _l[^1], _c[^1], _v[^1]) : default; + } + + public long LastTime { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _t.Count > 0 ? _t[^1] : 0; } + public double LastOpen { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _o.Count > 0 ? _o[^1] : double.NaN; } + public double LastHigh { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _h.Count > 0 ? _h[^1] : double.NaN; } + public double LastLow { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _l.Count > 0 ? _l[^1] : double.NaN; } + public double LastClose { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _c.Count > 0 ? _c[^1] : double.NaN; } + public double LastVolume { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _v.Count > 0 ? _v[^1] : double.NaN; } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(TBar bar, bool isNew = true) + { + if (isNew || _c.Count == 0) + { + _t.Add(bar.Time); + _o.Add(bar.Open); + _h.Add(bar.High); + _l.Add(bar.Low); + _c.Add(bar.Close); + _v.Add(bar.Volume); + } + else + { + int lastIdx = _c.Count - 1; + _t[lastIdx] = bar.Time; + _o[lastIdx] = bar.Open; + _h[lastIdx] = bar.High; + _l[lastIdx] = bar.Low; + _c[lastIdx] = bar.Close; + _v[lastIdx] = bar.Volume; + } + + Pub?.Invoke(bar); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(long time, double open, double high, double low, double close, double volume, bool isNew = true) => + Add(new TBar(time, open, high, low, close, volume), isNew); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(DateTime time, double open, double high, double low, double close, double volume, bool isNew = true) => + Add(new TBar(time.Ticks, open, high, low, close, volume), isNew); + + public void Add(IEnumerable t, IEnumerable o, IEnumerable h, IEnumerable l, IEnumerable c, IEnumerable v) + { + _t.AddRange(t); + _o.AddRange(o); + _h.AddRange(h); + _l.AddRange(l); + _c.AddRange(c); + _v.AddRange(v); + } + + public IEnumerator GetEnumerator() + { + for (int i = 0; i < _c.Count; i++) + { + yield return new TBar(_t[i], _o[i], _h[i], _l[i], _c[i], _v[i]); + } + } + + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); +} diff --git a/lib/core/tseries/TSeries.Tests.cs b/lib/core/tseries/TSeries.Tests.cs index 8849554b..4482d9ce 100644 --- a/lib/core/tseries/TSeries.Tests.cs +++ b/lib/core/tseries/TSeries.Tests.cs @@ -1,49 +1,49 @@ -using System; -using Xunit; -using QuanTAlib; - -namespace QuanTAlib.Tests -{ - public class TSeriesTests - { - [Fact] - public void Add_NewValue_IncreasesCount() - { - var series = new TSeries(); - long time = DateTime.UtcNow.Ticks; - - series.Add(time, 10.0, isNew: true); - - Assert.Single(series); - Assert.Equal(10.0, series.Last.Value); - } - - [Fact] - public void Add_UpdateValue_DoesNotIncreaseCount() - { - var series = new TSeries(); - long time = DateTime.UtcNow.Ticks; - - series.Add(time, 10.0, isNew: true); - series.Add(time, 11.0, isNew: false); - - Assert.Single(series); - Assert.Equal(11.0, series.Last.Value); - } - - [Fact] - public void Add_MultipleValues_MaintainsOrder() - { - var series = new TSeries(); - long t0 = DateTime.UtcNow.Ticks; - long t1 = t0 + TimeSpan.TicksPerMinute; - - series.Add(t0, 10.0, isNew: true); - series.Add(t1, 20.0, isNew: true); - - Assert.Equal(2, series.Count); - Assert.Equal(10.0, series[0].Value); - Assert.Equal(20.0, series[1].Value); - } - } -} +using System; +using Xunit; +using QuanTAlib; + +namespace QuanTAlib.Tests +{ + public class TSeriesTests + { + [Fact] + public void Add_NewValue_IncreasesCount() + { + var series = new TSeries(); + long time = DateTime.UtcNow.Ticks; + + series.Add(time, 10.0, isNew: true); + + Assert.Single(series); + Assert.Equal(10.0, series.Last.Value); + } + + [Fact] + public void Add_UpdateValue_DoesNotIncreaseCount() + { + var series = new TSeries(); + long time = DateTime.UtcNow.Ticks; + + series.Add(time, 10.0, isNew: true); + series.Add(time, 11.0, isNew: false); + + Assert.Single(series); + Assert.Equal(11.0, series.Last.Value); + } + + [Fact] + public void Add_MultipleValues_MaintainsOrder() + { + var series = new TSeries(); + long t0 = DateTime.UtcNow.Ticks; + long t1 = t0 + TimeSpan.TicksPerMinute; + + series.Add(t0, 10.0, isNew: true); + series.Add(t1, 20.0, isNew: true); + + Assert.Equal(2, series.Count); + Assert.Equal(10.0, series[0].Value); + Assert.Equal(20.0, series[1].Value); + } + } +} diff --git a/lib/core/tseries/TSeries.md b/lib/core/tseries/TSeries.md index bba3c546..6d07dd9b 100644 --- a/lib/core/tseries/TSeries.md +++ b/lib/core/tseries/TSeries.md @@ -1,56 +1,56 @@ -# TSeries: Time Series Data - -## Overview - -`TSeries` is a high-performance container for time-series data. Unlike a standard `List`, it uses a **Structure of Arrays (SoA)** layout internally. This means it stores timestamps and values in separate contiguous arrays (`List` and `List`). - -This layout is critical for performance because it allows: -1. **SIMD Optimization**: The `Values` property returns a `ReadOnlySpan` that can be directly processed by CPU vector instructions (AVX/SSE). -2. **Cache Locality**: Iterating over values doesn't load timestamps into the CPU cache, and vice versa. - -## Structure - -```csharp -public class TSeries : IReadOnlyList -{ - // Internal SoA storage - protected readonly List _t; - protected readonly List _v; - - // Public accessors - public ReadOnlySpan Values => ...; // Zero-copy access - public ReadOnlySpan Times => ...; // Zero-copy access - - public TValue Last { get; } - public int Count { get; } -} -``` - -## Key Features - -* **SoA Layout**: Optimized for numerical computing and SIMD. -* **Zero-Copy Access**: `Values` and `Times` properties expose internal storage as Spans without copying. -* **Streaming Support**: The `Add` method supports `isNew` parameter to handle intra-bar updates (replacing the last value instead of appending). -* **Event Publishing**: Optional `Pub` event for reactive pipelines. - -## Usage - -### Creating and Adding Data -```csharp -var series = new TSeries(); -series.Add(DateTime.Now, 100.0); // isNew=true by default -``` - -### Streaming Updates -```csharp -// New bar -series.Add(time, 100.0, isNew: true); - -// Update current bar (e.g. price change within same minute) -series.Add(time, 101.0, isNew: false); -``` - -### SIMD Processing -```csharp -// Calculate average using SIMD -double avg = series.Values.AverageSIMD(); +# TSeries: Time Series Data + +## Overview + +`TSeries` is a high-performance container for time-series data. Unlike a standard `List`, it uses a **Structure of Arrays (SoA)** layout internally. This means it stores timestamps and values in separate contiguous arrays (`List` and `List`). + +This layout is critical for performance because it allows: +1. **SIMD Optimization**: The `Values` property returns a `ReadOnlySpan` that can be directly processed by CPU vector instructions (AVX/SSE). +2. **Cache Locality**: Iterating over values doesn't load timestamps into the CPU cache, and vice versa. + +## Structure + +```csharp +public class TSeries : IReadOnlyList +{ + // Internal SoA storage + protected readonly List _t; + protected readonly List _v; + + // Public accessors + public ReadOnlySpan Values => ...; // Zero-copy access + public ReadOnlySpan Times => ...; // Zero-copy access + + public TValue Last { get; } + public int Count { get; } +} +``` + +## Key Features + +* **SoA Layout**: Optimized for numerical computing and SIMD. +* **Zero-Copy Access**: `Values` and `Times` properties expose internal storage as Spans without copying. +* **Streaming Support**: The `Add` method supports `isNew` parameter to handle intra-bar updates (replacing the last value instead of appending). +* **Event Publishing**: Optional `Pub` event for reactive pipelines. + +## Usage + +### Creating and Adding Data +```csharp +var series = new TSeries(); +series.Add(DateTime.Now, 100.0); // isNew=true by default +``` + +### Streaming Updates +```csharp +// New bar +series.Add(time, 100.0, isNew: true); + +// Update current bar (e.g. price change within same minute) +series.Add(time, 101.0, isNew: false); +``` + +### SIMD Processing +```csharp +// Calculate average using SIMD +double avg = series.Values.AverageSIMD(); diff --git a/lib/core/tseries/tseries.cs b/lib/core/tseries/tseries.cs index 2d1b26f7..9723f5ff 100644 --- a/lib/core/tseries/tseries.cs +++ b/lib/core/tseries/tseries.cs @@ -1,146 +1,146 @@ -using System.Collections; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace QuanTAlib; - -/// -/// A high-performance time series implementation using Structure of Arrays (SoA) layout. -/// Stores Time (long) and Value (double) in separate contiguous arrays for SIMD efficiency. -/// Supports "New Bar" vs "Update Last" streaming semantics. -/// -public class TSeries : IReadOnlyList -{ - // Internal storage: SoA layout - // We use List for dynamic sizing but access internal arrays via CollectionsMarshal for speed - protected readonly List _t; - protected readonly List _v; - - public string Name { get; set; } = "Data"; - - // Event optimization: Use Action to avoid EventArgs allocation - // Note: Events are generally discouraged in the hot path of this high-perf design, - // but kept for compatibility/chaining. - public event Action? Pub; - - public TSeries() - { - _t = new List(); - _v = new List(); - } - - /// - /// Constructor with capacity hint to avoid List growth overhead. - /// - public TSeries(int capacity) - { - _t = new List(capacity); - _v = new List(capacity); - } - - /// - /// Constructor for wrapping existing lists (e.g. from TBarSeries). - /// - public TSeries(List time, List values) - { - _t = time; - _v = values; - } - - public int Count - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _v.Count; - } - - public TValue this[int index] - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => new(_t[index], _v[index]); - } - - public TValue Last - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _v.Count > 0 ? new(_t[^1], _v[^1]) : default; - } - - public double LastValue - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _v.Count > 0 ? _v[^1] : double.NaN; - } - - public long LastTime - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _t.Count > 0 ? _t[^1] : 0; - } - - /// - /// Direct access to the underlying Value array as a Span for SIMD operations. - /// - public ReadOnlySpan Values - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => CollectionsMarshal.AsSpan(_v); - } - - /// - /// Direct access to the underlying Time array as a Span. - /// - public ReadOnlySpan Times - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => CollectionsMarshal.AsSpan(_t); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public virtual void Add(TValue value, bool isNew) - { - if (isNew || _v.Count == 0) - { - _t.Add(value.Time); - _v.Add(value.Value); - } - else - { - // Update last bar - int lastIdx = _v.Count - 1; - _t[lastIdx] = value.Time; - _v[lastIdx] = value.Value; - } - Pub?.Invoke(value); - } - - // Overload for backward compatibility (assumes isNew=true) - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public virtual void Add(TValue value) => Add(value, true); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Add(long time, double value, bool isNew = true) => Add(new TValue(time, value), isNew); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Add(DateTime time, double value, bool isNew = true) => Add(new TValue(time.Ticks, value), isNew); - - public void Add(IEnumerable values) - { - long t = DateTime.UtcNow.Ticks; - foreach (var v in values) - { - Add(new TValue(t, v), isNew: true); - t += TimeSpan.TicksPerMinute; // Dummy time increment - } - } - - // IEnumerable implementation - public IEnumerator GetEnumerator() - { - for (int i = 0; i < _v.Count; i++) - { - yield return new TValue(_t[i], _v[i]); - } - } - - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); -} +using System.Collections; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace QuanTAlib; + +/// +/// A high-performance time series implementation using Structure of Arrays (SoA) layout. +/// Stores Time (long) and Value (double) in separate contiguous arrays for SIMD efficiency. +/// Supports "New Bar" vs "Update Last" streaming semantics. +/// +public class TSeries : IReadOnlyList +{ + // Internal storage: SoA layout + // We use List for dynamic sizing but access internal arrays via CollectionsMarshal for speed + protected readonly List _t; + protected readonly List _v; + + public string Name { get; set; } = "Data"; + + // Event optimization: Use Action to avoid EventArgs allocation + // Note: Events are generally discouraged in the hot path of this high-perf design, + // but kept for compatibility/chaining. + public event Action? Pub; + + public TSeries() + { + _t = new List(); + _v = new List(); + } + + /// + /// Constructor with capacity hint to avoid List growth overhead. + /// + public TSeries(int capacity) + { + _t = new List(capacity); + _v = new List(capacity); + } + + /// + /// Constructor for wrapping existing lists (e.g. from TBarSeries). + /// + public TSeries(List time, List values) + { + _t = time; + _v = values; + } + + public int Count + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _v.Count; + } + + public TValue this[int index] + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new(_t[index], _v[index]); + } + + public TValue Last + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _v.Count > 0 ? new(_t[^1], _v[^1]) : default; + } + + public double LastValue + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _v.Count > 0 ? _v[^1] : double.NaN; + } + + public long LastTime + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _t.Count > 0 ? _t[^1] : 0; + } + + /// + /// Direct access to the underlying Value array as a Span for SIMD operations. + /// + public ReadOnlySpan Values + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => CollectionsMarshal.AsSpan(_v); + } + + /// + /// Direct access to the underlying Time array as a Span. + /// + public ReadOnlySpan Times + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => CollectionsMarshal.AsSpan(_t); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public virtual void Add(TValue value, bool isNew) + { + if (isNew || _v.Count == 0) + { + _t.Add(value.Time); + _v.Add(value.Value); + } + else + { + // Update last bar + int lastIdx = _v.Count - 1; + _t[lastIdx] = value.Time; + _v[lastIdx] = value.Value; + } + Pub?.Invoke(value); + } + + // Overload for backward compatibility (assumes isNew=true) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public virtual void Add(TValue value) => Add(value, true); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(long time, double value, bool isNew = true) => Add(new TValue(time, value), isNew); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(DateTime time, double value, bool isNew = true) => Add(new TValue(time.Ticks, value), isNew); + + public void Add(IEnumerable values) + { + long t = DateTime.UtcNow.Ticks; + foreach (var v in values) + { + Add(new TValue(t, v), isNew: true); + t += TimeSpan.TicksPerMinute; // Dummy time increment + } + } + + // IEnumerable implementation + public IEnumerator GetEnumerator() + { + for (int i = 0; i < _v.Count; i++) + { + yield return new TValue(_t[i], _v[i]); + } + } + + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); +} diff --git a/lib/core/tvalue/TValue.Tests.cs b/lib/core/tvalue/TValue.Tests.cs index 8b2e8614..b51e9f0b 100644 --- a/lib/core/tvalue/TValue.Tests.cs +++ b/lib/core/tvalue/TValue.Tests.cs @@ -1,51 +1,51 @@ -using System; -using Xunit; -using QuanTAlib; - -namespace QuanTAlib.Tests -{ - public class TValueTests - { - [Fact] - public void Constructor_SetsPropertiesCorrectly() - { - long time = DateTime.UtcNow.Ticks; - double value = 123.45; - - var tValue = new TValue(time, value); - - Assert.Equal(time, tValue.Time); - Assert.Equal(value, tValue.Value); - } - - [Fact] - public void AsDateTime_ReturnsCorrectDateTime() - { - DateTime dt = new DateTime(2023, 1, 1, 12, 0, 0, DateTimeKind.Utc); - long ticks = dt.Ticks; - var tValue = new TValue(ticks, 100.0); - - Assert.Equal(dt, tValue.AsDateTime); - } - - [Fact] - public void ToString_FormatsCorrectly() - { - DateTime dt = new DateTime(2023, 1, 1, 12, 0, 0, DateTimeKind.Utc); - var tValue = new TValue(dt.Ticks, 123.456); - - string result = tValue.ToString(); - - Assert.Contains(dt.ToString("yyyy-MM-dd HH:mm:ss"), result); - Assert.Contains("123.46", result); // Default formatting usually 2 decimals or similar - } - - [Fact] - public void ImplicitConversion_ToDouble() - { - var tValue = new TValue(DateTime.UtcNow.Ticks, 42.0); - double val = tValue; - Assert.Equal(42.0, val); - } - } -} +using System; +using Xunit; +using QuanTAlib; + +namespace QuanTAlib.Tests +{ + public class TValueTests + { + [Fact] + public void Constructor_SetsPropertiesCorrectly() + { + long time = DateTime.UtcNow.Ticks; + double value = 123.45; + + var tValue = new TValue(time, value); + + Assert.Equal(time, tValue.Time); + Assert.Equal(value, tValue.Value); + } + + [Fact] + public void AsDateTime_ReturnsCorrectDateTime() + { + DateTime dt = new DateTime(2023, 1, 1, 12, 0, 0, DateTimeKind.Utc); + long ticks = dt.Ticks; + var tValue = new TValue(ticks, 100.0); + + Assert.Equal(dt, tValue.AsDateTime); + } + + [Fact] + public void ToString_FormatsCorrectly() + { + DateTime dt = new DateTime(2023, 1, 1, 12, 0, 0, DateTimeKind.Utc); + var tValue = new TValue(dt.Ticks, 123.456); + + string result = tValue.ToString(); + + Assert.Contains(dt.ToString("yyyy-MM-dd HH:mm:ss"), result); + Assert.Contains("123.46", result); // Default formatting usually 2 decimals or similar + } + + [Fact] + public void ImplicitConversion_ToDouble() + { + var tValue = new TValue(DateTime.UtcNow.Ticks, 42.0); + double val = tValue; + Assert.Equal(42.0, val); + } + } +} diff --git a/lib/core/tvalue/TValue.md b/lib/core/tvalue/TValue.md index 41ac7ba6..02ac40cd 100644 --- a/lib/core/tvalue/TValue.md +++ b/lib/core/tvalue/TValue.md @@ -1,37 +1,37 @@ -# TValue: Time-Value Pair - -## Overview - -`TValue` is the fundamental building block of QuanTAlib. It represents a single data point in a time series, consisting of a timestamp and a double-precision floating-point value. - -It is implemented as a lightweight `readonly struct` to ensure immutability and high performance (stack allocation, no GC overhead). - -## Structure - -```csharp -public readonly struct TValue -{ - public readonly long Time; // Ticks (UTC) - public readonly double Value; // Data value - public readonly bool IsNew; // Metadata for streaming (optional usage) -} -``` - -## Key Features - -* **Lightweight**: 24 bytes (long + double + bool + padding). -* **Immutable**: Thread-safe by design. -* **Implicit Conversions**: Can be implicitly converted to `double` (returns Value) and `DateTime` (returns Time). -* **Performance**: Designed for high-frequency trading and large dataset processing. - -## Usage - -`TValue` is used throughout the library for: -* Input to indicators (`Update(TValue)`). -* Output from indicators (`Value` property). -* Elements in `TSeries`. - -## Constructors - -* `new TValue(long time, double value, bool isNew = true)` -* `new TValue(DateTime time, double value, bool isNew = true)` +# TValue: Time-Value Pair + +## Overview + +`TValue` is the fundamental building block of QuanTAlib. It represents a single data point in a time series, consisting of a timestamp and a double-precision floating-point value. + +It is implemented as a lightweight `readonly struct` to ensure immutability and high performance (stack allocation, no GC overhead). + +## Structure + +```csharp +public readonly struct TValue +{ + public readonly long Time; // Ticks (UTC) + public readonly double Value; // Data value + public readonly bool IsNew; // Metadata for streaming (optional usage) +} +``` + +## Key Features + +* **Lightweight**: 24 bytes (long + double + bool + padding). +* **Immutable**: Thread-safe by design. +* **Implicit Conversions**: Can be implicitly converted to `double` (returns Value) and `DateTime` (returns Time). +* **Performance**: Designed for high-frequency trading and large dataset processing. + +## Usage + +`TValue` is used throughout the library for: +* Input to indicators (`Update(TValue)`). +* Output from indicators (`Value` property). +* Elements in `TSeries`. + +## Constructors + +* `new TValue(long time, double value, bool isNew = true)` +* `new TValue(DateTime time, double value, bool isNew = true)` diff --git a/lib/core/tvalue/tvalue.cs b/lib/core/tvalue/tvalue.cs index 49050c18..2f23679f 100644 --- a/lib/core/tvalue/tvalue.cs +++ b/lib/core/tvalue/tvalue.cs @@ -1,57 +1,57 @@ -using System.Runtime.CompilerServices; - -namespace QuanTAlib; - -/// -/// A lightweight struct representing a time-value pair. -/// Pure data type: 16 bytes (long + double). -/// -[SkipLocalsInit] -public readonly struct TValue : IEquatable -{ - /// - /// Time in ticks (UTC). - /// - public readonly long Time; - - /// - /// The value. - /// - public readonly double Value; - - /// - /// Convenience property to get DateTime from Ticks. - /// - public DateTime AsDateTime => new(Time, DateTimeKind.Utc); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public TValue(long time, double value) - { - Time = time; - Value = value; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public TValue(DateTime time, double value) - { - Time = time.Ticks; - Value = value; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static implicit operator double(TValue tv) => tv.Value; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static implicit operator DateTime(TValue tv) => new(tv.Time, DateTimeKind.Utc); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override string ToString() => $"[{AsDateTime:yyyy-MM-dd HH:mm:ss}, {Value:F2}]"; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool Equals(TValue other) => Time == other.Time && Value == other.Value; - - public override bool Equals(object? obj) => obj is TValue other && Equals(other); - public override int GetHashCode() => HashCode.Combine(Time, Value); - public static bool operator ==(TValue left, TValue right) => left.Equals(right); - public static bool operator !=(TValue left, TValue right) => !left.Equals(right); -} +using System.Runtime.CompilerServices; + +namespace QuanTAlib; + +/// +/// A lightweight struct representing a time-value pair. +/// Pure data type: 16 bytes (long + double). +/// +[SkipLocalsInit] +public readonly struct TValue : IEquatable +{ + /// + /// Time in ticks (UTC). + /// + public readonly long Time; + + /// + /// The value. + /// + public readonly double Value; + + /// + /// Convenience property to get DateTime from Ticks. + /// + public DateTime AsDateTime => new(Time, DateTimeKind.Utc); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public TValue(long time, double value) + { + Time = time; + Value = value; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public TValue(DateTime time, double value) + { + Time = time.Ticks; + Value = value; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double(TValue tv) => tv.Value; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator DateTime(TValue tv) => new(tv.Time, DateTimeKind.Utc); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() => $"[{AsDateTime:yyyy-MM-dd HH:mm:ss}, {Value:F2}]"; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(TValue other) => Time == other.Time && Value == other.Value; + + public override bool Equals(object? obj) => obj is TValue other && Equals(other); + public override int GetHashCode() => HashCode.Combine(Time, Value); + public static bool operator ==(TValue left, TValue right) => left.Equals(right); + public static bool operator !=(TValue left, TValue right) => !left.Equals(right); +} diff --git a/lib/feeds/IFeed.cs b/lib/feeds/IFeed.cs index d3b7ba54..f40d0ff8 100644 --- a/lib/feeds/IFeed.cs +++ b/lib/feeds/IFeed.cs @@ -1,35 +1,35 @@ -namespace QuanTAlib; - -/// -/// Interface for data feeds that provide TBar (OHLCV) data. -/// Implementations include synthetic generators (GBM), API-based feeds (AlphaVantage), -/// file readers (CSV), and real-time streams (WebSocket). -/// -public interface IFeed -{ - /// - /// Gets the next bar from the feed with full bidirectional control. - /// - /// - /// Input: Request for new bar (true) or update current bar (false). - /// Output: Actual behavior - may differ if feed cannot honor request (e.g., end of data). - /// - /// The bar (new or updated) - TBar Next(ref bool isNew); - - /// - /// Gets the next bar from the feed with simple control. - /// - /// Request for new bar (true) or update current bar (false). Defaults to true. - /// The bar (new or updated) - TBar Next(bool isNew = true); - - /// - /// Gets multiple bars in batch with explicit time parameters. - /// - /// Number of bars to retrieve - /// Starting timestamp for first bar (in ticks) - /// Time interval between bars - /// Series containing the requested bars - TBarSeries Fetch(int count, long startTime, TimeSpan interval); -} +namespace QuanTAlib; + +/// +/// Interface for data feeds that provide TBar (OHLCV) data. +/// Implementations include synthetic generators (GBM), API-based feeds (AlphaVantage), +/// file readers (CSV), and real-time streams (WebSocket). +/// +public interface IFeed +{ + /// + /// Gets the next bar from the feed with full bidirectional control. + /// + /// + /// Input: Request for new bar (true) or update current bar (false). + /// Output: Actual behavior - may differ if feed cannot honor request (e.g., end of data). + /// + /// The bar (new or updated) + TBar Next(ref bool isNew); + + /// + /// Gets the next bar from the feed with simple control. + /// + /// Request for new bar (true) or update current bar (false). Defaults to true. + /// The bar (new or updated) + TBar Next(bool isNew = true); + + /// + /// Gets multiple bars in batch with explicit time parameters. + /// + /// Number of bars to retrieve + /// Starting timestamp for first bar (in ticks) + /// Time interval between bars + /// Series containing the requested bars + TBarSeries Fetch(int count, long startTime, TimeSpan interval); +} diff --git a/lib/feeds/IFeed.md b/lib/feeds/IFeed.md index c00ec34e..4b52fa5b 100644 --- a/lib/feeds/IFeed.md +++ b/lib/feeds/IFeed.md @@ -1,45 +1,45 @@ -# IFeed Interface - -`IFeed` defines the standard contract for all data feeds in QuanTAlib, ensuring consistent behavior across different data sources (synthetic, file-based, or live API). - -## Key Concepts - -- **Bidirectional Control**: The `Next(ref bool isNew)` method allows the consumer to request a new bar (`isNew = true`) or an update to the current bar (`isNew = false`). -- **Streaming**: Designed for bar-by-bar processing, simulating real-time data flow. -- **Batching**: Supports fetching historical data ranges via `Fetch()`. - -## Interface Definition - -```csharp -public interface IFeed -{ - /// - /// Gets the next bar with full control over new/update state. - /// - TBar Next(ref bool isNew); - - /// - /// Convenience overload for simple next-bar requests. - /// - TBar Next(bool isNew = true); - - /// - /// Retrieves a batch of historical bars. - /// - TBarSeries Fetch(int count, long startTime, TimeSpan interval); -} -``` - -## Implementation Guidelines - -When implementing `IFeed`: - -1. **State Management**: Maintain the current position in the data source. -2. **End of Data**: When data is exhausted, `Next` should return the last valid bar and set `isNew` to `false`. -3. **Intra-bar Updates**: If the source supports it (e.g., live ticks), `Next(isNew: false)` should return the updated state of the current bar. If not supported (e.g., CSV), it should return the current bar unchanged. -4. **Thread Safety**: Implementations are generally not required to be thread-safe unless specified. - -## Implementations - -- **`GBM`**: Geometric Brownian Motion generator (Synthetic). -- **`CsvFeed`**: Reads OHLCV data from CSV files (Historical). +# IFeed Interface + +`IFeed` defines the standard contract for all data feeds in QuanTAlib, ensuring consistent behavior across different data sources (synthetic, file-based, or live API). + +## Key Concepts + +- **Bidirectional Control**: The `Next(ref bool isNew)` method allows the consumer to request a new bar (`isNew = true`) or an update to the current bar (`isNew = false`). +- **Streaming**: Designed for bar-by-bar processing, simulating real-time data flow. +- **Batching**: Supports fetching historical data ranges via `Fetch()`. + +## Interface Definition + +```csharp +public interface IFeed +{ + /// + /// Gets the next bar with full control over new/update state. + /// + TBar Next(ref bool isNew); + + /// + /// Convenience overload for simple next-bar requests. + /// + TBar Next(bool isNew = true); + + /// + /// Retrieves a batch of historical bars. + /// + TBarSeries Fetch(int count, long startTime, TimeSpan interval); +} +``` + +## Implementation Guidelines + +When implementing `IFeed`: + +1. **State Management**: Maintain the current position in the data source. +2. **End of Data**: When data is exhausted, `Next` should return the last valid bar and set `isNew` to `false`. +3. **Intra-bar Updates**: If the source supports it (e.g., live ticks), `Next(isNew: false)` should return the updated state of the current bar. If not supported (e.g., CSV), it should return the current bar unchanged. +4. **Thread Safety**: Implementations are generally not required to be thread-safe unless specified. + +## Implementations + +- **`GBM`**: Geometric Brownian Motion generator (Synthetic). +- **`CsvFeed`**: Reads OHLCV data from CSV files (Historical). diff --git a/lib/feeds/csv/CsvFeed.Tests.cs b/lib/feeds/csv/CsvFeed.Tests.cs index b2ccb9ab..e9656302 100644 --- a/lib/feeds/csv/CsvFeed.Tests.cs +++ b/lib/feeds/csv/CsvFeed.Tests.cs @@ -1,254 +1,254 @@ -using Xunit; - -namespace QuanTAlib.Tests; - -public class CsvFeedTests -{ - private const string TestCsvPath = "daily_IBM.csv"; - - [Fact] - public void Constructor_ValidFile_LoadsData() - { - var feed = new CsvFeed(TestCsvPath); - Assert.NotNull(feed); - } - - [Fact] - public void Constructor_NonExistentFile_ThrowsFileNotFoundException() - { - Assert.Throws(() => new CsvFeed("nonexistent.csv")); - } - - [Fact] - public void Constructor_NullPath_ThrowsArgumentException() - { - Assert.Throws(() => new CsvFeed(null!)); - } - - [Fact] - public void Constructor_EmptyPath_ThrowsArgumentException() - { - Assert.Throws(() => new CsvFeed("")); - } - - [Fact] - public void Next_StreamsDataChronologically() - { - var feed = new CsvFeed(TestCsvPath); - - // Get first bar - var bar1 = feed.Next(isNew: true); - Assert.True(bar1.Time > 0); - - // Get second bar - should be later in time - var bar2 = feed.Next(isNew: true); - Assert.True(bar2.Time > bar1.Time); - - // Get third bar - var bar3 = feed.Next(isNew: true); - Assert.True(bar3.Time > bar2.Time); - } - - [Fact] - public void Next_WithRefParameter_StreamsCorrectly() - { - var feed = new CsvFeed(TestCsvPath); - - bool isNew = true; - var bar1 = feed.Next(ref isNew); - Assert.True(isNew); // Should still be true - Assert.True(bar1.Time > 0); - - isNew = true; - var bar2 = feed.Next(ref isNew); - Assert.True(isNew); - Assert.True(bar2.Time > bar1.Time); - } - - [Fact] - public void Next_UpdateCurrentBar_ReturnsSameBar() - { - var feed = new CsvFeed(TestCsvPath); - - // Get first bar - var bar1 = feed.Next(isNew: true); - - // Update current bar (should return same bar) - var bar2 = feed.Next(isNew: false); - Assert.Equal(bar1.Time, bar2.Time); - Assert.Equal(bar1.Close, bar2.Close); - - // Get next bar - var bar3 = feed.Next(isNew: true); - Assert.True(bar3.Time > bar1.Time); - } - - [Fact] - public void Next_EndOfData_SignalsNoMoreData() - { - var feed = new CsvFeed(TestCsvPath); - - // Stream through all data - TBar lastBar = default; - bool isNew = true; - int count = 0; - - while (isNew && count < 200) // Safety limit - { - lastBar = feed.Next(ref isNew); - count++; - } - - // Should have reached end and isNew should be false - Assert.False(isNew); - Assert.True(lastBar.Time > 0); - - // Calling again should return same bar with isNew=false - isNew = true; - var finalBar = feed.Next(ref isNew); - Assert.False(isNew); - Assert.Equal(lastBar.Time, finalBar.Time); - } - - [Fact] - public void Fetch_ReturnsCorrectNumberOfBars() - { - var feed = new CsvFeed(TestCsvPath); - - var startTime = new DateTime(2025, 7, 1, 0, 0, 0, DateTimeKind.Utc).Ticks; - var interval = TimeSpan.FromDays(1); - - var series = feed.Fetch(10, startTime, interval); - - Assert.True(series.Count > 0); - Assert.True(series.Count <= 10); - } - - [Fact] - public void Fetch_InvalidCount_ThrowsArgumentException() - { - var feed = new CsvFeed(TestCsvPath); - - var startTime = DateTime.UtcNow.Ticks; - var interval = TimeSpan.FromDays(1); - - Assert.Throws(() => feed.Fetch(0, startTime, interval)); - Assert.Throws(() => feed.Fetch(-1, startTime, interval)); - } - - [Fact] - public void Fetch_ResetsStreamingPosition() - { - var feed = new CsvFeed(TestCsvPath); - - // Stream a few bars - feed.Next(isNew: true); - feed.Next(isNew: true); - feed.Next(isNew: true); - - // Fetch from start - var startTime = new DateTime(2025, 7, 1, 0, 0, 0, DateTimeKind.Utc).Ticks; - var series = feed.Fetch(5, startTime, TimeSpan.FromDays(1)); - - // Next should now stream from fetched position - var bar = feed.Next(isNew: true); - Assert.True(bar.Time >= startTime); - } - - [Fact] - public void LoadFromCsv_ParsesValuesCorrectly() - { - var feed = new CsvFeed(TestCsvPath); - - // Get first bar (oldest in chronological order) - var bar = feed.Next(isNew: true); - - // Verify it has valid OHLCV data - Assert.True(bar.Open > 0); - Assert.True(bar.High >= bar.Open); - Assert.True(bar.High >= bar.Close); - Assert.True(bar.Low <= bar.Open); - Assert.True(bar.Low <= bar.Close); - Assert.True(bar.Close > 0); - Assert.True(bar.Volume > 0); - } - - [Fact] - public void LoadFromCsv_DataInChronologicalOrder() - { - var feed = new CsvFeed(TestCsvPath); - - var bars = new List(); - bool isNew = true; - - // Collect first 10 bars - for (int i = 0; i < 10 && isNew; i++) - { - bars.Add(feed.Next(ref isNew)); - } - - // Verify chronological order (each bar later than previous) - for (int i = 1; i < bars.Count; i++) - { - Assert.True(bars[i].Time > bars[i - 1].Time, - $"Bar {i} time ({bars[i].AsDateTime}) should be after bar {i-1} time ({bars[i-1].AsDateTime})"); - } - } - - [Fact] - public void CsvFeed_WorksWithIFeedInterface() - { - IFeed feed = new CsvFeed(TestCsvPath); - - var bar1 = feed.Next(isNew: true); - Assert.True(bar1.Time > 0); - - var bar2 = feed.Next(isNew: true); - Assert.True(bar2.Time > bar1.Time); - } - - [Fact] - public void Next_MixedNewAndUpdate_WorksCorrectly() - { - var feed = new CsvFeed(TestCsvPath); - - var bar1 = feed.Next(isNew: true); - var bar1Update = feed.Next(isNew: false); - Assert.Equal(bar1.Time, bar1Update.Time); - - var bar2 = feed.Next(isNew: true); - Assert.True(bar2.Time > bar1.Time); - - var bar2Update = feed.Next(isNew: false); - Assert.Equal(bar2.Time, bar2Update.Time); - - var bar3 = feed.Next(isNew: true); - Assert.True(bar3.Time > bar2.Time); - } - - [Fact] - public void Fetch_WithEarlyStartTime_ReturnsData() - { - var feed = new CsvFeed(TestCsvPath); - - // Start from very early date (before any data) - var startTime = new DateTime(2020, 1, 1, 0, 0, 0, DateTimeKind.Utc).Ticks; - var series = feed.Fetch(5, startTime, TimeSpan.FromDays(1)); - - // Should return data starting from first available bar - Assert.True(series.Count > 0); - } - - [Fact] - public void Fetch_WithFutureStartTime_ReturnsEmpty() - { - var feed = new CsvFeed(TestCsvPath); - - // Start from future date (after all data) - var startTime = new DateTime(2030, 1, 1, 0, 0, 0, DateTimeKind.Utc).Ticks; - var series = feed.Fetch(5, startTime, TimeSpan.FromDays(1)); - - // Should return empty or minimal data - Assert.True(series.Count == 0); - } -} +using Xunit; + +namespace QuanTAlib.Tests; + +public class CsvFeedTests +{ + private const string TestCsvPath = "daily_IBM.csv"; + + [Fact] + public void Constructor_ValidFile_LoadsData() + { + var feed = new CsvFeed(TestCsvPath); + Assert.NotNull(feed); + } + + [Fact] + public void Constructor_NonExistentFile_ThrowsFileNotFoundException() + { + Assert.Throws(() => new CsvFeed("nonexistent.csv")); + } + + [Fact] + public void Constructor_NullPath_ThrowsArgumentException() + { + Assert.Throws(() => new CsvFeed(null!)); + } + + [Fact] + public void Constructor_EmptyPath_ThrowsArgumentException() + { + Assert.Throws(() => new CsvFeed("")); + } + + [Fact] + public void Next_StreamsDataChronologically() + { + var feed = new CsvFeed(TestCsvPath); + + // Get first bar + var bar1 = feed.Next(isNew: true); + Assert.True(bar1.Time > 0); + + // Get second bar - should be later in time + var bar2 = feed.Next(isNew: true); + Assert.True(bar2.Time > bar1.Time); + + // Get third bar + var bar3 = feed.Next(isNew: true); + Assert.True(bar3.Time > bar2.Time); + } + + [Fact] + public void Next_WithRefParameter_StreamsCorrectly() + { + var feed = new CsvFeed(TestCsvPath); + + bool isNew = true; + var bar1 = feed.Next(ref isNew); + Assert.True(isNew); // Should still be true + Assert.True(bar1.Time > 0); + + isNew = true; + var bar2 = feed.Next(ref isNew); + Assert.True(isNew); + Assert.True(bar2.Time > bar1.Time); + } + + [Fact] + public void Next_UpdateCurrentBar_ReturnsSameBar() + { + var feed = new CsvFeed(TestCsvPath); + + // Get first bar + var bar1 = feed.Next(isNew: true); + + // Update current bar (should return same bar) + var bar2 = feed.Next(isNew: false); + Assert.Equal(bar1.Time, bar2.Time); + Assert.Equal(bar1.Close, bar2.Close); + + // Get next bar + var bar3 = feed.Next(isNew: true); + Assert.True(bar3.Time > bar1.Time); + } + + [Fact] + public void Next_EndOfData_SignalsNoMoreData() + { + var feed = new CsvFeed(TestCsvPath); + + // Stream through all data + TBar lastBar = default; + bool isNew = true; + int count = 0; + + while (isNew && count < 200) // Safety limit + { + lastBar = feed.Next(ref isNew); + count++; + } + + // Should have reached end and isNew should be false + Assert.False(isNew); + Assert.True(lastBar.Time > 0); + + // Calling again should return same bar with isNew=false + isNew = true; + var finalBar = feed.Next(ref isNew); + Assert.False(isNew); + Assert.Equal(lastBar.Time, finalBar.Time); + } + + [Fact] + public void Fetch_ReturnsCorrectNumberOfBars() + { + var feed = new CsvFeed(TestCsvPath); + + var startTime = new DateTime(2025, 7, 1, 0, 0, 0, DateTimeKind.Utc).Ticks; + var interval = TimeSpan.FromDays(1); + + var series = feed.Fetch(10, startTime, interval); + + Assert.True(series.Count > 0); + Assert.True(series.Count <= 10); + } + + [Fact] + public void Fetch_InvalidCount_ThrowsArgumentException() + { + var feed = new CsvFeed(TestCsvPath); + + var startTime = DateTime.UtcNow.Ticks; + var interval = TimeSpan.FromDays(1); + + Assert.Throws(() => feed.Fetch(0, startTime, interval)); + Assert.Throws(() => feed.Fetch(-1, startTime, interval)); + } + + [Fact] + public void Fetch_ResetsStreamingPosition() + { + var feed = new CsvFeed(TestCsvPath); + + // Stream a few bars + feed.Next(isNew: true); + feed.Next(isNew: true); + feed.Next(isNew: true); + + // Fetch from start + var startTime = new DateTime(2025, 7, 1, 0, 0, 0, DateTimeKind.Utc).Ticks; + var series = feed.Fetch(5, startTime, TimeSpan.FromDays(1)); + + // Next should now stream from fetched position + var bar = feed.Next(isNew: true); + Assert.True(bar.Time >= startTime); + } + + [Fact] + public void LoadFromCsv_ParsesValuesCorrectly() + { + var feed = new CsvFeed(TestCsvPath); + + // Get first bar (oldest in chronological order) + var bar = feed.Next(isNew: true); + + // Verify it has valid OHLCV data + Assert.True(bar.Open > 0); + Assert.True(bar.High >= bar.Open); + Assert.True(bar.High >= bar.Close); + Assert.True(bar.Low <= bar.Open); + Assert.True(bar.Low <= bar.Close); + Assert.True(bar.Close > 0); + Assert.True(bar.Volume > 0); + } + + [Fact] + public void LoadFromCsv_DataInChronologicalOrder() + { + var feed = new CsvFeed(TestCsvPath); + + var bars = new List(); + bool isNew = true; + + // Collect first 10 bars + for (int i = 0; i < 10 && isNew; i++) + { + bars.Add(feed.Next(ref isNew)); + } + + // Verify chronological order (each bar later than previous) + for (int i = 1; i < bars.Count; i++) + { + Assert.True(bars[i].Time > bars[i - 1].Time, + $"Bar {i} time ({bars[i].AsDateTime}) should be after bar {i-1} time ({bars[i-1].AsDateTime})"); + } + } + + [Fact] + public void CsvFeed_WorksWithIFeedInterface() + { + IFeed feed = new CsvFeed(TestCsvPath); + + var bar1 = feed.Next(isNew: true); + Assert.True(bar1.Time > 0); + + var bar2 = feed.Next(isNew: true); + Assert.True(bar2.Time > bar1.Time); + } + + [Fact] + public void Next_MixedNewAndUpdate_WorksCorrectly() + { + var feed = new CsvFeed(TestCsvPath); + + var bar1 = feed.Next(isNew: true); + var bar1Update = feed.Next(isNew: false); + Assert.Equal(bar1.Time, bar1Update.Time); + + var bar2 = feed.Next(isNew: true); + Assert.True(bar2.Time > bar1.Time); + + var bar2Update = feed.Next(isNew: false); + Assert.Equal(bar2.Time, bar2Update.Time); + + var bar3 = feed.Next(isNew: true); + Assert.True(bar3.Time > bar2.Time); + } + + [Fact] + public void Fetch_WithEarlyStartTime_ReturnsData() + { + var feed = new CsvFeed(TestCsvPath); + + // Start from very early date (before any data) + var startTime = new DateTime(2020, 1, 1, 0, 0, 0, DateTimeKind.Utc).Ticks; + var series = feed.Fetch(5, startTime, TimeSpan.FromDays(1)); + + // Should return data starting from first available bar + Assert.True(series.Count > 0); + } + + [Fact] + public void Fetch_WithFutureStartTime_ReturnsEmpty() + { + var feed = new CsvFeed(TestCsvPath); + + // Start from future date (after all data) + var startTime = new DateTime(2030, 1, 1, 0, 0, 0, DateTimeKind.Utc).Ticks; + var series = feed.Fetch(5, startTime, TimeSpan.FromDays(1)); + + // Should return empty or minimal data + Assert.True(series.Count == 0); + } +} diff --git a/lib/feeds/csv/CsvFeed.cs b/lib/feeds/csv/CsvFeed.cs index 0c6a93f0..8ee67524 100644 --- a/lib/feeds/csv/CsvFeed.cs +++ b/lib/feeds/csv/CsvFeed.cs @@ -1,196 +1,196 @@ -using System.Globalization; -using System.Runtime.CompilerServices; - -namespace QuanTAlib; - -/// -/// CSV file feed for loading historical OHLCV data. -/// Loads data in constructor and streams through it with Next() or returns batches with Fetch(). -/// CSV format: timestamp,open,high,low,close,volume (header required) -/// Timestamp format: YYYY-MM-DD (UTC midnight assumed) -/// -public class CsvFeed : IFeed -{ - private readonly TBarSeries _data; - - // Streaming state - private int _currentIndex; - private TBar _currentBar; - private bool _hasCurrentBar; - - /// - /// Loads CSV file and prepares data for streaming. - /// Data is reversed to chronological order (oldest first). - /// - /// Path to CSV file - public CsvFeed(string filePath) - { - if (string.IsNullOrWhiteSpace(filePath)) - throw new ArgumentException("File path cannot be null or empty", nameof(filePath)); - - if (!File.Exists(filePath)) - throw new FileNotFoundException($"CSV file not found: {filePath}", filePath); - - _data = LoadFromCsv(filePath); - _currentIndex = 0; - } - - /// - /// Parses CSV file into TBarSeries. - /// Expected format: timestamp,open,high,low,close,volume - /// - private static TBarSeries LoadFromCsv(string filePath) - { - var lines = File.ReadAllLines(filePath); - - if (lines.Length == 0) - throw new InvalidDataException("CSV file is empty"); - - // Skip header, reverse to chronological order (oldest first) - var dataLines = lines.Skip(1).Reverse().ToArray(); - - if (dataLines.Length == 0) - throw new InvalidDataException("CSV file contains only header, no data"); - - var series = new TBarSeries(dataLines.Length); - - for (int i = 0; i < dataLines.Length; i++) - { - var line = dataLines[i]; - if (string.IsNullOrWhiteSpace(line)) - continue; - - var parts = line.Split(','); - if (parts.Length != 6) - throw new FormatException($"Invalid CSV format at line {i + 2}. Expected 6 columns, found {parts.Length}"); - - try - { - // Parse timestamp (YYYY-MM-DD format, assume UTC midnight) - var timestamp = DateTime.ParseExact(parts[0].Trim(), "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal); - - // Parse OHLCV values - double open = double.Parse(parts[1].Trim(), CultureInfo.InvariantCulture); - double high = double.Parse(parts[2].Trim(), CultureInfo.InvariantCulture); - double low = double.Parse(parts[3].Trim(), CultureInfo.InvariantCulture); - double close = double.Parse(parts[4].Trim(), CultureInfo.InvariantCulture); - double volume = double.Parse(parts[5].Trim(), CultureInfo.InvariantCulture); - - series.Add(timestamp, open, high, low, close, volume, isNew: true); - } - catch (Exception ex) when (ex is FormatException or OverflowException) - { - throw new FormatException($"Failed to parse CSV line {i + 2}: {line}", ex); - } - } - - return series; - } - - /// - /// Gets the next bar with full bidirectional control. - /// When end of data reached, returns last bar and sets isNew=false. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public TBar Next(ref bool isNew) - { - if (_data.Count == 0) - { - isNew = false; - return default; - } - - if (isNew || !_hasCurrentBar) - { - // Request for new bar - if (_currentIndex >= _data.Count) - { - // End of data - return last bar and signal no more data - isNew = false; - return _currentBar; - } - - _currentBar = _data[_currentIndex]; - _currentIndex++; - _hasCurrentBar = true; - } - else - { - // Update current bar - CSV has no intra-bar updates, return same bar - // No change to _currentBar or _currentIndex - } - - return _currentBar; - } - - /// - /// Gets the next bar with simple control. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public TBar Next(bool isNew = true) - { - return Next(ref isNew); - } - - /// - /// Returns a filtered subset of data matching the criteria. - /// Resets streaming position to start of returned data. - /// - public TBarSeries Fetch(int count, long startTime, TimeSpan interval) - { - if (count <= 0) - throw new ArgumentException("Count must be positive", nameof(count)); - - var result = new TBarSeries(count); - - // Find starting index - int startIndex = 0; - for (int i = 0; i < _data.Count; i++) - { - if (_data[i].Time >= startTime) - { - startIndex = i; - break; - } - } - - // Collect bars matching interval - long expectedTime = startTime; - int collected = 0; - - for (int i = startIndex; i < _data.Count && collected < count; i++) - { - var bar = _data[i]; - - // Check if bar time matches expected time (within tolerance) - long timeDiff = Math.Abs(bar.Time - expectedTime); - long tolerance = interval.Ticks / 2; // Allow 50% tolerance - - if (timeDiff <= tolerance) - { - result.Add(bar, isNew: true); - collected++; - expectedTime += interval.Ticks; - } - else if (bar.Time > expectedTime) - { - // Gap in data - skip forward - long gaps = (bar.Time - expectedTime) / interval.Ticks; - expectedTime += (gaps + 1) * interval.Ticks; - - if (Math.Abs(bar.Time - expectedTime + interval.Ticks) <= tolerance) - { - result.Add(bar, isNew: true); - collected++; - expectedTime += interval.Ticks; - } - } - } - - // Reset streaming to start of returned data - _currentIndex = startIndex; - _hasCurrentBar = false; - - return result; - } -} +using System.Globalization; +using System.Runtime.CompilerServices; + +namespace QuanTAlib; + +/// +/// CSV file feed for loading historical OHLCV data. +/// Loads data in constructor and streams through it with Next() or returns batches with Fetch(). +/// CSV format: timestamp,open,high,low,close,volume (header required) +/// Timestamp format: YYYY-MM-DD (UTC midnight assumed) +/// +public class CsvFeed : IFeed +{ + private readonly TBarSeries _data; + + // Streaming state + private int _currentIndex; + private TBar _currentBar; + private bool _hasCurrentBar; + + /// + /// Loads CSV file and prepares data for streaming. + /// Data is reversed to chronological order (oldest first). + /// + /// Path to CSV file + public CsvFeed(string filePath) + { + if (string.IsNullOrWhiteSpace(filePath)) + throw new ArgumentException("File path cannot be null or empty", nameof(filePath)); + + if (!File.Exists(filePath)) + throw new FileNotFoundException($"CSV file not found: {filePath}", filePath); + + _data = LoadFromCsv(filePath); + _currentIndex = 0; + } + + /// + /// Parses CSV file into TBarSeries. + /// Expected format: timestamp,open,high,low,close,volume + /// + private static TBarSeries LoadFromCsv(string filePath) + { + var lines = File.ReadAllLines(filePath); + + if (lines.Length == 0) + throw new InvalidDataException("CSV file is empty"); + + // Skip header, reverse to chronological order (oldest first) + var dataLines = lines.Skip(1).Reverse().ToArray(); + + if (dataLines.Length == 0) + throw new InvalidDataException("CSV file contains only header, no data"); + + var series = new TBarSeries(dataLines.Length); + + for (int i = 0; i < dataLines.Length; i++) + { + var line = dataLines[i]; + if (string.IsNullOrWhiteSpace(line)) + continue; + + var parts = line.Split(','); + if (parts.Length != 6) + throw new FormatException($"Invalid CSV format at line {i + 2}. Expected 6 columns, found {parts.Length}"); + + try + { + // Parse timestamp (YYYY-MM-DD format, assume UTC midnight) + var timestamp = DateTime.ParseExact(parts[0].Trim(), "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal); + + // Parse OHLCV values + double open = double.Parse(parts[1].Trim(), CultureInfo.InvariantCulture); + double high = double.Parse(parts[2].Trim(), CultureInfo.InvariantCulture); + double low = double.Parse(parts[3].Trim(), CultureInfo.InvariantCulture); + double close = double.Parse(parts[4].Trim(), CultureInfo.InvariantCulture); + double volume = double.Parse(parts[5].Trim(), CultureInfo.InvariantCulture); + + series.Add(timestamp, open, high, low, close, volume, isNew: true); + } + catch (Exception ex) when (ex is FormatException or OverflowException) + { + throw new FormatException($"Failed to parse CSV line {i + 2}: {line}", ex); + } + } + + return series; + } + + /// + /// Gets the next bar with full bidirectional control. + /// When end of data reached, returns last bar and sets isNew=false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public TBar Next(ref bool isNew) + { + if (_data.Count == 0) + { + isNew = false; + return default; + } + + if (isNew || !_hasCurrentBar) + { + // Request for new bar + if (_currentIndex >= _data.Count) + { + // End of data - return last bar and signal no more data + isNew = false; + return _currentBar; + } + + _currentBar = _data[_currentIndex]; + _currentIndex++; + _hasCurrentBar = true; + } + else + { + // Update current bar - CSV has no intra-bar updates, return same bar + // No change to _currentBar or _currentIndex + } + + return _currentBar; + } + + /// + /// Gets the next bar with simple control. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public TBar Next(bool isNew = true) + { + return Next(ref isNew); + } + + /// + /// Returns a filtered subset of data matching the criteria. + /// Resets streaming position to start of returned data. + /// + public TBarSeries Fetch(int count, long startTime, TimeSpan interval) + { + if (count <= 0) + throw new ArgumentException("Count must be positive", nameof(count)); + + var result = new TBarSeries(count); + + // Find starting index + int startIndex = 0; + for (int i = 0; i < _data.Count; i++) + { + if (_data[i].Time >= startTime) + { + startIndex = i; + break; + } + } + + // Collect bars matching interval + long expectedTime = startTime; + int collected = 0; + + for (int i = startIndex; i < _data.Count && collected < count; i++) + { + var bar = _data[i]; + + // Check if bar time matches expected time (within tolerance) + long timeDiff = Math.Abs(bar.Time - expectedTime); + long tolerance = interval.Ticks / 2; // Allow 50% tolerance + + if (timeDiff <= tolerance) + { + result.Add(bar, isNew: true); + collected++; + expectedTime += interval.Ticks; + } + else if (bar.Time > expectedTime) + { + // Gap in data - skip forward + long gaps = (bar.Time - expectedTime) / interval.Ticks; + expectedTime += (gaps + 1) * interval.Ticks; + + if (Math.Abs(bar.Time - expectedTime + interval.Ticks) <= tolerance) + { + result.Add(bar, isNew: true); + collected++; + expectedTime += interval.Ticks; + } + } + } + + // Reset streaming to start of returned data + _currentIndex = startIndex; + _hasCurrentBar = false; + + return result; + } +} diff --git a/lib/feeds/csv/CsvFeed.md b/lib/feeds/csv/CsvFeed.md index db5e10c7..e4038afe 100644 --- a/lib/feeds/csv/CsvFeed.md +++ b/lib/feeds/csv/CsvFeed.md @@ -1,68 +1,68 @@ -# CsvFeed Class - -`CsvFeed` is a file-based feed implementation that loads historical OHLCV data from CSV files. It supports both streaming access (simulating real-time playback) and batch retrieval. - -## Key Features - -- **Historical Data Loading**: Reads standard OHLCV CSV files. -- **Chronological Ordering**: Automatically reverses data if needed (assumes newest-first in file, provides oldest-first). -- **Streaming Interface**: Implements `IFeed` for consistent usage with other feed types. -- **Batch Retrieval**: Supports fetching specific time ranges via `Fetch()`. - -## CSV Format Requirements - -The file must have a header row and follow this column order: -`timestamp, open, high, low, close, volume` - -- **Timestamp**: `YYYY-MM-DD` (assumed UTC midnight) -- **Prices/Volume**: Numeric values - -Example: -```csv -Date,Open,High,Low,Close,Volume -2024-01-01,100.0,105.0,99.0,102.5,10000 -2024-01-02,102.5,103.0,101.0,101.5,8500 -``` - -## Class Definition - -```csharp -public class CsvFeed : IFeed -{ - public CsvFeed(string filePath); - public TBar Next(bool isNew = true); - public TBarSeries Fetch(int count, long startTime, TimeSpan interval); -} -``` - -## Usage - -### 1. Loading Data -```csharp -var feed = new CsvFeed("path/to/data.csv"); -``` - -### 2. Streaming Data (Simulation) -```csharp -// Get first bar -var bar = feed.Next(isNew: true); - -// Loop through all data -while (true) -{ - // Process bar... - Console.WriteLine(bar); - - // Get next bar - bool isNew = true; - bar = feed.Next(ref isNew); - - // Stop if no more new data - if (!isNew) break; -} -``` - -### 3. Fetching a Batch -```csharp -long startTime = new DateTime(2024, 1, 1).Ticks; -var batch = feed.Fetch(10, startTime, TimeSpan.FromDays(1)); +# CsvFeed Class + +`CsvFeed` is a file-based feed implementation that loads historical OHLCV data from CSV files. It supports both streaming access (simulating real-time playback) and batch retrieval. + +## Key Features + +- **Historical Data Loading**: Reads standard OHLCV CSV files. +- **Chronological Ordering**: Automatically reverses data if needed (assumes newest-first in file, provides oldest-first). +- **Streaming Interface**: Implements `IFeed` for consistent usage with other feed types. +- **Batch Retrieval**: Supports fetching specific time ranges via `Fetch()`. + +## CSV Format Requirements + +The file must have a header row and follow this column order: +`timestamp, open, high, low, close, volume` + +- **Timestamp**: `YYYY-MM-DD` (assumed UTC midnight) +- **Prices/Volume**: Numeric values + +Example: +```csv +Date,Open,High,Low,Close,Volume +2024-01-01,100.0,105.0,99.0,102.5,10000 +2024-01-02,102.5,103.0,101.0,101.5,8500 +``` + +## Class Definition + +```csharp +public class CsvFeed : IFeed +{ + public CsvFeed(string filePath); + public TBar Next(bool isNew = true); + public TBarSeries Fetch(int count, long startTime, TimeSpan interval); +} +``` + +## Usage + +### 1. Loading Data +```csharp +var feed = new CsvFeed("path/to/data.csv"); +``` + +### 2. Streaming Data (Simulation) +```csharp +// Get first bar +var bar = feed.Next(isNew: true); + +// Loop through all data +while (true) +{ + // Process bar... + Console.WriteLine(bar); + + // Get next bar + bool isNew = true; + bar = feed.Next(ref isNew); + + // Stop if no more new data + if (!isNew) break; +} +``` + +### 3. Fetching a Batch +```csharp +long startTime = new DateTime(2024, 1, 1).Ticks; +var batch = feed.Fetch(10, startTime, TimeSpan.FromDays(1)); diff --git a/lib/feeds/csv/daily_IBM.csv b/lib/feeds/csv/daily_IBM.csv index 111591d2..37ee73db 100644 --- a/lib/feeds/csv/daily_IBM.csv +++ b/lib/feeds/csv/daily_IBM.csv @@ -1,101 +1,101 @@ -timestamp,open,high,low,close,volume -2025-11-25,304.1250,306.0000,297.0600,304.4800,2825322 -2025-11-24,299.1800,307.1800,297.5100,304.1200,6050640 -2025-11-21,293.4800,300.4800,291.8900,297.4400,5710903 -2025-11-20,294.6400,300.7100,290.1600,290.4000,5597028 -2025-11-19,290.5000,291.1099,288.0700,288.5300,3595912 -2025-11-18,297.0000,297.0000,289.9200,289.9500,4861928 -2025-11-17,305.5900,306.0000,296.5100,297.1700,3909741 -2025-11-14,300.0000,307.7200,297.5900,305.6900,3592455 -2025-11-13,312.2900,314.6000,303.6800,304.8600,5310150 -2025-11-12,319.8900,324.9000,314.5324,314.9800,6042686 -2025-11-11,309.0000,317.9100,308.4300,313.7200,4381913 -2025-11-10,306.8200,309.9400,304.2300,309.1300,2975188 -2025-11-07,309.6800,310.0000,302.6301,306.3800,5070773 -2025-11-06,306.7500,315.4400,301.0900,312.4200,6818521 -2025-11-05,301.3800,307.2000,299.7100,306.7700,4633195 -2025-11-04,300.0000,303.1700,296.0000,300.8500,5677330 -2025-11-03,308.0000,312.1411,304.2300,304.7300,4957958 -2025-10-31,312.0000,313.5000,301.6300,307.4100,7697499 -2025-10-30,306.6500,313.7500,305.0200,310.0600,4694275 -2025-10-29,312.7900,314.3300,307.5200,308.2100,4135948 -2025-10-28,312.6000,319.3500,311.4100,312.5700,6044770 -2025-10-27,307.8000,313.5000,302.8800,313.0900,9868151 -2025-10-24,283.7700,310.7500,282.2100,307.4600,16914243 -2025-10-23,264.9500,285.5791,263.5623,285.0000,16676394 -2025-10-22,281.9900,289.1700,281.3500,287.5100,10538480 -2025-10-21,283.3100,285.3100,281.6000,282.0500,4080981 -2025-10-20,281.2500,285.5000,280.9600,283.6500,3494336 -2025-10-17,276.1500,283.4000,275.3500,281.2800,5309565 -2025-10-16,281.1100,282.5600,275.6000,275.9700,2956923 -2025-10-15,278.3800,285.4500,277.0000,280.7500,3346753 -2025-10-14,275.5200,277.5300,272.5469,276.1500,3058149 -2025-10-13,279.7900,282.4399,274.6400,277.2200,4333836 -2025-10-10,288.9700,290.3850,277.5000,277.8200,4508506 -2025-10-09,289.8200,290.1300,283.3200,288.2300,4912375 -2025-10-08,294.1600,294.2000,286.4730,289.4600,5297030 -2025-10-07,295.5500,301.0425,293.2850,293.8700,7190126 -2025-10-06,288.6100,291.4500,287.8000,289.4200,2881947 -2025-10-03,287.5000,293.3200,287.3000,288.3700,4375082 -2025-10-02,285.7900,288.5400,282.7900,286.7200,3814232 -2025-10-01,280.2000,286.5900,280.1500,286.4900,4381338 -2025-09-30,280.8800,286.0250,280.5200,282.1600,5926924 -2025-09-29,286.0000,286.0000,279.6600,279.8000,6022125 -2025-09-26,280.5100,288.8500,280.1100,284.3100,9063938 -2025-09-25,272.9350,284.2300,271.1480,281.4400,11506192 -2025-09-24,272.6200,273.6499,267.3000,267.5300,3159924 -2025-09-23,272.7000,273.2962,269.2650,272.2400,5394121 -2025-09-22,266.6200,272.3100,266.0000,271.3700,5030540 -2025-09-19,266.0500,267.8700,263.6400,266.4000,9858112 -2025-09-18,258.8600,265.2300,256.8004,265.0000,4988421 -2025-09-17,257.4950,260.9644,257.0100,259.0800,3974785 -2025-09-16,256.2600,258.0000,254.4100,257.5200,2719918 -2025-09-15,254.0200,259.0500,254.0000,256.2400,4028365 -2025-09-12,256.9500,257.2500,252.4250,253.4400,3433300 -2025-09-11,257.5600,258.5450,255.6550,257.0100,3576048 -2025-09-10,259.6500,260.0800,254.5600,256.8800,5185420 -2025-09-09,256.1200,260.6600,254.8800,259.1100,4931105 -2025-09-08,248.6300,257.1500,247.0200,256.0900,6940270 -2025-09-05,248.2300,249.0300,245.4500,248.5300,3147478 -2025-09-04,245.4200,249.2800,242.8500,247.1800,4765087 -2025-09-03,240.0200,244.2500,239.4100,244.1000,3156289 -2025-09-02,240.9000,241.5500,238.2500,241.5000,3469501 -2025-08-29,245.2300,245.4599,241.7200,243.4900,2967558 -2025-08-28,245.4300,245.8800,243.3600,245.7300,2820817 -2025-08-27,242.8700,245.9600,242.0000,244.8400,3698372 -2025-08-26,241.0200,244.9800,240.3800,242.6300,5386582 -2025-08-25,242.5650,242.5650,239.4300,239.4300,3513327 -2025-08-22,240.7400,243.6800,240.2200,242.0900,3134882 -2025-08-21,242.2100,242.5000,238.6500,239.4000,2991902 -2025-08-20,242.1100,242.8800,240.3400,242.5500,3240064 -2025-08-19,240.0000,242.8300,239.4900,241.2800,3328305 -2025-08-18,239.5700,241.4200,239.1158,239.4500,3569594 -2025-08-15,237.6100,240.6200,236.7700,239.7200,4344322 -2025-08-14,238.2500,239.0000,235.6200,237.1100,4556725 -2025-08-13,236.2000,240.8411,236.2000,240.0700,5663562 -2025-08-12,236.5300,237.9600,233.3600,234.7700,8800597 -2025-08-11,242.2400,243.1500,234.7000,236.3000,9381960 -2025-08-08,248.8800,249.4800,241.6500,242.2700,6828390 -2025-08-07,252.8100,255.0000,248.8750,250.1600,6251285 -2025-08-06,251.5300,254.3200,249.2800,252.2800,3692105 -2025-08-05,252.0000,252.8000,248.9950,250.6700,5823016 -2025-08-04,251.0500,252.0800,248.1100,251.9800,5280588 -2025-08-01,251.4050,251.4791,245.6100,250.0500,9683404 -2025-07-31,259.5700,259.9900,252.2200,253.1500,6739092 -2025-07-30,261.6000,262.0000,258.9000,260.2600,3718290 -2025-07-29,264.3000,265.7999,261.0200,262.4100,4627265 -2025-07-28,260.3000,264.0000,259.6100,263.2100,5192516 -2025-07-25,260.0200,260.8000,256.3500,259.7200,7758653 -2025-07-24,261.2500,262.0486,252.7500,260.5100,22647720 -2025-07-23,284.3000,288.0800,281.4400,282.0100,8105906 -2025-07-22,284.7400,284.8800,281.2500,281.9600,4824219 -2025-07-21,286.2900,287.7300,284.3800,284.7100,3051791 -2025-07-18,283.3800,287.1600,282.2200,285.8700,4478165 -2025-07-17,281.5000,283.4566,280.9000,282.0000,3337168 -2025-07-16,282.7500,283.8700,279.8700,281.9200,2804831 -2025-07-15,283.7700,284.1550,280.7301,282.7000,2864106 -2025-07-14,282.8300,284.9250,281.7100,283.7900,2857401 -2025-07-11,285.0100,287.4300,282.9200,283.5900,3790679 -2025-07-10,288.9000,288.9000,282.2100,287.4300,3489068 -2025-07-09,291.3900,291.6000,288.6300,290.1400,2971309 -2025-07-08,293.1000,295.6100,289.4900,290.4200,2925329 +timestamp,open,high,low,close,volume +2025-11-25,304.1250,306.0000,297.0600,304.4800,2825322 +2025-11-24,299.1800,307.1800,297.5100,304.1200,6050640 +2025-11-21,293.4800,300.4800,291.8900,297.4400,5710903 +2025-11-20,294.6400,300.7100,290.1600,290.4000,5597028 +2025-11-19,290.5000,291.1099,288.0700,288.5300,3595912 +2025-11-18,297.0000,297.0000,289.9200,289.9500,4861928 +2025-11-17,305.5900,306.0000,296.5100,297.1700,3909741 +2025-11-14,300.0000,307.7200,297.5900,305.6900,3592455 +2025-11-13,312.2900,314.6000,303.6800,304.8600,5310150 +2025-11-12,319.8900,324.9000,314.5324,314.9800,6042686 +2025-11-11,309.0000,317.9100,308.4300,313.7200,4381913 +2025-11-10,306.8200,309.9400,304.2300,309.1300,2975188 +2025-11-07,309.6800,310.0000,302.6301,306.3800,5070773 +2025-11-06,306.7500,315.4400,301.0900,312.4200,6818521 +2025-11-05,301.3800,307.2000,299.7100,306.7700,4633195 +2025-11-04,300.0000,303.1700,296.0000,300.8500,5677330 +2025-11-03,308.0000,312.1411,304.2300,304.7300,4957958 +2025-10-31,312.0000,313.5000,301.6300,307.4100,7697499 +2025-10-30,306.6500,313.7500,305.0200,310.0600,4694275 +2025-10-29,312.7900,314.3300,307.5200,308.2100,4135948 +2025-10-28,312.6000,319.3500,311.4100,312.5700,6044770 +2025-10-27,307.8000,313.5000,302.8800,313.0900,9868151 +2025-10-24,283.7700,310.7500,282.2100,307.4600,16914243 +2025-10-23,264.9500,285.5791,263.5623,285.0000,16676394 +2025-10-22,281.9900,289.1700,281.3500,287.5100,10538480 +2025-10-21,283.3100,285.3100,281.6000,282.0500,4080981 +2025-10-20,281.2500,285.5000,280.9600,283.6500,3494336 +2025-10-17,276.1500,283.4000,275.3500,281.2800,5309565 +2025-10-16,281.1100,282.5600,275.6000,275.9700,2956923 +2025-10-15,278.3800,285.4500,277.0000,280.7500,3346753 +2025-10-14,275.5200,277.5300,272.5469,276.1500,3058149 +2025-10-13,279.7900,282.4399,274.6400,277.2200,4333836 +2025-10-10,288.9700,290.3850,277.5000,277.8200,4508506 +2025-10-09,289.8200,290.1300,283.3200,288.2300,4912375 +2025-10-08,294.1600,294.2000,286.4730,289.4600,5297030 +2025-10-07,295.5500,301.0425,293.2850,293.8700,7190126 +2025-10-06,288.6100,291.4500,287.8000,289.4200,2881947 +2025-10-03,287.5000,293.3200,287.3000,288.3700,4375082 +2025-10-02,285.7900,288.5400,282.7900,286.7200,3814232 +2025-10-01,280.2000,286.5900,280.1500,286.4900,4381338 +2025-09-30,280.8800,286.0250,280.5200,282.1600,5926924 +2025-09-29,286.0000,286.0000,279.6600,279.8000,6022125 +2025-09-26,280.5100,288.8500,280.1100,284.3100,9063938 +2025-09-25,272.9350,284.2300,271.1480,281.4400,11506192 +2025-09-24,272.6200,273.6499,267.3000,267.5300,3159924 +2025-09-23,272.7000,273.2962,269.2650,272.2400,5394121 +2025-09-22,266.6200,272.3100,266.0000,271.3700,5030540 +2025-09-19,266.0500,267.8700,263.6400,266.4000,9858112 +2025-09-18,258.8600,265.2300,256.8004,265.0000,4988421 +2025-09-17,257.4950,260.9644,257.0100,259.0800,3974785 +2025-09-16,256.2600,258.0000,254.4100,257.5200,2719918 +2025-09-15,254.0200,259.0500,254.0000,256.2400,4028365 +2025-09-12,256.9500,257.2500,252.4250,253.4400,3433300 +2025-09-11,257.5600,258.5450,255.6550,257.0100,3576048 +2025-09-10,259.6500,260.0800,254.5600,256.8800,5185420 +2025-09-09,256.1200,260.6600,254.8800,259.1100,4931105 +2025-09-08,248.6300,257.1500,247.0200,256.0900,6940270 +2025-09-05,248.2300,249.0300,245.4500,248.5300,3147478 +2025-09-04,245.4200,249.2800,242.8500,247.1800,4765087 +2025-09-03,240.0200,244.2500,239.4100,244.1000,3156289 +2025-09-02,240.9000,241.5500,238.2500,241.5000,3469501 +2025-08-29,245.2300,245.4599,241.7200,243.4900,2967558 +2025-08-28,245.4300,245.8800,243.3600,245.7300,2820817 +2025-08-27,242.8700,245.9600,242.0000,244.8400,3698372 +2025-08-26,241.0200,244.9800,240.3800,242.6300,5386582 +2025-08-25,242.5650,242.5650,239.4300,239.4300,3513327 +2025-08-22,240.7400,243.6800,240.2200,242.0900,3134882 +2025-08-21,242.2100,242.5000,238.6500,239.4000,2991902 +2025-08-20,242.1100,242.8800,240.3400,242.5500,3240064 +2025-08-19,240.0000,242.8300,239.4900,241.2800,3328305 +2025-08-18,239.5700,241.4200,239.1158,239.4500,3569594 +2025-08-15,237.6100,240.6200,236.7700,239.7200,4344322 +2025-08-14,238.2500,239.0000,235.6200,237.1100,4556725 +2025-08-13,236.2000,240.8411,236.2000,240.0700,5663562 +2025-08-12,236.5300,237.9600,233.3600,234.7700,8800597 +2025-08-11,242.2400,243.1500,234.7000,236.3000,9381960 +2025-08-08,248.8800,249.4800,241.6500,242.2700,6828390 +2025-08-07,252.8100,255.0000,248.8750,250.1600,6251285 +2025-08-06,251.5300,254.3200,249.2800,252.2800,3692105 +2025-08-05,252.0000,252.8000,248.9950,250.6700,5823016 +2025-08-04,251.0500,252.0800,248.1100,251.9800,5280588 +2025-08-01,251.4050,251.4791,245.6100,250.0500,9683404 +2025-07-31,259.5700,259.9900,252.2200,253.1500,6739092 +2025-07-30,261.6000,262.0000,258.9000,260.2600,3718290 +2025-07-29,264.3000,265.7999,261.0200,262.4100,4627265 +2025-07-28,260.3000,264.0000,259.6100,263.2100,5192516 +2025-07-25,260.0200,260.8000,256.3500,259.7200,7758653 +2025-07-24,261.2500,262.0486,252.7500,260.5100,22647720 +2025-07-23,284.3000,288.0800,281.4400,282.0100,8105906 +2025-07-22,284.7400,284.8800,281.2500,281.9600,4824219 +2025-07-21,286.2900,287.7300,284.3800,284.7100,3051791 +2025-07-18,283.3800,287.1600,282.2200,285.8700,4478165 +2025-07-17,281.5000,283.4566,280.9000,282.0000,3337168 +2025-07-16,282.7500,283.8700,279.8700,281.9200,2804831 +2025-07-15,283.7700,284.1550,280.7301,282.7000,2864106 +2025-07-14,282.8300,284.9250,281.7100,283.7900,2857401 +2025-07-11,285.0100,287.4300,282.9200,283.5900,3790679 +2025-07-10,288.9000,288.9000,282.2100,287.4300,3489068 +2025-07-09,291.3900,291.6000,288.6300,290.1400,2971309 +2025-07-08,293.1000,295.6100,289.4900,290.4200,2925329 diff --git a/lib/feeds/gbm/GBM.md b/lib/feeds/gbm/GBM.md index d53f787c..05308777 100644 --- a/lib/feeds/gbm/GBM.md +++ b/lib/feeds/gbm/GBM.md @@ -1,67 +1,67 @@ -# GBM Class - -`GBM` (Geometric Brownian Motion) is a synthetic data generator that simulates realistic financial price movements. It is useful for testing indicators, strategies, and system performance without relying on external data files. - -## Key Features - -- **Geometric Brownian Motion**: Uses the standard mathematical model for asset price dynamics. -- **Configurable Parameters**: Control drift (trend) and volatility (noise). -- **Stateless Design**: Minimal memory footprint; only maintains state needed for continuity. -- **Dual Modes**: Supports both streaming (bar-by-bar) and batch generation. -- **Intra-bar Updates**: Can simulate real-time price updates within a single bar. - -## Mathematical Model - -The price evolution follows the stochastic differential equation: - -$$ dS_t = \mu S_t dt + \sigma S_t dW_t $$ - -Where: -- $S_t$: Asset price at time $t$ -- $\mu$: Drift (expected return) -- $\sigma$: Volatility (standard deviation of returns) -- $W_t$: Wiener process (Brownian motion) - -## Class Definition - -```csharp -public class GBM : IFeed -{ - public GBM(double startPrice = 100.0, double mu = 0.05, double sigma = 0.2, TimeSpan? defaultTimeframe = null); - - public TBar Next(bool isNew = true); - public TBarSeries Fetch(int count, long startTime, TimeSpan interval); -} -``` - -## Usage - -### 1. Initialization -```csharp -// Default: Start at 100, 5% drift, 20% volatility -var gbm = new GBM(); - -// Custom: Start at 50, 10% drift, 50% volatility -var volatileGbm = new GBM(startPrice: 50.0, mu: 0.10, sigma: 0.50); -``` - -### 2. Streaming Generation -```csharp -// Generate a new bar -var bar = gbm.Next(isNew: true); - -// Simulate intra-bar updates (e.g., real-time ticks) -for (int i = 0; i < 5; i++) -{ - var updatedBar = gbm.Next(isNew: false); - Console.WriteLine($"Update: {updatedBar.Close}"); -} -``` - -### 3. Batch Generation -```csharp -long startTime = DateTime.UtcNow.Ticks; -var interval = TimeSpan.FromMinutes(1); - -// Generate 1000 bars -var history = gbm.Fetch(1000, startTime, interval); +# GBM Class + +`GBM` (Geometric Brownian Motion) is a synthetic data generator that simulates realistic financial price movements. It is useful for testing indicators, strategies, and system performance without relying on external data files. + +## Key Features + +- **Geometric Brownian Motion**: Uses the standard mathematical model for asset price dynamics. +- **Configurable Parameters**: Control drift (trend) and volatility (noise). +- **Stateless Design**: Minimal memory footprint; only maintains state needed for continuity. +- **Dual Modes**: Supports both streaming (bar-by-bar) and batch generation. +- **Intra-bar Updates**: Can simulate real-time price updates within a single bar. + +## Mathematical Model + +The price evolution follows the stochastic differential equation: + +$$ dS_t = \mu S_t dt + \sigma S_t dW_t $$ + +Where: +- $S_t$: Asset price at time $t$ +- $\mu$: Drift (expected return) +- $\sigma$: Volatility (standard deviation of returns) +- $W_t$: Wiener process (Brownian motion) + +## Class Definition + +```csharp +public class GBM : IFeed +{ + public GBM(double startPrice = 100.0, double mu = 0.05, double sigma = 0.2, TimeSpan? defaultTimeframe = null); + + public TBar Next(bool isNew = true); + public TBarSeries Fetch(int count, long startTime, TimeSpan interval); +} +``` + +## Usage + +### 1. Initialization +```csharp +// Default: Start at 100, 5% drift, 20% volatility +var gbm = new GBM(); + +// Custom: Start at 50, 10% drift, 50% volatility +var volatileGbm = new GBM(startPrice: 50.0, mu: 0.10, sigma: 0.50); +``` + +### 2. Streaming Generation +```csharp +// Generate a new bar +var bar = gbm.Next(isNew: true); + +// Simulate intra-bar updates (e.g., real-time ticks) +for (int i = 0; i < 5; i++) +{ + var updatedBar = gbm.Next(isNew: false); + Console.WriteLine($"Update: {updatedBar.Close}"); +} +``` + +### 3. Batch Generation +```csharp +long startTime = DateTime.UtcNow.Ticks; +var interval = TimeSpan.FromMinutes(1); + +// Generate 1000 bars +var history = gbm.Fetch(1000, startTime, interval); diff --git a/lib/feeds/gbm/Gbm.Tests.cs b/lib/feeds/gbm/Gbm.Tests.cs index cc7bb48f..f79887d4 100644 --- a/lib/feeds/gbm/Gbm.Tests.cs +++ b/lib/feeds/gbm/Gbm.Tests.cs @@ -1,283 +1,283 @@ -using System; -using Xunit; -using QuanTAlib; - -namespace QuanTAlib.Tests; - -public class GBMTests -{ - [Fact] - public void Next_DefaultParameter_GeneratesNewBar() - { - var gbm = new GBM(startPrice: 100.0); - - var bar1 = gbm.Next(); - var bar2 = gbm.Next(); - - Assert.NotEqual(bar1.Time, bar2.Time); - Assert.True(bar2.Time > bar1.Time); - } - - [Fact] - public void Next_IsNewTrue_AdvancesToNewBar() - { - var gbm = new GBM(startPrice: 100.0); - - var bar1 = gbm.Next(isNew: true); - var bar2 = gbm.Next(isNew: true); - - Assert.NotEqual(bar1.Time, bar2.Time); - Assert.True(bar2.Time > bar1.Time); - } - - [Fact] - public void Next_IsNewFalse_UpdatesCurrentBar() - { - var gbm = new GBM(startPrice: 100.0); - - var bar1 = gbm.Next(isNew: true); - long initialTime = bar1.Time; - - var bar2 = gbm.Next(isNew: false); - - Assert.Equal(initialTime, bar2.Time); - // Price likely changed (GBM random walk) - Assert.NotEqual(bar1.Close, bar2.Close); - } - - [Fact] - public void Next_RefBool_HonorsRequest() - { - var gbm = new GBM(startPrice: 100.0); - - // GBM always honors isNew - parameter should remain unchanged - bool isNew1 = true; - var bar1 = gbm.Next(ref isNew1); - Assert.True(isNew1, "GBM should honor isNew=true request"); - - bool isNew2 = false; - long time1 = bar1.Time; - var bar2 = gbm.Next(ref isNew2); - Assert.False(isNew2, "GBM should honor isNew=false request"); - Assert.Equal(time1, bar2.Time); - - bool isNew3 = true; - var bar3 = gbm.Next(ref isNew3); - Assert.True(isNew3, "GBM should honor isNew=true request"); - Assert.NotEqual(time1, bar3.Time); - } - - [Fact] - public void Fetch_GeneratesCorrectCount() - { - var gbm = new GBM(startPrice: 100.0); - int count = 10; - long startTime = DateTime.UtcNow.Ticks; - var interval = TimeSpan.FromMinutes(1); - - var series = gbm.Fetch(count, startTime, interval); - - Assert.Equal(count, series.Count); - } - - [Fact] - public void Fetch_GeneratesSequentialBars() - { - var gbm = new GBM(startPrice: 100.0); - long startTime = DateTime.UtcNow.Ticks; - var interval = TimeSpan.FromMinutes(1); - - var series = gbm.Fetch(5, startTime, interval); - - // Verify time sequence - for (int i = 1; i < series.Count; i++) - { - Assert.True(series[i].Time > series[i - 1].Time); - } - } - - [Fact] - public void Fetch_RespectsInterval() - { - var gbm = new GBM(startPrice: 100.0); - var interval = TimeSpan.FromHours(1); - long startTime = DateTime.UtcNow.Ticks; - - var series = gbm.Fetch(5, startTime, interval); - - // Verify interval spacing - for (int i = 1; i < series.Count; i++) - { - long expectedDiff = interval.Ticks; - long actualDiff = series[i].Time - series[i - 1].Time; - Assert.Equal(expectedDiff, actualDiff); - } - } - - [Fact] - public void Fetch_StartsAtSpecifiedTime() - { - var gbm = new GBM(startPrice: 100.0); - var startTime = new DateTime(2024, 1, 1, 9, 30, 0, DateTimeKind.Utc).Ticks; - var interval = TimeSpan.FromMinutes(5); - - var series = gbm.Fetch(3, startTime, interval); - - Assert.Equal(startTime, series[0].Time); - Assert.Equal(startTime + interval.Ticks, series[1].Time); - Assert.Equal(startTime + 2 * interval.Ticks, series[2].Time); - } - - [Fact] - public void Fetch_WithDifferentIntervals_WorksCorrectly() - { - var gbm = new GBM(startPrice: 100.0); - long startTime = DateTime.UtcNow.Ticks; - - // Test different intervals - var intervals = new[] { - TimeSpan.FromMinutes(1), - TimeSpan.FromMinutes(5), - TimeSpan.FromHours(1) - }; - - foreach (var interval in intervals) - { - var series = gbm.Fetch(3, startTime, interval); - - // Verify spacing - for (int i = 1; i < series.Count; i++) - { - long expectedDiff = interval.Ticks; - long actualDiff = series[i].Time - series[i - 1].Time; - Assert.Equal(expectedDiff, actualDiff); - } - } - } - - [Fact] - public void GeneratesRealisticOHLCV() - { - var gbm = new GBM(startPrice: 100.0); - long startTime = DateTime.UtcNow.Ticks; - var interval = TimeSpan.FromMinutes(1); - var series = gbm.Fetch(10, startTime, interval); - - for (int i = 0; i < series.Count; i++) - { - var bar = series[i]; - - // High should be >= max(Open, Close) - Assert.True(bar.High >= Math.Max(bar.Open, bar.Close)); - - // Low should be <= min(Open, Close) - Assert.True(bar.Low <= Math.Min(bar.Open, bar.Close)); - - // Volume should be positive - Assert.True(bar.Volume > 0); - - // All prices should be positive - Assert.True(bar.Open > 0); - Assert.True(bar.High > 0); - Assert.True(bar.Low > 0); - Assert.True(bar.Close > 0); - } - } - - [Fact] - public void IntraBarUpdates_ModifyCurrentBar() - { - var gbm = new GBM(startPrice: 100.0); - - var bar1 = gbm.Next(isNew: true); - long initialTime = bar1.Time; - double initialClose = bar1.Close; - - // Loop until price changes (random walk might stay same but unlikely) - bool changed = false; - for (int i = 0; i < 10; i++) - { - var bar = gbm.Next(isNew: false); - Assert.Equal(initialTime, bar.Time); - if (Math.Abs(bar.Close - initialClose) > double.Epsilon) - { - changed = true; - break; - } - } - - Assert.True(changed, "Price should change during intra-bar updates"); - } - - [Fact] - public void MixedStreamingAndBatch_WorksCorrectly() - { - var gbm = new GBM(startPrice: 100.0); - - // Start with streaming - var bar1 = gbm.Next(); - var bar2 = gbm.Next(); - - // Batch generation with explicit time - long startTime = bar2.Time + TimeSpan.FromMinutes(1).Ticks; - var interval = TimeSpan.FromMinutes(1); - var series = gbm.Fetch(3, startTime, interval); - - Assert.True(series[0].Time > bar2.Time); - Assert.Equal(3, series.Count); - - // Continue streaming after batch (uses internal state) - var bar3 = gbm.Next(); - Assert.True(bar3.Time > series[2].Time); - } - - [Fact] - public void DriftAndVolatility_AffectPriceMovement() - { - // High volatility should produce more price variation - var gbmLowVol = new GBM(startPrice: 100.0, mu: 0.0, sigma: 0.01); - var gbmHighVol = new GBM(startPrice: 100.0, mu: 0.0, sigma: 0.5); - - long startTime = DateTime.UtcNow.Ticks; - var interval = TimeSpan.FromMinutes(1); - var seriesLow = gbmLowVol.Fetch(100, startTime, interval); - var seriesHigh = gbmHighVol.Fetch(100, startTime, interval); - - // Calculate price ranges - double rangeLow = seriesLow[99].Close - seriesLow[0].Open; - double rangeHigh = seriesHigh[99].Close - seriesHigh[0].Open; - - // High volatility should generally produce larger absolute movements - Assert.True(Math.Abs(rangeHigh) > Math.Abs(rangeLow) * 0.5); - } - - [Fact] - public void ConsecutiveCalls_MaintainContinuity() - { - var gbm = new GBM(startPrice: 100.0); - - var bar1 = gbm.Next(); - var bar2 = gbm.Next(); - - // bar2.Open should equal bar1.Close (continuity) - Assert.Equal(bar1.Close, bar2.Open); - } - - [Fact] - public void Stateless_NoHistoryStorage() - { - var gbm = new GBM(startPrice: 100.0); - - // Generate multiple bars - for (int i = 0; i < 100; i++) - { - gbm.Next(); - } - - // GBM should not expose any history storage - var type = gbm.GetType(); - var barsProperty = type.GetProperty("Bars"); - - Assert.Null(barsProperty); - } -} +using System; +using Xunit; +using QuanTAlib; + +namespace QuanTAlib.Tests; + +public class GBMTests +{ + [Fact] + public void Next_DefaultParameter_GeneratesNewBar() + { + var gbm = new GBM(startPrice: 100.0); + + var bar1 = gbm.Next(); + var bar2 = gbm.Next(); + + Assert.NotEqual(bar1.Time, bar2.Time); + Assert.True(bar2.Time > bar1.Time); + } + + [Fact] + public void Next_IsNewTrue_AdvancesToNewBar() + { + var gbm = new GBM(startPrice: 100.0); + + var bar1 = gbm.Next(isNew: true); + var bar2 = gbm.Next(isNew: true); + + Assert.NotEqual(bar1.Time, bar2.Time); + Assert.True(bar2.Time > bar1.Time); + } + + [Fact] + public void Next_IsNewFalse_UpdatesCurrentBar() + { + var gbm = new GBM(startPrice: 100.0); + + var bar1 = gbm.Next(isNew: true); + long initialTime = bar1.Time; + + var bar2 = gbm.Next(isNew: false); + + Assert.Equal(initialTime, bar2.Time); + // Price likely changed (GBM random walk) + Assert.NotEqual(bar1.Close, bar2.Close); + } + + [Fact] + public void Next_RefBool_HonorsRequest() + { + var gbm = new GBM(startPrice: 100.0); + + // GBM always honors isNew - parameter should remain unchanged + bool isNew1 = true; + var bar1 = gbm.Next(ref isNew1); + Assert.True(isNew1, "GBM should honor isNew=true request"); + + bool isNew2 = false; + long time1 = bar1.Time; + var bar2 = gbm.Next(ref isNew2); + Assert.False(isNew2, "GBM should honor isNew=false request"); + Assert.Equal(time1, bar2.Time); + + bool isNew3 = true; + var bar3 = gbm.Next(ref isNew3); + Assert.True(isNew3, "GBM should honor isNew=true request"); + Assert.NotEqual(time1, bar3.Time); + } + + [Fact] + public void Fetch_GeneratesCorrectCount() + { + var gbm = new GBM(startPrice: 100.0); + int count = 10; + long startTime = DateTime.UtcNow.Ticks; + var interval = TimeSpan.FromMinutes(1); + + var series = gbm.Fetch(count, startTime, interval); + + Assert.Equal(count, series.Count); + } + + [Fact] + public void Fetch_GeneratesSequentialBars() + { + var gbm = new GBM(startPrice: 100.0); + long startTime = DateTime.UtcNow.Ticks; + var interval = TimeSpan.FromMinutes(1); + + var series = gbm.Fetch(5, startTime, interval); + + // Verify time sequence + for (int i = 1; i < series.Count; i++) + { + Assert.True(series[i].Time > series[i - 1].Time); + } + } + + [Fact] + public void Fetch_RespectsInterval() + { + var gbm = new GBM(startPrice: 100.0); + var interval = TimeSpan.FromHours(1); + long startTime = DateTime.UtcNow.Ticks; + + var series = gbm.Fetch(5, startTime, interval); + + // Verify interval spacing + for (int i = 1; i < series.Count; i++) + { + long expectedDiff = interval.Ticks; + long actualDiff = series[i].Time - series[i - 1].Time; + Assert.Equal(expectedDiff, actualDiff); + } + } + + [Fact] + public void Fetch_StartsAtSpecifiedTime() + { + var gbm = new GBM(startPrice: 100.0); + var startTime = new DateTime(2024, 1, 1, 9, 30, 0, DateTimeKind.Utc).Ticks; + var interval = TimeSpan.FromMinutes(5); + + var series = gbm.Fetch(3, startTime, interval); + + Assert.Equal(startTime, series[0].Time); + Assert.Equal(startTime + interval.Ticks, series[1].Time); + Assert.Equal(startTime + 2 * interval.Ticks, series[2].Time); + } + + [Fact] + public void Fetch_WithDifferentIntervals_WorksCorrectly() + { + var gbm = new GBM(startPrice: 100.0); + long startTime = DateTime.UtcNow.Ticks; + + // Test different intervals + var intervals = new[] { + TimeSpan.FromMinutes(1), + TimeSpan.FromMinutes(5), + TimeSpan.FromHours(1) + }; + + foreach (var interval in intervals) + { + var series = gbm.Fetch(3, startTime, interval); + + // Verify spacing + for (int i = 1; i < series.Count; i++) + { + long expectedDiff = interval.Ticks; + long actualDiff = series[i].Time - series[i - 1].Time; + Assert.Equal(expectedDiff, actualDiff); + } + } + } + + [Fact] + public void GeneratesRealisticOHLCV() + { + var gbm = new GBM(startPrice: 100.0); + long startTime = DateTime.UtcNow.Ticks; + var interval = TimeSpan.FromMinutes(1); + var series = gbm.Fetch(10, startTime, interval); + + for (int i = 0; i < series.Count; i++) + { + var bar = series[i]; + + // High should be >= max(Open, Close) + Assert.True(bar.High >= Math.Max(bar.Open, bar.Close)); + + // Low should be <= min(Open, Close) + Assert.True(bar.Low <= Math.Min(bar.Open, bar.Close)); + + // Volume should be positive + Assert.True(bar.Volume > 0); + + // All prices should be positive + Assert.True(bar.Open > 0); + Assert.True(bar.High > 0); + Assert.True(bar.Low > 0); + Assert.True(bar.Close > 0); + } + } + + [Fact] + public void IntraBarUpdates_ModifyCurrentBar() + { + var gbm = new GBM(startPrice: 100.0); + + var bar1 = gbm.Next(isNew: true); + long initialTime = bar1.Time; + double initialClose = bar1.Close; + + // Loop until price changes (random walk might stay same but unlikely) + bool changed = false; + for (int i = 0; i < 10; i++) + { + var bar = gbm.Next(isNew: false); + Assert.Equal(initialTime, bar.Time); + if (Math.Abs(bar.Close - initialClose) > double.Epsilon) + { + changed = true; + break; + } + } + + Assert.True(changed, "Price should change during intra-bar updates"); + } + + [Fact] + public void MixedStreamingAndBatch_WorksCorrectly() + { + var gbm = new GBM(startPrice: 100.0); + + // Start with streaming + var bar1 = gbm.Next(); + var bar2 = gbm.Next(); + + // Batch generation with explicit time + long startTime = bar2.Time + TimeSpan.FromMinutes(1).Ticks; + var interval = TimeSpan.FromMinutes(1); + var series = gbm.Fetch(3, startTime, interval); + + Assert.True(series[0].Time > bar2.Time); + Assert.Equal(3, series.Count); + + // Continue streaming after batch (uses internal state) + var bar3 = gbm.Next(); + Assert.True(bar3.Time > series[2].Time); + } + + [Fact] + public void DriftAndVolatility_AffectPriceMovement() + { + // High volatility should produce more price variation + var gbmLowVol = new GBM(startPrice: 100.0, mu: 0.0, sigma: 0.01); + var gbmHighVol = new GBM(startPrice: 100.0, mu: 0.0, sigma: 0.5); + + long startTime = DateTime.UtcNow.Ticks; + var interval = TimeSpan.FromMinutes(1); + var seriesLow = gbmLowVol.Fetch(100, startTime, interval); + var seriesHigh = gbmHighVol.Fetch(100, startTime, interval); + + // Calculate price ranges + double rangeLow = seriesLow[99].Close - seriesLow[0].Open; + double rangeHigh = seriesHigh[99].Close - seriesHigh[0].Open; + + // High volatility should generally produce larger absolute movements + Assert.True(Math.Abs(rangeHigh) > Math.Abs(rangeLow) * 0.5); + } + + [Fact] + public void ConsecutiveCalls_MaintainContinuity() + { + var gbm = new GBM(startPrice: 100.0); + + var bar1 = gbm.Next(); + var bar2 = gbm.Next(); + + // bar2.Open should equal bar1.Close (continuity) + Assert.Equal(bar1.Close, bar2.Open); + } + + [Fact] + public void Stateless_NoHistoryStorage() + { + var gbm = new GBM(startPrice: 100.0); + + // Generate multiple bars + for (int i = 0; i < 100; i++) + { + gbm.Next(); + } + + // GBM should not expose any history storage + var type = gbm.GetType(); + var barsProperty = type.GetProperty("Bars"); + + Assert.Null(barsProperty); + } +} diff --git a/lib/feeds/gbm/gbm.cs b/lib/feeds/gbm/gbm.cs index 1912fa07..40418d1f 100644 --- a/lib/feeds/gbm/gbm.cs +++ b/lib/feeds/gbm/gbm.cs @@ -1,211 +1,211 @@ -using System; -using System.Runtime.CompilerServices; - -namespace QuanTAlib; - -/// -/// Geometric Brownian Motion (GBM) generator for simulating OHLCV data. -/// Generates realistic price data for testing indicators and strategies. -/// Stateless design - only maintains minimal state needed for price continuity. -/// -public class GBM : IFeed -{ - private readonly Random _rnd = new(); - - private double _lastPrice; - private long _lastTime; - - private readonly double _mu; - private readonly double _sigma; - private readonly double _dt; - - // Precomputed GBM constants - private readonly double _drift; - private readonly double _vol; - private readonly long _defaultTimeStep; - - // State for streaming bar formation (only when isNew=false) - private TBar _currentBar; - private bool _hasCurrentBar; - - // Box-Muller optimization: cache second normal - private double _cachedZ; - private bool _hasCachedZ; - - /// - /// Creates a new GBM generator. - /// - /// Initial price (default: 100.0) - /// Annual drift/return rate (default: 0.05 = 5%) - /// Annual volatility (default: 0.2 = 20%) - /// Default timeframe for bars (default: 1 minute) - public GBM( - double startPrice = 100.0, - double mu = 0.05, - double sigma = 0.2, - TimeSpan? defaultTimeframe = null) - { - _lastPrice = startPrice; - _lastTime = DateTime.UtcNow.Ticks; - - _mu = mu; - _sigma = sigma; - - // Use provided timeframe or default to 1 minute - var timeframe = defaultTimeframe ?? TimeSpan.FromMinutes(1); - _defaultTimeStep = timeframe.Ticks; - - // Calculate dt based on timeframe (assuming 252 trading days/year, 6.5 hours/day) - double minutesPerYear = 252.0 * 6.5 * 60.0; - _dt = timeframe.TotalMinutes / minutesPerYear; - - _drift = (mu - 0.5 * sigma * sigma) * _dt; - _vol = sigma * Math.Sqrt(_dt); - } - - /// - /// Generates next standard normal using Box-Muller transform with caching. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private double NextNormal() - { - if (_hasCachedZ) - { - _hasCachedZ = false; - return _cachedZ; - } - - double u1 = 1.0 - _rnd.NextDouble(); - double u2 = 1.0 - _rnd.NextDouble(); - double mag = Math.Sqrt(-2.0 * Math.Log(u1)); - double angle = 2.0 * Math.PI * u2; - - _cachedZ = mag * Math.Sin(angle); - _hasCachedZ = true; - - return mag * Math.Cos(angle); - } - - /// - /// Gets the next bar with full bidirectional control. - /// GBM always honors the request - isNew parameter unchanged on return. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public TBar Next(ref bool isNew) - { - // GBM always honors request - parameter unchanged - - if (isNew || !_hasCurrentBar) - { - // Generate new bar - long currentTime = _lastTime + _defaultTimeStep; - - double z = NextNormal(); - double price = _lastPrice * Math.Exp(_drift + _vol * z); - double volume = 1000 + _rnd.NextDouble() * 1000; - - double open = _lastPrice; - double close = price; - double high = Math.Max(open, close) * (1.0 + _rnd.NextDouble() * 0.01); - double low = Math.Min(open, close) * (1.0 - _rnd.NextDouble() * 0.01); - - _currentBar = new TBar(currentTime, open, high, low, close, volume); - _hasCurrentBar = true; - - _lastPrice = close; - _lastTime = currentTime; - } - else - { - // Update current bar (intra-bar tick) - double z = NextNormal(); - double price = _lastPrice * Math.Exp(_drift + _vol * z); - double volume = 1000 + _rnd.NextDouble() * 1000; - - var bar = _currentBar; - double newClose = price; - double newHigh = Math.Max(bar.High, newClose); - double newLow = Math.Min(bar.Low, newClose); - - _currentBar = new TBar(bar.Time, bar.Open, newHigh, newLow, newClose, volume); - _lastPrice = newClose; - } - - return _currentBar; - } - - /// - /// Gets the next bar with simple control. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public TBar Next(bool isNew = true) - { - // Delegate to ref version - return Next(ref isNew); - } - - /// - /// Generates a batch of bars using optimized batch processing with explicit time parameters. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public TBarSeries Fetch(int count, long startTime, TimeSpan interval) - { - if (count <= 0) - throw new ArgumentException("Count must be positive", nameof(count)); - - var series = new TBarSeries(count); - - // Pre-allocate arrays for SoA layout - long[] t = new long[count]; - double[] o = new double[count]; - double[] h = new double[count]; - double[] l = new double[count]; - double[] c = new double[count]; - double[] v = new double[count]; - - // Calculate dt for this specific interval - double minutesPerYear = 252.0 * 6.5 * 60.0; - double dt = interval.TotalMinutes / minutesPerYear; - double drift = (_mu - 0.5 * _sigma * _sigma) * dt; - double vol = _sigma * Math.Sqrt(dt); - - long timeStep = interval.Ticks; - double currentPrice = _lastPrice; - long currentTime = startTime; - - for (int i = 0; i < count; i++) - { - double z = NextNormal(); - double price = currentPrice * Math.Exp(drift + vol * z); - - double open = currentPrice; - double close = price; - - double rnd1 = _rnd.NextDouble(); - double rnd2 = _rnd.NextDouble(); - double rnd3 = _rnd.NextDouble(); - - t[i] = currentTime; - o[i] = open; - c[i] = close; - h[i] = Math.Max(open, close) * (1.0 + rnd1 * 0.01); - l[i] = Math.Min(open, close) * (1.0 - rnd2 * 0.01); - v[i] = 1000 + rnd3 * 1000; - - currentPrice = price; - currentTime += timeStep; - } - - // Update internal state to continue from end of batch - _lastPrice = currentPrice; - _lastTime = currentTime - timeStep; // Last bar time, not next bar time - - // Bulk add to series - series.Add(t, o, h, l, c, v); - - // Reset streaming state after batch - _hasCurrentBar = false; - - return series; - } -} +using System; +using System.Runtime.CompilerServices; + +namespace QuanTAlib; + +/// +/// Geometric Brownian Motion (GBM) generator for simulating OHLCV data. +/// Generates realistic price data for testing indicators and strategies. +/// Stateless design - only maintains minimal state needed for price continuity. +/// +public class GBM : IFeed +{ + private readonly Random _rnd = new(); + + private double _lastPrice; + private long _lastTime; + + private readonly double _mu; + private readonly double _sigma; + private readonly double _dt; + + // Precomputed GBM constants + private readonly double _drift; + private readonly double _vol; + private readonly long _defaultTimeStep; + + // State for streaming bar formation (only when isNew=false) + private TBar _currentBar; + private bool _hasCurrentBar; + + // Box-Muller optimization: cache second normal + private double _cachedZ; + private bool _hasCachedZ; + + /// + /// Creates a new GBM generator. + /// + /// Initial price (default: 100.0) + /// Annual drift/return rate (default: 0.05 = 5%) + /// Annual volatility (default: 0.2 = 20%) + /// Default timeframe for bars (default: 1 minute) + public GBM( + double startPrice = 100.0, + double mu = 0.05, + double sigma = 0.2, + TimeSpan? defaultTimeframe = null) + { + _lastPrice = startPrice; + _lastTime = DateTime.UtcNow.Ticks; + + _mu = mu; + _sigma = sigma; + + // Use provided timeframe or default to 1 minute + var timeframe = defaultTimeframe ?? TimeSpan.FromMinutes(1); + _defaultTimeStep = timeframe.Ticks; + + // Calculate dt based on timeframe (assuming 252 trading days/year, 6.5 hours/day) + double minutesPerYear = 252.0 * 6.5 * 60.0; + _dt = timeframe.TotalMinutes / minutesPerYear; + + _drift = (mu - 0.5 * sigma * sigma) * _dt; + _vol = sigma * Math.Sqrt(_dt); + } + + /// + /// Generates next standard normal using Box-Muller transform with caching. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private double NextNormal() + { + if (_hasCachedZ) + { + _hasCachedZ = false; + return _cachedZ; + } + + double u1 = 1.0 - _rnd.NextDouble(); + double u2 = 1.0 - _rnd.NextDouble(); + double mag = Math.Sqrt(-2.0 * Math.Log(u1)); + double angle = 2.0 * Math.PI * u2; + + _cachedZ = mag * Math.Sin(angle); + _hasCachedZ = true; + + return mag * Math.Cos(angle); + } + + /// + /// Gets the next bar with full bidirectional control. + /// GBM always honors the request - isNew parameter unchanged on return. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public TBar Next(ref bool isNew) + { + // GBM always honors request - parameter unchanged + + if (isNew || !_hasCurrentBar) + { + // Generate new bar + long currentTime = _lastTime + _defaultTimeStep; + + double z = NextNormal(); + double price = _lastPrice * Math.Exp(_drift + _vol * z); + double volume = 1000 + _rnd.NextDouble() * 1000; + + double open = _lastPrice; + double close = price; + double high = Math.Max(open, close) * (1.0 + _rnd.NextDouble() * 0.01); + double low = Math.Min(open, close) * (1.0 - _rnd.NextDouble() * 0.01); + + _currentBar = new TBar(currentTime, open, high, low, close, volume); + _hasCurrentBar = true; + + _lastPrice = close; + _lastTime = currentTime; + } + else + { + // Update current bar (intra-bar tick) + double z = NextNormal(); + double price = _lastPrice * Math.Exp(_drift + _vol * z); + double volume = 1000 + _rnd.NextDouble() * 1000; + + var bar = _currentBar; + double newClose = price; + double newHigh = Math.Max(bar.High, newClose); + double newLow = Math.Min(bar.Low, newClose); + + _currentBar = new TBar(bar.Time, bar.Open, newHigh, newLow, newClose, volume); + _lastPrice = newClose; + } + + return _currentBar; + } + + /// + /// Gets the next bar with simple control. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public TBar Next(bool isNew = true) + { + // Delegate to ref version + return Next(ref isNew); + } + + /// + /// Generates a batch of bars using optimized batch processing with explicit time parameters. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public TBarSeries Fetch(int count, long startTime, TimeSpan interval) + { + if (count <= 0) + throw new ArgumentException("Count must be positive", nameof(count)); + + var series = new TBarSeries(count); + + // Pre-allocate arrays for SoA layout + long[] t = new long[count]; + double[] o = new double[count]; + double[] h = new double[count]; + double[] l = new double[count]; + double[] c = new double[count]; + double[] v = new double[count]; + + // Calculate dt for this specific interval + double minutesPerYear = 252.0 * 6.5 * 60.0; + double dt = interval.TotalMinutes / minutesPerYear; + double drift = (_mu - 0.5 * _sigma * _sigma) * dt; + double vol = _sigma * Math.Sqrt(dt); + + long timeStep = interval.Ticks; + double currentPrice = _lastPrice; + long currentTime = startTime; + + for (int i = 0; i < count; i++) + { + double z = NextNormal(); + double price = currentPrice * Math.Exp(drift + vol * z); + + double open = currentPrice; + double close = price; + + double rnd1 = _rnd.NextDouble(); + double rnd2 = _rnd.NextDouble(); + double rnd3 = _rnd.NextDouble(); + + t[i] = currentTime; + o[i] = open; + c[i] = close; + h[i] = Math.Max(open, close) * (1.0 + rnd1 * 0.01); + l[i] = Math.Min(open, close) * (1.0 - rnd2 * 0.01); + v[i] = 1000 + rnd3 * 1000; + + currentPrice = price; + currentTime += timeStep; + } + + // Update internal state to continue from end of batch + _lastPrice = currentPrice; + _lastTime = currentTime - timeStep; // Last bar time, not next bar time + + // Bulk add to series + series.Add(t, o, h, l, c, v); + + // Reset streaming state after batch + _hasCurrentBar = false; + + return series; + } +} diff --git a/lib/quantalib.csproj b/lib/quantalib.csproj index c14dccb7..e179cc73 100644 --- a/lib/quantalib.csproj +++ b/lib/quantalib.csproj @@ -1,51 +1,51 @@ - - - net8.0;net9.0;net10.0 - QuanTAlib - Library of TA Calculations, Charts and Strategies for Quantower - Quantitative Technical Analysis Library in C# for Quantower - git - https://github.com/mihakralj/QuanTAlib - Miha Kralj - Miha Kralj - QuanTAlib - QuanTAlib - true - true - QuanTAlib2.png - Apache-2.0 - true - - Indicators;Stock;Market;Technical;Analysis;Algorithmic;Trading;Trade;Trend;Momentum;Finance;Algorithm;Algo; - AlgoTrading;Financial;Strategy;Chart;Charting;Oscillator;Overlay;Equity;Bitcoin;Crypto;Cryptocurrency;Forex; - Quantitative;Historical;Quotes; - - https://raw.githubusercontent.com/mihakralj/QuanTAlib/main/.github/QuanTAlib2.png - True - false - $(GitVersion_MajorMinorPatch) - $(GitVersion_MajorMinorPatch) - $(GitVersion_AssemblySemVer) - $(GitVersion_AssemblySemFileVer) - $(GitVersion_InformationalVersion) - latest - 6afc11a7-4355-4f5e-9fdf-22431e5b03cb - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - + + + net8.0;net9.0;net10.0 + QuanTAlib + Library of TA Calculations, Charts and Strategies for Quantower + Quantitative Technical Analysis Library in C# for Quantower + git + https://github.com/mihakralj/QuanTAlib + Miha Kralj + Miha Kralj + QuanTAlib + QuanTAlib + true + true + QuanTAlib2.png + Apache-2.0 + true + + Indicators;Stock;Market;Technical;Analysis;Algorithmic;Trading;Trade;Trend;Momentum;Finance;Algorithm;Algo; + AlgoTrading;Financial;Strategy;Chart;Charting;Oscillator;Overlay;Equity;Bitcoin;Crypto;Cryptocurrency;Forex; + Quantitative;Historical;Quotes; + + https://raw.githubusercontent.com/mihakralj/QuanTAlib/main/.github/QuanTAlib2.png + True + false + $(GitVersion_MajorMinorPatch) + $(GitVersion_MajorMinorPatch) + $(GitVersion_AssemblySemVer) + $(GitVersion_AssemblySemFileVer) + $(GitVersion_InformationalVersion) + latest + 6afc11a7-4355-4f5e-9fdf-22431e5b03cb + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + diff --git a/quantower/Averages.csproj b/quantower/Averages.csproj index 853eeee8..d09264c6 100644 --- a/quantower/Averages.csproj +++ b/quantower/Averages.csproj @@ -1,32 +1,32 @@ - - - - net8.0 - Averages - Indicator - bin\$(Configuration)\ - false - false - - - - - - - - - - - - ..\.github\TradingPlatform.BusinessLayer.dll - - - TradingPlatform.BusinessLayer.xml - - - - - - - - + + + + net8.0 + Averages + Indicator + bin\$(Configuration)\ + false + false + + + + + + + + + + + + ..\.github\TradingPlatform.BusinessLayer.dll + + + TradingPlatform.BusinessLayer.xml + + + + + + + + diff --git a/quantower/IndicatorExtensions.cs b/quantower/IndicatorExtensions.cs index 3f4c13b4..fc13a02a 100644 --- a/quantower/IndicatorExtensions.cs +++ b/quantower/IndicatorExtensions.cs @@ -1,237 +1,237 @@ -using TradingPlatform.BusinessLayer; -using System.Drawing; -using System.Drawing.Drawing2D; - -namespace QuanTAlib; - -public enum SourceType -{ - Open, High, Low, Close, HL2, OC2, OHL3, HLC3, OHLC4, HLCC4 -} - -public enum MaType -{ - Alma, Dema, Dsma, Dwma, Ema, Epma, Frama, Fwma, Gma, Hma, Hwma, Jma, Kama, Maaf, Mgdi, MMa, Pwma, Rema, Rma, Sinema, Sma, Smma, T3, Tema, Trima, Vidya, Wma, Zlema -} - -public static class IndicatorExtensions -{ - public static readonly Color Averages = Color.FromArgb(255, 255, 128); // #FFFF80 - Yellow - public static readonly Color Volume = Color.FromArgb(128, 255, 128); // #80FF80 - Green - public static readonly Color Volatility = Color.FromArgb(255, 128, 128); // #FF8080 - Red - public static readonly Color Statistics = Color.FromArgb(128, 128, 255); // #8080FF - Blue - public static readonly Color Oscillators = Color.FromArgb(255, 128, 255); // #FF80FF - Magenta - public static readonly Color Momentum = Color.FromArgb(128, 255, 255); // #80FFFF - Cyan - public static readonly Color Experiments = Color.FromArgb(255, 165, 0); // #FFA500 - Orange - - [AttributeUsage(AttributeTargets.Property)] - public class DataSourceInputAttribute : InputParameterAttribute - { - public DataSourceInputAttribute(string label = "Data source", int sortIndex = 20) - : base(label, sortIndex, variants: new object[] - { - "Open", SourceType.Open, - "High", SourceType.High, - "Low", SourceType.Low, - "Close", SourceType.Close, - "HL/2 (Median)", SourceType.HL2, - "OC/2 (Midpoint)", SourceType.OC2, - "OHL/3 (Mean)", SourceType.OHL3, - "HLC/3 (Typical)", SourceType.HLC3, - "OHLC/4 (Average)", SourceType.OHLC4, - "HLCC/4 (Weighted)", SourceType.HLCC4 - }) - { } - } - - public static TValue GetInputValue(this Indicator indicator, UpdateArgs args, SourceType source) - { - var historicalData = indicator.HistoricalData; - TBar bar = new TBar( - time: historicalData.Time(), - open: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.Open], - high: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.High], - low: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.Low], - close: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.Close], - volume: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.Volume] - ); - - double price = source switch - { - SourceType.Open => bar.Open, - SourceType.High => bar.High, - SourceType.Low => bar.Low, - SourceType.Close => bar.Close, - SourceType.HL2 => bar.HL2, - SourceType.OC2 => bar.OC2, - SourceType.OHL3 => bar.OHL3, - SourceType.HLC3 => bar.HLC3, - SourceType.OHLC4 => bar.OHLC4, - SourceType.HLCC4 => bar.HLCC4, - _ => bar.Close - }; - - return new TValue(bar.Time, price); - } - - public static TBar GetInputBar(this Indicator indicator, UpdateArgs args) - { - var historicalData = indicator.HistoricalData; - return new TBar( - time: historicalData.Time(), - open: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.Open], - high: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.High], - low: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.Low], - close: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.Close], - volume: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.Volume] - ); - } - -#pragma warning disable CA1416 // Validate platform compatibility - public static void PaintHLine(this Indicator indicator, PaintChartEventArgs args, double value, Pen pen) - { - if (indicator.CurrentChart == null) - return; - - Graphics gr = args.Graphics; - var mainWindow = indicator.CurrentChart.Windows[args.WindowIndex]; - var converter = mainWindow.CoordinatesConverter; - var clientRect = mainWindow.ClientRectangle; - - gr.SetClip(clientRect); - int leftX = clientRect.Left; - int rightX = clientRect.Right; - int Y = (int)converter.GetChartY(value); - - using (pen) - { - gr.DrawLine(pen, new Point(leftX, Y), new Point(rightX, Y)); - } - } - - public static void PaintSmoothCurve(this Indicator indicator, PaintChartEventArgs args, LineSeries series, int warmupPeriod, bool showColdValues = true, double tension = 0.2) - { - if (!series.Visible || indicator.CurrentChart == null) - return; - - Graphics gr = args.Graphics; - gr.SmoothingMode = SmoothingMode.AntiAlias; - var mainWindow = indicator.CurrentChart.Windows[args.WindowIndex]; - var converter = mainWindow.CoordinatesConverter; - var clientRect = mainWindow.ClientRectangle; - - gr.SetClip(clientRect); - DateTime leftTime = new[] { converter.GetTime(clientRect.Left), indicator.HistoricalData.Time(indicator!.Count - 1) }.Max(); - DateTime rightTime = new[] { converter.GetTime(clientRect.Right), indicator.HistoricalData.Time(0) }.Min(); - - int leftIndex = (int)indicator.HistoricalData.GetIndexByTime(leftTime.Ticks) + 1; - int rightIndex = (int)indicator.HistoricalData.GetIndexByTime(rightTime.Ticks); - - List allPoints = new List(); - - for (int i = rightIndex; i < leftIndex; i++) - { - int barX = (int)converter.GetChartX(indicator.HistoricalData.Time(i)); - int barY = (int)converter.GetChartY(series[i]); - int halfBarWidth = indicator.CurrentChart.BarsWidth / 2; - Point point = new Point(barX + halfBarWidth, barY); - allPoints.Add(point); - } - - if (allPoints.Count > 1) - { - if (allPoints.Count < 2) return; - - using (Pen defaultPen = new(series.Color, series.Width) { DashStyle = ConvertLineStyleToDashStyle(series.Style) }) - using (Pen coldPen = new(series.Color, series.Width) { DashStyle = DashStyle.Dot }) - { - int hotCount = indicator.Count - warmupPeriod - rightIndex; - - // Draw the hot part - if (hotCount > 0) - { - var hotPoints = allPoints.Take(Math.Min(hotCount + 1, allPoints.Count)).ToArray(); - gr.DrawCurve(defaultPen, hotPoints, 0, hotPoints.Length - 1, (float)tension); - } - - // Draw the cold part - if (showColdValues && hotCount < allPoints.Count) - { - var coldPoints = allPoints.Skip(Math.Max(0, hotCount)).ToArray(); - gr.DrawCurve(coldPen, coldPoints, 0, coldPoints.Length - 1, (float)tension); - } - } - } - } - - public static void PaintHistogram(this Indicator indicator, PaintChartEventArgs args, LineSeries series, int warmupPeriod, bool showColdValues = true) - { - if (!series.Visible || indicator.CurrentChart == null) - return; - - Graphics gr = args.Graphics; - gr.SmoothingMode = SmoothingMode.AntiAlias; - var mainWindow = indicator.CurrentChart.Windows[args.WindowIndex]; - var converter = mainWindow.CoordinatesConverter; - var clientRect = mainWindow.ClientRectangle; - - gr.SetClip(clientRect); - DateTime leftTime = new[] { converter.GetTime(clientRect.Left), indicator.HistoricalData.Time(indicator!.Count - 1) }.Max(); - DateTime rightTime = new[] { converter.GetTime(clientRect.Right), indicator.HistoricalData.Time(0) }.Min(); - - int leftIndex = (int)indicator.HistoricalData.GetIndexByTime(leftTime.Ticks) + 1; - int rightIndex = (int)indicator.HistoricalData.GetIndexByTime(rightTime.Ticks); - - for (int i = rightIndex; i < leftIndex; i++) - { - int barX = (int)converter.GetChartX(indicator.HistoricalData.Time(i)); - int barY = (int)converter.GetChartY(series[i]); - int barY0 = (int)converter.GetChartY(0); - int HistBarWidth = indicator.CurrentChart.BarsWidth - 2; - - if (series[i] > 0) - { - using (Brush hist = new SolidBrush(Color.FromArgb(150, 0, 255, 0))) - { - gr.FillRectangle(hist, barX, barY, HistBarWidth, Math.Abs(barY - barY0)); - } - } - else - { - using (Brush hist = new SolidBrush(Color.FromArgb(150, 255, 0, 0))) - { - gr.FillRectangle(hist, barX, barY0, HistBarWidth, Math.Abs(barY0 - barY)); - } - } - } - } - - public static void DrawText(this Indicator indicator, PaintChartEventArgs args, string text) - { - if (indicator.CurrentChart == null) - return; - - Graphics gr = args.Graphics; - var clientRect = indicator.CurrentChart.MainWindow.ClientRectangle; - Font font = new Font("Inter", 8); - SizeF textSize = gr.MeasureString(text, font); - RectangleF textRect = new RectangleF(clientRect.Left + 5, - clientRect.Bottom - textSize.Height - 10, - textSize.Width + 10, textSize.Height + 10); - - gr.FillRectangle(Brushes.DarkBlue, textRect); - gr.DrawString(text, font, Brushes.White, new PointF(textRect.X + 6, textRect.Y + 5)); - } - - private static DashStyle ConvertLineStyleToDashStyle(LineStyle lineStyle) - { - return lineStyle switch - { - LineStyle.Solid => DashStyle.Solid, - LineStyle.Dash => DashStyle.Dash, - LineStyle.Dot => DashStyle.Dot, - LineStyle.DashDot => DashStyle.DashDot, - _ => DashStyle.Solid, - }; - } -} +using TradingPlatform.BusinessLayer; +using System.Drawing; +using System.Drawing.Drawing2D; + +namespace QuanTAlib; + +public enum SourceType +{ + Open, High, Low, Close, HL2, OC2, OHL3, HLC3, OHLC4, HLCC4 +} + +public enum MaType +{ + Alma, Dema, Dsma, Dwma, Ema, Epma, Frama, Fwma, Gma, Hma, Hwma, Jma, Kama, Maaf, Mgdi, MMa, Pwma, Rema, Rma, Sinema, Sma, Smma, T3, Tema, Trima, Vidya, Wma, Zlema +} + +public static class IndicatorExtensions +{ + public static readonly Color Averages = Color.FromArgb(255, 255, 128); // #FFFF80 - Yellow + public static readonly Color Volume = Color.FromArgb(128, 255, 128); // #80FF80 - Green + public static readonly Color Volatility = Color.FromArgb(255, 128, 128); // #FF8080 - Red + public static readonly Color Statistics = Color.FromArgb(128, 128, 255); // #8080FF - Blue + public static readonly Color Oscillators = Color.FromArgb(255, 128, 255); // #FF80FF - Magenta + public static readonly Color Momentum = Color.FromArgb(128, 255, 255); // #80FFFF - Cyan + public static readonly Color Experiments = Color.FromArgb(255, 165, 0); // #FFA500 - Orange + + [AttributeUsage(AttributeTargets.Property)] + public class DataSourceInputAttribute : InputParameterAttribute + { + public DataSourceInputAttribute(string label = "Data source", int sortIndex = 20) + : base(label, sortIndex, variants: new object[] + { + "Open", SourceType.Open, + "High", SourceType.High, + "Low", SourceType.Low, + "Close", SourceType.Close, + "HL/2 (Median)", SourceType.HL2, + "OC/2 (Midpoint)", SourceType.OC2, + "OHL/3 (Mean)", SourceType.OHL3, + "HLC/3 (Typical)", SourceType.HLC3, + "OHLC/4 (Average)", SourceType.OHLC4, + "HLCC/4 (Weighted)", SourceType.HLCC4 + }) + { } + } + + public static TValue GetInputValue(this Indicator indicator, UpdateArgs args, SourceType source) + { + var historicalData = indicator.HistoricalData; + TBar bar = new TBar( + time: historicalData.Time(), + open: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.Open], + high: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.High], + low: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.Low], + close: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.Close], + volume: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.Volume] + ); + + double price = source switch + { + SourceType.Open => bar.Open, + SourceType.High => bar.High, + SourceType.Low => bar.Low, + SourceType.Close => bar.Close, + SourceType.HL2 => bar.HL2, + SourceType.OC2 => bar.OC2, + SourceType.OHL3 => bar.OHL3, + SourceType.HLC3 => bar.HLC3, + SourceType.OHLC4 => bar.OHLC4, + SourceType.HLCC4 => bar.HLCC4, + _ => bar.Close + }; + + return new TValue(bar.Time, price); + } + + public static TBar GetInputBar(this Indicator indicator, UpdateArgs args) + { + var historicalData = indicator.HistoricalData; + return new TBar( + time: historicalData.Time(), + open: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.Open], + high: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.High], + low: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.Low], + close: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.Close], + volume: historicalData[indicator.Count - 1, SeekOriginHistory.Begin][PriceType.Volume] + ); + } + +#pragma warning disable CA1416 // Validate platform compatibility + public static void PaintHLine(this Indicator indicator, PaintChartEventArgs args, double value, Pen pen) + { + if (indicator.CurrentChart == null) + return; + + Graphics gr = args.Graphics; + var mainWindow = indicator.CurrentChart.Windows[args.WindowIndex]; + var converter = mainWindow.CoordinatesConverter; + var clientRect = mainWindow.ClientRectangle; + + gr.SetClip(clientRect); + int leftX = clientRect.Left; + int rightX = clientRect.Right; + int Y = (int)converter.GetChartY(value); + + using (pen) + { + gr.DrawLine(pen, new Point(leftX, Y), new Point(rightX, Y)); + } + } + + public static void PaintSmoothCurve(this Indicator indicator, PaintChartEventArgs args, LineSeries series, int warmupPeriod, bool showColdValues = true, double tension = 0.2) + { + if (!series.Visible || indicator.CurrentChart == null) + return; + + Graphics gr = args.Graphics; + gr.SmoothingMode = SmoothingMode.AntiAlias; + var mainWindow = indicator.CurrentChart.Windows[args.WindowIndex]; + var converter = mainWindow.CoordinatesConverter; + var clientRect = mainWindow.ClientRectangle; + + gr.SetClip(clientRect); + DateTime leftTime = new[] { converter.GetTime(clientRect.Left), indicator.HistoricalData.Time(indicator!.Count - 1) }.Max(); + DateTime rightTime = new[] { converter.GetTime(clientRect.Right), indicator.HistoricalData.Time(0) }.Min(); + + int leftIndex = (int)indicator.HistoricalData.GetIndexByTime(leftTime.Ticks) + 1; + int rightIndex = (int)indicator.HistoricalData.GetIndexByTime(rightTime.Ticks); + + List allPoints = new List(); + + for (int i = rightIndex; i < leftIndex; i++) + { + int barX = (int)converter.GetChartX(indicator.HistoricalData.Time(i)); + int barY = (int)converter.GetChartY(series[i]); + int halfBarWidth = indicator.CurrentChart.BarsWidth / 2; + Point point = new Point(barX + halfBarWidth, barY); + allPoints.Add(point); + } + + if (allPoints.Count > 1) + { + if (allPoints.Count < 2) return; + + using (Pen defaultPen = new(series.Color, series.Width) { DashStyle = ConvertLineStyleToDashStyle(series.Style) }) + using (Pen coldPen = new(series.Color, series.Width) { DashStyle = DashStyle.Dot }) + { + int hotCount = indicator.Count - warmupPeriod - rightIndex; + + // Draw the hot part + if (hotCount > 0) + { + var hotPoints = allPoints.Take(Math.Min(hotCount + 1, allPoints.Count)).ToArray(); + gr.DrawCurve(defaultPen, hotPoints, 0, hotPoints.Length - 1, (float)tension); + } + + // Draw the cold part + if (showColdValues && hotCount < allPoints.Count) + { + var coldPoints = allPoints.Skip(Math.Max(0, hotCount)).ToArray(); + gr.DrawCurve(coldPen, coldPoints, 0, coldPoints.Length - 1, (float)tension); + } + } + } + } + + public static void PaintHistogram(this Indicator indicator, PaintChartEventArgs args, LineSeries series, int warmupPeriod, bool showColdValues = true) + { + if (!series.Visible || indicator.CurrentChart == null) + return; + + Graphics gr = args.Graphics; + gr.SmoothingMode = SmoothingMode.AntiAlias; + var mainWindow = indicator.CurrentChart.Windows[args.WindowIndex]; + var converter = mainWindow.CoordinatesConverter; + var clientRect = mainWindow.ClientRectangle; + + gr.SetClip(clientRect); + DateTime leftTime = new[] { converter.GetTime(clientRect.Left), indicator.HistoricalData.Time(indicator!.Count - 1) }.Max(); + DateTime rightTime = new[] { converter.GetTime(clientRect.Right), indicator.HistoricalData.Time(0) }.Min(); + + int leftIndex = (int)indicator.HistoricalData.GetIndexByTime(leftTime.Ticks) + 1; + int rightIndex = (int)indicator.HistoricalData.GetIndexByTime(rightTime.Ticks); + + for (int i = rightIndex; i < leftIndex; i++) + { + int barX = (int)converter.GetChartX(indicator.HistoricalData.Time(i)); + int barY = (int)converter.GetChartY(series[i]); + int barY0 = (int)converter.GetChartY(0); + int HistBarWidth = indicator.CurrentChart.BarsWidth - 2; + + if (series[i] > 0) + { + using (Brush hist = new SolidBrush(Color.FromArgb(150, 0, 255, 0))) + { + gr.FillRectangle(hist, barX, barY, HistBarWidth, Math.Abs(barY - barY0)); + } + } + else + { + using (Brush hist = new SolidBrush(Color.FromArgb(150, 255, 0, 0))) + { + gr.FillRectangle(hist, barX, barY0, HistBarWidth, Math.Abs(barY0 - barY)); + } + } + } + } + + public static void DrawText(this Indicator indicator, PaintChartEventArgs args, string text) + { + if (indicator.CurrentChart == null) + return; + + Graphics gr = args.Graphics; + var clientRect = indicator.CurrentChart.MainWindow.ClientRectangle; + Font font = new Font("Inter", 8); + SizeF textSize = gr.MeasureString(text, font); + RectangleF textRect = new RectangleF(clientRect.Left + 5, + clientRect.Bottom - textSize.Height - 10, + textSize.Width + 10, textSize.Height + 10); + + gr.FillRectangle(Brushes.DarkBlue, textRect); + gr.DrawString(text, font, Brushes.White, new PointF(textRect.X + 6, textRect.Y + 5)); + } + + private static DashStyle ConvertLineStyleToDashStyle(LineStyle lineStyle) + { + return lineStyle switch + { + LineStyle.Solid => DashStyle.Solid, + LineStyle.Dash => DashStyle.Dash, + LineStyle.Dot => DashStyle.Dot, + LineStyle.DashDot => DashStyle.DashDot, + _ => DashStyle.Solid, + }; + } +}